public abstract class AstartePairableDevice extends AstarteDevice implements AstarteTransportEventListener
mAlwaysReconnect, mFailedMessageStorage, mPropertyStorage
Modifier | Constructor and Description |
---|---|
protected |
AstartePairableDevice(AstartePairingHandler pairingHandler,
AstartePropertyStorage propertyStorage,
AstarteFailedMessageStorage failedMessageStorage,
AstarteInterfaceProvider interfaceProvider) |
Modifier and Type | Method and Description |
---|---|
void |
addInterface(org.json.JSONObject astarteInterfaceObject)
Method that adds an interface dynamically to the introspection.
|
void |
connect() |
void |
disconnect() |
AstarteMessageListener |
getAstarteMessageListener() |
java.lang.String |
getAstarteRealm() |
AstarteTransport |
getAstarteTransport() |
AstarteCryptoStore |
getCryptoStore() |
java.lang.String |
getDeviceId() |
boolean |
isConnected() |
void |
onTransportConnected() |
void |
onTransportConnectionError(java.lang.Throwable cause) |
void |
onTransportConnectionInitializationError(java.lang.Throwable cause) |
void |
onTransportDisconnected() |
void |
removeInterface(java.lang.String interfaceName)
Method that dynamically removes an interface from the introspection.
|
void |
setAstarteMessageListener(AstarteMessageListener astarteMessageListener) |
void |
setAstarteTransport(AstarteTransport astarteTransport) |
addGlobalEventListener, alwaysReconnects, getAllInterfaceNames, getAllInterfaces, getInterface, hasInterface, removeGlobalListener, setAlwaysReconnect
protected AstartePairableDevice(AstartePairingHandler pairingHandler, AstartePropertyStorage propertyStorage, AstarteFailedMessageStorage failedMessageStorage, AstarteInterfaceProvider interfaceProvider) throws org.json.JSONException, AstarteInvalidInterfaceException
org.json.JSONException
AstarteInvalidInterfaceException
public java.lang.String getDeviceId()
getDeviceId
in class AstarteDevice
public java.lang.String getAstarteRealm()
getAstarteRealm
in class AstarteDevice
public AstarteCryptoStore getCryptoStore()
public AstarteTransport getAstarteTransport()
public void setAstarteTransport(AstarteTransport astarteTransport)
public AstarteMessageListener getAstarteMessageListener()
getAstarteMessageListener
in class AstarteDevice
public void setAstarteMessageListener(AstarteMessageListener astarteMessageListener)
setAstarteMessageListener
in class AstarteDevice
public void connect() throws AstarteTransportException, AstarteCryptoException, AstartePairingException
connect
in class AstarteDevice
AstarteTransportException
AstarteCryptoException
AstartePairingException
public void disconnect() throws AstarteTransportException
disconnect
in class AstarteDevice
AstarteTransportException
public boolean isConnected()
isConnected
in class AstarteDevice
public void onTransportConnected()
onTransportConnected
in interface AstarteTransportEventListener
public void onTransportConnectionInitializationError(java.lang.Throwable cause)
onTransportConnectionInitializationError
in interface AstarteTransportEventListener
public void onTransportConnectionError(java.lang.Throwable cause)
onTransportConnectionError
in interface AstarteTransportEventListener
public void onTransportDisconnected()
onTransportDisconnected
in interface AstarteTransportEventListener
public void addInterface(org.json.JSONObject astarteInterfaceObject) throws AstarteInvalidInterfaceException, AstarteInterfaceAlreadyPresentException
addInterface
in class AstarteDevice
astarteInterfaceObject
- the JSONObject representation of the interfaceAstarteInvalidInterfaceException
- when the JSON Object does not represent an interface
correctlyAstarteInterfaceAlreadyPresentException
- when an interface with the same name, major and
minor is already presentpublic void removeInterface(java.lang.String interfaceName) throws AstarteInterfaceNotFoundException
removeInterface
in class AstarteDevice
interfaceName
- The name of the interface to removeAstarteInterfaceNotFoundException
- when no interface is found with the given name