com.aetrion.flickr
Class Transport

java.lang.Object
  extended by com.aetrion.flickr.Transport
Direct Known Subclasses:
REST, SOAP

public abstract class Transport
extends java.lang.Object

The abstract Transport class provides a common interface for transporting requests to the Flickr servers. Flickr offers several transport methods including REST, SOAP and XML-RPC. FlickrJ currently implements the REST transport and work is being done to include the SOAP transport.

Author:
Matt Ray, Anthony Eden

Field Summary
protected  java.lang.Class responseClass
           
static java.lang.String REST
           
static java.lang.String SOAP
           
 
Constructor Summary
Transport()
           
 
Method Summary
abstract  Response get(java.lang.String path, java.util.List parameters)
          Invoke an HTTP GET request on a remote host.
 java.lang.String getHost()
           
 java.lang.String getPath()
           
 int getPort()
           
 java.lang.Class getResponseClass()
           
 java.lang.String getTransportType()
           
 Response post(java.lang.String path, java.util.List parameters)
          Invoke an HTTP POST request on a remote host.
abstract  Response post(java.lang.String path, java.util.List parameters, boolean multipart)
          Invoke an HTTP POST request on a remote host.
 void setHost(java.lang.String host)
           
 void setPath(java.lang.String path)
           
 void setPort(int port)
           
 void setResponseClass(java.lang.Class responseClass)
           
 void setTransportType(java.lang.String transport)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REST

public static final java.lang.String REST
See Also:
Constant Field Values

SOAP

public static final java.lang.String SOAP
See Also:
Constant Field Values

responseClass

protected java.lang.Class responseClass
Constructor Detail

Transport

public Transport()
Method Detail

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

getPort

public int getPort()

setPort

public void setPort(int port)

getTransportType

public java.lang.String getTransportType()

setTransportType

public void setTransportType(java.lang.String transport)

get

public abstract Response get(java.lang.String path,
                             java.util.List parameters)
                      throws java.io.IOException,
                             org.xml.sax.SAXException
Invoke an HTTP GET request on a remote host. You must close the InputStream after you are done with.

Parameters:
path - The request path
parameters - The parameters (collection of Parameter objects)
Returns:
The Response
Throws:
java.io.IOException
org.xml.sax.SAXException

post

public Response post(java.lang.String path,
                     java.util.List parameters)
              throws java.io.IOException,
                     org.xml.sax.SAXException
Invoke an HTTP POST request on a remote host.

Parameters:
path - The request path
parameters - The parameters (collection of Parameter objects)
Returns:
The Response object
Throws:
java.io.IOException
org.xml.sax.SAXException

post

public abstract Response post(java.lang.String path,
                              java.util.List parameters,
                              boolean multipart)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Invoke an HTTP POST request on a remote host.

Parameters:
path - The request path
parameters - The parameters (List of Parameter objects)
multipart - Use multipart
Returns:
The Response object
Throws:
java.io.IOException
org.xml.sax.SAXException

getPath

public java.lang.String getPath()
Returns:
Returns the path.

setPath

public void setPath(java.lang.String path)
Parameters:
path - The path to set.

getResponseClass

public java.lang.Class getResponseClass()

setResponseClass

public void setResponseClass(java.lang.Class responseClass)


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.