oracle.stellent.ridc.protocol.http
Class IdcHttpProtocol

java.lang.Object
  extended by oracle.stellent.ridc.protocol.http.IdcHttpProtocol
All Implemented Interfaces:
Protocol

public class IdcHttpProtocol
extends java.lang.Object
implements Protocol


Field Summary
static java.lang.String USER_AGENT
           
 
Constructor Summary
IdcHttpProtocol(ServiceRequest<IdcHttpClientConnection> serviceRequest, DataFactory dataFactory, IdcHttpClientConfig config)
           
 
Method Summary
protected  void addRequestHeaders(DataBinder binder, org.apache.commons.httpclient.HttpMethod httpMethod)
          Set the request headers into the HTTP method.
protected  void addStringToBinder(java.lang.String searchString, java.lang.String htmlBody, DataBinder binder)
           
protected  int executeBinderMethod(ServiceRequest serviceRequest, java.util.List<org.apache.commons.httpclient.NameValuePair> parameters)
          Execute an HTTP method against the content server that POSTs a binder in HDA format
protected  int executeStreamMethod(ServiceRequest serviceRequest, java.util.List<org.apache.commons.httpclient.NameValuePair> parameters)
          Execute a multipart POST method against the content server that uploads the given files.
 IdcHttpClientConfig getClientConfig()
           
 IdcHttpClientConnection getConnection()
           
 DataFactory getDataFactory()
           
protected  java.util.List<org.apache.commons.httpclient.NameValuePair> getDefaultParameters(ServiceRequest serviceRequest)
          Create a list of the default NameValuePair parameters
 java.lang.String getEncoding()
           
 org.apache.commons.httpclient.HttpClient getHttpClient()
           
 java.io.InputStream getInputStream()
           
 ServiceRequest<IdcHttpClientConnection> getServiceRequest()
           
 ServiceResponse readResponse()
          Reads the next message, if a message is not completely received within the timeout specified an exception is thrown.
 void writeRequest()
          Write the request to the Content Server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_AGENT

public static final java.lang.String USER_AGENT
See Also:
Constant Field Values
Constructor Detail

IdcHttpProtocol

public IdcHttpProtocol(ServiceRequest<IdcHttpClientConnection> serviceRequest,
                       DataFactory dataFactory,
                       IdcHttpClientConfig config)
Method Detail

getDataFactory

public DataFactory getDataFactory()

getServiceRequest

public ServiceRequest<IdcHttpClientConnection> getServiceRequest()

getEncoding

public java.lang.String getEncoding()

getClientConfig

public IdcHttpClientConfig getClientConfig()

getConnection

public IdcHttpClientConnection getConnection()

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

writeRequest

public void writeRequest()
                  throws ProtocolException
Write the request to the Content Server

Specified by:
writeRequest in interface Protocol
Throws:
ProtocolException

readResponse

public ServiceResponse readResponse()
                             throws ProtocolException
Reads the next message, if a message is not completely received within the timeout specified an exception is thrown.

Specified by:
readResponse in interface Protocol
Returns:
The received message.
Throws:
ProtocolException

addStringToBinder

protected void addStringToBinder(java.lang.String searchString,
                                 java.lang.String htmlBody,
                                 DataBinder binder)

getDefaultParameters

protected java.util.List<org.apache.commons.httpclient.NameValuePair> getDefaultParameters(ServiceRequest serviceRequest)
Create a list of the default NameValuePair parameters

Parameters:
serviceRequest - the request
Returns:
the default parameters

executeStreamMethod

protected int executeStreamMethod(ServiceRequest serviceRequest,
                                  java.util.List<org.apache.commons.httpclient.NameValuePair> parameters)
                           throws java.io.IOException
Execute a multipart POST method against the content server that uploads the given files.

Parameters:
serviceRequest - the request
parameters - the default parameters
Returns:
the status code
Throws:
java.io.IOException

executeBinderMethod

protected int executeBinderMethod(ServiceRequest serviceRequest,
                                  java.util.List<org.apache.commons.httpclient.NameValuePair> parameters)
                           throws java.io.IOException
Execute an HTTP method against the content server that POSTs a binder in HDA format

Parameters:
serviceRequest - the service request
parameters - the default parameters
Returns:
the response code
Throws:
java.io.IOException

addRequestHeaders

protected void addRequestHeaders(DataBinder binder,
                                 org.apache.commons.httpclient.HttpMethod httpMethod)
Set the request headers into the HTTP method. Takes headers from the ISCSContext object as well as specially demarcated properties in the databinder local data.

Parameters:
binder - the binder
httpMethod - the http method to set the parameters


Copyright © 2008-2009 Oracle Corporation. All Rights Reserved.