|
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_bActive True means it will be included in the clipping definition |
protected boolean |
m_bNew False is for reusing (SECTION, CLIPPING) in studio mode |
protected java.util.Hashtable |
m_htHeaders |
protected java.util.Hashtable |
m_htParams The parameters (name - value pair) should be encoded according to right encoding by calling WcEncoder.encodeNonAscii(). |
protected HttpTransportProperties |
m_props The HTTP properties, includes ProxyHost, proxyPort, WalletLocation, WalletPassword AUTH_TYPE (basic) |
protected java.lang.String |
m_szAuthRealm |
protected java.lang.String |
m_szAuthType The Authorization stuff for both basic and digest |
protected java.lang.String |
m_szEffectiveUri The 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_transport The actual transport implementation to handle connection. |
protected TransportSessionContext |
m_tsc The 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()
DefaultWcrHttpInputContext
public 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 HttpInputContext
protected HttpTransportLiaison createHttpTransportLiaison()
protected final HttpTransportLiaison createHttpTransportLiaison(java.lang.String className, HttpInputContext hic)
public java.io.Reader getReader() throws TransportException
getReader
in interface InputContext
getReader
in class AbstractInputContext
TransportException
public java.lang.String getUrl()
getUrl
in interface InputContext
getUrl
in class AbstractInputContext
public void setUrl(java.lang.String szUrl)
setUrl
in interface HttpInputContext
public void setUser(java.security.Principal user)
HttpInputContext
setUser
in interface HttpInputContext
public java.security.Principal getUser()
HttpInputContext
getUser
in interface HttpInputContext
public void addParam(java.lang.String szName, java.lang.String szValue)
addParam
in interface HttpInputContext
WcrBrowseUrl.getHttpInputContext()
, WcRepository.getClippingDef(oracle.portal.wcs.ClippingKey)
public void addParam(java.lang.String szName, java.lang.String[] szValues)
addParam
in interface HttpInputContext
public java.util.Enumeration getParamNames()
getParamNames
in interface HttpInputContext
public java.lang.String[] getParam(java.lang.String szName)
getParam
in interface HttpInputContext
public 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 DigestHttpTransportException
public void setAuthType(java.lang.String szType)
setAuthType
in interface HttpInputContext
public java.lang.String getAuthUsername()
getAuthUsername
in interface HttpInputContext
public void setAuthUsername(java.lang.String szUsername)
setAuthUsername
in interface HttpInputContext
public java.lang.String getAuthPassword()
getAuthPassword
in interface HttpInputContext
public void setAuthPassword(java.lang.String szPwd)
setAuthPassword
in interface HttpInputContext
public java.lang.String getAuthRealm()
getAuthRealm
in interface HttpInputContext
public void setAuthRealm(java.lang.String szAuthRealm)
HttpClientTransportLiaison.getHeaders()
which is part of the HTTP Authorization challenge.setAuthRealm
in interface HttpInputContext
public java.lang.String getProxyHost()
getProxyHost
in interface HttpInputContext
public int getProxyPort()
getProxyPort
in interface HttpInputContext
public java.lang.String getProxyUsername()
getProxyUsername
in interface HttpInputContext
public java.lang.String getProxyPassword()
getProxyPassword
in interface HttpInputContext
public java.lang.String getProxyAuthType()
getProxyAuthType
in interface HttpInputContext
public java.lang.String getProxyAuthRealm()
getProxyAuthRealm
in interface HttpInputContext
public java.lang.String getWalletLocation()
getWalletLocation
in interface HttpInputContext
public java.lang.String getWalletPassword()
getWalletPassword
in interface HttpInputContext
public java.util.Hashtable getHeaders()
getHeaders
in interface HttpInputContext
public void setHeaders(java.util.Hashtable htHeaders)
setHeaders
in interface HttpInputContext
public java.lang.String getQueryString()
getQueryString
in interface HttpInputContext
HttpServletUtil.inheritOrignalParams(javax.servlet.http.HttpServletRequest, java.lang.String)
, oracle.portal.wcs.transport.http.HttpClientTransportLiaison#getHttpResponse
public void setSessionContext(TransportSessionContext tsc)
setSessionContext
in interface HttpInputContext
public TransportSessionContext getSessionContext()
getSessionContext
in interface HttpInputContext
public int getTimeout()
getTimeout
in interface HttpInputContext
public int getTimeConsumed()
getTimeConsumed
in interface HttpInputContext
getTimeConsumed
in interface InputContext
getTimeConsumed
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 InputContext
getContentType
in class AbstractInputContext
TransportException
public java.lang.String getResponseEncoding() throws TransportException
getResponseEncoding
in interface InputContext
getResponseEncoding
in class AbstractInputContext
TransportException
public void setResponseEncoding(java.lang.String szEncoding) throws TransportException
InputContext
setResponseEncoding
in interface InputContext
setResponseEncoding
in class AbstractInputContext
TransportException
public void open() throws TransportException
open
in interface InputContext
open
in class AbstractInputContext
TransportException
public void close() throws TransportException
close
in interface InputContext
close
in class AbstractInputContext
TransportException
public java.lang.String getEffectiveUri() throws TransportException
getEffectiveUri
in interface InputContext
getEffectiveUri
in class AbstractInputContext
TransportException
public java.lang.String toString()
toString
in interface HttpInputContext
toString
in class java.lang.Object
public java.util.Hashtable getResponseHeaders() throws TransportException
getResponseHeaders
in interface HttpInputContext
TransportException
public int getResponseStatus() throws TransportException
getResponseStatus
in interface HttpInputContext
TransportException
public javax.servlet.http.Cookie[] getResponseCookies()
getResponseCookies
in interface HttpInputContext
public boolean isStateChanged()
isStateChanged
in interface HttpInputContext
oracle.portal.wcs.model.UrlModel
public void setNonStateChanged()
setNonStateChanged
in interface HttpInputContext
HttpClientTransportLiaison
public boolean isNew()
isNew
in interface HttpInputContext
HttpClientTransportLiaison
public void setOld()
setOld
in interface HttpInputContext
public java.io.InputStream getInputStream() throws TransportException
AbstractInputContext
getReader
from this class.getInputStream
in interface InputContext
getInputStream
in class AbstractInputContext
TransportException
public 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 |