Protocol.NullHandlingStrategy
Modifier and Type | Field and Description |
---|---|
static String |
IDC_HTTP_METHOD |
static String |
IDC_VERSION |
IDC_HEADER_PREFIX, IDC_NULL_HANDLING, NULL_VALUE_OMIT, NULL_VALUE_TREAT_AS_EMPTYSTRING, NULL_VALUE_TREAT_AS_LOWERCASENULL
Constructor and Description |
---|
IdcHttpProtocol(IdcHttpClient client,
ServiceRequest<IdcHttpClientConnection> serviceRequest) |
Modifier and Type | Method and Description |
---|---|
static void |
addHandler(IdcContext.HttpAuthScheme authScheme,
Class<? extends AuthenticationHandler> handler)
Add/replace a handler associated with the given authentication scheme
|
static void |
addHandlerFirst(IdcContext.HttpAuthScheme authScheme,
Class<? extends AuthenticationHandler> handler)
Add/replace a handler to be the first authentication scheme
|
static void |
addHandlerLast(IdcContext.HttpAuthScheme authScheme,
Class<? extends AuthenticationHandler> handler)
Add/replace a handler to be the last authentication scheme
|
protected void |
addRequestData(RIDCHttpMethod httpMethod)
Set standard request headers, cookies and other info into the HTTP method.
|
protected void |
addStringToBinder(String searchString,
String htmlBody,
DataBinder binder) |
static AuthenticationHandler |
createAuthHandler(IdcContext.HttpAuthScheme authScheme,
IdcHttpProtocol httpProtocol)
Retrieve the authentication handler associated with the given authentication scheme
|
protected int |
executeBinderMethod(List<NameValuePair> parameters,
Boolean followRedirects)
Execute an HTTP method against the content server that POSTs a binder in
HDA format
|
protected int |
executeStreamMethod(List<NameValuePair> parameters)
Execute a multipart POST method against the content server that uploads the given files.
|
static Set<IdcContext.HttpAuthScheme> |
getAuthSchemes() |
IdcHttpClient |
getClient() |
IdcHttpClientConfig |
getClientConfig() |
IdcHttpClientConnection |
getConnection() |
DataBinder |
getDataBinder() |
DataFactory |
getDataFactory() |
protected List<NameValuePair> |
getDefaultParameters()
Create a list of the default
NameValuePair parameters |
String |
getEncoding() |
IdcFilterManager |
getFilterManager() |
RIDCHttpClient |
getHttpClient() |
RIDCHttpMethod |
getHttpMethod() |
InputStream |
getInputStream() |
URI |
getLastRequestURI() |
IdcRequestConfig |
getRequestConfig() |
ServiceLog |
getServiceLog() |
ServiceRequest<IdcHttpClientConnection> |
getServiceRequest() |
IdcContext |
getUserContext() |
void |
logout()
Best-effort Logout from Content Server
|
ServiceResponse |
readResponse()
Reads the next message, if a message is not completely received within the timeout specified an exception
is thrown.
|
static void |
removeAllHandlers()
Removes all handlers associated with authentication schemes
|
static Class<? extends AuthenticationHandler> |
removeHandler(IdcContext.HttpAuthScheme authScheme)
Removes a handler associated with the given authentication scheme
|
int |
sendRequest()
Send the request to the Content Server; used internally by the AuthHandler implementations
Same as
sendRequest(null) |
int |
sendRequest(Boolean followRedirects)
Send the request to the Content Server; used internally by the AuthHandler implementations
|
void |
setFilterManager(IdcFilterManager filterManager) |
void |
writeRequest()
Write the request to the Content Server
|
public static final String IDC_VERSION
public static final String IDC_HTTP_METHOD
public IdcHttpProtocol(IdcHttpClient client, ServiceRequest<IdcHttpClientConnection> serviceRequest)
public static void addHandler(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler)
authScheme
- the auth schemehandler
- the authentication handlerpublic static void addHandlerFirst(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler)
authScheme
- the auth schemehandler
- the authentication handlerpublic static void addHandlerLast(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler)
authScheme
- the auth schemehandler
- the authentication handlerpublic static Class<? extends AuthenticationHandler> removeHandler(IdcContext.HttpAuthScheme authScheme)
authScheme
- the auth schemepublic static void removeAllHandlers()
public static Set<IdcContext.HttpAuthScheme> getAuthSchemes()
public static AuthenticationHandler createAuthHandler(IdcContext.HttpAuthScheme authScheme, IdcHttpProtocol httpProtocol) throws ProtocolException
authScheme
- the auth schemehttpProtocol
- the http protocol to initialize the auth handlerProtocolException
public IdcHttpClient getClient()
public DataFactory getDataFactory()
public ServiceRequest<IdcHttpClientConnection> getServiceRequest()
public DataBinder getDataBinder()
public IdcContext getUserContext()
public String getEncoding()
public IdcHttpClientConfig getClientConfig()
public IdcHttpClientConnection getConnection()
public IdcRequestConfig getRequestConfig()
public ServiceLog getServiceLog()
public RIDCHttpClient getHttpClient()
public RIDCHttpMethod getHttpMethod()
public InputStream getInputStream() throws IOException, ProtocolException
IOException
ProtocolException
public void setFilterManager(IdcFilterManager filterManager)
setFilterManager
in interface Protocol
public IdcFilterManager getFilterManager()
getFilterManager
in interface Protocol
public URI getLastRequestURI()
public void writeRequest() throws ProtocolException
writeRequest
in interface Protocol
ProtocolException
public ServiceResponse readResponse() throws ProtocolException
readResponse
in interface Protocol
ProtocolException
public void logout() throws ProtocolException
Protocol
logout
in interface Protocol
ProtocolException
public int sendRequest() throws ProtocolException
sendRequest(null)
ProtocolException
public int sendRequest(Boolean followRedirects) throws ProtocolException
followRedirects
- whether to follow redirects or not. null
leaves it up
to the protocol implementationProtocolException
protected void addStringToBinder(String searchString, String htmlBody, DataBinder binder)
protected List<NameValuePair> getDefaultParameters()
NameValuePair
parametersprotected int executeStreamMethod(List<NameValuePair> parameters) throws IOException, ProtocolException
parameters
- the default parametersIOException
ProtocolException
protected int executeBinderMethod(List<NameValuePair> parameters, Boolean followRedirects) throws IOException, ProtocolException
parameters
- the default parametersfollowRedirects
- whether to follow redirects or not. null
leaves it up
to the protocol implementationIOException
ProtocolException
protected void addRequestData(RIDCHttpMethod httpMethod)
httpMethod
- the http method to set the parameters