KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > ejb > authorization > AccessRulesDataBean


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 package org.ejbca.core.ejb.authorization;
15
16 import javax.ejb.CreateException JavaDoc;
17
18 import org.ejbca.core.ejb.BaseEntityBean;
19 import org.ejbca.core.model.authorization.AccessRule;
20
21
22 /** Entity bean should not be used directly, use though Session beans.
23  *
24  * Entity Bean representing accessrules in EJBCA authorization module
25  * Information stored:
26  * <pre>
27  * Access rule
28  * rule (accept of decline)
29  * isrecursive
30  * </pre>
31  *
32  *
33  * @ejb.bean
34  * description="This enterprise bean entity represents an access rule"
35  * display-name="AccessRuleDataEB"
36  * name="AccessRulesData"
37  * jndi-name="AccessRulesData"
38  * view-type="local"
39  * type="CMP"
40  * reentrant="False"
41  * cmp-version="2.x"
42  * transaction-type="Container"
43  * schema="AccessRulesDataBean"
44  *
45  * @ejb.pk
46  * generate="false"
47  * class="org.ejbca.core.ejb.authorization.AccessRulesPK"
48  * extends="java.lang.Object"
49  * implements="java.io.Serializable"
50  *
51  * @ejb.persistence table-name = "AccessRulesData"
52  *
53  * @ejb.transaction type="Required"
54  *
55  * @ejb.home
56  * generate="local"
57  * local-extends="javax.ejb.EJBLocalHome"
58  * local-class="org.ejbca.core.ejb.authorization.AccessRulesDataLocalHome"
59  *
60  * @ejb.interface
61  * generate="local"
62  * local-extends="javax.ejb.EJBLocalObject"
63  * local-class="org.ejbca.core.ejb.authorization.AccessRulesDataLocal"
64  *
65  * @version $Id: AccessRulesDataBean.java,v 1.4 2006/11/10 09:28:50 anatom Exp $
66  */

67 public abstract class AccessRulesDataBean extends BaseEntityBean
68 {
69     /**
70      * @ejb.persistence column-name="pK"
71      * @ejb.pk-field
72      */

73     public abstract int getPrimKey();
74     public abstract void setPrimKey(int primKey);
75
76     /**
77      * @ejb.persistence column-name="accessRule"
78      * @ejb.interface-method view-type="local"
79      */

80     public abstract String JavaDoc getAccessRule();
81     public abstract void setAccessRule(String JavaDoc accessrule);
82
83     /**
84      * @ejb.persistence column-name="rule"
85      * @ejb.interface-method view-type="local"
86      */

87     public abstract int getRule();
88     public abstract void setRule(int rule);
89
90     /**
91      * @ejb.persistence column-name="isRecursive"
92      * @ejb.interface-method view-type="local"
93      */

94     public abstract boolean getIsRecursive();
95     public abstract void setIsRecursive(boolean isrecursive);
96
97     /**
98      * Return the access rule transfer object
99      * @return the access rule transfer object
100      * @ejb.interface-method
101      */

102     public AccessRule getAccessRuleObject() {
103         return new AccessRule(getAccessRule(), getRule(), getIsRecursive());
104     }
105
106     /**
107      *
108      * @ejb.create-method
109      */

110     public AccessRulesPK ejbCreate(String JavaDoc admingroupname, int caid, String JavaDoc accessrule, int rule, boolean isrecursive) throws CreateException JavaDoc {
111         AccessRulesPK ret = new AccessRulesPK(admingroupname, caid, new AccessRule(accessrule, rule, isrecursive));
112         setPrimKey(ret.primKey);
113         setAccessRule(accessrule);
114         setRule(rule);
115         setIsRecursive(isrecursive);
116         debug("Created accessrule : "+ accessrule);
117         return ret;
118     }
119
120     public void ejbPostCreate(String JavaDoc admingroupname, int caid, String JavaDoc accessrule, int rule, boolean isrecursive) {
121         // Do nothing. Required method.
122
}
123
124 }
125
Popular Tags