public class SomSession
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SomSession.SomRights |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACP127_PROTOCOL |
protected long |
connectionTimeout |
static java.lang.String |
GSSAPI |
com.isode.som.SomThread |
listenerThread |
static java.lang.String |
OTAM_PROTOCOL |
static int |
SOM_ERROR_ABORT |
static int |
SOM_ERROR_AUTHFAILED |
static int |
SOM_ERROR_FAILED |
static int |
SOM_ERROR_INTERNAL |
static int |
SOM_ERROR_LIMITREACHED |
static int |
SOM_ERROR_MORE |
static int |
SOM_ERROR_NETWORK
Error codes which can be returned.
|
static int |
SOM_ERROR_OK |
static int |
SOM_ERROR_PROTOCOL |
static java.lang.String |
SOM_PROTOCOL
Useful string values
|
Constructor and Description |
---|
SomSession()
Create a new SomSession object
|
SomSession(SomHandler handler)
Create a new SomSession object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticated()
Check whether the connection is authenticated or not
|
void |
close()
Close an open connection
|
static java.lang.String |
getErrorText(int status)
Obtain a string representation of a given error code.
|
java.lang.String |
getHostName()
Get the hostname for this session
|
int |
getOpStatus()
Get operation status value
|
java.util.List<com.isode.crypto.x509.SSLCertificate> |
getPeerCertificates()
Get a list of the SSL Certificates which the server has returned
when a TLS-encrypted connection is in use.
|
java.lang.String |
getRights() |
java.lang.String[] |
getSupportedMechanisms()
Get the list of SASL mechanisms which this Queue Manager supports.
|
boolean |
hasRight(SomSession.SomRights r) |
boolean |
isAsync()
Test whether session is an asynchonous one
|
boolean |
isConnected()
Test whether the session is connected
|
boolean |
isConnecting()
Test whether we are in the process of establishing a connection.
|
boolean |
isDisconnected()
Test whether the session is disconnected
|
void |
open(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Open a connection, using SIMPLE authentication
|
void |
open(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String mechanism)
Open a connection using a specific SASL mechanism
|
void |
open(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String mechanism,
boolean useTls)
Open a connection using a specific SASL mechanism over TLS
|
void |
pauseResults(boolean cache) |
void |
registerACP127CircuitCreateCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127CircuitDeleteCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127CircuitUpdate(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorDataSameCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorMsgStatusCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorRateCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorReadCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorReadMissCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorWriteCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonitorWriteMissCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127MonStatusCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127NewMsgOutCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerACP127OTAMStatusCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerLogMonitorCommand(SomCommand commandObj)
Register a persistent handler for LOGMON responses
|
void |
registerRecapListCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
registerStoreMonitorCommand(SomCommand commandObj)
Register a persistent handler for STORE MONITOR responses
|
void |
sendCommand(SomCommand commandObj)
Send a command out over the wire
|
void |
sendCommand(SomCommand commandObj,
boolean withCrlfs)
Send a command out over the wire
|
void |
sendResponse(SomCommand commandObj,
java.lang.String resp)
Send a response back to the server.
|
void |
setAsync(boolean async)
Set session to be asynchronous
|
void |
setConnectionTimeout(int t)
Set connection timeout.
|
void |
setOpStatus(int val)
Set operation status
|
void |
setProtocol(java.lang.String prot) |
void |
waitForCommand(long timeout)
Wait for some sort of response to come back to a command
|
public static final int SOM_ERROR_NETWORK
public static final int SOM_ERROR_ABORT
public static final int SOM_ERROR_INTERNAL
public static final int SOM_ERROR_PROTOCOL
public static final int SOM_ERROR_LIMITREACHED
public static final int SOM_ERROR_AUTHFAILED
public static final int SOM_ERROR_MORE
public static final int SOM_ERROR_FAILED
public static final int SOM_ERROR_OK
public static final java.lang.String SOM_PROTOCOL
public static final java.lang.String ACP127_PROTOCOL
public static final java.lang.String OTAM_PROTOCOL
public static final java.lang.String GSSAPI
protected long connectionTimeout
public com.isode.som.SomThread listenerThread
public SomSession()
public SomSession(SomHandler handler)
handler
- object which will handle command responsespublic void setProtocol(java.lang.String prot)
public void setConnectionTimeout(int t)
t
- timeout in secondspublic static java.lang.String getErrorText(int status)
status
- error codepublic boolean hasRight(SomSession.SomRights r)
public java.lang.String getRights()
public boolean isConnected()
public boolean isConnecting()
public boolean isDisconnected()
public boolean isAsync()
public void setAsync(boolean async)
async
- whether session should be asynchronous or notpublic int getOpStatus()
public void setOpStatus(int val)
val
- value to setpublic void open(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws SomException
host
- hostname or IP address to connect toport
- port to useusername
- username to usepassword
- password to useSomException
- on errorpublic void open(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.lang.String mechanism) throws SomException
host
- hostname or IP address to connect toport
- port to useusername
- username to usepassword
- password to usemechanism
- SASL mechanism to useSomException
- on errorpublic void open(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.lang.String mechanism, boolean useTls) throws SomException
host
- hostname or IP address to connect toport
- port to useusername
- username to usepassword
- password to usemechanism
- SASL mechanism to useuseTls
- whether to use TLS or notSomException
- on errorpublic java.util.List<com.isode.crypto.x509.SSLCertificate> getPeerCertificates()
public void close()
public boolean authenticated()
public java.lang.String[] getSupportedMechanisms()
public void waitForCommand(long timeout) throws SomException
timeout
- length of time to waitSomException
- on errorpublic void pauseResults(boolean cache)
public void sendCommand(SomCommand commandObj) throws SomException
commandObj
- Command object to sendSomException
- on errorpublic void sendCommand(SomCommand commandObj, boolean withCrlfs) throws SomException
commandObj
- Command object to sendwithCrlfs
- true if the command should be followed by CRLFs
before sending, false otherwiseSomException
- on errorpublic void sendResponse(SomCommand commandObj, java.lang.String resp) throws SomException
commandObj
- Command object with which response is associatedresp
- Response stringSomException
- on errorpublic void registerLogMonitorCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerStoreMonitorCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerRecapListCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorWriteCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127CircuitDeleteCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127CircuitCreateCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127CircuitUpdate(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorReadCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorRateCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorReadMissCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorWriteMissCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorMsgStatusCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonitorDataSameCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127OTAMStatusCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127MonStatusCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic void registerACP127NewMsgOutCommand(SomCommand commandObj) throws SomException
commandObj
- Command object which handler is associated withSomException
- on errorpublic java.lang.String getHostName()
Version: 18.0v6-0
Copyright (c) 2017-2020 Isode