com.waveset.provision
Class ResourceOp

java.lang.Object
  extended bycom.waveset.provision.ResourceOp

public class ResourceOp
extends java.lang.Object

An object representing one operation to be performed on a particular resource. The provisioning engine builds up a list of these after comparing the resource accounts currently held on the user, with those specified by the role and private account references on the user.

These became more complex with the introduction of multiple provisioning threads, and support for provisioning order dependencies. OPs have a "state" field that indicates whether they're waiting to be processed, currently being processed, or finished processing. Each OP may have a pointer to a dependent OP that must be finished before this OP can be processed.

ResourceOp objects are collected inside a OpBucket object, the provisioning engine may create several op buckets for various sinister purposes.

Each OP now contains a WavesetResult object used to collect adapter messages for this operation.


Field Summary
static java.lang.String code_id
           
static java.lang.String CREATE
          Constants specifying the operation we're performing.
static java.lang.String DELETE
           
static java.lang.String FETCH
           
static int FINISHED
           
static int PROCESSING
           
static int READY
          States an operation can be in.
static java.lang.String UPDATE
           
 
Constructor Summary
ResourceOp(java.lang.String op, ResourceInfo info)
          Construct a resource OP given an OP code and a resource Made public for IDMX.
 
Method Summary
 void disconnect()
           
 void dumpFile(java.lang.String file)
           
 ResourceAdapter findAdapter(ObjectCache cache)
          Create the resource adapter associated with the resource.
static ResourceAdapter findAdapter(Resource res, ObjectCache cache)
          Create the resource adapter associated with the resource.
 ResourceAdapter getAdapter()
          Get the resource adapter associated with this resource.
 OpBucket getBucket()
           
 ResourceOp getDependentOp()
           
 long getEndDate()
           
 java.lang.String getOp()
           
 Resource getResource()
           
 ResourceInfo getResourceInfo()
           
 ResourceResult getResult()
           
 long getStartDate()
           
 int getState()
           
 WSUser getUser()
           
 boolean isCreate()
           
 boolean isDelete()
           
 boolean isFetch()
           
 boolean isFinished()
           
 boolean isReady()
           
 boolean isUpdate()
           
 void setBucket(OpBucket b)
           
 void setDependentOp(ResourceOp op)
           
 void setOp(java.lang.String op)
           
 void setResource(Resource res)
          Setter only necessary if we determine later that resource attributes need to be overridden.
 void setResult(ResourceResult result)
           
 void setState(int value)
           
 void setUser(WSUser user)
           
 java.lang.String toIdentityString()
           
 java.lang.String toString()
           
 java.lang.String toSummaryString()
           
 java.lang.String toVerboseString()
           
 java.lang.String toVerboseString(java.lang.String linePrefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

CREATE

public static final java.lang.String CREATE
Constants specifying the operation we're performing.

See Also:
Constant Field Values

UPDATE

public static final java.lang.String UPDATE
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

FETCH

public static final java.lang.String FETCH
See Also:
Constant Field Values

READY

public static final int READY
States an operation can be in.

See Also:
Constant Field Values

PROCESSING

public static final int PROCESSING
See Also:
Constant Field Values

FINISHED

public static final int FINISHED
See Also:
Constant Field Values
Constructor Detail

ResourceOp

public ResourceOp(java.lang.String op,
                  ResourceInfo info)
           throws WavesetException
Construct a resource OP given an OP code and a resource Made public for IDMX.

Method Detail

setOp

public void setOp(java.lang.String op)

setResult

public void setResult(ResourceResult result)

setState

public void setState(int value)

setBucket

public void setBucket(OpBucket b)

setUser

public void setUser(WSUser user)

setDependentOp

public void setDependentOp(ResourceOp op)

setResource

public void setResource(Resource res)
Setter only necessary if we determine later that resource attributes need to be overridden.


disconnect

public void disconnect()

toString

public java.lang.String toString()

getOp

public java.lang.String getOp()

getResourceInfo

public ResourceInfo getResourceInfo()

getResource

public Resource getResource()

getUser

public WSUser getUser()

getState

public int getState()

isReady

public boolean isReady()

isFinished

public boolean isFinished()

isCreate

public boolean isCreate()

isUpdate

public boolean isUpdate()

isDelete

public boolean isDelete()

isFetch

public boolean isFetch()

getBucket

public OpBucket getBucket()

getResult

public ResourceResult getResult()

getDependentOp

public ResourceOp getDependentOp()

getAdapter

public ResourceAdapter getAdapter()
Get the resource adapter associated with this resource.


findAdapter

public ResourceAdapter findAdapter(ObjectCache cache)
                            throws WavesetException
Create the resource adapter associated with the resource. We'll do these for all ops in one pass before handing them off to the iterators. Note that this must be done after we know for sure what _resource we will use. This won't be the same one that is inside ResourceInfo if we have to override resource attributes.

Throws:
WavesetException

findAdapter

public static ResourceAdapter findAdapter(Resource res,
                                          ObjectCache cache)
                                   throws WavesetException
Create the resource adapter associated with the resource. We'll do these for all ops in one pass before handing them off to the iterators. Note that this must be done after we know for sure what _resource we will use. This won't be the same one that is inside ResourceInfo if we have to override resource attributes.

Throws:
WavesetException

dumpFile

public void dumpFile(java.lang.String file)

toVerboseString

public java.lang.String toVerboseString()

toIdentityString

public java.lang.String toIdentityString()

toVerboseString

public java.lang.String toVerboseString(java.lang.String linePrefix)

toSummaryString

public java.lang.String toSummaryString()

getEndDate

public long getEndDate()

getStartDate

public long getStartDate()