org.enhydra.shark
Class WfResourceWrapper

java.lang.Object
  extended by org.enhydra.shark.WfResourceWrapper
All Implemented Interfaces:
java.io.Serializable, BaseBusinessObject, WfResource

public class WfResourceWrapper
extends java.lang.Object
implements WfResource, java.io.Serializable

WfResourceWrapper - Workflow Resource Object implementation.

Author:
Sasa Bojanic, Vladimir Puskas
See Also:
Serialized Form

Field Summary
protected  WMSessionHandle shandle
           
protected  java.lang.String username
           
 
Constructor Summary
protected WfResourceWrapper(WMSessionHandle shandle, java.lang.String username)
          Creates a new WfResource.
 
Method Summary
protected  void checkSecurity(java.lang.String methodName, java.util.Map d)
           
 boolean equals(java.lang.Object obj)
          It is assumed that there can't be two or more resources that have the same resource key.
 WfAssignmentIterator get_iterator_work_item()
          Gets an iterator of work items.
 WfAssignment[] get_sequence_work_item(int max_number)
          Gets the work items.
protected  WfResourceInternal getResourceImpl(java.lang.String uname)
           
 int hashCode()
           
 int how_many_work_item()
          Gets the number of work items currently assigned to this resource.
 boolean is_member_of_work_items(WfAssignment member)
          Checks if an assignment object is associated with this resource.
 void release(WfAssignment from_assigment, java.lang.String release_info)
          Releases the resouce from the assignment.
 java.lang.String resource_key()
          Gets the resource username.
 java.lang.String resource_name()
          Gets the resource name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

shandle

protected WMSessionHandle shandle

username

protected java.lang.String username
Constructor Detail

WfResourceWrapper

protected WfResourceWrapper(WMSessionHandle shandle,
                            java.lang.String username)
Creates a new WfResource.

Parameters:
username - uniquely identifies the resource.
Method Detail

how_many_work_item

public int how_many_work_item()
                       throws java.lang.Exception
Gets the number of work items currently assigned to this resource.

Specified by:
how_many_work_item in interface WfResource
Throws:
java.lang.Exception

get_iterator_work_item

public WfAssignmentIterator get_iterator_work_item()
                                            throws java.lang.Exception
Gets an iterator of work items.

Specified by:
get_iterator_work_item in interface WfResource
Throws:
java.lang.Exception

get_sequence_work_item

public WfAssignment[] get_sequence_work_item(int max_number)
                                      throws java.lang.Exception
Gets the work items.

Specified by:
get_sequence_work_item in interface WfResource
Returns:
List of WfAssignment objects.
Throws:
java.lang.Exception

is_member_of_work_items

public boolean is_member_of_work_items(WfAssignment member)
                                throws java.lang.Exception
Checks if an assignment object is associated with this resource.

Specified by:
is_member_of_work_items in interface WfResource
Returns:
true if assignment is part of the work list for this resource.
Throws:
java.lang.Exception

resource_key

public java.lang.String resource_key()
                              throws java.lang.Exception
Gets the resource username.

Specified by:
resource_key in interface WfResource
Throws:
java.lang.Exception

resource_name

public java.lang.String resource_name()
                               throws java.lang.Exception
Gets the resource name.

Specified by:
resource_name in interface WfResource
Throws:
java.lang.Exception

release

public void release(WfAssignment from_assigment,
                    java.lang.String release_info)
             throws java.lang.Exception,
                    NotAssigned
Releases the resouce from the assignment.

Specified by:
release in interface WfResource
Throws:
java.lang.Exception
NotAssigned

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
It is assumed that there can't be two or more resources that have the same resource key.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

checkSecurity

protected void checkSecurity(java.lang.String methodName,
                             java.util.Map d)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getResourceImpl

protected WfResourceInternal getResourceImpl(java.lang.String uname)
                                      throws java.lang.Exception
Throws:
java.lang.Exception