|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connection
Classes implementing this interface hold all the necessary data to establish an authenticated connection to a Server.
Field Summary | |
---|---|
static int |
DEFAULT_TIMEOUT
Default connection timeout. |
static java.lang.String |
DIME
DIME attachment format. |
static java.lang.String |
MIME
MIME attachment format. |
static java.lang.String |
MTOM
MTOM attachment format. |
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 Port to connect. |
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()
Use a secured connection. |
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. |
Field Detail |
---|
static final java.lang.String DIME
static final java.lang.String MIME
static final java.lang.String MTOM
static final int DEFAULT_TIMEOUT
Method Detail |
---|
java.lang.String getHost()
int getPort()
boolean isSecured()
java.lang.String getContextPath()
By default, Kernel services are located in /kernel/api.
boolean isChunkedTransferEnabled()
This flag is set to true by default.
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.
enabled
- The new flag valueboolean isKeepAliveEnabled()
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.
enabled
- The new flag valueint getTimeout()
void setTimeout(int timeout)
timeout
- The connection timeout in millisecondsjava.lang.String getAttachmentFormat()
void setAttachmentFormat(java.lang.String format)
format
- The attachment format to usejava.net.URL getUrl(java.lang.String apiName) throws KernelException
apiName
- the name of the API
KernelException
- CLT008
if the resulting URL is invalidCredentials getCredentials()
void manageException(KernelException ke, int retry) throws KernelException
ke
- KernelException capturedretry
- number of retries
KernelException
- the ke
exception if it passes along the
exception without managingvoid success()
void checkConnection() throws KernelException
KernelException
- CLT060
if the port cannot be reached.
KernelException
- CLT061
if the port can be reached but the
protocol is not valid.
KernelException
- CLT062
if a valid URL to the port to check
cannot be created.void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |