Class 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
- "status"/propertyName
- "operations"/"service"/operationName
constant.
The respective invocables must follow this naming schema for access.- Author:
- Holger Eichelberger, SSE
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classThe protocol server builder for this provider.private static classAn entry as last element of a potentially hierarchically nested access path.private static enumThe main kinds of entries.private static classRepresents a property consisting of a consumer and a supplier function.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.OperationsProvider
de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptorprivate Map<String, Map<String, AasOperationsProvider.Entry>> static final StringThe path prefix for operations.static final StringA convenient combination ofOPERATIONS+SEPARATOR.static final Stringstatic final Stringprivate Map<String, AasOperationsProvider.Property> static final StringThe path separator.private static final longprivate Map<String, AasOperationsProvider.Entry> static final StringThe operations category sub-path for operations.private Map<String, AasOperationsProvider.Entry> static final StringThe path prefix for status/properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOperations(String category, boolean qualified, Set<String> result) Adds all operations known forcategorytoresult.defineServiceFunction(String name, Function<Object[], Object> function) getOperation(String category, String name) getOperations(boolean qualified) getOperations(String category, boolean qualified) protected StringReturns the base path name for operations.getServiceFunction(String name) getServiceOperations(boolean qualified) protected StringReturns the base (sub-)path name for services.protected StringReturns the base path name for status/properties.private StringmakeUnique(Map<String, ?> map, String baseName) Makes a name unique within its kind, i.e., the given map.voidsetInterceptor(de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptor interceptor) Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
SEPARATOR
The path separator.- See Also:
-
STATUS
The path prefix for status/properties.- See Also:
-
PREFIX_STATUS
- See Also:
-
OPERATIONS
The path prefix for operations.- See Also:
-
PREFIX_OPERATIONS
A convenient combination ofOPERATIONS+SEPARATOR.- See Also:
-
SERVICE
The operations category sub-path for operations.- See Also:
-
PREFIX_SERVICE
- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
status
-
operations
-
service
-
properties
-
operationFunctions
-
interceptor
private de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptor interceptor
-
-
Constructor Details
-
AasOperationsProvider
public AasOperationsProvider()Creates a VAB operations provider instance.
-
-
Method Details
-
getStatusPath
Returns the base path name for status/properties. Allows for overriding the default settings.- Returns:
- the path name, by default
STATUS
-
getOperationsPath
Returns the base path name for operations. Allows for overriding the default settings.- Returns:
- the path name, by default
OPERATIONS
-
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 ofgetOperationsPath().
-
makeUnique
Makes a name unique within its kind, i.e., the given map.- Parameters:
map- the mapbaseName- 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:
defineOperationin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getOperation
- Specified by:
getOperationin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getServiceFunction
- Specified by:
getServiceFunctionin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getOperations
- Specified by:
getOperationsin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getOperations
- Specified by:
getOperationsin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
addOperations
Adds all operations known forcategorytoresult.- Parameters:
category- the categoryqualified- add qualified or unqualified namesresult- the result set to modify- Returns:
result
-
getServiceOperations
- Specified by:
getServiceOperationsin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
defineServiceFunction
- Specified by:
defineServiceFunctionin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
defineProperty
public AasOperationsProvider defineProperty(String name, Supplier<Object> get, Consumer<Object> set) - Specified by:
definePropertyin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getGetter
- Specified by:
getGetterin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
getSetter
- Specified by:
getSetterin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-
setInterceptor
public void setInterceptor(de.iip_ecosphere.platform.support.aas.OperationsProvider.Interceptor interceptor) - Specified by:
setInterceptorin interfacede.iip_ecosphere.platform.support.aas.OperationsProvider
-