|
Oracle® WebLogic Server Web Clipping Transport API Reference 11g Release 1 (11.1.1) E14346-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.portal.wcs.transport.AbstractInputContext
oracle.portal.wcs.transport.http.DefaultHttpInputContext
public class DefaultHttpInputContext
This is an abstraction at Studio time to let any transportation layer to fire off the HTTP request and get the response back. Currently, we only test it against HTTPClient package. The implementation for Provider mode is WcrHttpInputContext. Note: At Studio mode, if the request gets 401 error, a new HttpInputContext will be created the handle the credential entered by the user. When this context is saved into database, the non-ascii characters are escaped in URL but not in parameter name-values pair.
| Field Summary | |
|---|---|
protected boolean |
m_bActiveTrue means it will be included in the clipping definition |
protected boolean |
m_bNewFalse is for reusing (SECTION, CLIPPING) in studio mode |
protected java.util.Hashtable |
m_htHeaders |
protected java.util.Hashtable |
m_htParamsThe parameters (name - value pair) should be encoded according to right encoding by calling WcEncoder.encodeNonAscii(). |
protected HttpTransportProperties |
m_propsThe HTTP properties, includes ProxyHost, proxyPort, WalletLocation, WalletPassword AUTH_TYPE (basic) |
protected java.lang.String |
m_szAuthRealm |
protected java.lang.String |
m_szAuthTypeThe Authorization stuff for both basic and digest |
protected java.lang.String |
m_szEffectiveUriThe effective URI |
protected java.lang.String |
m_szMethod |
protected java.lang.String |
m_szPassword |
protected java.lang.String |
m_szUrl |
protected java.lang.String |
m_szUsername |
protected HttpTransportLiaison |
m_transportThe actual transport implementation to handle connection. |
protected TransportSessionContext |
m_tscThe transport context to maintain cookies to outside |
| Fields inherited from class oracle.portal.wcs.transport.AbstractInputContext |
|---|
m_r, m_szContentType, m_szReqEncoding, m_szRespEncoding |
| Fields inherited from interface oracle.portal.wcs.transport.InputContext |
|---|
BUFFER_SIZE |
| Constructor Summary | |
|---|---|
protected |
DefaultHttpInputContext()Make subclass easy to construct |
|
DefaultHttpInputContext(HttpInputContext hic)Create a new Object, with the same TransportSessionContext, and it's always "new" and "active". |
|
DefaultHttpInputContext(java.lang.String szUrl)Test constructor |
|
DefaultHttpInputContext(java.lang.String szUrl, java.util.Hashtable htParams, java.util.Hashtable htHeaders, java.lang.String szMethod)This constuctor is called in both STUDIO and PROVIDER mode from InputContextFactory. |
| Method Summary | |
|---|---|
void |
addParam(java.lang.String szName, java.lang.String szValue)Http parameters. |
void |
addParam(java.lang.String szName, java.lang.String[] szValues) |
void |
close()Relay the call down to the transport |
protected HttpTransportLiaison |
createHttpTransportLiaison()The factory method to create Transport layer |
protected HttpTransportLiaison |
createHttpTransportLiaison(java.lang.String className, HttpInputContext hic)The factory method to create Tranport layer |
java.lang.String |
getAuthPassword() |
java.lang.String |
getAuthRealm()The realm of the http authorization |
java.lang.String |
getAuthType()This method must be called first to check the supported auth type |
java.lang.String |
getAuthUsername()This method must be called before any other calls except getAuthType() |
java.lang.String |
getContentType()If the content-type is set by the caller, simply return it. |
java.lang.String |
getEffectiveUri()Returns the effective uri. |
java.util.Hashtable |
getHeaders()Headers |
java.io.InputStream |
getInputStream()This method needs to be implemented by all subclasses in case they depend on getReader from this class. |
java.lang.String |
getMethod()Http method |
java.lang.String[] |
getParam(java.lang.String szName)Return the parameter value give a name |
java.util.Enumeration |
getParamNames()Returns the enumeration of parameter names |
java.util.Hashtable |
getParams()Deep copy of the parameters since the parameter value is String array. |
java.lang.String |
getProxyAuthRealm() |
java.lang.String |
getProxyAuthType() |
java.lang.String |
getProxyHost()Proxy information |
java.lang.String |
getProxyPassword() |
int |
getProxyPort() |
java.lang.String |
getProxyUsername() |
java.lang.String |
getQueryString()Convert the hashtbale into querystring. |
java.io.Reader |
getReader()If character set is defined, let super handle it, otherwise, create our own one |
javax.servlet.http.Cookie[] |
getResponseCookies() |
java.lang.String |
getResponseEncoding()This method could return null for html, since the content-type return could be simple "text/html" However, for javascript, it should not return null, rather, it will return the default one. |
java.util.Hashtable |
getResponseHeaders() |
int |
getResponseStatus() |
TransportSessionContext |
getSessionContext() |
int |
getTimeConsumed()Get the number of milliseconds consumed for this request |
int |
getTimeout()Timeout |
HttpTransportLiaison |
getTransportLiaison()The main reason we do not have method setTransportLiaison is to support cluster. |
java.lang.String |
getUrl()Http Url which could contains querystring |
java.security.Principal |
getUser()Gets the principal -used by the TransportLiaison to much with transport |
java.lang.String |
getWalletLocation()SSL |
java.lang.String |
getWalletPassword() |
boolean |
isNew()This method tells that if this HttpInputContext is a new one (browse) or the reused one (section, clip, backwards and forwards) |
boolean |
isStateChanged()This method tells that if this HttpInputContext needs to be added into the ClippingDef. |
void |
open()Opens up the stream so that subsequent calls to getReader will be ok. |
void |
setAuthPassword(java.lang.String szPwd) |
void |
setAuthRealm(java.lang.String szAuthRealm)set in HttpClientTransportLiaison.getHeaders() which is part of the HTTP Authorization challenge. |
void |
setAuthType(java.lang.String szType)This value should be set either from 401 error or from repository |
void |
setAuthUsername(java.lang.String szUsername) |
void |
setHeaders(java.util.Hashtable htHeaders) |
void |
setNonStateChanged()Mark this HttpInputContext to be nonactive. |
void |
setOld() |
void |
setResponseEncoding(java.lang.String szEncoding)After this call, the engine will not go to external resource to retrieve response charset encoding. |
void |
setSessionContext(TransportSessionContext tsc)Http session context which could be null in the copy construtor. |
void |
setUrl(java.lang.String szUrl)Only supposed to use for SSO effective URL support |
void |
setUser(java.security.Principal user)Sets the principal so that the implementationof the HttpTransportLiaison can use that Principal to fetch other tokens required for authentication. |
java.lang.String |
toString() |
| Methods inherited from class oracle.portal.wcs.transport.AbstractInputContext |
|---|
getRequestEncoding, setContentType, setRequestEncoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface oracle.portal.wcs.transport.InputContext |
|---|
getRequestEncoding, setContentType, setRequestEncoding |
| Field Detail |
|---|
protected java.lang.String m_szUrl
protected java.lang.String m_szMethod
protected java.util.Hashtable m_htParams
protected java.util.Hashtable m_htHeaders
protected java.lang.String m_szAuthType
protected java.lang.String m_szAuthRealm
protected java.lang.String m_szUsername
protected java.lang.String m_szPassword
protected TransportSessionContext m_tsc
protected boolean m_bActive
protected boolean m_bNew
protected HttpTransportProperties m_props
protected transient HttpTransportLiaison m_transport
protected java.lang.String m_szEffectiveUri
| Constructor Detail |
|---|
protected DefaultHttpInputContext()
DefaultWcrHttpInputContextpublic DefaultHttpInputContext(java.lang.String szUrl)
public DefaultHttpInputContext(java.lang.String szUrl,
java.util.Hashtable htParams,
java.util.Hashtable htHeaders,
java.lang.String szMethod)
HttpServletUtil.inheritOrignalParams(javax.servlet.http.HttpServletRequest, java.lang.String)
szUrl - the url to external web sitehtParams - the hashtable contains the name-value[] pair for all parametershtHeaders - the HTTP request headersszMethod - the HTTP request method, either GET or POSTpublic DefaultHttpInputContext(HttpInputContext hic)
| Method Detail |
|---|
public HttpTransportLiaison getTransportLiaison()
HttpTransportLiaison is not serializable, and we need to be able to created by its own here.getTransportLiaison in interface HttpInputContextprotected HttpTransportLiaison createHttpTransportLiaison()
protected final HttpTransportLiaison createHttpTransportLiaison(java.lang.String className,
HttpInputContext hic)
public java.io.Reader getReader()
throws TransportException
getReader in interface InputContextgetReader in class AbstractInputContextTransportExceptionpublic java.lang.String getUrl()
getUrl in interface InputContextgetUrl in class AbstractInputContextpublic void setUrl(java.lang.String szUrl)
setUrl in interface HttpInputContextpublic void setUser(java.security.Principal user)
HttpInputContextsetUser in interface HttpInputContextpublic java.security.Principal getUser()
HttpInputContextgetUser in interface HttpInputContext
public void addParam(java.lang.String szName,
java.lang.String szValue)
addParam in interface HttpInputContextWcrBrowseUrl.getHttpInputContext(), WcRepository.getClippingDef(oracle.portal.wcs.ClippingKey)
public void addParam(java.lang.String szName,
java.lang.String[] szValues)
addParam in interface HttpInputContextpublic java.util.Enumeration getParamNames()
getParamNames in interface HttpInputContextpublic java.lang.String[] getParam(java.lang.String szName)
getParam in interface HttpInputContextpublic java.lang.String getMethod()
getMethod in interface HttpInputContext
public java.lang.String getAuthType()
throws HttpTransportException
In HTTP scenaroir, there could be two levels of Authentications, one for http proxy server, and the other the actual web site. Currently, we only support one of them, i.e., you can not visit a web site needing authentication via a proxy server needing authentication too. Or, does this scenaroir exist in the real world? Can browser handler it? The one different behavior against browser is that now we can not use the HTTP Authorization header directly for Basic since the realm is not part of it. Therefore, if there are two clips access a restricted website, user needs to log in twice.
getAuthType in interface HttpInputContext- - if authentication type not equals to Basic or DigestHttpTransportExceptionpublic void setAuthType(java.lang.String szType)
setAuthType in interface HttpInputContextpublic java.lang.String getAuthUsername()
getAuthUsername in interface HttpInputContextpublic void setAuthUsername(java.lang.String szUsername)
setAuthUsername in interface HttpInputContextpublic java.lang.String getAuthPassword()
getAuthPassword in interface HttpInputContextpublic void setAuthPassword(java.lang.String szPwd)
setAuthPassword in interface HttpInputContextpublic java.lang.String getAuthRealm()
getAuthRealm in interface HttpInputContextpublic void setAuthRealm(java.lang.String szAuthRealm)
HttpClientTransportLiaison.getHeaders() which is part of the HTTP Authorization challenge.setAuthRealm in interface HttpInputContextpublic java.lang.String getProxyHost()
getProxyHost in interface HttpInputContextpublic int getProxyPort()
getProxyPort in interface HttpInputContextpublic java.lang.String getProxyUsername()
getProxyUsername in interface HttpInputContextpublic java.lang.String getProxyPassword()
getProxyPassword in interface HttpInputContextpublic java.lang.String getProxyAuthType()
getProxyAuthType in interface HttpInputContextpublic java.lang.String getProxyAuthRealm()
getProxyAuthRealm in interface HttpInputContextpublic java.lang.String getWalletLocation()
getWalletLocation in interface HttpInputContextpublic java.lang.String getWalletPassword()
getWalletPassword in interface HttpInputContextpublic java.util.Hashtable getHeaders()
getHeaders in interface HttpInputContextpublic void setHeaders(java.util.Hashtable htHeaders)
setHeaders in interface HttpInputContextpublic java.lang.String getQueryString()
getQueryString in interface HttpInputContextHttpServletUtil.inheritOrignalParams(javax.servlet.http.HttpServletRequest, java.lang.String), oracle.portal.wcs.transport.http.HttpClientTransportLiaison#getHttpResponsepublic void setSessionContext(TransportSessionContext tsc)
setSessionContext in interface HttpInputContextpublic TransportSessionContext getSessionContext()
getSessionContext in interface HttpInputContextpublic int getTimeout()
getTimeout in interface HttpInputContextpublic int getTimeConsumed()
getTimeConsumed in interface HttpInputContextgetTimeConsumed in interface InputContextgetTimeConsumed in class AbstractInputContext
public java.lang.String getContentType()
throws TransportException
setContentType to set a client-defined value or not to call this method at all. Otherwise, the default value defined by ContentTypeConstants.SZ_DEFAULT_CONTENT_TYPE_WITH_CHARSET is returned.getContentType in interface InputContextgetContentType in class AbstractInputContextTransportException
public java.lang.String getResponseEncoding()
throws TransportException
getResponseEncoding in interface InputContextgetResponseEncoding in class AbstractInputContextTransportException
public void setResponseEncoding(java.lang.String szEncoding)
throws TransportException
InputContextsetResponseEncoding in interface InputContextsetResponseEncoding in class AbstractInputContextTransportException
public void open()
throws TransportException
open in interface InputContextopen in class AbstractInputContextTransportException
public void close()
throws TransportException
close in interface InputContextclose in class AbstractInputContextTransportException
public java.lang.String getEffectiveUri()
throws TransportException
getEffectiveUri in interface InputContextgetEffectiveUri in class AbstractInputContextTransportExceptionpublic java.lang.String toString()
toString in interface HttpInputContexttoString in class java.lang.Object
public java.util.Hashtable getResponseHeaders()
throws TransportException
getResponseHeaders in interface HttpInputContextTransportException
public int getResponseStatus()
throws TransportException
getResponseStatus in interface HttpInputContextTransportExceptionpublic javax.servlet.http.Cookie[] getResponseCookies()
getResponseCookies in interface HttpInputContextpublic boolean isStateChanged()
isStateChanged in interface HttpInputContextoracle.portal.wcs.model.UrlModelpublic void setNonStateChanged()
setNonStateChanged in interface HttpInputContextHttpClientTransportLiaisonpublic boolean isNew()
isNew in interface HttpInputContextHttpClientTransportLiaisonpublic void setOld()
setOld in interface HttpInputContext
public java.io.InputStream getInputStream()
throws TransportException
AbstractInputContextgetReader from this class.getInputStream in interface InputContextgetInputStream in class AbstractInputContextTransportExceptionpublic java.util.Hashtable getParams()
getParams in interface HttpInputContext
|
Oracle® WebLogic Server Web Clipping Transport API Reference 11g Release 1 (11.1.1) E14346-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||