KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > authorization > AdminInformation


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 /*
15  * AdminInformation.java
16  *
17  * Created on den 19 juli 2002, 11:53
18  */

19
20 package org.ejbca.core.model.authorization;
21
22 import java.security.cert.X509Certificate JavaDoc;
23
24 /**
25  * A class used to send user information to the authorization tree. It can contain types of information, a X509Certificate or a
26  * special user type when certificates cannot be retrieved. Special usertype constants is specified in AdminEntity class.
27  *
28  * @version $Id: AdminInformation.java,v 1.1 2006/01/17 20:30:56 anatom Exp $
29  */

30 public class AdminInformation implements java.io.Serializable JavaDoc {
31
32     // Public Methods
33
/** Creates a new instance of AdminInformation */
34     public AdminInformation(X509Certificate JavaDoc certificate){
35       this.certificate=certificate;
36       this.specialuser=0;
37     }
38     
39     public AdminInformation(int specialuser) {
40       this.specialuser=specialuser;
41       
42     }
43     
44     public AdminInformation(AdminGroup admingroup) {
45       this.specialuser=0;
46       this.admingroup= admingroup;
47     }
48
49
50     public boolean isSpecialUser() {
51       return this.specialuser!=0;
52     }
53     
54     public boolean isGroupUser() {
55       return this.admingroup != null;
56     }
57
58     public X509Certificate JavaDoc getX509Certificate() {
59       return this.certificate;
60     }
61
62     public int getSpecialUser() {
63       return this.specialuser;
64     }
65     
66     public int getGroupId(){
67       return this.admingroup.getAdminGroupId();
68     }
69
70     // Private fields
71
private X509Certificate JavaDoc certificate;
72     private int specialuser = 0;
73     private AdminGroup admingroup = null;
74 }
75
Popular Tags