public class Incompatibility extends BaseMetadata implements Serializable
An Incompatibility specifies JobDefinition and/or JobSet definitions that are considered to be incompatible in the system and jobs for those definitions should not be concurrently run. Enterprise Scheduler performs incompatibility checks when it prepares to execute a request. The request will be blocked if an incompatible request is already being executed.
An Incompatibility is made up of one or more incompatible entities. An entity references a JobDefintion or JobSet definition. Each entity must reference a different JobDefintion or JobSet that is present in the metadata repository.
An entity can be marked self-incompatible. A self incompatible entity means that two request for that entity are not compatible and should not run concurrently.
An Incompatibility can be defined globally or for a given domain (resource). The entities for a global incompatibility are always considered to be incompatible. The entities for a domain incompatibility are considered incompatible if they have the same value for the specified domain resource. The resource is identified by a property name specified for each entity making up the Incompatibility. Each entity can specify the same property name or a different property name.
A valid Incompatibility definition usually has two or more entities. An Incompatibility having one entity is valid only if it is a self-incompatible entity.
IncompatibleEntity
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Incompatibility.IncompatibilityType
Enum for valid Incompatibility type.
|
Constructor and Description |
---|
Incompatibility(String name,
String description,
Incompatibility.IncompatibilityType type)
Constructs a new incompatibility definition.
|
Incompatibility(String name,
String displayNameKey,
String descriptionKey,
Incompatibility.IncompatibilityType type,
String[] resourceBundleIDs)
Constructs a new incompatibility definition and associate
resource bundles.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntity(IncompatibleEntity incompEntity)
Adds an incompatibility entity to this object.
|
void |
addEntity(MetadataObjectId entity,
boolean selfIncompatible)
Adds an incompatibility entity to this object.
|
void |
addEntity(MetadataObjectId entity,
String property,
boolean selfIncompatible)
Adds an incompatibility entity to this object.
|
Incompatibility |
clone(String newName) |
boolean |
equals(Object obj)
Compares an object for equality with this Incompatibility object.
|
Collection |
getAllEntities()
Gets a collection of the incompatibility entities associated
with this object.
|
BaseMetadataType |
getBaseMetadataType()
Gets the intended type of this metadata.
|
IncompatibleEntity |
getEntity(MetadataObjectId entity)
Gets information for an incompatibility entity associated
with this incompatibility definition.
|
Incompatibility.IncompatibilityType |
getType()
Gets the incompatibility type.
|
int |
hashCode()
The hash code for this object.
|
void |
removeEntity(MetadataObjectId entity)
Removes the specified entity from this incompatibility definition.
|
getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMetadataObjectId, getName, getResourceBundles, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toString, validate
public Incompatibility(String name, String description, Incompatibility.IncompatibilityType type)
This constructor is used by clients to create Incompatibility definitions. Each incompatibility entity that is subsequently added is expected to be valid for incompatibility type associated with this object
name
- the unique name to be given to this incompatibility
definition. Must not be null
. The name is also used as
the default display name unless otherwise specifically set.description
- an optional description. This can be null
.type
- the incompatibility type. Must not be null
.NullPointerException
- if a name or incompatibility type
is not specified.public Incompatibility(String name, String displayNameKey, String descriptionKey, Incompatibility.IncompatibilityType type, String[] resourceBundleIDs)
This constructor is used by clients to create Incompatibility definitions. Each incompatibility entity that is subsequently added is expected to be valid for incompatibility type associated with this object
name
- the name for this instance. It cannot be null
.
The name is also used as the default display name unless otherwise
specifically set.displayNameKey
- the resource bundle key for the display name.
Optional.descriptionKey
- the resource bundle key for the description.
Optional.type
- the incompatibility type. Must not be null
.resourceBundleIDs
- an array of resource bundle id. Optional.NullPointerException
- if a name or incompatibility type
is not specified.public Incompatibility.IncompatibilityType getType()
public void addEntity(MetadataObjectId entity, boolean selfIncompatible) throws ValidationException
entity
- the unique identifier for the JobDefinition
or JobSet
entity being added.selfIncompatible
- true
if the incompatibility entity is
self-incompatible, or false
if it is not self-incompatible.ValidationException
- if this incompatibility already contains
a reference to the entity. Also, thrown if the entity is not suitable
for this incompatibility definition; for example, a property must
be specified for each entity of a domain incompatibility.public void addEntity(MetadataObjectId entity, String property, boolean selfIncompatible) throws ValidationException
entity
- the unique identifier for the JobDefinition
or JobSet
entity being added.property
- the property associated with the incompatibility
entity. This cannot be null
for a domain incompatibility.selfIncompatible
- true
if the incompatibility entity is
self-incompatible, or false
if it is not self-incompatible.ValidationException
- if this incompatibility already contains
a reference to the entity. Also, thrown if the entity is not suitable
for this incompatibility definition; for example, a property must
be specified for each entity of a domain incompatibility.public void addEntity(IncompatibleEntity incompEntity) throws ValidationException
This makes a copy of the entity information being added.
incompEntity
- information for the incompatibility entity.NullPointerException
- if incompatibility entity not specified.ValidationException
- if this incompatibility already contains
a reference to the entity. Also, thrown if the entity is not suitable
for this incompatibility definition; for example, a property must
be specified for each entity of a domain incompatibility.public void removeEntity(MetadataObjectId entity)
entity
- the identifier of the entity to be removed.public IncompatibleEntity getEntity(MetadataObjectId entity)
entity
- the identiifer of the incompatibility entitynull
if no such entity is associated with this object,
or no entity was specified.public Collection getAllEntities()
public int hashCode()
hashCode
in class BaseMetadata
public boolean equals(Object obj)
public BaseMetadataType getBaseMetadataType()
BaseMetadata
getBaseMetadataType
in class BaseMetadata
public Incompatibility clone(String newName) throws ValidationException
clone
in class BaseMetadata
ValidationException