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, setAlwaysReconnectprotected AstartePairableDevice(AstartePairingHandler pairingHandler, AstartePropertyStorage propertyStorage, AstarteFailedMessageStorage failedMessageStorage, AstarteInterfaceProvider interfaceProvider) throws org.json.JSONException, AstarteInvalidInterfaceException
org.json.JSONExceptionAstarteInvalidInterfaceExceptionpublic java.lang.String getDeviceId()
getDeviceId in class AstarteDevicepublic java.lang.String getAstarteRealm()
getAstarteRealm in class AstarteDevicepublic AstarteCryptoStore getCryptoStore()
public AstarteTransport getAstarteTransport()
public void setAstarteTransport(AstarteTransport astarteTransport)
public AstarteMessageListener getAstarteMessageListener()
getAstarteMessageListener in class AstarteDevicepublic void setAstarteMessageListener(AstarteMessageListener astarteMessageListener)
setAstarteMessageListener in class AstarteDevicepublic void connect()
throws AstarteTransportException,
AstarteCryptoException,
AstartePairingException
connect in class AstarteDeviceAstarteTransportExceptionAstarteCryptoExceptionAstartePairingExceptionpublic void disconnect()
throws AstarteTransportException
disconnect in class AstarteDeviceAstarteTransportExceptionpublic boolean isConnected()
isConnected in class AstarteDevicepublic void onTransportConnected()
onTransportConnected in interface AstarteTransportEventListenerpublic void onTransportConnectionInitializationError(java.lang.Throwable cause)
onTransportConnectionInitializationError in interface AstarteTransportEventListenerpublic void onTransportConnectionError(java.lang.Throwable cause)
onTransportConnectionError in interface AstarteTransportEventListenerpublic void onTransportDisconnected()
onTransportDisconnected in interface AstarteTransportEventListenerpublic void addInterface(org.json.JSONObject astarteInterfaceObject)
throws AstarteInvalidInterfaceException,
AstarteInterfaceAlreadyPresentException
addInterface in class AstarteDeviceastarteInterfaceObject - 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 AstarteDeviceinterfaceName - The name of the interface to removeAstarteInterfaceNotFoundException - when no interface is found with the given name