public abstract class PortManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
allIDsValid
Whether to allow all device ids.
|
static java.lang.String |
cvsRev |
Modifier and Type | Method and Description |
---|---|
void |
addDeviceId(int deviceId,
java.lang.Object messageHandlerObject)
Add a message handler for a specified session id.
|
static void |
addPortManager(PortManager portManager)
Adds a new port manager.
|
abstract int |
available()
Returns the number of bytes available.
|
abstract void |
close()
Close the port.
|
ConnectionManager |
getConnectionManager()
Returns the current connection.
|
static ConnectionManager |
getConnectionManagerForId(int testPort,
java.lang.String id)
Returns a connection manager for the provided ID.
|
java.lang.String |
getId()
This id is a string which, together with the port number uniquely identifies
this port manager.
|
LoggerInterface |
getLogger()
Returns the current logger object.
|
java.util.Vector<java.lang.Object> |
getMessageHandlersForId(int sessionId)
Get a message handler for a particular ID.
|
int |
getPort()
Returns the port.
|
static PortManager |
getPortManagerForId(int testPort,
java.lang.String id)
Returns a connection manager for the provided ID.
|
static java.util.Vector<PortManager> |
getPortManagers()
Returns the current vector of port managers.
|
byte |
read()
Read the port.
|
abstract int |
read(byte[] b,
int off,
int len)
Read the port.
|
void |
removeDeviceId(int deviceId,
java.lang.Object messageHandlerObject)
Add a message handler for a specified session id.
|
static void |
removePortManager(PortManager portManager)
Remove a port manager.
|
void |
removeSessionId(int sessionId)
Remove a message handler for a specified session id.
|
void |
setConnectionManager(ConnectionManager cm)
Sets the connection manager for this connection.
|
void |
setLogger(LoggerInterface newLogger)
Register a logger.
|
void |
setPort(int newPort)
sets the port.
|
void |
write(byte b)
Writes the byte to the port.
|
abstract void |
write(byte[] b)
Writes the array to the port.
|
public static boolean allIDsValid
public static final java.lang.String cvsRev
public void addDeviceId(int deviceId, java.lang.Object messageHandlerObject)
public static void addPortManager(PortManager portManager)
public abstract int available() throws java.io.IOException
java.io.IOException
public abstract void close() throws java.io.IOException
java.io.IOException
public ConnectionManager getConnectionManager()
public static ConnectionManager getConnectionManagerForId(int testPort, java.lang.String id)
testPort
- the port to compare againstid
- the unique id of this port manager. This will be a hostname of HSMS.public java.lang.String getId()
public LoggerInterface getLogger()
public java.util.Vector<java.lang.Object> getMessageHandlersForId(int sessionId)
public int getPort()
public static PortManager getPortManagerForId(int testPort, java.lang.String id)
testPort
- the port to compare againstid
- the unique id of this port manager. This will be a hostname of HSMS.public static java.util.Vector<PortManager> getPortManagers()
public byte read() throws java.io.IOException
java.io.IOException
read
public abstract int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
read
public void removeDeviceId(int deviceId, java.lang.Object messageHandlerObject)
public static void removePortManager(PortManager portManager)
public void removeSessionId(int sessionId)
public void setConnectionManager(ConnectionManager cm)
public void setLogger(LoggerInterface newLogger)
newLogger
- the new logger objectpublic void setPort(int newPort) throws java.io.IOException
java.io.IOException
public void write(byte b) throws java.io.IOException
java.io.IOException
public abstract void write(byte[] b) throws java.io.IOException
java.io.IOException
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.