com.gridsystems.innergrid.api
Class DirectConnection

java.lang.Object
  extended by com.gridsystems.innergrid.api.AbstractConnection
      extended by com.gridsystems.innergrid.api.DirectConnection
All Implemented Interfaces:
Connection

public class DirectConnection
extends AbstractConnection

Connects to a single server.

Used when connecting to a Server that has no backup Server (redundant).

Version:
1.0
Author:
Rodrigo Ruiz, Xmas

Field Summary
 
Fields inherited from class com.gridsystems.innergrid.api.AbstractConnection
attachmentFormat, chunkedTransferEnabled, connChecked, contextPath, credentials, DEFAULT_RETRIES, host, keepAliveEnabled, port, retries, secured, sslInfo, sync, timeout
 
Fields inherited from interface com.gridsystems.innergrid.api.Connection
DEFAULT_TIMEOUT, DIME, MIME, MTOM
 
Constructor Summary
DirectConnection(java.lang.String h, int p, boolean secure, Credentials credentials)
          Creates an instance of the connection to the specified host:port, using the specified credentials.
DirectConnection(java.lang.String h, int p, boolean secure, SSLConnectionInfo sslInfo, Credentials credentials)
          Creates an instance of the connector to the specified host:port, using the specified credentials.
DirectConnection(java.lang.String h, int p, boolean secure, java.lang.String contextPath, SSLConnectionInfo sslInfo, Credentials credentials)
          Creates an instance of the connector to the specified host:port, using the specified credentials.
DirectConnection(java.lang.String h, int p, SSLConnectionInfo sslinfo, Credentials credentials)
          Creates an instance of the connection to the specified host:port, using the specified credentials.
 
Method Summary
 void close()
          Disposes the object and releases kept resources.
 java.lang.String getBaseUrl()
          Gets the base URL for all API URLs (Internal use only).
 void manageException(KernelException ke, int retry)
          Manages exceptions (Internal use only).
 void success()
          Notifies to the Connection instance that the target API has been reached.
 
Methods inherited from class com.gridsystems.innergrid.api.AbstractConnection
checkConnection, clearChecks, getAttachmentFormat, getContextPath, getCredentials, getHost, getPort, getRetries, getSSLConnectionInfo, getTimeout, getUrl, isChunkedTransferEnabled, isKeepAliveEnabled, isSecured, setAttachmentFormat, setChunkedTransferEnabled, setContextPath, setKeepAliveEnabled, setRetries, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectConnection

public DirectConnection(java.lang.String h,
                        int p,
                        boolean secure,
                        Credentials credentials)
Creates an instance of the connection to the specified host:port, using the specified credentials.

Parameters:
h - a string with the remote Server host name or address
p - the remote Server port
secure - a boolean set to true if a secure protocol(HTTPS) must be used; false otherwise
credentials - the credentials to authenticate the user

DirectConnection

public DirectConnection(java.lang.String h,
                        int p,
                        SSLConnectionInfo sslinfo,
                        Credentials credentials)
Creates an instance of the connection to the specified host:port, using the specified credentials. The port must accept SSL connections.

Parameters:
h - a string with the remote Server host name or address
p - the remote Server port
sslinfo - additional info to establish SSL connections
credentials - the credentials to authenticate the user
See Also:
AcceptAllCertificates, AcceptCertificate, AcceptCertificateOfKeyStore, AcceptCertificateOfSystemKeyStore

DirectConnection

public DirectConnection(java.lang.String h,
                        int p,
                        boolean secure,
                        SSLConnectionInfo sslInfo,
                        Credentials credentials)
Creates an instance of the connector to the specified host:port, using the specified credentials.

Parameters:
h - a string with the remote Server host name or address
p - the remote Server port
secure - a boolean set to true if a secure protocol(HTTPS) must be used; false otherwise
sslInfo - additional info to establish SSL connection
credentials - the credentials to authenticate the user
See Also:
AcceptAllCertificates, AcceptCertificate, AcceptCertificateOfKeyStore, AcceptCertificateOfSystemKeyStore

DirectConnection

public DirectConnection(java.lang.String h,
                        int p,
                        boolean secure,
                        java.lang.String contextPath,
                        SSLConnectionInfo sslInfo,
                        Credentials credentials)
Creates an instance of the connector to the specified host:port, using the specified credentials.

Parameters:
h - a string with the remote Server host name or address
p - the remote Server port
secure - a boolean set to true if a secure protocol(HTTPS) must be used; false otherwise
contextPath - Service context path
sslInfo - additional info to establish SSL connection
credentials - the credentials to authenticate the user
See Also:
AcceptAllCertificates, AcceptCertificate, AcceptCertificateOfKeyStore, AcceptCertificateOfSystemKeyStore
Method Detail

close

public void close()
Disposes the object and releases kept resources.


getBaseUrl

public java.lang.String getBaseUrl()
                            throws KernelException
Gets the base URL for all API URLs (Internal use only).

Specified by:
getBaseUrl in class AbstractConnection
Returns:
the base URL
Throws:
KernelException - CTL008 if the URL is not well formed

manageException

public void manageException(KernelException ke,
                            int retry)
                     throws KernelException
Manages exceptions (Internal use only).

Specified by:
manageException in interface Connection
Specified by:
manageException in class AbstractConnection
Parameters:
ke - KernelException captured
retry - number of retries
Throws:
KernelException - the ke exception if it passes along the exception without managing

success

public void success()
Notifies to the Connection instance that the target API has been reached.



Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.