Class IdcHttpProtocol
java.lang.Object
oracle.stellent.ridc.protocol.http.IdcHttpProtocol
- All Implemented Interfaces:
Protocol
-
Nested Class Summary
Nested classes/interfaces inherited from interface oracle.stellent.ridc.protocol.Protocol
Protocol.NullHandlingStrategy -
Field Summary
FieldsFields inherited from interface oracle.stellent.ridc.protocol.Protocol
IDC_HEADER_PREFIX, IDC_NULL_HANDLING, NULL_VALUE_OMIT, NULL_VALUE_TREAT_AS_EMPTYSTRING, NULL_VALUE_TREAT_AS_LOWERCASENULL -
Constructor Summary
ConstructorsConstructorDescriptionIdcHttpProtocol(IdcHttpClient client, ServiceRequest<IdcHttpClientConnection> serviceRequest) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddHandler(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler associated with the given authentication schemestatic voidaddHandlerFirst(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler to be the first authentication schemestatic voidaddHandlerLast(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler to be the last authentication schemeprotected voidaddRequestData(RIDCHttpMethod httpMethod) Set standard request headers, cookies and other info into the HTTP method.protected voidaddStringToBinder(String searchString, String htmlBody, DataBinder binder) static AuthenticationHandlercreateAuthHandler(IdcContext.HttpAuthScheme authScheme, IdcHttpProtocol httpProtocol) Retrieve the authentication handler associated with the given authentication schemeprotected intexecuteBinderMethod(List<NameValuePair> parameters, Boolean followRedirects) Execute an HTTP method against the content server that POSTs a binder in HDA formatprotected intexecuteStreamMethod(List<NameValuePair> parameters) Execute a multipart POST method against the content server that uploads the given files.static Set<IdcContext.HttpAuthScheme>protected List<NameValuePair>Create a list of the defaultNameValuePairparametersvoidlogout()Best-effort Logout from Content ServerReads the next message, if a message is not completely received within the timeout specified an exception is thrown.static voidRemoves all handlers associated with authentication schemesstatic Class<? extends AuthenticationHandler>removeHandler(IdcContext.HttpAuthScheme authScheme) Removes a handler associated with the given authentication schemeintSend the request to the Content Server; used internally by the AuthHandler implementations Same assendRequest(null)intsendRequest(Boolean followRedirects) Send the request to the Content Server; used internally by the AuthHandler implementationsvoidsetFilterManager(IdcFilterManager filterManager) voidWrite the request to the Content Server
-
Field Details
-
IDC_VERSION
- See Also:
-
IDC_HTTP_METHOD
- See Also:
-
-
Constructor Details
-
IdcHttpProtocol
public IdcHttpProtocol(IdcHttpClient client, ServiceRequest<IdcHttpClientConnection> serviceRequest)
-
-
Method Details
-
addHandler
public static void addHandler(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler associated with the given authentication scheme- Parameters:
authScheme- the auth schemehandler- the authentication handler
-
addHandlerFirst
public static void addHandlerFirst(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler to be the first authentication scheme- Parameters:
authScheme- the auth schemehandler- the authentication handler
-
addHandlerLast
public static void addHandlerLast(IdcContext.HttpAuthScheme authScheme, Class<? extends AuthenticationHandler> handler) Add/replace a handler to be the last authentication scheme- Parameters:
authScheme- the auth schemehandler- the authentication handler
-
removeHandler
public static Class<? extends AuthenticationHandler> removeHandler(IdcContext.HttpAuthScheme authScheme) Removes a handler associated with the given authentication scheme- Parameters:
authScheme- the auth scheme
-
removeAllHandlers
public static void removeAllHandlers()Removes all handlers associated with authentication schemes -
getAuthSchemes
- Returns:
- a set of the authentication schemes in the correct load order.
-
createAuthHandler
public static AuthenticationHandler createAuthHandler(IdcContext.HttpAuthScheme authScheme, IdcHttpProtocol httpProtocol) throws ProtocolException Retrieve the authentication handler associated with the given authentication scheme- Parameters:
authScheme- the auth schemehttpProtocol- the http protocol to initialize the auth handler- Returns:
- a new authentication handler or null if not bound to the given scheme
- Throws:
ProtocolException
-
getClient
-
getDataFactory
-
getServiceRequest
-
getDataBinder
-
getUserContext
-
getEncoding
-
getClientConfig
-
getConnection
-
getRequestConfig
-
getServiceLog
-
getHttpClient
-
getHttpMethod
-
getInputStream
- Throws:
IOExceptionProtocolException
-
setFilterManager
- Specified by:
setFilterManagerin interfaceProtocol
-
getFilterManager
- Specified by:
getFilterManagerin interfaceProtocol
-
getLastRequestURI
-
writeRequest
Write the request to the Content Server- Specified by:
writeRequestin interfaceProtocol- Throws:
ProtocolException
-
readResponse
Reads the next message, if a message is not completely received within the timeout specified an exception is thrown.- Specified by:
readResponsein interfaceProtocol- Returns:
- The received message.
- Throws:
ProtocolException
-
logout
Description copied from interface:ProtocolBest-effort Logout from Content Server- Specified by:
logoutin interfaceProtocol- Throws:
ProtocolException
-
sendRequest
Send the request to the Content Server; used internally by the AuthHandler implementations Same assendRequest(null)- Returns:
- the http response code
- Throws:
ProtocolException
-
sendRequest
Send the request to the Content Server; used internally by the AuthHandler implementations- Parameters:
followRedirects- whether to follow redirects or not.nullleaves it up to the protocol implementation- Returns:
- the http response code
- Throws:
ProtocolException
-
addStringToBinder
-
getDefaultParameters
Create a list of the defaultNameValuePairparameters- Returns:
- the default parameters
-
executeStreamMethod
protected int executeStreamMethod(List<NameValuePair> parameters) throws IOException, ProtocolException Execute a multipart POST method against the content server that uploads the given files.- Parameters:
parameters- the default parameters- Returns:
- the status code
- Throws:
IOExceptionProtocolException
-
executeBinderMethod
protected int executeBinderMethod(List<NameValuePair> parameters, Boolean followRedirects) throws IOException, ProtocolException Execute an HTTP method against the content server that POSTs a binder in HDA format- Parameters:
parameters- the default parametersfollowRedirects- whether to follow redirects or not.nullleaves it up to the protocol implementation- Returns:
- the response code
- Throws:
IOExceptionProtocolException
-
addRequestData
Set standard request headers, cookies and other info into the HTTP method. Also takes headers from the binder object if available.- Parameters:
httpMethod- the http method to set the parameters
-