public class TriggerManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SOURCE_TYPE_CATALOG |
static int |
SOURCE_TYPE_CATEGORIES |
static int |
SOURCE_TYPE_CATEGORY |
static int |
SOURCE_TYPE_RECORD |
static int |
SOURCE_TYPE_RECORDS |
static int |
SOURCE_TYPE_SERVER |
Modifier and Type | Method and Description |
---|---|
void |
addCatalogTrigger(Catalog catalog,
Trigger trigger)
Adds the given trigger as a catalog trigger.
|
void |
addCategoriesTrigger(Catalog catalog,
Trigger trigger)
Adds the given trigger as a trigger for all categories of the specified catalog.
|
void |
addItemTrigger(Item item,
Trigger trigger)
Adds the given trigger as a trigger for the specified item.
|
void |
addRecordsTrigger(Catalog catalog,
Trigger trigger)
Adds the given trigger as a trigger for all records of the specified catalog.
|
void |
addServerTrigger(Trigger trigger)
Adds the given trigger as a server trigger.
|
Binding |
createBinding(Catalog catalog)
Returns a binding for the given catalog.
|
Binding |
createBinding(Item item)
Returns a binding for the given item.
|
Binding |
createBindingForCategories(Catalog catalog)
Returns a binding for the categories of the given catalog.
|
Binding |
createBindingForRecords(Catalog catalog)
Returns a binding for the records of the given catalog.
|
ActionESP |
getActionESP(GUID guid)
Returns the trigger action ESP for the given GUID.
|
GUID[] |
getActionsAvailable(int condition)
Returns an array of GUIDs of available action ESPs supporting the given condition.
|
java.util.Collection<Trigger> |
getCatalogTriggers(Catalog catalog)
Returns a collection of all existing triggers for the given catalog.
|
java.util.Collection<Trigger> |
getCategoriesTriggers(Catalog catalog)
Returns a collection of all existing triggers for all categories of the given catalog.
|
static TriggerManager |
getInstance(Server server)
Returns the trigger manager instance for the given server.
|
java.util.Collection<Trigger> |
getItemTriggers(Item item)
Returns a collection of all existing triggers for the given item.
|
java.util.Collection<Trigger> |
getRecordsTriggers(Catalog catalog)
Returns a collection of all existing triggers for all records of the given catalog.
|
Server |
getServer()
Returns the server of this connection.
|
java.util.Collection |
getServerTriggers()
Returns a collection of all existing server triggers.
|
void |
removeCatalogTrigger(Catalog catalog,
Trigger trigger)
Removes the given trigger as a catalog trigger.
|
void |
removeCategoriesTrigger(Catalog catalog,
Trigger trigger)
Removes the given trigger as a trigger for all categories of the specified catalog.
|
void |
removeItemTrigger(Item item,
Trigger trigger)
Removes the given trigger as a trigger for the specified record.
|
void |
removeRecordsTrigger(Catalog catalog,
Trigger trigger)
Removes the given trigger as a trigger for all records of the specified catalog.
|
void |
removeServerTrigger(Trigger trigger)
Removes the given trigger as a server trigger.
|
public static final int SOURCE_TYPE_SERVER
public static final int SOURCE_TYPE_CATALOG
public static final int SOURCE_TYPE_RECORD
public static final int SOURCE_TYPE_RECORDS
public static final int SOURCE_TYPE_CATEGORY
public static final int SOURCE_TYPE_CATEGORIES
public static TriggerManager getInstance(Server server)
server
- server to get the trigger manager forpublic Server getServer()
public ActionESP getActionESP(GUID guid) throws CumulusException, java.lang.ClassNotFoundException, InvalidStateException
guid
- GUID of the trigger actionActionESP
or null if not foundCumulusException
- in case of an errorjava.lang.ClassNotFoundException
- class of the action ESP could not be foundInvalidStateException
- in case of an errorpublic GUID[] getActionsAvailable(int condition) throws CumulusException, InvalidStateException
ConditionTypes.CONDITION_TYPE_CATALOG_SETTINGS_CHANGED
, ConditionTypes.CONDITION_TYPE_FIELD_VALUE_CHANGED
,
ConditionTypes.CONDITION_TYPE_RECORD_CATEGORY_ADDED
and ConditionTypes.CONDITION_TYPE_RECORD_CATEGORY_DELETED
.condition
- the condition wantedCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void addServerTrigger(Trigger trigger) throws CumulusException, InvalidStateException
trigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void removeServerTrigger(Trigger trigger) throws CumulusException, InvalidStateException
trigger
- trigger to removeCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic java.util.Collection getServerTriggers() throws CumulusException, InvalidStateException
Trigger
instancesCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void addCatalogTrigger(Catalog catalog, Trigger trigger) throws CumulusException, InvalidStateException
catalog
- the catalog to add the trigger fortrigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void removeCatalogTrigger(Catalog catalog, Trigger trigger) throws CumulusException, InvalidStateException
catalog
- the catalog remove the trigger fromtrigger
- the trigger to removeCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic java.util.Collection<Trigger> getCatalogTriggers(Catalog catalog) throws CumulusException, InvalidStateException
catalog
- the catalog to get all triggers forTrigger
instancesCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void addRecordsTrigger(Catalog catalog, Trigger trigger) throws InvalidStateException, CumulusException
catalog
- the catalog to add the trigger fortrigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void removeRecordsTrigger(Catalog catalog, Trigger trigger) throws InvalidStateException, CumulusException
catalog
- the catalog to remove the trigger fromtrigger
- the trigger to removeCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic Binding createBinding(Item item)
item
- item to create the binding forBinding
public Binding createBinding(Catalog catalog)
catalog
- catalog to create the binding forBinding
public Binding createBindingForRecords(Catalog catalog)
catalog
- catalog to create the binding for all contained recordsBinding
public Binding createBindingForCategories(Catalog catalog)
catalog
- catalog to create the binding for all contained categoriesBinding
public java.util.Collection<Trigger> getRecordsTriggers(Catalog catalog) throws CumulusException, InvalidStateException
catalog
- the catalog to get all triggers forTrigger
instancesCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void addCategoriesTrigger(Catalog catalog, Trigger trigger) throws CumulusException, InvalidStateException
catalog
- the catalog to add the trigger fortrigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void removeCategoriesTrigger(Catalog catalog, Trigger trigger) throws CumulusException, InvalidStateException
catalog
- the catalog to remove the trigger fromtrigger
- the trigger to removeCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic java.util.Collection<Trigger> getCategoriesTriggers(Catalog catalog) throws CumulusException, InvalidStateException
catalog
- the catalog to get all triggers forTrigger
instancesCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void addItemTrigger(Item item, Trigger trigger) throws InvalidStateException, CumulusException
item
- the item to add the trigger fortrigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic void removeItemTrigger(Item item, Trigger trigger) throws InvalidStateException, CumulusException
item
- the item to remove the trigger fromtrigger
- the trigger to addCumulusException
- in case of an errorInvalidStateException
- in case of an errorpublic java.util.Collection<Trigger> getItemTriggers(Item item) throws CumulusException, InvalidStateException
item
- the item to get all triggers forTrigger
instancesCumulusException
- in case of an errorInvalidStateException
- in case of an errorwww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.