Package com.redwood.scheduler.api.model
Class ObjectRetriever
- java.lang.Object
-
- com.redwood.scheduler.api.model.ObjectRetriever
-
public class ObjectRetriever extends Object
Generated class for retrieving/dispatching objects of a specific type.This class can be used for:
- Locating objects when their type and unique-Id are known;
- Type-safe dispatching based on an object whose type and unique-Id are known;
- Type-safe dispatch based on the type of an object.
-
-
Constructor Summary
Constructors Constructor Description ObjectRetriever(SchedulerSession initSession)
Construct an object retriever that will use the supplied session.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
callbackSchedulerEntity(SchedulerEntity schedulerEntity, ConcreteObjectCallback callback)
Dispatch to an appropriate callback, based on the type of the object.static void
callbackSchedulerEntity(SchedulerSession session, String objectType, Long uniqueId, ConcreteObjectCallback callback)
Lookup an object and invoke a callback with it, similar tocallbackSchedulerEntity(String,Long,ConcreteObjectCallback)
, but using the supplied session instead.void
callbackSchedulerEntity(String objectType, Long uniqueId, ConcreteObjectCallback callback)
Lookup an object that inherits fromSchedulerEntity
, given its concrete-type and uniqueId, and invoke a callback with the object.void
close()
Deprecated.static SchedulerEntity
lookupSchedulerEntity(SchedulerSession session, String objectType, Long uniqueId)
Deprecated.SchedulerEntity
lookupSchedulerEntity(String objectType, Long uniqueId)
Deprecated.
-
-
-
Constructor Detail
-
ObjectRetriever
public ObjectRetriever(SchedulerSession initSession)
Construct an object retriever that will use the supplied session. The session can be closed by invoking theclose()
method.- Parameters:
initSession
- Session to use for retrieving objects.
-
-
Method Detail
-
close
@Deprecated public void close()
Deprecated.Mark this object retriever as no longer being used. This involves closing the session that was supplied to the constructor.
-
lookupSchedulerEntity
@Deprecated public SchedulerEntity lookupSchedulerEntity(String objectType, Long uniqueId)
Deprecated.This method is deprecated, please useSchedulerSession.getSchedulerEntityByObjectTypeUniqueId(String, Long)
instead.Lookup an object that inherits from
SchedulerEntity
, given its concrete-type and uniqueId. For an object to be returned, it must:- Be of the supplied concrete-type;
- Have the supplied unique-id;
- Be visible to the user that owns the session.
null
is returned.- Parameters:
objectType
- Concrete-type of the object to locate.uniqueId
- Unique-ID of the object being sought.- Returns:
- The object that matches these characters, or
null
if it could not be found.
-
lookupSchedulerEntity
@Deprecated public static SchedulerEntity lookupSchedulerEntity(SchedulerSession session, String objectType, Long uniqueId)
Deprecated.This method is deprecated, please useSchedulerSession.getSchedulerEntityByObjectTypeUniqueId(String, Long)
instead. If a UIForm is available, then use MetaServer.getMetaEntity(objectType).getSchedulerEntity(uiForm, uniqueId).Lookup an object similar to
lookupSchedulerEntity(String,Long)
, but using the supplied session instead.- Parameters:
session
- The session to use to locate the object.objectType
- Concrete-type of the object to locate.uniqueId
- Unique-ID of the object being sought.- Returns:
- The object that matches these characters, or
null
if it could not be found.
-
callbackSchedulerEntity
public void callbackSchedulerEntity(String objectType, Long uniqueId, ConcreteObjectCallback callback) throws com.redwood.scheduler.api.exception.CallbackException
Lookup an object that inherits fromSchedulerEntity
, given its concrete-type and uniqueId, and invoke a callback with the object. The callback must supply typed methods for each concrete class that inherits from SchedulerEntity, which can then implement behavior based on the type of the object in a type-safe manner.In locating the object, the same conditions as for
lookupSchedulerEntity(String,Long)
apply. If the object cannot be located, no action is taken.- Parameters:
objectType
- Concrete-type of the object to locate.uniqueId
- Unique-ID of the object being sought.callback
- Callback to invoke with the located object.- Throws:
com.redwood.scheduler.api.exception.CallbackException
- This means the callback threw an exception.
-
callbackSchedulerEntity
public static void callbackSchedulerEntity(SchedulerSession session, String objectType, Long uniqueId, ConcreteObjectCallback callback) throws com.redwood.scheduler.api.exception.CallbackException
Lookup an object and invoke a callback with it, similar tocallbackSchedulerEntity(String,Long,ConcreteObjectCallback)
, but using the supplied session instead.- Parameters:
session
- The session to use to locate the object.objectType
- Concrete-type of the object to locate.uniqueId
- Unique-ID of the object being sought.callback
- Callback to invoke with the located object.- Throws:
com.redwood.scheduler.api.exception.CallbackException
- This means the callback threw an exception.
-
callbackSchedulerEntity
public static void callbackSchedulerEntity(SchedulerEntity schedulerEntity, ConcreteObjectCallback callback) throws com.redwood.scheduler.api.exception.CallbackException
Dispatch to an appropriate callback, based on the type of the object. The callback must supply typed methods for each concrete class that inherits from SchedulerEntity, which can then implement behavior based on the type of the object in a type-safe manner.- Parameters:
schedulerEntity
- Object to dispatch.callback
- Callback to invoke with the located object.- Throws:
com.redwood.scheduler.api.exception.CallbackException
- This means the callback threw an exception.
-
-