// Path: lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/Response.java
// public interface Response {
// 
//     /**
//      * Returns the URL that the request was made to.
//      *
//      * @return The URL of the request.
//      */
//     String getRequestURL();
// 
//     /**
//      * This method gets the HTTP status of the response.
//      *
//      * @return The HTTP status of the response. Will be 0 when there was no response.
//      */
//     int getStatus();
// 
//     /**
//      * This method parses the response body as a String.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return The body of the response as a String. Empty string if there is no body.
//      */
//     String getResponseText();
// 
//     /**
//      * This method parses the response body as a JSONObject.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return The body of the response as a JSONObject.
//      */
//     JSONObject getResponseJSON();
// 
//     /**
//      * This method gets the bytes of the response body.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return the bytes of the response body. Will be null if there is no body.
//      */
//     byte[] getResponseBytes();
// 
//     /**
//      * This method gets the response body as an input stream.
//      *
//      * <p>
//      * <b>Important: </b>This method may not be used for requests made with any of the {@link Request} download() methods,
//      * since the stream will already be closed. Use {@link Response#getResponseBytes()} instead.
//      * </p>
//      *
//      * @return The input stream representing the response body. Will be null if there is no body.
//      */
//     InputStream getResponseByteStream();
// 
//     /**
//      * This method gets the Content-Length of the response body.
//      *
//      * @return The content length of the response.
//      */
//     long getContentLength();
// 
//     /**
//      * Get the HTTP headers from the response.
//      *
//      * @return A map with all the headers, and the corresponding values for each one.
//      */
//     Map<String, List<String>> getHeaders();
// }
// 
// Path: lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/ResponseListener.java
// public interface ResponseListener {
// 
// 	/**
// 	 * This method will be called only when a response from the server has been received with a status
// 	 * in the 200 range.
// 	 * @param response the server response
// 	 */
// 	void onSuccess(Response response);
// 
// 	/**
// 	 * This method will be called in the following cases:
// 	 * <ul>
// 	 * <li>There is no response from the server.</li>
// 	 * <li>The status from the server response is in the 400 or 500 ranges.</li>
// 	 * <li>There is an operational failure such as: authentication failure, data validation failure, or custom failure.</li>
// 	 * </ul>
// 	 * @param response Contains detail regarding why the Http request failed. May be null if the request did not reach the server
// 	 * @param t Exception that could have caused the request to fail. null if no Exception thrown.
// 	 * @param extendedInfo Contains details regarding operational failure. null if no operational failure occurred.
// 	 */
// 	void onFailure(Response response, Throwable t, JSONObject extendedInfo);
// 
// }


import android.util.Log;
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.Response;
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.ResponseListener;
import org.json.JSONObject;
/*
 *     Copyright 2017 IBM Corp.
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *     See the License for the specific language governing permissions and
 *     limitations under the License.
 */

package com.ibm.mobilefirstplatform.clientsdk.android.core.app;






public class MyResponseListener implements ResponseListener {

    @Override
    public void onSuccess(Response response) {
        // here we handle authentication success

        Log.i("BMSCore", "Request succeeded!");
        if (response != null) {
            Log.i("BMSCore", "Response status: " + response.getStatus());
            Log.i("BMSCore", "Response headers: " + response.getHeaders());
            Log.i("BMSCore", "Length of response body: " + response.getResponseBytes().length);
            Log.i("BMSCore", "Response body: " + response.getResponseText());
        }
    }

    @Override
// Path: lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/Response.java
// public interface Response {
// 
//     /**
//      * Returns the URL that the request was made to.
//      *
//      * @return The URL of the request.
//      */
//     String getRequestURL();
// 
//     /**
//      * This method gets the HTTP status of the response.
//      *
//      * @return The HTTP status of the response. Will be 0 when there was no response.
//      */
//     int getStatus();
// 
//     /**
//      * This method parses the response body as a String.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return The body of the response as a String. Empty string if there is no body.
//      */
//     String getResponseText();
// 
//     /**
//      * This method parses the response body as a JSONObject.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return The body of the response as a JSONObject.
//      */
//     JSONObject getResponseJSON();
// 
//     /**
//      * This method gets the bytes of the response body.
//      * If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
//      * will return null unless the {@link Request} was made using a <code>download()</code> method.
//      *
//      * @return the bytes of the response body. Will be null if there is no body.
//      */
//     byte[] getResponseBytes();
// 
//     /**
//      * This method gets the response body as an input stream.
//      *
//      * <p>
//      * <b>Important: </b>This method may not be used for requests made with any of the {@link Request} download() methods,
//      * since the stream will already be closed. Use {@link Response#getResponseBytes()} instead.
//      * </p>
//      *
//      * @return The input stream representing the response body. Will be null if there is no body.
//      */
//     InputStream getResponseByteStream();
// 
//     /**
//      * This method gets the Content-Length of the response body.
//      *
//      * @return The content length of the response.
//      */
//     long getContentLength();
// 
//     /**
//      * Get the HTTP headers from the response.
//      *
//      * @return A map with all the headers, and the corresponding values for each one.
//      */
//     Map<String, List<String>> getHeaders();
// }
// 
// Path: lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/ResponseListener.java
// public interface ResponseListener {
// 
// 	/**
// 	 * This method will be called only when a response from the server has been received with a status
// 	 * in the 200 range.
// 	 * @param response the server response
// 	 */
// 	void onSuccess(Response response);
// 
// 	/**
// 	 * This method will be called in the following cases:
// 	 * <ul>
// 	 * <li>There is no response from the server.</li>
// 	 * <li>The status from the server response is in the 400 or 500 ranges.</li>
// 	 * <li>There is an operational failure such as: authentication failure, data validation failure, or custom failure.</li>
// 	 * </ul>
// 	 * @param response Contains detail regarding why the Http request failed. May be null if the request did not reach the server
// 	 * @param t Exception that could have caused the request to fail. null if no Exception thrown.
// 	 * @param extendedInfo Contains details regarding operational failure. null if no operational failure occurred.
// 	 */
// 	void onFailure(Response response, Throwable t, JSONObject extendedInfo);
// 
// }


// Path: app/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/app/MyResponseListener.java
import android.util.Log;
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.Response;
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.ResponseListener;
import org.json.JSONObject;

/*
 *     Copyright 2017 IBM Corp.
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *     See the License for the specific language governing permissions and
 *     limitations under the License.
 */

package com.ibm.mobilefirstplatform.clientsdk.android.core.app;






public class MyResponseListener implements ResponseListener {

    @Override
    public void onSuccess(Response response) {
        // here we handle authentication success

        Log.i("BMSCore", "Request succeeded!");
        if (response != null) {
            Log.i("BMSCore", "Response status: " + response.getStatus());
            Log.i("BMSCore", "Response headers: " + response.getHeaders());
            Log.i("BMSCore", "Length of response body: " + response.getResponseBytes().length);
            Log.i("BMSCore", "Response body: " + response.getResponseText());
        }
    }

    @Override
    public void onFailure(Response response, Throwable t, JSONObject extendedInfo) {