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.java69
1 files changed, 38 insertions, 31 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 a0f7133a..028f55a8 100644
--- a/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
+++ b/pki/base/common/src/com/netscape/certsrv/authorization/AuthzToken.java
@@ -17,21 +17,19 @@
// --- 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
- * the AuthzToken, the plugin name of the authorization manager, time of
- * authorization happened, name of the resource, type of operation performed
- * on the resource.
+ * Authorization token returned by Authorization Managers. Upon return, it
+ * contains the name of the authorization manager that create the AuthzToken,
+ * the plugin name of the authorization manager, time of authorization happened,
+ * name of the resource, type of operation performed on the resource.
* <p>
+ *
* @version $Revision$, $Date$
*/
public class AuthzToken implements IAttrSet {
@@ -43,19 +41,19 @@ public class AuthzToken implements IAttrSet {
private Hashtable mAttrs = null;
/**
- * Plugin name of the authorization manager that created the
- * AuthzToken as a string.
+ * Plugin name of the authorization manager that created the AuthzToken as a
+ * string.
*/
public static final String TOKEN_AUTHZMGR_IMPL_NAME = "authzMgrImplName";
/**
- * Name of the authorization manager that created the AuthzToken
- * as a string.
+ * Name of the authorization manager that created the AuthzToken as a
+ * string.
*/
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";
@@ -65,7 +63,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";
@@ -73,41 +71,45 @@ 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>
+ * 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();
- 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);
}
/**
- * Used by an Authorization manager to set an attribute and value
- * in the AuthzToken.
+ * Used by an Authorization manager to set an attribute and value in the
+ * AuthzToken.
+ *
* @param attrName The name of the attribute
* @param value The value of the attribute to set.
*/
@@ -117,6 +119,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) {
@@ -125,6 +128,7 @@ public class AuthzToken implements IAttrSet {
/**
* Enumerate all attribute names in the AuthzToken.
+ *
* @return Enumeration of all attribute names in this AuthzToken.
*/
public Enumeration getElements() {
@@ -133,6 +137,7 @@ public class AuthzToken implements IAttrSet {
/**
* Enumerate all attribute values in the AuthzToken.
+ *
* @return Enumeration of all attribute names in this AuthzToken.
*/
public Enumeration getVals() {
@@ -140,10 +145,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
- * this token.
+ * 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));
@@ -152,8 +158,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));
@@ -161,10 +168,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));
}
}
-