|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gridsystems.innergrid.api.WrapperConnection
public class WrapperConnection
Connection implementation that wraps another connection, optionally changing one of its fields.
| Field Summary |
|---|
| Fields inherited from interface com.gridsystems.innergrid.api.Connection |
|---|
DEFAULT_TIMEOUT, DIME, MIME, MTOM |
| Constructor Summary | |
|---|---|
WrapperConnection(Connection con,
Credentials cred)
Creates a new wrapper that will use alternative credentials. |
|
WrapperConnection(Connection con,
java.lang.String h,
int p,
boolean secure)
Creates a wrapper around the specified connection, and changes the URL. |
|
| Method Summary | |
|---|---|
void |
checkConnection()
Checks that the connection is directed to an open port with the proper protocol. |
void |
close()
Disposes the object and releases kept resources. |
java.lang.String |
getAttachmentFormat()
Gets the attachment format (DIME, MIME or MTOM). |
java.lang.String |
getContextPath()
Gets the connection context path. |
Credentials |
getCredentials()
Gets the credentials for the connection. |
java.lang.String |
getHost()
Gets the Host to connect to. |
int |
getPort()
Gets the port to connect to. |
int |
getTimeout()
Gets the connection timeout. |
java.net.URL |
getUrl(java.lang.String apiName)
Gets a target URL to the SOAP service for the specified API (Internal use only). |
boolean |
isChunkedTransferEnabled()
Gets the value of the chunked transfer control flag. |
boolean |
isKeepAliveEnabled()
Gets the keep-alive control flag value. |
boolean |
isSecured()
Checks if the connection is done through SSL. |
void |
manageException(KernelException ke,
int retry)
Manages exceptions (Internal use only). |
void |
setAttachmentFormat(java.lang.String format)
Sets the attachment format (DIME, MIME or MTOM). |
void |
setChunkedTransferEnabled(boolean enabled)
Enables or disables chunked transfer encoding (it is enabled by default). |
void |
setKeepAliveEnabled(boolean enabled)
Sets the keep-alive control flag value. |
void |
setTimeout(int timeout)
Sets the connection timeout. |
void |
success()
Notifies to the Connection instance that the target API has been reached. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WrapperConnection(Connection con,
java.lang.String h,
int p,
boolean secure)
throws KernelException
con - the connection to wraph - a string with the remote Server host name or address of the wrapperp - the remote Server port of the wrappersecure - a boolean set to true if a secure protocol(HTTPS)
must be used; false otherwise
KernelException - CLT011 if the connection is null
KernelException - CLT012 if the URL is null
public WrapperConnection(Connection con,
Credentials cred)
throws KernelException
con - a connection to wrapcred - credentials to use
KernelException - CLT011 if the connection is null| Method Detail |
|---|
public java.lang.String getHost()
getHost in interface Connectionpublic int getPort()
getPort in interface Connectionpublic boolean isSecured()
isSecured in interface Connectiontrue if this connection uses SSL.public java.lang.String getAttachmentFormat()
getAttachmentFormat in interface Connectionpublic java.lang.String getContextPath()
By default, Kernel services are located in /kernel/api.
getContextPath in interface Connectionpublic int getTimeout()
getTimeout in interface Connectionpublic boolean isChunkedTransferEnabled()
This flag is set to true by default.
isChunkedTransferEnabled in interface Connectionpublic boolean isKeepAliveEnabled()
isKeepAliveEnabled in interface Connectionpublic void setAttachmentFormat(java.lang.String format)
setAttachmentFormat in interface Connectionformat - The attachment format to usepublic void setChunkedTransferEnabled(boolean enabled)
This flag must be set to false when connecting to servers that do not support this transfer encoding. In particular, simple servers used by MUSE for event notification require this flag to be disabled.
Embedded servers used during unit tests will usually require this encoding to be disabled too.
setChunkedTransferEnabled in interface Connectionenabled - The new flag valuepublic void setKeepAliveEnabled(boolean enabled)
Keep-alive is disabled by default for scalability reasons. However, if several calls must be performed in a short time period, enabling it can drastically improve the performance.
setKeepAliveEnabled in interface Connectionenabled - The new flag valuepublic void setTimeout(int timeout)
setTimeout in interface Connectiontimeout - The connection timeout in milliseconds
public java.net.URL getUrl(java.lang.String apiName)
throws KernelException
getUrl in interface ConnectionapiName - the name of the API
KernelException - CLT008 if the resulting URL is invalidpublic Credentials getCredentials()
getCredentials in interface Connection
public void manageException(KernelException ke,
int retry)
throws KernelException
manageException in interface Connectionke - KernelException capturedretry - number of retries
KernelException - the ke exception if it passes along the
exception without managing
public void checkConnection()
throws KernelException
checkConnection in interface ConnectionKernelException - CLT060 if the port cannot be reached.public void close()
Connection
close in interface ConnectionConnection.close()public void success()
Connection
success in interface ConnectionConnection.success()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||