?? authresult.java
字號:
/************************************************************************* * * * EJBCA: The OpenSource Certificate Authority * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package se.anatom.ejbca.samples;import java.util.Hashtable;/** * Class containing the complete result from an authenticateUser request. * * @author Original code by Peter Neemeth * @version $Id: AuthResult.java,v 1.4 2004/04/16 07:39:02 anatom Exp $ */public class AuthResult { /** Constants for grant and reject */ private static final boolean GRANT_STATUS = true; private static final boolean REJECT_STATUS = false; /** Default to rejecting a request */ private boolean status = REJECT_STATUS; //GRANT_STATUS or REJECT_STATUS /** What was the reason to reject this request? */ private String reason = ""; //No reason /** This Hashtable keeps all the name-value pairs in the result. */ private Hashtable resultHash = new Hashtable(); /** * Adds a new key, value pair to the grant response. * * @param key left hand value. Must be unique for this result * @param value right hand value */ public void add(final String key, final String value) { resultHash.put(key, value); } /** * DOCUMENT ME! * * @return reason for rejecting this request */ public String getReason() { return reason; } /** * Get result as Hashtable. * * @return hash table of results */ public Hashtable getResult() { return resultHash; } /** * Set status to GRANT */ public void grant() { status = GRANT_STATUS; } /** * DOCUMENT ME! * * @return true if the request was GRANTed */ public boolean granted() { return status == GRANT_STATUS; } /** * Set status to REJECT */ public void reject() { status = REJECT_STATUS; } /** * DOCUMENT ME! * * @return true if the request was REJECTed */ public boolean rejected() { return status == REJECT_STATUS; } /** * Set reason of rejected request. No default. * * @param newReason describing why the request was rejected */ public void setReason(final String newReason) { reason = newReason; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -