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 | 
HEADER  | 
static java.lang.String | 
HEADER_KEY  | 
static java.lang.String | 
HEADER_VALUE  | 
static java.lang.String | 
HTTP_HEADERS_MAP
Http Headers Map attribute. 
 | 
static java.lang.String | 
IS_ADFBC_MODE
Saves the adfbcMode in connection. 
 | 
static java.lang.String | 
IS_CSRF_HEADER  | 
static java.lang.String | 
REST_CONNECTION_INVOKER_DELEGATE  | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
RestConnection(java.lang.String name,
              org.w3c.dom.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 org.w3c.dom.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. 
 | 
RestResponse | 
getResponse(java.lang.String httpMethod,
           java.lang.String path,
           java.util.Map<java.lang.String,java.lang.String> urlQueryMap,
           java.util.Map<java.lang.String,java.lang.Object> fixedHeaders,
           byte[] requestBody,
           java.lang.String contentType)
Fetches the connection response for given HTTP operation and parameters. 
 | 
RestResponse | 
getResponse(java.lang.String httpMethod,
           java.lang.String path,
           java.lang.String urlQueryString,
           java.util.Map<java.lang.String,java.lang.Object> fixedHeaders,
           byte[] requestBody,
           java.lang.String contentType)
Deprecated. 
 
use the version that takes map as URL query parameter 
Fetches the connection response for given HTTP operation and parameters. Internal: Applications should not call this method.  | 
RestResponse | 
getResponse(java.lang.String httpMethod,
           java.lang.String path,
           java.lang.String urlQueryString,
           java.util.Map<java.lang.String,java.lang.Object> fixedHeaders,
           java.util.Map<java.lang.String,java.lang.Object> userProvidedHeaders,
           byte[] requestBody,
           java.lang.String contentType)
Deprecated. 
 
use the version that takes map as URL query parameter 
Fetches the connection response for given HTTP operation and parameters. Internal: Applications should not call this method.  | 
int | 
getTimeout()  | 
java.net.URL | 
getURL()
Returns the URL associated with the connection 
 | 
protected java.lang.String | 
getURLConnectionClassName()  | 
boolean | 
isADFBCMode()
Deprecated.  
 | 
void | 
setADFBCMode(boolean adfbcMode)
Deprecated.  
 | 
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 static final java.lang.String IS_CSRF_HEADER
public static final java.lang.String HTTP_HEADERS_MAP
public static final java.lang.String HEADER
public static final java.lang.String HEADER_KEY
public static final java.lang.String HEADER_VALUE
public static final java.lang.String REST_CONNECTION_INVOKER_DELEGATE
public RestConnection(java.lang.String name,
                      java.net.URL url,
                      java.util.Map<java.lang.String,java.lang.Object> clientConfigProperties)
public RestConnection(java.lang.String name,
                      java.net.URL url)
protected RestConnection(java.lang.String name,
                         org.w3c.dom.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.ConnectionExceptionpublic javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic 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 org.w3c.dom.DocumentFragment describe()
                                         throws ConnectionException
DocumentFragment describing this connection
          instance.ConnectionExceptionpublic java.lang.String getName()
public void setProxy(RestProxy proxy)
public RestProxy getProxy()
@Deprecated public RestResponse getResponse(java.lang.String httpMethod, java.lang.String path, java.lang.String urlQueryString, java.util.Map<java.lang.String,java.lang.Object> fixedHeaders, java.util.Map<java.lang.String,java.lang.Object> userProvidedHeaders, byte[] requestBody, java.lang.String contentType)
httpMethod - e.g GET/PUT/POST etcpath - path component of a hierarchical URIurlQueryString - urlQuery without ? (question mark) for the query, values of query should be encodedfixedHeaders - supported HTTPHeadersuserProvidedHeaders - used provided HTTPHeadersrequestBody - Stream in case of e.g PUT, POST request. null in case body is empty e.g in case of GETcontentType - Header Content-Type in case requestBody is provided@Deprecated public RestResponse getResponse(java.lang.String httpMethod, java.lang.String path, java.lang.String urlQueryString, java.util.Map<java.lang.String,java.lang.Object> fixedHeaders, byte[] requestBody, java.lang.String contentType)
httpMethod - e.g GET/PUT/POST etcpath - path component of a hierarchical URIurlQueryString - urlQuery without ? (question mark) for the query, values of query should be encodedfixedHeaders - supported HTTPHeadersrequestBody - Stream in case of e.g PUT, POST request. null in case body is empty e.g in case of GETcontentType - Header Content-Type in case requestBody is providedpublic RestResponse getResponse(java.lang.String httpMethod, java.lang.String path, java.util.Map<java.lang.String,java.lang.String> urlQueryMap, java.util.Map<java.lang.String,java.lang.Object> fixedHeaders, byte[] requestBody, java.lang.String contentType) throws java.net.URISyntaxException, java.net.MalformedURLException
restConn - httpMethod - e.g GET/PUT/POST etc. If null is passed, then HTTP GET call is madepath - path component of a hierarchical URIurlQueryMap - Key Value pair for url query Map with non null key.fixedHeaders - supported HTTPHeadersrequestBody - Stream in case of e.g PUT, POST request. null in case body is empty e.g in case of GETcontentType - Header Content-Type in case requestBody is providedjava.net.URISyntaxExceptionjava.net.MalformedURLExceptionpublic java.net.URL getURL()
public int getTimeout()
public void setTimeout(int timeout)
timeout - @Deprecated public void setADFBCMode(boolean adfbcMode)
@Deprecated public boolean isADFBCMode()
public java.net.URL getResourcePatternURL()
protected java.lang.String getURLConnectionClassName()