Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.5)
E20742-01


oracle.as.scheduler
Class WorkAssignment

java.lang.Object
  extended by oracle.as.scheduler.BaseMetadata<WorkAssignment>
      extended by oracle.as.scheduler.WorkAssignment
All Implemented Interfaces:
java.io.Serializable

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

This class defines the nature of the work (requests) that should be processed by a Request Processor. A WorkAssignment contains all the specialization rules and workshifts to define what kind of requests a Request Processor should process, when it should process and how much resources should be provided to a Request Processor.

Once a WorkAssignment is defined, it is then associated with a Request Processor at runtime. A definition of a WorkAssignment can be bound to multiple Request Processors and a Request Processor can be bound to multiple WorkAssignment definitions.

The operating times and resource allocation within a WorkAssignment is defined via a Workshift definition. One or more Workshift definitions are then associated with the WorkAssignment definition and finally the WorkAssignment definitions are bound to a Request Processor.

See Also:
Serialized Form

Nested Class Summary
static class WorkAssignment.SpecializationNode
          Enumerates the supported nodes for WorkAssignment specialization.
static class WorkAssignment.SpecializationProperty
          Enumerates the supported property names for WorkAssignment specialization.
 
Constructor Summary
WorkAssignment(java.lang.String name, java.lang.String description)
          Constructor with the name and description.
WorkAssignment(java.lang.String name, java.lang.String description, org.w3c.dom.Document specialization, java.util.Collection<MetadataObjectId> workshifts, boolean active)
          Constructor to create a fully-defined WorkAssignment.
WorkAssignment(java.lang.String name, java.lang.String description, MetadataObjectId objectId)
          Constructor with the name and description.
WorkAssignment(java.lang.String name, java.lang.String displayNameKey, java.lang.String descriptionKey, org.w3c.dom.Document specialization, java.util.Collection<MetadataObjectId> workshifts, boolean active, java.lang.String[] resourceBundleIDs)
          Constructor to create a fully-defined WorkAssignment and associated resource bundles.
WorkAssignment(java.lang.String name, java.lang.String displayNameKey, java.lang.String descriptionKey, java.lang.String[] resourceBundleIDs)
          Constructor with the name and description and associated resource bundles.
 
Method Summary
 void addWorkshift(MetadataObjectId objectId)
          Adds a workshift to this WorkAssignment.
 void addWorkshifts(java.util.Collection<MetadataObjectId> objectIds)
          Adds a list of workshifts to this WorkAssignment.
 WorkAssignment clone(java.lang.String newName)
           
 boolean equals(java.lang.Object obj)
          Compares an object for equality with this WorkAssignment object.
static WorkAssignment from(javax.management.openmbean.CompositeData cd)
          Create an instance of the model specific class out of an associated CompositeData instance
 BaseMetadataType<WorkAssignment> getBaseMetadataType()
           
protected  WorkAssignment getSelf()
           
 org.w3c.dom.Document getSpecializationRules()
          Retrieves the specialization rules defined in this WorkAssignment.
 java.util.Collection<MetadataObjectId> getWorkshifts()
          Returns the workshifts that are associated with this WorkAssignment.
 boolean isActive()
          Deprecated. Replaced by isEnabled()
 boolean isEnabled()
          Checks if the work assignment definition is enabled.
 void removeWorkshift(MetadataObjectId objectId)
          Removes a workshift from this WorkAssignment.
 void setActive(boolean value)
          Deprecated. Replaced by setEnabled(boolean)
 void setEnabled(boolean value)
          Enables or disables the work assignment.
 void setSpecializationRules(org.w3c.dom.Document doc)
          Sets the specialization rules for this WorkAssignment.
 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
 java.lang.String toDebugString()
          Returns a debug string representation for this WorkAssignment object.
 java.lang.String toString()
           
 void validateBound()
          Validates this as a bound WorkAssignment.
protected  void validateCustom()
          Validates this instance of WorkAssignment.
 
Methods inherited from class oracle.as.scheduler.BaseMetadata
from, getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMessages, getMetadataObjectId, getName, getResourceBundles, hashCode, localize, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toCompositeData, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkAssignment

public WorkAssignment(java.lang.String name,
                      java.lang.String description)
Constructor with the name and description.

Parameters:
name - name to be assigned to this WorkAssignment. Name is also used as the default display name unless otherwise specifially set.
description - description for this WorkAssignment, or null if none.

WorkAssignment

public WorkAssignment(java.lang.String name,
                      java.lang.String displayNameKey,
                      java.lang.String descriptionKey,
                      java.lang.String[] resourceBundleIDs)
Constructor with the name and description and associated resource bundles.

Parameters:
name - name of the WorkAssignment. Name is also used as the default display name unless otherwise specifially set.
displayNameKey - optional key of the entry in the resourcebundles to lookup the name
descriptionKey - optional key of the entry in the resourcebundles to lookup the description.
resourceBundleIDs - optional array of resource bundle id

WorkAssignment

public WorkAssignment(java.lang.String name,
                      java.lang.String description,
                      MetadataObjectId objectId)
Constructor with the name and description.

This constructor is for internal use ONLY and should not be used to construct a new instance. This constructor is used internally by the MetadataService to populate the unique identifier of this object(definition) within the metadata repository.

Parameters:
name - name to be assigned to this WorkAssignment. Name is also used as the default display name unless otherwise specifially set.
description - description for this WorkAssignment, or null if none.
objectId - unique identifier of this object in the metadata repository. The identifier is set which this object is MetadataService.

WorkAssignment

public WorkAssignment(java.lang.String name,
                      java.lang.String description,
                      org.w3c.dom.Document specialization,
                      java.util.Collection<MetadataObjectId> workshifts,
                      boolean active)
Constructor to create a fully-defined WorkAssignment.

Parameters:
name - name of the WorkAssignment. Name is also used as the default display name unless otherwise specifially set.
description - the description for this WorkAssignment, or null if none.
specialization - XML fragment that defines the specialization rules for this WorkAssignment.
workshifts - collection of the names of one or more Workshift definitions to be associated with this WorkAssignment.
active - true if the work assignment is active; false if it is not active.

WorkAssignment

public WorkAssignment(java.lang.String name,
                      java.lang.String displayNameKey,
                      java.lang.String descriptionKey,
                      org.w3c.dom.Document specialization,
                      java.util.Collection<MetadataObjectId> workshifts,
                      boolean active,
                      java.lang.String[] resourceBundleIDs)
Constructor to create a fully-defined WorkAssignment and associated resource bundles.

Parameters:
name - name of the WorkAssignment. Name is also used as the default display name unless otherwise specifially set.
displayNameKey - optional key of the entry in the resourcebundles to lookup the name.
descriptionKey - optional key of the entry in the resourcebundles to lookup the description.
specialization - the XML fragment that defines the specialization rules for this WorkAssignment.
workshifts - a collection of the names of one or more Workshift definitions to be associated with this WorkAssignment.
active - true if the work assignment is active; false if it is not active.
resourceBundleIDs - optional array of resource bundle id.
Method Detail

addWorkshifts

public void addWorkshifts(java.util.Collection<MetadataObjectId> objectIds)
Adds a list of workshifts to this WorkAssignment. The list of workshifts are identified by the names of the workshifts that exist in the system.

When this WorkAssignment definition is persisted in the metadata repository using the metadata services, the metadata service validates that the workshifts referred by the names in the argument exist in the system.

Parameters:
objectIds - the list of workshifts to be associated to this WorkAssignment.

addWorkshift

public void addWorkshift(MetadataObjectId objectId)
Adds a workshift to this WorkAssignment. The workshift is appended to list of workshifts already associated with this WorkAssignment.

When this WorkAssignment definition is persisted in the metadata repository using the metadata services, the metadata service validates that the workshift referred by the name in the argument exist in the system.

Parameters:
objectId - the identifier of workshift to be associated to this WorkAssignment.

getWorkshifts

public java.util.Collection<MetadataObjectId> getWorkshifts()
Returns the workshifts that are associated with this WorkAssignment. The method returns the metadata identifer of the workshifts.

The actual Workshift definitions can be retrieved by calling corresponding methods in the metdata services.

Returns:
collection of the identifiers of the Workshifts associated with this WorkAssignment.

removeWorkshift

public void removeWorkshift(MetadataObjectId objectId)
Removes a workshift from this WorkAssignment.

Parameters:
objectId - the identifier of the Workshift to be removed.

getSpecializationRules

public org.w3c.dom.Document getSpecializationRules()
Retrieves the specialization rules defined in this WorkAssignment.

Returns:
specialization rules in XML format.

setSpecializationRules

public void setSpecializationRules(org.w3c.dom.Document doc)
Sets the specialization rules for this WorkAssignment.

These rules are specified as an XML fragment that must comply with the specified XML schema. The enforcement and validation of the XML fragment against the schema is done when the WorkAssignment is persisted using the metadata services.

Parameters:
doc - the XML fragment that contains the specialization rule.

isEnabled

public boolean isEnabled()
Checks if the work assignment definition is enabled.

Returns:
true if enabled, or {code false} is disabled.

setEnabled

public void setEnabled(boolean value)
Enables or disables the work assignment.

Parameters:
value - true to enable; false to disable.

isActive

@Deprecated
public boolean isActive()
Deprecated. Replaced by isEnabled()

Checks if the work assignment definition is enabled or not.

Returns:
true if enabled, or {code false} otherwise.

setActive

@Deprecated
public void setActive(boolean value)
Deprecated. Replaced by setEnabled(boolean)

Enables or disables the work assignment.

Parameters:
value - true to enable, false to disable.

validateCustom

protected void validateCustom()
                       throws ValidationException
Validates this instance of WorkAssignment.

The method performs checks that are possible on this object. It does not ensure the existence of objects referenced by this definition. Such references and related validations are done by the MetadataService at the time of object persistence.

MetadataService also calls this method to ensure only valid objects are persisted.

Specified by:
validateCustom in class BaseMetadata<WorkAssignment>
Throws:
ValidationException - thrown if any invalid data is detected.

validateBound

public void validateBound()
                   throws ValidationException
Validates this as a bound WorkAssignment. The validation for a bound WorkAssignment is more stringent than for a non-bound one. This method also performs the basic validation.

The method performs checks that are possible on this object. It does not ensure the existence of objects referenced by this definition. Such references and related validations are done by the MetadataService at the time of object persistence.

MetadataService also calls this method to ensure only valid objects are persisted.

Throws:
ValidationException - thrown if any invalid data is detected.

equals

public boolean equals(java.lang.Object obj)
Compares an object for equality with this WorkAssignment object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with this WorkAssignment.
Returns:
true if the object is an instance of WorkAssignment and is equal to this WorkAssignment, or false otherwise.

toDebugString

public java.lang.String toDebugString()
Returns a debug string representation for this WorkAssignment object.

Returns:
debug String representation of WorkAssignment JobSet.

toString

public java.lang.String toString()
Overrides:
toString in class BaseMetadata<WorkAssignment>

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<WorkAssignment>

from

public static WorkAssignment 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 WorkAssignment getSelf()
Specified by:
getSelf in class BaseMetadata<WorkAssignment>

getBaseMetadataType

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

clone

public WorkAssignment clone(java.lang.String newName)
Specified by:
clone in class BaseMetadata<WorkAssignment>

Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.5)
E20742-01


Copyright © 2008, 2011 Oracle. All rights reserved.