|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.anwrt.hl.model.AwtDataManager
public class AwtDataManager
The AwtDataManager is the entry point of the AWT high level API.
It allows the sending of data and events to the server and the
(un)registration of AwtMessageListener.
creation : 3 oct. 2008
| Constructor Summary | |
|---|---|
AwtDataManager(java.lang.String assetId)
Returns a new AwtDataManager instance for the assetId given as parameter. |
|
AwtDataManager(java.lang.String assetId,
java.lang.String host,
int port)
Returns a new AwtDataManager instance for the assetId given as parameter. |
|
| Method Summary | |
|---|---|
void |
addAcknowledgment(AwtMessage message,
java.lang.Object data,
int statusCode)
add an acknowledgment to the list of message to be sent and serialize it. |
void |
addContainer(AbstractContainer container)
Serialized, according to the AwtDaProtocol specification, the container given as parameter and add it to the list of objects to be sent. |
int |
addContainer(AbstractContainer container,
AwtResponseListener listener)
Serialize, according to the AwtDaProtocol specification, the container given as parameter and add it to the list of objects to be sent. |
void |
destroy()
Close the connection with the M2MAgent and release all internal resources. |
void |
flush()
Send all added containers and acks to the M2MAgent. |
AwtCom |
getAwtCom()
Returns the internal instance of the AwtCom. |
void |
setMessageListener(java.lang.String relativePath,
AwtMessageListener listener,
int messageType)
If listener is not null registers a message listener to the framework for messages to assetId.relativePath and type messageType. |
void |
start()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AwtDataManager(java.lang.String assetId)
throws AwtException
assetId - AssetId of the asset (i.e the root path of the
application).
AwtException - if the connection to the M2MAgent fails or if a
manager is already registered with the same assetId.
public AwtDataManager(java.lang.String assetId,
java.lang.String host,
int port)
throws AwtException
assetId - AssetId of the asset (i.e the root path of the
application).String - ReadyAgent host name or IPint - Port of the ReadyAgent to connect to
AwtException - if the connection to the M2MAgent fails or if a
manager is already registered with the same assetId.| Method Detail |
|---|
public void start()
throws AwtComException
AwtComExceptionpublic void destroy()
public void addAcknowledgment(AwtMessage message,
java.lang.Object data,
int statusCode)
throws AwtException
message - The message to acknowledgedata - Data of the acknowledgmentstatusCode - Status of the Acknowledgment
AwtException - If a problem occurred during the serialization.
public void addContainer(AbstractContainer container)
throws AwtException
container - The container to be sent.
AwtException - if the serialization of the container failed.
public int addContainer(AbstractContainer container,
AwtResponseListener listener)
throws AwtException
container - The container to be sent.listener - The listener to be notified.
AwtResponseListener.onAck(int, AwtResponse) method.
AwtException - if the given listener is null or if the
serialization of the container failed.
public void flush()
throws AwtComException
AwtCom.forceConnectionToServer(com.anwrt.communication.listeners.AwtConnectionStatusListener)
method of the M2MAgentConnector.
AwtComException - Throws AwtComException if a communication error
occurred between the application and the M2MAgent, or if a
message can not be serialized.
public void setMessageListener(java.lang.String relativePath,
AwtMessageListener listener,
int messageType)
relativePath - relative path to listen to or to unregistered.listener - if not null, the listener to be added.messageType - MessageType is the type of message to listen to.
AwtMessageListener for available messages type.public AwtCom getAwtCom()
AwtCom.
AwtCom.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||