com.netscape.certsrv.request
Class AgentApprovals

java.lang.Object
  extended by com.netscape.certsrv.request.AgentApprovals
All Implemented Interfaces:
java.io.Serializable

public class AgentApprovals
extends java.lang.Object
implements java.io.Serializable

A collection of AgentApproval objects.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
Serialized Form

Field Summary
protected  java.util.Vector mVector
           
 
Constructor Summary
AgentApprovals()
           
 
Method Summary
 void addApproval(java.lang.String userName)
          Adds an approval to approval's list.
 java.util.Enumeration elements()
          Returns an enumeration of the agent approvals
 AgentApproval findApproval(java.lang.String userName)
          Finds an existing AgentApproval for the named user.
static AgentApprovals fromStringVector(java.util.Vector stringVector)
          Recreates an AgentApprovals instance from a Vector of strings that was created by toStringVector().
 void removeApproval(java.lang.String userName)
          Removes an approval from approval's list.
 java.util.Vector toStringVector()
          Returns the AgentApprovals as a Vector of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mVector

protected java.util.Vector mVector
Constructor Detail

AgentApprovals

public AgentApprovals()
Method Detail

addApproval

public void addApproval(java.lang.String userName)
Adds an approval to approval's list.

If an approval is already present for this user, it is updated with a new date. Otherwise a new value is inserted.

Parameters:
userName - user name of the approving agent

removeApproval

public void removeApproval(java.lang.String userName)
Removes an approval from approval's list.

If there is no approval for this userName, this call does nothing.

Parameters:
userName - user name of the approving agent

findApproval

public AgentApproval findApproval(java.lang.String userName)
Finds an existing AgentApproval for the named user.

Parameters:
userName - user name of the approving agent
Returns:
an AgentApproval object

elements

public java.util.Enumeration elements()
Returns an enumeration of the agent approvals

Returns:
an enumeration of the agent approvals

toStringVector

public java.util.Vector toStringVector()
Returns the AgentApprovals as a Vector of strings. Each entry in the vector is of the format: epoch;username where epoch is the date.getTime()

This is used for serialization in Request.setExtData().

Returns:
The string vector.

fromStringVector

public static AgentApprovals fromStringVector(java.util.Vector stringVector)
Recreates an AgentApprovals instance from a Vector of strings that was created by toStringVector().

Parameters:
stringVector - The vector of strings to translate
Returns:
the AgentApprovals instance or null if it can't be translated.