View Javadoc

1   /* 
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.security.om;
18  
19  import java.io.Serializable;
20  import java.sql.Timestamp;
21  import java.util.Collection;
22  
23  /***
24   * <p>Interface representing a policy permission.  This will be used by the 
25   * {@link org.apache.jetspeed.security.impl.RdbmsPolicy} to retrieve a permission
26   * policy according to JAAS where permission are used in JAAS:</p>
27   * <pre>
28   * <code>grant [SignedBy "signer_names"] [, CodeBase "URL"]
29   *             [, InternalPrincipal [principal_class_name] "principal_name"]
30   *             [, InternalPrincipal [principal_class_name] "principal_name"] ... 
31   *       {
32   *                  permission permission_class_name [ "target_name" ] 
33   *                                                   [, "action"] [, SignedBy "signer_names"];
34   *                  permission ...
35   *       };
36   * </code>
37   * </pre>
38   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
39   */
40  public interface InternalPermission extends Serializable, Cloneable
41  {
42  
43      /***
44       * <p>Getter for the permission id.</p>
45       * @return The permission id.
46       */
47      long getPermissionId();
48  
49      /***
50       * <p>Setter for the permission id.</p>
51       * @param permissionId The permission id.
52       */
53      void setPermissionId(long permissionId);
54  
55      /***
56       * <p>Getter for the permission classname.</p>
57       * @return The permission classname.
58       */
59      String getClassname();
60  
61      /***
62       * <p>Setter for the permission classname.</p>
63       * @param classname The permission classname.
64       */
65      void setClassname(String classname);
66  
67      /***
68       * <p>Getter for the permission resource name.</p>
69       * @return The permission resource name.
70       */
71      String getName();
72  
73      /***
74       * <p>Setter for the permission resource name.</p>
75       * @param name The permission resource name.
76       */
77      void setName(String name);
78      
79      /***
80       * <p>Getter for the permission actions.</p>
81       * @return The permission actions.
82       */
83      String getActions();
84  
85      /***
86       * <p>Setter for the permission actions.</p>
87       * @param actions The permission actions.
88       */
89      void setActions(String actions);
90  
91      /***
92       * <p>Getter for the permission principals.</p>
93       * @return The permission principals.
94       */
95      Collection getPrincipals();
96  
97      /***
98       * <p>Setter for the permission principals.</p>
99       * @param principals The permission principals.
100      */
101     void setPrincipals(Collection principals);
102 
103     /***
104      * <p>Getter for creation date.</p>
105      * @return The creation date.
106      */
107     Timestamp getCreationDate();
108 
109     /***
110      * <p>Setter for the creation date.</p>
111      * @param creationDate The creation date.
112      */
113     void setCreationDate(Timestamp creationDate);
114 
115     /***
116      * <p>Getter for the modified date.</p>
117      * @return The modified date.
118      */
119     Timestamp getModifiedDate();
120 
121     /***
122      * <p>Setter for the modified date.</p>
123      * @param modifiedDate The modified date.
124      */
125     void setModifiedDate(Timestamp modifiedDate);
126 
127     /***
128      * <p>Equals method used to appropriately compare 2 {@link InternalPermission} objects.</p>
129      * @param object The object to compare with.
130      * @return The comparison result.
131      */
132     boolean equals(Object object);
133 }