public class RestConnection
extends java.lang.Object
implements javax.naming.Referenceable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_NAME
Connection Name attribute
|
static java.lang.String |
ATTR_URL
Connection endpoint attribute
|
static java.lang.String |
IS_ADFBC_MODE
Saves the adfbcMode in connection.
|
Modifier | Constructor and Description |
---|---|
protected |
RestConnection(java.lang.String name,
DocumentFragment description,
java.util.Hashtable environment)
Instantiate this RestConnection instance from the description and
the corresponding environment.
|
|
RestConnection(java.lang.String name,
java.net.URL url) |
|
RestConnection(java.lang.String name,
java.net.URL url,
java.util.Map<java.lang.String,java.lang.Object> clientConfigProperties) |
Modifier and Type | Method and Description |
---|---|
protected DocumentFragment |
describe()
Create the DocumentFragment that describes this connection to the
Connection Architecture.
|
ConnectionAuthentication |
getAuthenticationScheme()
Get the
ConnectionAuthentication used by this connection
to authenticate against the endpoint |
java.lang.String |
getName() |
RestProxy |
getProxy() |
javax.naming.Reference |
getReference() |
java.net.URL |
getResourcePatternURL()
Returned value is same as that of getURL() when isADFBCMode is false
In case when Connection is in adfBCMode (default) then this URL strips of ending "/describe" from URL if present
and returns the URL.
|
int |
getTimeout() |
java.net.URL |
getURL()
Returns the URL associated with the connection
|
protected java.lang.String |
getURLConnectionClassName() |
com.sun.jersey.api.client.WebResource |
getWebResource() |
com.sun.jersey.api.client.WebResource |
getWebResource(java.lang.String urlPath)
The method takes the base url i.e
url.getAuthority()
and appends the urlPath passed. |
boolean |
isADFBCMode() |
void |
setADFBCMode(boolean adfbcMode)
adfBCMode is true by default.
|
protected void |
setAuthenticationScheme(ConnectionAuthentication authScheme)
Registers an
ConnectionAuthentication for this connection to use
when authenticating against the Resource. |
void |
setProxy(RestProxy proxy) |
void |
setTimeout(int timeout)
Timeout interval in milliseconds
If 0 then an interval of infinity is declared.
|
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_URL
public static final java.lang.String IS_ADFBC_MODE
public RestConnection(java.lang.String name, java.net.URL url, java.util.Map<java.lang.String,java.lang.Object> clientConfigProperties) throws ConnectionException
ConnectionException
public RestConnection(java.lang.String name, java.net.URL url) throws ConnectionException
ConnectionException
protected RestConnection(java.lang.String name, DocumentFragment description, java.util.Hashtable environment) throws ConnectionException
name
- The Name of this Connection.description
- The DocumentFragment
describing this
connectionEnvironment
- The Environment having the necessary credential
information for this connection.{@link
- ConnectionException} if the connection instance could not
be created.ConnectionException
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public ConnectionAuthentication getAuthenticationScheme()
ConnectionAuthentication
used by this connection
to authenticate against the endpointConnectionAuthentication
used by this
connection. If the connection does not use any authentication
null
is returned.protected void setAuthenticationScheme(ConnectionAuthentication authScheme)
ConnectionAuthentication
for this connection to use
when authenticating against the Resource. The
ConnectionAuthentication
allows for extensions, to define custom
authentication modules for a connection.authScheme
- ConnectionAuthentication
to be used when
authenticating against the resource.protected DocumentFragment describe() throws ConnectionException
DocumentFragment
describing this connection
instance.ConnectionException
public java.lang.String getName()
public void setProxy(RestProxy proxy)
public RestProxy getProxy()
public com.sun.jersey.api.client.WebResource getWebResource() throws ConnectionException
ConnectionException
public com.sun.jersey.api.client.WebResource getWebResource(java.lang.String urlPath) throws ConnectionException
url.getAuthority()
and appends the urlPath passed. If the urlPath passed is null, it returns
WebResource associated with connection urlurlPath
- ConnectionException
public java.net.URL getURL()
public int getTimeout()
public void setTimeout(int timeout)
timeout
- public void setADFBCMode(boolean adfbcMode)
public boolean isADFBCMode()
public java.net.URL getResourcePatternURL()
protected java.lang.String getURLConnectionClassName()