Interface TCSObjectService
- All Known Subinterfaces:
InternalPeripheralJobService
,InternalPeripheralService
,InternalPlantModelService
,InternalTransportOrderService
,InternalVehicleService
,PeripheralJobService
,PeripheralService
,PlantModelService
,TransportOrderService
,VehicleService
public interface TCSObjectService
Provides methods concerning
TCSObject
s.-
Method Summary
Modifier and Type Method Description void
appendObjectHistoryEntry(TCSObjectReference<?> ref, ObjectHistory.Entry entry)
Appends a history entry to aTCSObject
.<T extends TCSObject<T>>
TfetchObject(java.lang.Class<T> clazz, java.lang.String name)
Returns a singleTCSObject
of the given class.<T extends TCSObject<T>>
TfetchObject(java.lang.Class<T> clazz, TCSObjectReference<T> ref)
Returns a singleTCSObject
of the given class.<T extends TCSObject<T>>
java.util.Set<T>fetchObjects(java.lang.Class<T> clazz)
Returns all existingTCSObject
s of the given class.<T extends TCSObject<T>>
java.util.Set<T>fetchObjects(java.lang.Class<T> clazz, java.util.function.Predicate<? super T> predicate)
Returns all existingTCSObject
s of the given class for which the given predicate is true.void
updateObjectProperty(TCSObjectReference<?> ref, java.lang.String key, java.lang.String value)
Updates aTCSObject
's property.
-
Method Details
-
fetchObject
<T extends TCSObject<T>> T fetchObject(java.lang.Class<T> clazz, TCSObjectReference<T> ref) throws KernelRuntimeExceptionReturns a singleTCSObject
of the given class.- Type Parameters:
T
- The TCSObject's actual type.- Parameters:
clazz
- The class of the object to be returned.ref
- A reference to the object to be returned.- Returns:
- A copy of the referenced object, or
null
if no such object exists or if an object exists but is not an instance of the given class. - Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
fetchObject
<T extends TCSObject<T>> T fetchObject(java.lang.Class<T> clazz, java.lang.String name) throws KernelRuntimeExceptionReturns a singleTCSObject
of the given class.- Type Parameters:
T
- The TCSObject's actual type.- Parameters:
clazz
- The class of the object to be returned.name
- The name of the object to be returned.- Returns:
- A copy of the named object, or
null
if no such object exists or if an object exists but is not an instance of the given class. - Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
fetchObjects
<T extends TCSObject<T>> java.util.Set<T> fetchObjects(java.lang.Class<T> clazz) throws KernelRuntimeExceptionReturns all existingTCSObject
s of the given class.- Type Parameters:
T
- The TCSObjects' actual type.- Parameters:
clazz
- The class of the objects to be returned.- Returns:
- Copies of all existing objects of the given class.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
fetchObjects
<T extends TCSObject<T>> java.util.Set<T> fetchObjects(@Nonnull java.lang.Class<T> clazz, @Nonnull java.util.function.Predicate<? super T> predicate) throws KernelRuntimeExceptionReturns all existingTCSObject
s of the given class for which the given predicate is true.- Type Parameters:
T
- The TCSObjects' actual type.- Parameters:
clazz
- The class of the objects to be returned.predicate
- The predicate that must be true for returned objects.- Returns:
- Copies of all existing objects of the given class for which the given predicate is true. If no such objects exist, the returned set will be empty.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
updateObjectProperty
void updateObjectProperty(TCSObjectReference<?> ref, java.lang.String key, @Nullable java.lang.String value) throws ObjectUnknownException, KernelRuntimeExceptionUpdates aTCSObject
's property.- Parameters:
ref
- A reference to the TCSObject to be modified.key
- The property's key.value
- The property's (new) value. Ifnull
, removes the property from the object.- Throws:
ObjectUnknownException
- If the referenced object does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
appendObjectHistoryEntry
void appendObjectHistoryEntry(TCSObjectReference<?> ref, ObjectHistory.Entry entry) throws ObjectUnknownException, KernelRuntimeExceptionAppends a history entry to aTCSObject
.- Parameters:
ref
- A reference to the TCSObject to be modified.entry
- The history entry to be appended.- Throws:
ObjectUnknownException
- If the referenced object does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-