Package com.webmethods.jms.protocol.link
Class Link
- java.lang.Object
-
- com.webmethods.jms.protocol.link.Link
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
_logApi
static int
ENCRYPT_LEVEL_ENCRYPTION
Encryption enabledstatic int
ENCRYPT_LEVEL_NO_ENCRYPTION
No encryptionstatic int
ENCRYPT_LEVEL_US_DOMESTIC
Deprecated.Replaced byENCRYPT_LEVEL_ENCRYPTION
static int
ENCRYPT_LEVEL_US_EXPORT
Deprecated.Replaced byENCRYPT_LEVEL_ENCRYPTION
static java.lang.String
SSL_PROVIDER_ENTRUST
static java.lang.String
SSL_PROVIDER_SPYRUS
-
Constructor Summary
Constructors Constructor Description Link()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
addFailingBrokerHost(BrokerURL url, long expireTime, javax.jms.JMSException exception)
Update the failing brokers list with expire time and exception as values.protected void
applyJMSConfigParams(java.net.Socket socket)
static void
checkConnect(BrokerURL url)
Check if we should attempt to connect to the provided host.abstract void
connect(BrokerURL url)
Create the physical connection to the Broker.static Link
create(javax.jms.Connection connection, SSLInfo sslinfo)
abstract void
destroy()
Cleanup any resources associated with the connection to the Broker.abstract void
disconnect()
Close the physical connection to the Broker.abstract void
flush()
Flushes any data in the output buffer to the socket.abstract int
getEncryptionLevel()
Returns the encryption level of the link.abstract java.util.Properties
getServerCertificate()
Returns properties of the server certificate.abstract int
recv(byte[] buf, int offset, int length)
Reads bytes from the link into the specified byte array, starting at the given offset.abstract void
send(byte[] data, int offset, int length)
Writeslength
bytes from the specified byte array starting atoffset
to the link.
-
-
-
Field Detail
-
ENCRYPT_LEVEL_NO_ENCRYPTION
public static final int ENCRYPT_LEVEL_NO_ENCRYPTION
No encryption- See Also:
- Constant Field Values
-
ENCRYPT_LEVEL_US_EXPORT
public static final int ENCRYPT_LEVEL_US_EXPORT
Deprecated.Replaced byENCRYPT_LEVEL_ENCRYPTION
Export encryption level- See Also:
- Constant Field Values
-
ENCRYPT_LEVEL_US_DOMESTIC
public static final int ENCRYPT_LEVEL_US_DOMESTIC
Deprecated.Replaced byENCRYPT_LEVEL_ENCRYPTION
Domestic encryption level- See Also:
- Constant Field Values
-
ENCRYPT_LEVEL_ENCRYPTION
public static final int ENCRYPT_LEVEL_ENCRYPTION
Encryption enabled- See Also:
- Constant Field Values
-
SSL_PROVIDER_SPYRUS
public static final java.lang.String SSL_PROVIDER_SPYRUS
- See Also:
- Constant Field Values
-
SSL_PROVIDER_ENTRUST
public static final java.lang.String SSL_PROVIDER_ENTRUST
- See Also:
- Constant Field Values
-
_logApi
protected static boolean _logApi
-
-
Method Detail
-
create
public static Link create(javax.jms.Connection connection, SSLInfo sslinfo) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
checkConnect
public static void checkConnect(BrokerURL url) throws javax.jms.JMSException
Check if we should attempt to connect to the provided host. If no, then throw the error quickly, instead of blocking on a socket call for several seconds/minutes.- Parameters:
url
- Broker URL which must at least have host name and port.- Throws:
javax.jms.JMSException
-
addFailingBrokerHost
public static void addFailingBrokerHost(BrokerURL url, long expireTime, javax.jms.JMSException exception)
Update the failing brokers list with expire time and exception as values.- Parameters:
url
- Broker URL which must at least have host name and port.- Throws:
javax.jms.JMSException
-
connect
public abstract void connect(BrokerURL url) throws javax.jms.JMSException
Create the physical connection to the Broker.- Parameters:
url
- the URL of the Broker- Throws:
javax.jms.JMSException
- if a connection could not be established
-
disconnect
public abstract void disconnect() throws javax.jms.JMSException
Close the physical connection to the Broker.- Throws:
javax.jms.JMSException
- if errors occur closing the connection
-
destroy
public abstract void destroy() throws javax.jms.JMSException
Cleanup any resources associated with the connection to the Broker.- Throws:
javax.jms.JMSException
- if errors occur destroying the connection
-
recv
public abstract int recv(byte[] buf, int offset, int length) throws javax.jms.JMSException, java.io.IOException
Reads bytes from the link into the specified byte array, starting at the given offset.- Parameters:
buf
- destination buffer.offset
- offset at which to start storing byteslength
- maximum number of bytes to read- Returns:
- the number of bytes read, or
-1
if the end of the stream has been reached. - Throws:
javax.jms.JMSException
- if an error occurs reading from the linkjava.io.IOException
-
send
public abstract void send(byte[] data, int offset, int length) throws javax.jms.JMSException, java.io.IOException
Writeslength
bytes from the specified byte array starting atoffset
to the link.- Parameters:
data
- the command dataoffset
- the start offset in the datalength
- the number of bytes to write- Throws:
javax.jms.JMSException
- if an error occurs writing data to the linkjava.io.IOException
-
flush
public abstract void flush() throws javax.jms.JMSException, java.io.IOException
Flushes any data in the output buffer to the socket.- Throws:
javax.jms.JMSException
- if an error occurs flushing data to the socketjava.io.IOException
-
getEncryptionLevel
public abstract int getEncryptionLevel() throws javax.jms.JMSException
Returns the encryption level of the link.- Returns:
- the encryption level
- Throws:
javax.jms.JMSException
- if an error occurs getting the encryption level
-
getServerCertificate
public abstract java.util.Properties getServerCertificate() throws javax.jms.JMSException
Returns properties of the server certificate. The included property names are: "subjectDn", "issuerDn", "status" "serialNumber", "beginDate", "endDate".- Returns:
- server certificate properties
- Throws:
javax.jms.JMSException
- if an error occurs getting the server certificate
-
applyJMSConfigParams
protected void applyJMSConfigParams(java.net.Socket socket) throws java.net.SocketException
- Throws:
java.net.SocketException
-
-