public class HSMSSessionManager extends SessionManager
Modifier and Type | Field and Description |
---|---|
boolean |
selected
The end user should never need to set this.
|
debugLevel, eventListeners, globalSimulation, logger, MULTI_THREADED, 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, setSimulationFlag, setThreadingModel, setValid, simulationStateChanged, toString
public boolean selected
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-2021 ErgoTech Systems, Inc. All Rights Reserved.