summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java')
-rw-r--r--pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java46
1 files changed, 27 insertions, 19 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java b/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
index 0b5db00a..b6e2d144 100644
--- a/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
+++ b/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
@@ -17,14 +17,12 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.certsrv.authorization;
-
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import com.netscape.certsrv.base.IAttrSet;
-
/**
* Authorization token returned by Authorization Managers.
* Upon return, it contains the name of the authorization manager that create
@@ -32,6 +30,7 @@ import com.netscape.certsrv.base.IAttrSet;
* authorization happened, name of the resource, type of operation performed
* on the resource.
* <p>
+ *
* @version $Revision$, $Date$
*/
public class AuthzToken implements IAttrSet {
@@ -39,7 +38,7 @@ public class AuthzToken implements IAttrSet {
private Hashtable<String, Object> mAttrs = null;
/**
- * Plugin name of the authorization manager that created the
+ * Plugin name of the authorization manager that created the
* AuthzToken as a string.
*/
public static final String TOKEN_AUTHZMGR_IMPL_NAME = "authzMgrImplName";
@@ -51,7 +50,7 @@ public class AuthzToken implements IAttrSet {
public static final String TOKEN_AUTHZMGR_INST_NAME = "authzMgrInstName";
/**
- * Time of authorization as a java.util.Date
+ * Time of authorization as a java.util.Date
*/
public static final String TOKEN_AUTHZTIME = "authzTime";
@@ -61,7 +60,7 @@ public class AuthzToken implements IAttrSet {
public static final String TOKEN_AUTHZ_RESOURCE = "authzRes";
/**
- * name of the operation
+ * name of the operation
*/
public static final String TOKEN_AUTHZ_OPERATION = "authzOp";
@@ -69,33 +68,36 @@ public class AuthzToken implements IAttrSet {
* Status of the authorization evaluation
*/
public static final String TOKEN_AUTHZ_STATUS = "status";
-
+
/**
- * Constant for the success status of the authorization evaluation.
+ * Constant for the success status of the authorization evaluation.
*/
public static final String AUTHZ_STATUS_SUCCESS = "statusSuccess";
/**
* Constructs an instance of a authorization token.
* The token by default contains the following attributes: <br>
+ *
* <pre>
- * "authzMgrInstName" - The authorization manager instance name.
- * "authzMgrImplName" - The authorization manager plugin name.
- * "authzTime" - The - The time of authorization.
+ * "authzMgrInstName" - The authorization manager instance name.
+ * "authzMgrImplName" - The authorization manager plugin name.
+ * "authzTime" - The - The time of authorization.
* </pre>
+ *
* @param authzMgr The authorization manager that created this Token.
*/
public AuthzToken(IAuthzManager authzMgr) {
mAttrs = new Hashtable<String, Object>();
- mAttrs.put(TOKEN_AUTHZMGR_INST_NAME, authzMgr.getName());
- mAttrs.put(TOKEN_AUTHZMGR_IMPL_NAME, authzMgr.getImplName());
+ mAttrs.put(TOKEN_AUTHZMGR_INST_NAME, authzMgr.getName());
+ mAttrs.put(TOKEN_AUTHZMGR_IMPL_NAME, authzMgr.getImplName());
mAttrs.put(TOKEN_AUTHZTIME, new Date());
}
/**
* Get the value of an attribute in the AuthzToken
+ *
* @param attrName The attribute name
- * @return The value of attrName if any.
+ * @return The value of attrName if any.
*/
public Object get(String attrName) {
return mAttrs.get(attrName);
@@ -103,7 +105,8 @@ public class AuthzToken implements IAttrSet {
/**
* Used by an Authorization manager to set an attribute and value
- * in the AuthzToken.
+ * in the AuthzToken.
+ *
* @param attrName The name of the attribute
* @param value The value of the attribute to set.
*/
@@ -113,6 +116,7 @@ public class AuthzToken implements IAttrSet {
/**
* Removes an attribute in the AuthzToken
+ *
* @param attrName The name of the attribute to remove.
*/
public void delete(String attrName) {
@@ -121,6 +125,7 @@ public class AuthzToken implements IAttrSet {
/**
* Enumerate all attribute names in the AuthzToken.
+ *
* @return Enumeration of all attribute names in this AuthzToken.
*/
public Enumeration<String> getElements() {
@@ -129,6 +134,7 @@ public class AuthzToken implements IAttrSet {
/**
* Enumerate all attribute values in the AuthzToken.
+ *
* @return Enumeration of all attribute names in this AuthzToken.
*/
public Enumeration<Object> getVals() {
@@ -136,10 +142,11 @@ public class AuthzToken implements IAttrSet {
}
/**
- * Gets the name of the authorization manager instance that created
- * this token.
- * @return The name of the authorization manager instance that created
+ * Gets the name of the authorization manager instance that created
* this token.
+ *
+ * @return The name of the authorization manager instance that created
+ * this token.
*/
public String getAuthzManagerInstName() {
return ((String) mAttrs.get(TOKEN_AUTHZMGR_INST_NAME));
@@ -148,8 +155,9 @@ public class AuthzToken implements IAttrSet {
/**
* Gets the plugin name of the authorization manager that created this
* token.
+ *
* @return The plugin name of the authorization manager that created this
- * token.
+ * token.
*/
public String getAuthzManagerImplName() {
return ((String) mAttrs.get(TOKEN_AUTHZMGR_IMPL_NAME));
@@ -157,10 +165,10 @@ public class AuthzToken implements IAttrSet {
/**
* Gets the time of authorization.
+ *
* @return The time of authorization
*/
public Date getAuthzTime() {
return ((Date) mAttrs.get(TOKEN_AUTHZTIME));
}
}
-