Class SubmodelClient

java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.SubmodelClient
Direct Known Subclasses:
ApplicationInstancesAasClient, PlatformAasClient, SubmodelElementsCollectionClient

public class SubmodelClient extends Object
Basic class for submodel clients, i.e., classes that act as frontend for an (active) AAS.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private de.iip_ecosphere.platform.support.aas.Submodel
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SubmodelClient(de.iip_ecosphere.platform.support.aas.Submodel submodel)
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    checkNotNull(T obj)
    Checks for that result is not null.
    static String
    Checks for that obj is a non-empty string.
    void
    If there is caching, force re-caching.
    static de.iip_ecosphere.platform.support.aas.Operation
    getOperation(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort)
    Returns the operation for the given idShort defined on submodel.
    protected de.iip_ecosphere.platform.support.aas.Operation
    Returns the operation for the given idShort defined on submodel.
    static de.iip_ecosphere.platform.support.aas.Property
    getProperty(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort)
    Returns the property for the given idShort defined on submodel.
    protected de.iip_ecosphere.platform.support.aas.Property
    Returns the property for the given idShort defined on submodel.
    protected String
    Returns the value of the property name from submodel as String.
    de.iip_ecosphere.platform.support.aas.Submodel
    Returns the submodel.
    void
    Indicates the submodel may need a refresh.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • submodel

      private de.iip_ecosphere.platform.support.aas.Submodel submodel
    • refreshRequested

      private boolean refreshRequested
  • Constructor Details

    • SubmodelClient

      protected SubmodelClient(de.iip_ecosphere.platform.support.aas.Submodel submodel)
      Creates an instance.
      Parameters:
      submodel - defines the submodel for querying/execution
  • Method Details

    • getSubmodel

      public de.iip_ecosphere.platform.support.aas.Submodel getSubmodel()
      Returns the submodel.
      Returns:
      the submodel
    • requestRefresh

      public void requestRefresh()
      Indicates the submodel may need a refresh. Refresh will be carried out with next getSubmodel() call.
    • getOperation

      protected de.iip_ecosphere.platform.support.aas.Operation getOperation(String idShort) throws ExecutionException
      Returns the operation for the given idShort defined on submodel.
      Parameters:
      idShort - the short id
      Returns:
      the operation
      Throws:
      ExecutionException - if the operation was not found
      See Also:
    • clear

      public void clear()
      If there is caching, force re-caching.
    • getProperty

      protected de.iip_ecosphere.platform.support.aas.Property getProperty(String idShort) throws ExecutionException
      Returns the property for the given idShort defined on submodel.
      Parameters:
      idShort - the short id
      Returns:
      the property
      Throws:
      ExecutionException - if the property was not found
      See Also:
    • getOperation

      public static de.iip_ecosphere.platform.support.aas.Operation getOperation(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort) throws ExecutionException
      Returns the operation for the given idShort defined on submodel.
      Parameters:
      submodel - the submodel to query
      idShort - the short id
      Returns:
      the operation
      Throws:
      ExecutionException - if the operation was not found
    • getProperty

      public static de.iip_ecosphere.platform.support.aas.Property getProperty(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort) throws ExecutionException
      Returns the property for the given idShort defined on submodel.
      Parameters:
      submodel - the submodel to query
      idShort - the short id
      Returns:
      the property
      Throws:
      ExecutionException - if the property was not found
    • getPropertyStringValue

      protected String getPropertyStringValue(String name, String dflt)
      Returns the value of the property name from submodel as String.
      Parameters:
      name - the name
      dflt - the default value to be used if reading the value fails
      Returns:
      the string value or dflt
    • checkString

      public static String checkString(Object obj)
      Checks for that obj is a non-empty string.
      Parameters:
      obj - the object representing the string
      Returns:
      the string
      Throws:
      IllegalArgumentException - if there is no valid string
    • checkNotNull

      public static <T> T checkNotNull(T obj)
      Checks for that result is not null.
      Type Parameters:
      T - the type of object
      Parameters:
      obj - the object to check
      Returns:
      obj
      Throws:
      IllegalArgumentException - if obj is null