public class HSMSSessionManager extends SessionManager
Modifier and Type | Field and Description |
---|---|
static byte |
COMMUNICATION_ALREADY_ACTIVE
Select Status - Communications Already Active.
|
static byte |
COMMUNICATION_BUSY
Deselect Status - Communication Busy.
|
static byte |
COMMUNICATION_ENDED
Deselect Status - Communication Ended.
|
static byte |
COMMUNICATION_ESTABLISHED
Select Status - Communications Established.
|
static byte |
COMMUNICATION_NOT_ESTABLISHED
Deselect Status - Communication Not Established.
|
static byte |
CONNECTION_EXHAUST
Select Status - connections exhausted.
|
static byte |
CONNECTION_NOT_READY
Select Status - Connection not ready.
|
static byte |
DATA_MESSAGE
Data Message
|
static byte |
DESELECT_REQ
Deselect Request
|
static byte |
DESELECT_RES
Deselect Response
|
static byte |
ENTITY_IN_USE
Select Status - Entity in Use.
|
static byte |
ENTITY_NOT_SELECTED
Reason Code for Reject Message - Entity not supported.
|
static byte |
ENTITY_SELECTED
Select Status - Entity selected by current connection.
|
static byte |
LINKTEST_REQ
LinkTest Request
|
static byte |
LINKTEST_RES
LinkTest Response
|
static byte |
NO_SUCH_ENTITY
Select Status - No Such entity.
|
static byte |
PTYPE_NOT_SUPPORTED
Reason Code for Reject Message - PType not supported.
|
static byte |
REJECT_REQ
Reject Request
|
static byte |
SELECT_REQ
Select Request
|
static byte |
SELECT_RES
Select Response
|
boolean |
selected
The end user should never need to set this.
|
static byte |
SEPARATE_REQ
Separate Request
|
static byte |
STYPE_NOT_SUPPORTED
Reason Code for Reject Message - SType not supported.
|
static byte |
TRANSACTION_NOT_OPEN
Reason Code for Reject Message - Transaction not Supported.
|
eventListeners, globalSimulation, logger, MULTI_THREADED, primaryThreads, responseThreads, sendErrorMessages, SINGLE_THREADED
Modifier and Type | Method and Description |
---|---|
void |
breakConnection()
This will break one hsms session, killing whos attached to it.
|
byte[][] |
convertToBytes(SecsMsg msg)
Converts a SecsMsg into the raw byte stream.
|
SecsMsg |
createMessage(byte[] unconverted)
Creates a SecsMsg from the raw byte stream.
|
void |
deSelectSession()
Deselect the session.
|
void |
endSession()
End the session.
|
static byte |
getDefaultSelectResponse()
Sets the global select response
|
int |
getHeaderSize()
Returns the headersize for HSMS messages.
|
static SessionManager |
getNewSessionManager()
Return a new session manager object.
|
byte |
getSelectResponse()
returns the select response.
|
int |
getSessionId()
Returns the session ID.
|
static int |
getSessionId(byte[] unconv)
Returns the session ID from the byte stream provide.
|
static SessionManager |
getSessionManager(int port,
java.lang.String connectionId,
int deviceId,
int sessionId,
boolean shouldCreate)
Returns the session for the given port host and string.
|
static SessionManager |
getSessionManager(int port,
java.lang.String connectionId,
int deviceId,
int sessionId,
boolean shouldCreate,
LoggerInterface theLogger)
Returns the session for the given port host and string.
|
boolean |
isSelected()
Returns true if the session is selected, otherwise false.
|
void |
selectSession()
Select the session.
|
boolean |
sendHSMSHeaderMessage(byte byte3,
byte sType,
int systemBytes,
int sessionId)
This message creates a message that is only the HSMS header and sends it.
|
boolean |
sendHSMSHeaderMessage(byte byte3,
byte sType,
int sID,
SecsMsg sm)
This message creates a message that is only the HSMS header and sends it.
|
void |
sendMessage(SecsMsg msg)
Sends the SECS Message over the HSMS link.
|
void |
separateSession()
Separate the session.
|
static void |
setDefaultSelectResponse(byte defaultSelectResponse)
Sets the global select response.
|
void |
setSelectResponse(byte selectResponse)
Sets the default response to a select.
|
void |
setSessionId(int newValue)
Sets the session ID for this session manager.
|
addMessageHandler, addToConnection, createSessionManager, createSessionManager, createSessionManager, createSessionManager, getConnectionManager, getDefault, getDeviceId, getExpectsReply, getIsHost, getLogger, getMessageHandlers, getPortManager, getReplyTimeout, getSessionManager, getSessionManager, getThreadingModel, getWaitingMessages, isDefault, isSimulating, isSimulationFlag, isValid, isValidHostCommandMessage, removeMessageHandler, reprocessMessage, setDefault, setDefault, setDeviceId, setIsHost, setLogger, setMessageHandlers, setReplyTimeout, setSimulationFlag, setThreadingModel, setValid, simulationStateChanged, toString
public static final byte COMMUNICATION_ALREADY_ACTIVE
public static final byte COMMUNICATION_BUSY
public static final byte COMMUNICATION_ENDED
public static final byte COMMUNICATION_ESTABLISHED
public static final byte COMMUNICATION_NOT_ESTABLISHED
public static final byte CONNECTION_EXHAUST
public static final byte CONNECTION_NOT_READY
public static final byte DATA_MESSAGE
public static final byte DESELECT_REQ
public static final byte DESELECT_RES
public static final byte ENTITY_IN_USE
public static final byte ENTITY_NOT_SELECTED
public static final byte ENTITY_SELECTED
public static final byte LINKTEST_REQ
public static final byte LINKTEST_RES
public static final byte NO_SUCH_ENTITY
public static final byte PTYPE_NOT_SUPPORTED
public static final byte REJECT_REQ
public static final byte SELECT_REQ
public static final byte SELECT_RES
public boolean selected
public static final byte SEPARATE_REQ
public static final byte STYPE_NOT_SUPPORTED
public static final byte TRANSACTION_NOT_OPEN
public void breakConnection() throws SecsException
breakConnection
in class SessionManager
SecsException
public byte[][] convertToBytes(SecsMsg msg) throws SecsException
convertToBytes
in class SessionManager
SecsException
public SecsMsg createMessage(byte[] unconverted) throws SecsException
createMessage
in class SessionManager
SecsException
SecsMsg.getData()
public void deSelectSession() throws SecsException
SecsException
public void endSession()
endSession
in class SessionManager
public static byte getDefaultSelectResponse()
public int getHeaderSize()
getHeaderSize
in class SessionManager
public static SessionManager getNewSessionManager()
public byte getSelectResponse()
setSelectResponse(byte)
public int getSessionId()
public static int getSessionId(byte[] unconv)
public static SessionManager getSessionManager(int port, java.lang.String connectionId, int deviceId, int sessionId, boolean shouldCreate) throws SecsException
port
- the port identifier. The socket port for HSMS and arbitrary designation for SECS1.connectionId
- the host name for HSMS, ignored for SECS1deviceId
- the device idSecsException
public static SessionManager getSessionManager(int port, java.lang.String connectionId, int deviceId, int sessionId, boolean shouldCreate, LoggerInterface theLogger) throws SecsException
port
- the port identifier. The socket port for HSMS and arbitrary designation for SECS1.connectionId
- the host name for HSMS, ignored for SECS1deviceId
- the device idtheLogger
- the logger objectSecsException
public boolean isSelected()
public void selectSession() throws SecsException
SecsException
public boolean sendHSMSHeaderMessage(byte byte3, byte sType, int systemBytes, int sessionId) throws SecsException
SecsException
public boolean sendHSMSHeaderMessage(byte byte3, byte sType, int sID, SecsMsg sm) throws SecsException
SecsException
public void sendMessage(SecsMsg msg) throws SecsException
SessionManager
sendMessage
in class SessionManager
SecsException
public void separateSession() throws SecsException
SecsException
public static void setDefaultSelectResponse(byte defaultSelectResponse)
defaultSelectResponse
- The defaultSelectResponse to set.public void setSelectResponse(byte selectResponse)
public void setSessionId(int newValue)
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.