Interface TCSObjectService
- All Known Subinterfaces:
InternalPeripheralJobService,InternalPeripheralService,InternalPlantModelService,InternalTransportOrderService,InternalVehicleService,PeripheralJobService,PeripheralService,PlantModelService,TransportOrderService,VehicleService
public interface TCSObjectService
Provides methods concerning
TCSObjects.-
Method Summary
Modifier and TypeMethodDescriptionvoidappendObjectHistoryEntry(TCSObjectReference<?> ref, ObjectHistory.Entry entry) Appends a history entry to aTCSObject.<T extends TCSObject<T>>
TfetchObject(Class<T> clazz, String name) Returns a singleTCSObjectof the given class.<T extends TCSObject<T>>
TfetchObject(Class<T> clazz, TCSObjectReference<T> ref) Returns a singleTCSObjectof the given class.fetchObjects(Class<T> clazz) Returns all existingTCSObjects of the given class.fetchObjects(Class<T> clazz, Predicate<? super T> predicate) Returns all existingTCSObjects of the given class for which the given predicate is true.voidupdateObjectProperty(TCSObjectReference<?> ref, String key, String value) Updates aTCSObject's property.
-
Method Details
-
fetchObject
<T extends TCSObject<T>> T fetchObject(Class<T> clazz, TCSObjectReference<T> ref) throws KernelRuntimeException Returns a singleTCSObjectof 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
nullif 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
Returns a singleTCSObjectof 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
nullif 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
Returns all existingTCSObjects 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>> Set<T> fetchObjects(@Nonnull Class<T> clazz, @Nonnull Predicate<? super T> predicate) throws KernelRuntimeException Returns all existingTCSObjects 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, String key, @Nullable String value) throws ObjectUnknownException, KernelRuntimeException Updates 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, KernelRuntimeException Appends 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.
-