Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.6.3)
E26229-05


oracle.as.scheduler
Class Incompatibility

java.lang.Object
  extended by oracle.as.scheduler.BaseMetadata<Incompatibility>
      extended by oracle.as.scheduler.Incompatibility

All Implemented Interfaces:
java.io.Serializable

public class Incompatibility
extends BaseMetadata<Incompatibility>
implements java.io.Serializable

Encapsulate an incompatibility among Job and/or JobSet definitions over a given resource.

Incompatibility defines which Job and JobSet definitions, referred as entities, are incompatible with other entities in the system and should not be allowed to run together.

It is possible to define self-incompatibility where a given entity is incompatible with itself implying two requests for such an entity should not run together.

Incompatibility can be defined for a given resource or globally. A resource is identified by a property name available in the entities being marked for incompatibility. Such a resource can be referred by the same or different property name.

At runtime, the system will check if the given entities are accessing the same resource (identified as the values of the properties defined in the incompatibility definition) and prevent them from running concurrently.

Each instance of this class defines such an incompatibility in the system. It contains two or more Job,JobSet definitions (or even one in case of self incompatibility) marked as incompatible either globally or over a given resource.

A valid incompatibility definition must have at least two entities or one self-incompatible entity.

See Also:
Serialized Form

Nested Class Summary
static class Incompatibility.IncompatibilityType
          Enum for valid Incompatibility type.

 

Constructor Summary
Incompatibility(java.lang.String name, java.lang.String description, Incompatibility.IncompatibilityType type)
          Constructs a new incompatibility definition.
Incompatibility(java.lang.String name, java.lang.String description, Incompatibility.IncompatibilityType type, MetadataObjectId objectId)
          Constructs a new instance.
Incompatibility(java.lang.String name, java.lang.String displayNameKey, java.lang.String descriptionKey, Incompatibility.IncompatibilityType type, java.lang.String[] resourceBundleIDs)
          Constructs a new incompatibility definition and associate resource bundles.

 

Method Summary
 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, java.lang.String property, boolean selfIncompatible)
          Adds an incompatibility entity to this object.
 Incompatibility clone(java.lang.String newName)
           
 boolean equals(java.lang.Object obj)
          Compares an object for equality with this Incompatibility object.
static Incompatibility from(javax.management.openmbean.CompositeData cd)
          Create an instance of the model specific class out of an associated CompositeData instance
 java.util.Collection<IncompatibleEntity> getAllEntities()
          Returns a collection of the incompatibility entities associated with this object.
 BaseMetadataType<Incompatibility> getBaseMetadataType()
           
 IncompatibleEntity getEntity(MetadataObjectId entity)
          Returns information for an incompatibility entity associated with this incompatibility definition.
protected  Incompatibility getSelf()
           
 Incompatibility.IncompatibilityType getType()
          Returns the incompatibility type.
 int hashCode()
          Returns the hash code for this object.
protected  int numEntities()
          Returns the number of incompatible entities for this object.
 void removeEntity(MetadataObjectId entity)
          Removes the specified entity from this incompatibility definition.
 javax.management.openmbean.CompositeData toCompositeData(javax.management.openmbean.CompositeType ct)
           
static javax.management.openmbean.CompositeType toCompositeType()
          Returns the CompositeType that describes this model specific class
protected  void validateCustom()
          Validates this incompatibility definition instance.

 

Methods inherited from class oracle.as.scheduler.BaseMetadata
from, getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMessages, getMetadataObjectId, getName, getResourceBundles, localize, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toCompositeData, toString, validate

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

Incompatibility

public Incompatibility(java.lang.String name,
                       java.lang.String description,
                       Incompatibility.IncompatibilityType type)
Constructs a new incompatibility definition.

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

Parameters:
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 specifially set.
description - an optional description. This can be null.
type - the incompatibility type. Must not be null.
Throws:
java.lang.NullPointerException - if a name or incompatibility type is not specified.

Incompatibility

public Incompatibility(java.lang.String name,
                       java.lang.String displayNameKey,
                       java.lang.String descriptionKey,
                       Incompatibility.IncompatibilityType type,
                       java.lang.String[] resourceBundleIDs)
Constructs a new incompatibility definition and associate resource bundles.

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

Parameters:
name - -- name for this instance. It cannot be null. The name is also used as the default display name unless otherwise specifially set.
displayNameKey - - the key of the entry in the resourcebundles to lookup the name. Optional
descriptionKey - - the key of the entry in the resourcebundles to lookup the description. Optional.
type - the incompatibility type. Must not be null.
resourceBundleIDs - -- an array of resource bundle id. Optional
Throws:
java.lang.NullPointerException - if a name or incompatibility type is not specified.

Incompatibility

public Incompatibility(java.lang.String name,
                       java.lang.String description,
                       Incompatibility.IncompatibilityType type,
                       MetadataObjectId objectId)
Constructs a new instance.

INTERNAL ONLY
This constructor is used by the MetadataService to populate the unique identifier of this object (incompatibility definition) within the metadata repository.

Parameters:
name - the unique name of this incompatibility definition.
description - the description, if any.
type - the incompatibility type
objectId - the unique identifier of this object in the metadata repository.
Throws:
java.lang.NullPointerException - if a name, incompatibility type, or metadata object id is not specified.

Method Detail

getType

public Incompatibility.IncompatibilityType getType()
Returns the incompatibility type.
Returns:
the incompatibility type

addEntity

public void addEntity(MetadataObjectId entity,
                      boolean selfIncompatible)
               throws ValidationException
Adds an incompatibility entity to this object. This method is suitable for adding a new entity to a global incompatibility definition.
Parameters:
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.
Throws:
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.

addEntity

public void addEntity(MetadataObjectId entity,
                      java.lang.String property,
                      boolean selfIncompatible)
               throws ValidationException
Adds an incompatibility entity to this object. This method is suitable for adding a new entity to a domain incompatibility definition.
Parameters:
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.
Throws:
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.

addEntity

public void addEntity(IncompatibleEntity incompEntity)
               throws ValidationException
Adds an incompatibility entity to this object.

Note: This makes a copy of the entity information being added.

Parameters:
incompEntity - information for the incompatibility entity.
Throws:
java.lang.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.

removeEntity

public void removeEntity(MetadataObjectId entity)
Removes the specified entity from this incompatibility definition.
Parameters:
entity - the identifier of the entity to be removed.

getEntity

public IncompatibleEntity getEntity(MetadataObjectId entity)
Returns information for an incompatibility entity associated with this incompatibility definition.
Parameters:
entity - the identiifer of the incompatibility entity
Returns:
information for the incompatibility entity. This will be null if no such entity is associated with this object, or no entity was specified.

getAllEntities

public java.util.Collection<IncompatibleEntity> getAllEntities()
Returns a collection of the incompatibility entities associated with this object.
Returns:
the entities associated with this object.

numEntities

protected int numEntities()
Returns the number of incompatible entities for this object.
Returns:
the number of entities

validateCustom

protected void validateCustom()
                       throws ValidationException
Validates this incompatibility definition instance. This method checks for completeness and correctness of this object.

This method performs only those validations that are possible just on this instance. It does not validate the existence of any JobDefinition or JobSet definitions referenced by the incompatibility entities. Such validations are performed by the [@code MetadataService} when the Incompatibility is persisted to the metadata repository.

Specified by:
validateCustom in class BaseMetadata<Incompatibility>
Throws:
ValidationException - if a validation error occurs.

hashCode

public int hashCode()
Returns the hash code for this object.
Overrides:
hashCode in class BaseMetadata<Incompatibility>
Returns:
hash code of this object.

equals

public boolean equals(java.lang.Object obj)
Compares an object for equality with this Incompatibility object.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with this Incompatibility.
Returns:
true if the object is an instance of Incompatibility and is considered equal to this object, or false otherwise.

toCompositeType

public static javax.management.openmbean.CompositeType toCompositeType()
Returns the CompositeType that describes this model specific class

toCompositeData

public javax.management.openmbean.CompositeData toCompositeData(javax.management.openmbean.CompositeType ct)
Specified by:
toCompositeData in class BaseMetadata<Incompatibility>

from

public static Incompatibility from(javax.management.openmbean.CompositeData cd)
                            throws java.lang.IllegalArgumentException
Create an instance of the model specific class out of an associated CompositeData instance
Throws:
java.lang.IllegalArgumentException

getSelf

protected Incompatibility getSelf()
Specified by:
getSelf in class BaseMetadata<Incompatibility>

getBaseMetadataType

public BaseMetadataType<Incompatibility> getBaseMetadataType()
Specified by:
getBaseMetadataType in class BaseMetadata<Incompatibility>

clone

public Incompatibility clone(java.lang.String newName)
                      throws ValidationException
Specified by:
clone in class BaseMetadata<Incompatibility>
Throws:
ValidationException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.6.3)
E26229-05


Copyright © 2008, 2012 Oracle. All rights reserved.