Class AasOperationsProvider

java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
de.iip_ecosphere.platform.support.aas.basyx2.AasOperationsProvider
All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.OperationsProvider, Serializable, Cloneable, Map<String,Object>

public class AasOperationsProvider extends HashMap<String,Object> implements de.iip_ecosphere.platform.support.aas.OperationsProvider
Implements a simple operations provider still following a simple status/operations/service structure. The idea is to attach the relevant operations of an implementing object to this provider, whereby the implementing object is actually providing the functionality and this provider just acts as an intermediary. For this purpose, you can register function objects for operations and supplier/consumer objects of the implementing object in the provider. The provider then offers the respective access under while ""service"" is just seen as a category of many potential operation categories that you can register. Use "/" as path separator, which is available as constant. The respective invocables must follow this naming schema for access.
Author:
Holger Eichelberger, SSE
See Also:
  • Field Details

  • Constructor Details

    • AasOperationsProvider

      public AasOperationsProvider()
      Creates a VAB operations provider instance.
  • Method Details

    • getStatusPath

      protected String getStatusPath()
      Returns the base path name for status/properties. Allows for overriding the default settings.
      Returns:
      the path name, by default STATUS
    • getOperationsPath

      protected String getOperationsPath()
      Returns the base path name for operations. Allows for overriding the default settings.
      Returns:
      the path name, by default OPERATIONS
    • getServicePath

      protected String getServicePath()
      Returns the base (sub-)path name for services. Allows for overriding the default settings.
      Returns:
      the path name, by default SERVICE (interpreted as sub-path of getOperationsPath().
    • makeUnique

      private String makeUnique(Map<String,?> map, String baseName)
      Makes a name unique within its kind, i.e., the given map.
      Parameters:
      map - the map
      baseName - the (base) name to be made unique
      Returns:
      the unique name
    • defineOperation

      public AasOperationsProvider defineOperation(String category, String name, Function<Object[],Object> function)
      Specified by:
      defineOperation in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getOperation

      public Function<Object[],Object> getOperation(String category, String name)
      Specified by:
      getOperation in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getServiceFunction

      public Function<Object[],Object> getServiceFunction(String name)
      Specified by:
      getServiceFunction in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getOperations

      public Set<String> getOperations(boolean qualified)
      Specified by:
      getOperations in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getOperations

      public Set<String> getOperations(String category, boolean qualified)
      Specified by:
      getOperations in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • addOperations

      private Set<String> addOperations(String category, boolean qualified, Set<String> result)
      Adds all operations known for category to result.
      Parameters:
      category - the category
      qualified - add qualified or unqualified names
      result - the result set to modify
      Returns:
      result
    • getServiceOperations

      public Set<String> getServiceOperations(boolean qualified)
      Specified by:
      getServiceOperations in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • defineServiceFunction

      public AasOperationsProvider defineServiceFunction(String name, Function<Object[],Object> function)
      Specified by:
      defineServiceFunction in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • defineProperty

      public AasOperationsProvider defineProperty(String name, Supplier<Object> get, Consumer<Object> set)
      Specified by:
      defineProperty in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getGetter

      public Supplier<Object> getGetter(String name)
      Specified by:
      getGetter in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • getSetter

      public Consumer<Object> getSetter(String name)
      Specified by:
      getSetter in interface de.iip_ecosphere.platform.support.aas.OperationsProvider
    • setInterceptor

      public void setInterceptor(de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptor interceptor)
      Specified by:
      setInterceptor in interface de.iip_ecosphere.platform.support.aas.OperationsProvider