public abstract class Connection extends Object implements JSONSerializable, Serializable, Closeable
Modifier and Type | Class and Description |
---|---|
static class |
Connection.State |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BAUDRATE |
protected InputStream |
is |
protected OutputStream |
os |
Constructor and Description |
---|
Connection() |
Connection(int bitPerSecond,
int responseTimeOutOffset) |
Modifier and Type | Method and Description |
---|---|
static Connection |
createFromJSON(net.sf.json.JSONObject json)
find fields in json and create approbirate connection instance
|
void |
fromJSON(net.sf.json.JSONObject json) |
int |
getBitPerSecond() |
Connection.State |
getConnState() |
InputStream |
getInputStream() |
abstract String |
getJsonFieldName() |
OutputStream |
getLoggingStream() |
abstract String |
getName() |
OutputStream |
getOutputStrteam() |
int |
getResponseTimeOutOffset() |
abstract void |
open() |
void |
setBitPerSecond(int bitPerSecond) |
protected void |
setConnState(Connection.State connState) |
void |
setLoggingStream(OutputStream loggingStream) |
void |
setResponseTimeOutOffset(int responseTimeOutOffset) |
net.sf.json.JSONObject |
toJSON(JsonSerializeType jsonSerializeType) |
public static final int DEFAULT_BAUDRATE
protected transient InputStream is
protected transient OutputStream os
public Connection()
public Connection(int bitPerSecond, int responseTimeOutOffset)
public Connection.State getConnState()
protected void setConnState(Connection.State connState)
connState
- the connState to setpublic OutputStream getLoggingStream()
public void setLoggingStream(OutputStream loggingStream)
loggingStream
- the loggingStream to setpublic InputStream getInputStream()
public OutputStream getOutputStrteam()
public int getBitPerSecond()
public abstract String getName()
public void setBitPerSecond(int bitPerSecond)
bitPerSecond
- the bitPerSecond to setpublic int getResponseTimeOutOffset()
public void setResponseTimeOutOffset(int responseTimeOutOffset)
responseTimeOutOffset
- the responseTimeOutOffset to setpublic abstract void open() throws IOException
IOException
public net.sf.json.JSONObject toJSON(JsonSerializeType jsonSerializeType)
toJSON
in interface JSONSerializable
public void fromJSON(net.sf.json.JSONObject json)
fromJSON
in interface JSONSerializable
public static Connection createFromJSON(net.sf.json.JSONObject json)
json
- public abstract String getJsonFieldName()
Copyright © 2009–2016 MBus4J. All rights reserved.