summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java')
-rw-r--r--pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java b/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java
index 410e3b2c3..ddb1dae2a 100644
--- a/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java
+++ b/pki/base/common/src/com/netscape/certsrv/request/AgentApprovals.java
@@ -17,21 +17,19 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.certsrv.request;
-
import java.io.Serializable;
import java.util.Date;
import java.util.Enumeration;
import java.util.Vector;
-
/**
- * A collection of AgentApproval objects.
+ * A collection of AgentApproval objects.
* <single-threaded>
- *
+ *
* @version $Revision$, $Date$
*/
public class AgentApprovals
- implements Serializable {
+ implements Serializable {
/**
*
@@ -41,15 +39,13 @@ public class AgentApprovals
/**
* Adds an approval to approval's list.
* <p>
- * If an approval is already present for this user,
- * it is updated with a new date. Otherwise a new
- * value is inserted.
- *
+ * If an approval is already present for this user, it is updated with a new date. Otherwise a new value is inserted.
+ *
* @param userName user name of the approving agent
*/
public void addApproval(String userName) {
AgentApproval a = findApproval(userName);
-
+
// update existing approval
if (a != null) {
a.mDate = new Date(); /* CMS.getCurrentDate(); */
@@ -63,9 +59,8 @@ public class AgentApprovals
/**
* Removes an approval from approval's list.
* <p>
- * If there is no approval for this userName, this
- * call does nothing.
- *
+ * If there is no approval for this userName, this call does nothing.
+ *
* @param userName user name of the approving agent
*/
public void removeApproval(String userName) {
@@ -77,7 +72,7 @@ public class AgentApprovals
/**
* Finds an existing AgentApproval for the named user.
- *
+ *
* @param userName user name of the approving agent
* @return an AgentApproval object
*/
@@ -88,7 +83,8 @@ public class AgentApprovals
for (int i = 0; i < mVector.size(); i++) {
a = (AgentApproval) mVector.elementAt(i);
- if (a.mUserName.equals(userName)) break;
+ if (a.mUserName.equals(userName))
+ break;
}
return a;
@@ -96,7 +92,7 @@ public class AgentApprovals
/**
* Returns an enumeration of the agent approvals
- *
+ *
* @return an enumeration of the agent approvals
*/
public Enumeration elements() {
@@ -106,10 +102,11 @@ public class AgentApprovals
/**
* Returns the AgentApprovals as a Vector of strings.
* Each entry in the vector is of the format:
- * epoch;username
+ * epoch;username
* where epoch is the date.getTime()
* <p>
* This is used for serialization in Request.setExtData().
+ *
* @return The string vector.
*/
public Vector toStringVector() {
@@ -125,6 +122,7 @@ public class AgentApprovals
/**
* Recreates an AgentApprovals instance from a Vector of strings that
* was created by toStringVector().
+ *
* @param stringVector The vector of strings to translate
* @return the AgentApprovals instance or null if it can't be translated.
*/
@@ -135,7 +133,7 @@ public class AgentApprovals
AgentApprovals approvals = new AgentApprovals();
for (int i = 0; i < stringVector.size(); i++) {
try {
- String approvalString = (String)stringVector.get(i);
+ String approvalString = (String) stringVector.get(i);
String[] parts = approvalString.split(";", 2);
if (parts.length != 2) {
return null;