01: /*************************************************************************
02: * *
03: * EJBCA: The OpenSource Certificate Authority *
04: * *
05: * This software is free software; you can redistribute it and/or *
06: * modify it under the terms of the GNU Lesser General Public *
07: * License as published by the Free Software Foundation; either *
08: * version 2.1 of the License, or any later version. *
09: * *
10: * See terms of license at gnu.org. *
11: * *
12: *************************************************************************/package org.ejbca.core.model.authorization;
13:
14: import java.security.cert.X509Certificate;
15:
16: /**
17: * A class used to send user information to the authorization tree. It can contain types of information, a X509Certificate or a
18: * special user type when certificates cannot be retrieved. Special usertype constants is specified in AdminEntity class.
19: *
20: * @version $Id: AdminInformation.java,v 1.1 2006/01/17 20:30:56 anatom Exp $
21: */
22: public class AdminInformation implements java.io.Serializable {
23:
24: // Public Methods
25: /** Creates a new instance of AdminInformation */
26: public AdminInformation(X509Certificate certificate) {
27: this .certificate = certificate;
28: this .specialuser = 0;
29: }
30:
31: public AdminInformation(int specialuser) {
32: this .specialuser = specialuser;
33:
34: }
35:
36: public AdminInformation(AdminGroup admingroup) {
37: this .specialuser = 0;
38: this .admingroup = admingroup;
39: }
40:
41: public boolean isSpecialUser() {
42: return this .specialuser != 0;
43: }
44:
45: public boolean isGroupUser() {
46: return this .admingroup != null;
47: }
48:
49: public X509Certificate getX509Certificate() {
50: return this .certificate;
51: }
52:
53: public int getSpecialUser() {
54: return this .specialuser;
55: }
56:
57: public int getGroupId() {
58: return this .admingroup.getAdminGroupId();
59: }
60:
61: // Private fields
62: private X509Certificate certificate;
63: private int specialuser = 0;
64: private AdminGroup admingroup = null;
65: }
|