public abstract class DataTransportAdapter extends CODAStateMachineAdapter implements DataTransport
DataTransport.createChannel(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, boolean, org.jlab.coda.emu.Emu, org.jlab.coda.emu.EmuModule, int)
method
which must be provided in subclasses.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
attr
Map of attributes.
|
protected boolean |
connected
Is this object connected?
|
protected Emu |
emu
Emu object that created this transport.
|
protected java.util.concurrent.atomic.AtomicReference<java.lang.String> |
errorMsg
Possible error message.
|
protected boolean |
isServer
Does this DataTransport object receive data (server = true) or does it send data (server = false)?
|
protected Logger |
logger
Logging object associated with the emu that created this transport.
|
protected java.lang.String |
name
Name of this DataTransport object.
|
protected java.lang.String |
transportClass
Name of class extending this class.
|
protected CODAStateIF |
transportState
DataTransport object's state.
|
Constructor and Description |
---|
DataTransportAdapter(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attrib,
Emu emu)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttr(java.lang.String name)
This method gets an attribute as a String object.
|
java.lang.String |
getError()
Get any available error information.
|
int |
getIntAttr(java.lang.String name)
This method gets an attribute as an int.
|
java.lang.String |
getTransportClass()
This method gets the name of the transport class implementing this interface.
|
boolean |
isConnected()
This method tells if this DataTransport object is connected.
|
boolean |
isServer()
This method returns true if this DataTransport object
is a server (sends data) or false if it is a client
(receives data).
|
java.lang.String |
name()
This method gets the name of this DataTransport object.
|
void |
reset()
This method implements the RESET transition of the CODA run control state machine.
|
void |
setAttr(java.lang.String name,
java.lang.String value)
This method sets an attribute.
|
void |
setConnected(boolean connected)
This method sets if this DataTransport object is connected or not.
|
void |
setName(java.lang.String name)
This method sets the name of this DataTransport object.
|
CODAStateIF |
state()
Get the state of this object.
|
download, end, getEndCallback, getPrestartCallback, go, pause, prestart, registerEndCallback, registerPrestartCallback
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createChannel
download, end, getEndCallback, getPrestartCallback, go, pause, prestart, registerEndCallback, registerPrestartCallback
protected java.lang.String name
protected CODAStateIF transportState
protected java.util.concurrent.atomic.AtomicReference<java.lang.String> errorMsg
protected Emu emu
protected Logger logger
protected boolean isServer
protected boolean connected
protected java.lang.String transportClass
protected final java.util.Map<java.lang.String,java.lang.String> attr
public DataTransportAdapter(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> attrib, Emu emu) throws DataNotFoundException
name
- name of this transport objectattrib
- Map of attributes of this transportemu
- emu that created this transportDataNotFoundException
- when "server" and "class" attributes
are missing from attrib map.public java.lang.String getTransportClass()
getTransportClass
in interface DataTransport
public void setName(java.lang.String name)
setName
in interface DataTransport
name
- the name of this DataTransport object.public java.lang.String name()
name
in interface DataTransport
public CODAStateIF state()
state
in interface StatedObject
public java.lang.String getError()
getError
in interface StatedObject
public void setAttr(java.lang.String name, java.lang.String value)
setAttr
in interface DataTransport
name
- name of attribute (key)value
- value of attribute (val)public java.lang.String getAttr(java.lang.String name) throws DataNotFoundException
getAttr
in interface DataTransport
name
- name of attributeDataNotFoundException
- if cannot find named attributepublic int getIntAttr(java.lang.String name) throws DataNotFoundException
getIntAttr
in interface DataTransport
name
- name of attributeDataNotFoundException
- if couldn't find named attributepublic boolean isServer()
isServer
in interface DataTransport
public boolean isConnected()
isConnected
in interface DataTransport
public void setConnected(boolean connected)
connected
- boolean: true if connected else falsepublic void reset()
reset
in interface CODAStateMachine
reset
in class CODAStateMachineAdapter