Package com.exedio.cope.pattern
Class Dispatcher
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- com.exedio.cope.pattern.Dispatcher
-
- All Implemented Interfaces:
Serializable
public final class Dispatcher extends Pattern
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Dispatcher.Config
static class
Dispatcher.Result
static class
Dispatcher.Run
-
Constructor Summary
Constructors Constructor Description Dispatcher()
-
Method Summary
-
Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, registerSource
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Method Detail
-
defaultPendingTo
public Dispatcher defaultPendingTo(boolean defaultConstant)
-
withoutPurge
public Dispatcher withoutPurge()
Disablespurge(DispatcherPurgeProperties, JobContext)
functionality. Avoids additional columns in database needed for purge functionality. Additionally disables resetting failureLimit on unpend.
-
withoutRemaining
public Dispatcher withoutRemaining()
DisablesDispatcher.Run.getRemaining()
andDispatcher.Run.getLimit()
fields. Avoids additional columns in database.
-
onMount
protected void onMount()
Description copied from class:Pattern
Here you can do additional initialization not yet done in the constructor. In this method you can call methodsPattern.getType()
andFeature.getName()
for the first time.
-
getPending
public BooleanField getPending()
-
getNoPurge
public BooleanField getNoPurge()
-
getUnpendSuccess
public BooleanField getUnpendSuccess()
-
getUnpendDate
public DateField getUnpendDate()
-
getRunParent
@Nonnull public <P extends Item> ItemField<P> getRunParent(@Nonnull Class<P> parentClass)
-
getRunRuns
public PartOf<?> getRunRuns()
-
getRunDate
public DateField getRunDate()
-
getRunElapsed
public LongField getRunElapsed()
-
getRunRemaining
public IntegerField getRunRemaining()
-
getRunLimit
public IntegerField getRunLimit()
-
getRunResult
public EnumField<Dispatcher.Result> getRunResult()
-
getRunFailure
public DataField getRunFailure()
-
getRunType
public Type<Dispatcher.Run> getRunType()
-
dispatch
public <P extends Item & Dispatchable> void dispatch(@Nonnull Class<P> parentClass, @Nonnull Dispatcher.Config config, @Nonnull JobContext ctx)
-
dispatch
public <P extends Item & Dispatchable> void dispatch(@Nonnull Class<P> parentClass, @Nonnull Dispatcher.Config config, @Nonnull Runnable probe, @Nonnull JobContext ctx)
-
getRuns
@Nonnull public List<Dispatcher.Run> getRuns(Item item)
-
getFailures
@Nonnull public List<Dispatcher.Run> getFailures(Item item)
-
purge
public void purge(@Nonnull DispatcherPurgeProperties properties, @Nonnull JobContext ctx)
- Throws:
IllegalArgumentException
- if purge is disabled bywithoutPurge()
.
-
purge
public void purge(@Nonnull DispatcherPurgeProperties properties, @Nonnull Condition restriction, @Nonnull JobContext ctx)
- Throws:
IllegalArgumentException
- if purge is disabled bywithoutPurge()
.
-
dispatch
@Deprecated public <P extends Item & Dispatchable> int dispatch(@Nonnull Class<P> parentClass, @Nonnull Dispatcher.Config config, @Nullable Interrupter interrupter)
Deprecated.Usedispatch(Class,Config,JobContext)
instead.- Returns:
- the number of successfully dispatched items
-
-