com.googlecode.jinahya.twitter.xauth
Class SocketConnectionRequester

java.lang.Object
  extended by com.googlecode.jinahya.twitter.xauth.SocketConnectionRequester
All Implemented Interfaces:
Requester

public class SocketConnectionRequester
extends Object

Author:
Jin Kwon

Field Summary
protected static SocketFactory DEFAULT_SSL_SOCKET_FACTORY
          default ssl socket factory.
 
Constructor Summary
SocketConnectionRequester()
           
 
Method Summary
protected  void checkStatus(String statusCode, String reasonPhrase)
          Checks HTTP response status.
protected  void checkStatusLine(String statusLine)
          Checks given statusLine of HTTP response.
protected  javax.microedition.io.SocketConnection open(String name)
           
 InputStream request(String method, String url, String parameters, String authorization)
          Requests with given arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SSL_SOCKET_FACTORY

protected static final SocketFactory DEFAULT_SSL_SOCKET_FACTORY
default ssl socket factory.

See Also:
SSLSocketFactory.getDefault()
Constructor Detail

SocketConnectionRequester

public SocketConnectionRequester()
Method Detail

request

public InputStream request(String method,
                           String url,
                           String parameters,
                           String authorization)
                    throws Exception
Description copied from interface: Requester
Requests with given arguments.

Parameters:
method - request method
url - request url
parameters - parameters (already url encoded)
authorization - authorization header value or null.
Returns:
resource stream
Throws:
Exception - if any error occurs

open

protected javax.microedition.io.SocketConnection open(String name)
                                               throws IOException
Parameters:
name -
Returns:
Throws:
IOException

checkStatusLine

protected void checkStatusLine(String statusLine)
                        throws IOException
Checks given statusLine of HTTP response.

Parameters:
statusLine - status line of HTTP response message.
Throws:
IOException - if statusLine is not OK

checkStatus

protected void checkStatus(String statusCode,
                           String reasonPhrase)
                    throws IOException
Checks HTTP response status.

Parameters:
statusCode - status code
reasonPhrase - reason phrase
Throws:
IOException - if the status is not OK


Copyright © 2011. All Rights Reserved.