Class SubmodelClient
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.SubmodelClient
- Direct Known Subclasses:
ApplicationInstancesAasClient,PlatformAasClient,SubmodelElementsCollectionClient
Basic class for submodel clients, i.e., classes that act as frontend for an (active) AAS.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate de.iip_ecosphere.platform.support.aas.Submodel -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubmodelClient(de.iip_ecosphere.platform.support.aas.Submodel submodel) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcheckNotNull(T obj) Checks for thatresultis not null.static StringcheckString(Object obj) Checks for thatobjis a non-empty string.voidclear()If there is caching, force re-caching.static de.iip_ecosphere.platform.support.aas.OperationgetOperation(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort) Returns the operation for the givenidShortdefined onsubmodel.protected de.iip_ecosphere.platform.support.aas.OperationgetOperation(String idShort) Returns the operation for the givenidShortdefined onsubmodel.static de.iip_ecosphere.platform.support.aas.PropertygetProperty(de.iip_ecosphere.platform.support.aas.Submodel submodel, String idShort) Returns the property for the givenidShortdefined onsubmodel.protected de.iip_ecosphere.platform.support.aas.PropertygetProperty(String idShort) Returns the property for the givenidShortdefined onsubmodel.protected StringgetPropertyStringValue(String name, String dflt) Returns the value of the propertynamefromsubmodelas String.de.iip_ecosphere.platform.support.aas.SubmodelReturns the submodel.voidIndicates the submodel may need a refresh.
-
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 nextgetSubmodel()call. -
getOperation
protected de.iip_ecosphere.platform.support.aas.Operation getOperation(String idShort) throws ExecutionException Returns the operation for the givenidShortdefined onsubmodel.- 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 givenidShortdefined onsubmodel.- 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 givenidShortdefined onsubmodel.- Parameters:
submodel- the submodel to queryidShort- 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 givenidShortdefined onsubmodel.- Parameters:
submodel- the submodel to queryidShort- the short id- Returns:
- the property
- Throws:
ExecutionException- if the property was not found
-
getPropertyStringValue
Returns the value of the propertynamefromsubmodelas String.- Parameters:
name- the namedflt- the default value to be used if reading the value fails- Returns:
- the string value or
dflt
-
checkString
Checks for thatobjis 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 thatresultis not null.- Type Parameters:
T- the type of object- Parameters:
obj- the object to check- Returns:
obj- Throws:
IllegalArgumentException- ifobjis null
-