com.google.code.facebookapi
Interface CommunicationStrategy

All Known Implementing Classes:
DefaultCommunicationStrategy

public interface CommunicationStrategy

Interface for encapsulating network communication logic.


Method Summary
 int getConnectionTimeout()
           
 int getReadTimeout()
           
 java.lang.String postRequest(java.net.URL serverUrl, java.util.SortedMap<java.lang.String,java.lang.String> params)
          Sends a post request to the specified URL.
 java.lang.String postRequest(java.net.URL serverUrl, java.util.SortedMap<java.lang.String,java.lang.String> params, java.lang.String fileName, java.io.InputStream fileStream)
          Helper function for posting a request that includes raw file data, such as file upload.
 void setConnectionTimeout(int connectTimeout)
           
 void setReadTimeout(int readTimeout)
           
 

Method Detail

postRequest

java.lang.String postRequest(java.net.URL serverUrl,
                             java.util.SortedMap<java.lang.String,java.lang.String> params)
                             throws java.io.IOException
Sends a post request to the specified URL.

Parameters:
serverUrl - Target server URL.
params - Parameters to include in POST body.
Returns:
String response.
Throws:
java.io.IOException - Thrown on any communication-related error.

postRequest

java.lang.String postRequest(java.net.URL serverUrl,
                             java.util.SortedMap<java.lang.String,java.lang.String> params,
                             java.lang.String fileName,
                             java.io.InputStream fileStream)
                             throws java.io.IOException
Helper function for posting a request that includes raw file data, such as file upload.

Parameters:
serverUrl - Target server URL.
params - request parameters (not including the file)
fileName -
fileStream -
Returns:
an InputStream with the request response
Throws:
java.io.IOException

getConnectionTimeout

int getConnectionTimeout()

setConnectionTimeout

void setConnectionTimeout(int connectTimeout)

getReadTimeout

int getReadTimeout()

setReadTimeout

void setReadTimeout(int readTimeout)


Copyright © 2010. All Rights Reserved.