com.ibm.tws.objects.plan
Class ResourceInPlan

java.lang.Object
  extended bycom.ibm.tws.objects.plan.ResourceInPlan
All Implemented Interfaces:
java.io.Serializable, TWSHeader, TWSObject

public class ResourceInPlan
extends java.lang.Object
implements TWSObject, TWSHeader

The ResourceInPlan object, representing a TWS logical resource wraps a ResourceKey, which references the target workstation through a WorkstationInPlanKey.

The following syntax validation constraints must be met on ResourceInPlan objects in distributed environment:

name Name of an existing plan resource.
workstationKey Reference to an existing workstation
description N/A
availableResources Value between 0 and 1024. Default is 0.
usedResources Read Only. Value between 0 and 1024.
holders List of ResourceHolderInPlan class.
Read Only.
status One of the memebers of ResourceStatusType class
Read Only.

The following syntax validation constraints must be met on ResourceInPlan objects in zOS environment:

name Always required
Not longer than 44 characters
description Not longer than 46 characters
resourceAvailabilityIntervals List of ResourceInPlanAvailabilityInterval
See ResourceInPlanAvailabilityInterval for constraints on this field
defaultConstraints List of ResourceInPlanConstraints
See ResourceInPlanConstraints for constraints on this field
status Output only. Return one of the values defined in ResourceStatusType class
workstationKey N/A
availableResources N/A
usedResources N/A
holders N/A

See Also:
com.ibm.tws.objects.plan.types.ResourceInPlanAvailabilityInterval;, com.ibm.tws.objects.plan.types.ResourceInPlanConstraints;, com.ibm.tws.objects.plan.types.ResourceStatusType;, Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright.
 
Constructor Summary
ResourceInPlan()
          Empty Constructor
ResourceInPlan(Identifier id)
          Constructor.
ResourceInPlan(Identifier id, ResourceInPlanKey key)
          Constructor.
ResourceInPlan(ResourceInPlanKey key)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
          equality method.
 int getAvailableResources()
          Returns the number of available resources.
 ResourceInPlanConstraints getDefaultConstraints()
          z/OS only method.
 java.lang.String getDescription()
          Returns the Resource description.
 java.util.List getHolders()
          Returns the list of ResourceHolderInPlan (i.e.
 Identifier getId()
          Returns the Resource Identifier
 ResourceInPlanKey getKey()
          Returns the Resource key
 LockData getLockData()
          Return the object's LockData.
 ModifyData getModifyData()
          Return the object's ModifyData.
 java.lang.String getName()
          Returns the Resource Name
 int getNumberOfAvailaibilityIntervals()
          z/OS only method.
 TWSHeader getObjectHeader()
          Returns the object's header.
 TWSKey getObjectKey()
          Returns the object's key.
 java.util.List getResourceInPlanAvailaibilityIntervals()
          z/OS only method.
 ResourceStatusType getStatus()
          Returns the resource status Valid values are: Available, Not Avaliable, Undecided.
 int getUsedResources()
          Returns the number of used resources
 Identifier getWorkstationId()
          Returns the referenced Workstation Identifier.
 WorkstationInPlanKey getWorkstationKey()
          Returns the Resource Workstation key.
 int hashCode()
          Returns a hash code for this ResourceInPlan object.
 void setAvailableResources(int i)
          Sets the number of available resources.
 void setDefaultConstraints(ResourceInPlanConstraints constraints)
          Sets the default resource constraints.
 void setDescription(java.lang.String description)
          Sets the Resource description
 void setHolders(java.util.List list)
          Deprecated.  
 void setId(Identifier identifier)
          Sets the Resource Ientifier.
 void setKey(ResourceInPlanKey key)
          Sets the Resource Key.
 void setModifyData(ModifyData modData)
          z/OS specific method For internal use only.
 void setName(java.lang.String name)
          Sets the Resource key name.
 void setStatus(ResourceStatusType type)
          Sets the Resource status For internal use only.
 void setUsedResources(int i)
          Sets the number of used Resources For internal use only.
 void setWorkstationId(Identifier identifier)
          The Identifier of the referenced Workstation.
 void setWorkstationKey(WorkstationInPlanKey key)
          Sets the Workstation key.
 java.lang.String toString()
          Returns a string representation of this ResourceInPlan.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright.

Constructor Detail

ResourceInPlan

public ResourceInPlan()
Empty Constructor


ResourceInPlan

public ResourceInPlan(Identifier id)
Constructor.

Parameters:
id - The Resource Identifier

ResourceInPlan

public ResourceInPlan(ResourceInPlanKey key)
Constructor.

Parameters:
key - The Resource key

ResourceInPlan

public ResourceInPlan(Identifier id,
                      ResourceInPlanKey key)
Constructor.

Parameters:
id - The Resource Identifier
key - The Resource key
Method Detail

getId

public Identifier getId()
Returns the Resource Identifier

Specified by:
getId in interface TWSObject
Returns:
The Resource Identifier
See Also:
TWSHeader.getId()

getName

public java.lang.String getName()
Returns the Resource Name

Specified by:
getName in interface TWSObject
Returns:
The Resource name.
See Also:
TWSHeader.getName()

setName

public void setName(java.lang.String name)
Sets the Resource key name.

Parameters:
name - the Resource Key name.

getObjectKey

public TWSKey getObjectKey()
Returns the object's key.

Specified by:
getObjectKey in interface TWSObject
Returns:
the object's key.
See Also:
TWSHeader.getObjectKey()

getWorkstationKey

public WorkstationInPlanKey getWorkstationKey()
Returns the Resource Workstation key.

Returns:
the Resource Workstation key.

getObjectHeader

public TWSHeader getObjectHeader()
Returns the object's header. In this case it returns the object itself.

Specified by:
getObjectHeader in interface TWSObject
Returns:
the object's header.
See Also:
TWSObject.getObjectHeader()

getModifyData

public ModifyData getModifyData()
Return the object's ModifyData. For all the plan object it returns null.

Specified by:
getModifyData in interface TWSObject
Returns:
the object's ModifyData.
See Also:
TWSHeader.getModifyData()

getLockData

public LockData getLockData()
Return the object's LockData. For all the plan object it returns null.

Specified by:
getLockData in interface TWSObject
Returns:
the object's LockData.
See Also:
TWSHeader.getLockData()

getAvailableResources

public int getAvailableResources()
Returns the number of available resources.

Returns:
the number of available resources.

getHolders

public java.util.List getHolders()
Returns the list of ResourceHolderInPlan (i.e. Jobs or Job Streams) that holds this resource

Returns:
the list of holders

getKey

public ResourceInPlanKey getKey()
Returns the Resource key

Returns:
the resource key.

getUsedResources

public int getUsedResources()
Returns the number of used resources

Returns:
the number of used resources

getWorkstationId

public Identifier getWorkstationId()
Returns the referenced Workstation Identifier.

Returns:
the referenced Workstation Identifier.

setAvailableResources

public void setAvailableResources(int i)
Sets the number of available resources.

Parameters:
i - the number of available resources.

getStatus

public ResourceStatusType getStatus()
Returns the resource status Valid values are: Available, Not Avaliable, Undecided.

Returns:
returns the resource status

getDescription

public java.lang.String getDescription()
Returns the Resource description.

Returns:
Returns the description.

getDefaultConstraints

public ResourceInPlanConstraints getDefaultConstraints()
z/OS only method.

Returns:
The default resource constraits.

getResourceInPlanAvailaibilityIntervals

public java.util.List getResourceInPlanAvailaibilityIntervals()
z/OS only method.

Returns:
A list of ResourceInPlanAvailabilityInterval objects

getNumberOfAvailaibilityIntervals

public int getNumberOfAvailaibilityIntervals()
z/OS only method.

Returns:
The number of availability Intervals

setId

public void setId(Identifier identifier)
Sets the Resource Ientifier.

Parameters:
identifier -

setHolders

public void setHolders(java.util.List list)
Deprecated.  

Sets the holders of this Resource. For internal use only.

Parameters:
list - the new Resource Holders list.

setKey

public void setKey(ResourceInPlanKey key)
Sets the Resource Key.

Parameters:
key - the Resource key.

setWorkstationKey

public void setWorkstationKey(WorkstationInPlanKey key)
Sets the Workstation key. For Internal UIse Only

Parameters:
key - The workstation key.

setUsedResources

public void setUsedResources(int i)
Sets the number of used Resources For internal use only.

Parameters:
i - The number of used Resources.

setWorkstationId

public void setWorkstationId(Identifier identifier)
The Identifier of the referenced Workstation.

Parameters:
identifier - The Workstation Identifier.

setStatus

public void setStatus(ResourceStatusType type)
Sets the Resource status For internal use only.

Parameters:
type - the Resource status.

setDescription

public void setDescription(java.lang.String description)
Sets the Resource description

Parameters:
description - The description to set.

setDefaultConstraints

public void setDefaultConstraints(ResourceInPlanConstraints constraints)
Sets the default resource constraints. z/OS specific method.

Parameters:
constraints - The default resource constraints.

setModifyData

public void setModifyData(ModifyData modData)
z/OS specific method For internal use only.

Parameters:
modData - the new modify Data.

equals

public boolean equals(java.lang.Object object)
equality method.

Parameters:
object - the object to be compared.
Returns:
true of object is equal to this one.

hashCode

public int hashCode()
Returns a hash code for this ResourceInPlan object.

Returns:
The object's hash code.

toString

public java.lang.String toString()
Returns a string representation of this ResourceInPlan.

Returns:
A text string including all ResourceInPlan fields.


Copyright © 2005 IBM All Rights Reserved.