Class AppEndpoint


  • public class AppEndpoint
    extends java.lang.Object
    The MessageDispatcher sends messages to a DigitalTwin
    • Constructor Summary

      Constructors 
      Constructor Description
      AppEndpoint()  
    • Method Summary

      Modifier and Type Method Description
      static <T extends DigitalTwinBase>
      SendingResult
      createInstance​(java.lang.String model, java.lang.String id, T instance)
      Creates a digital twin instance.
      static SendingResult createInstanceFromPersistenceStore​(java.lang.String model, java.lang.String id)
      Creates a digital twin instance.
      static <T extends DigitalTwinBase>
      SendingResult
      createInstanceFromPersistenceStore​(java.lang.String model, java.lang.String id, T instance)
      Creates a digital twin instance.
      static SendingResult deleteInstance​(java.lang.String model, java.lang.String id)
      Creates a digital twin instance.
      static SharedData getGlobalSharedData()
      Retrieve globally shared data.
      static SharedData getModelSharedData​(java.lang.String model)
      Retrieve the shared data for the specified model.
      static SendingResult send​(java.lang.String model, java.lang.String id, byte[] serializedJsonMessage)
      Sends a list of JSON message
      static SendingResult send​(java.lang.String model, java.lang.String id, java.lang.String jsonMessage)
      Sends a list of JSON message
      static SendingResult send​(java.lang.String model, java.lang.String id, java.util.List<byte[]> serializedJsonMessages)
      Sends a list of JSON message
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppEndpoint

        public AppEndpoint()
    • Method Detail

      • send

        public static SendingResult send​(java.lang.String model,
                                         java.lang.String id,
                                         java.util.List<byte[]> serializedJsonMessages)
                                  throws AppEndpointException
        Sends a list of JSON message
        Parameters:
        model - the model of the hosted DigitalTwin
        id - the identifier for the DigitalTwin
        serializedJsonMessages - the serialized JSON messages
        Returns:
        the sending result
        Throws:
        AppEndpointException - if an error occurs while sending the message
      • send

        public static SendingResult send​(java.lang.String model,
                                         java.lang.String id,
                                         byte[] serializedJsonMessage)
                                  throws AppEndpointException
        Sends a list of JSON message
        Parameters:
        model - the model of the hosted DigitalTwin
        id - the identifier for the DigitalTwin
        serializedJsonMessage - a serialized JSON message
        Returns:
        the sending result
        Throws:
        AppEndpointException - if an error occurs while sending the message
      • send

        public static SendingResult send​(java.lang.String model,
                                         java.lang.String id,
                                         java.lang.String jsonMessage)
                                  throws AppEndpointException
        Sends a list of JSON message
        Parameters:
        model - the model of the hosted DigitalTwin
        id - the identifier for the DigitalTwin
        jsonMessage - a JSON message
        Returns:
        the sending result
        Throws:
        AppEndpointException - if an error occurs while sending the message
      • createInstance

        public static <T extends DigitalTwinBaseSendingResult createInstance​(java.lang.String model,
                                                                               java.lang.String id,
                                                                               T instance)
                                                                        throws AppEndpointException
        Creates a digital twin instance.
        Type Parameters:
        T - the type of the digital twin instance. Must be json serializable.
        Parameters:
        model - the model.
        id - the id.
        instance - the instance to create (must be JSON serializable.
        Returns:
        the sending result.
        Throws:
        AppEndpointException - if an error occurs while sending the message.
      • createInstanceFromPersistenceStore

        public static SendingResult createInstanceFromPersistenceStore​(java.lang.String model,
                                                                       java.lang.String id)
                                                                throws AppEndpointException
        Creates a digital twin instance.
        Parameters:
        model - the model.
        id - the id.
        Returns:
        the sending result.
        Throws:
        AppEndpointException - if an error occurs while sending the message.
      • createInstanceFromPersistenceStore

        public static <T extends DigitalTwinBaseSendingResult createInstanceFromPersistenceStore​(java.lang.String model,
                                                                                                   java.lang.String id,
                                                                                                   T instance)
                                                                                            throws AppEndpointException
        Creates a digital twin instance.
        Type Parameters:
        T - the type of the digital twin instance. Must be json serializable.
        Parameters:
        model - the model.
        id - the id.
        instance - the instance to create (must be JSON serializable.
        Returns:
        the sending result.
        Throws:
        AppEndpointException - if an error occurs while sending the message.
      • deleteInstance

        public static SendingResult deleteInstance​(java.lang.String model,
                                                   java.lang.String id)
                                            throws AppEndpointException
        Creates a digital twin instance.
        Parameters:
        model - the model.
        id - the id.
        Returns:
        the sending result.
        Throws:
        AppEndpointException - if an error occurs while sending the message.
      • getModelSharedData

        public static SharedData getModelSharedData​(java.lang.String model)
        Retrieve the shared data for the specified model.
        Parameters:
        model - the model name.
        Returns:
        the SharedData implementation.
      • getGlobalSharedData

        public static SharedData getGlobalSharedData()
        Retrieve globally shared data.
        Returns:
        the SharedData implementation.