001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.security.om;
018:
019: import java.io.Serializable;
020: import java.util.Collection;
021: import java.sql.Timestamp;
022:
023: /**
024: * <p>
025: * Interface representing a policy principal. This will be used by the
026: * {@link org.apache.jetspeed.security.impl.RdbmsPolicy}to retrieve specify
027: * which permissions are applied on which principal according to the JAAS
028: * policy:
029: * </p>
030: *
031: * <pre>
032: * <code>
033: * grant [SignedBy "signer_names"] [, CodeBase "URL"]
034: * [, InternalPrincipal [principal_class_name] "principal_name"]
035: * [, InternalPrincipal [principal_class_name] "principal_name"] ...
036: * {
037: * permission permission_class_name [ "target_name" ]
038: * [, "action"] [, SignedBy "signer_names"];
039: * permission ...
040: * };
041: *
042: * </code>
043: * </pre>
044: *
045: * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
046: */
047: public interface InternalPrincipal extends Serializable, Cloneable {
048:
049: /**
050: * <p>
051: * Getter for the principal id.
052: * </p>
053: *
054: * @return The principal id.
055: */
056: long getPrincipalId();
057:
058: /**
059: * <p>
060: * Setter for the principal id.
061: * </p>
062: *
063: * @param principalId The principal id.
064: */
065: void setPrincipalId(long principalId);
066:
067: /**
068: * <p>
069: * Getter for the principal classname.
070: * </p>
071: *
072: * @return The principal classname.
073: */
074: String getClassname();
075:
076: /**
077: * <p>
078: * Setter for the principal classname.
079: * </p>
080: *
081: * @param classname The principal classname.
082: */
083: void setClassname(String classname);
084:
085: /**
086: * <p>
087: * Getter for isMappingOnly.
088: * </p>
089: *
090: * @return The isMappingOnly.
091: */
092: boolean isMappingOnly();
093:
094: /**
095: * <p>
096: * Setter for isMappingOnly.
097: * </p>
098: *
099: * @param isMappingOnly The isMappingOnly.
100: */
101: void setMappingOnly(boolean isMappingOnly);
102:
103: /**
104: * <p>
105: * Getter for the principal full path.
106: * </p>
107: * <p>
108: * The full path allows to retrieve the principal preferences from the
109: * preferences services.
110: * </p>
111: *
112: * @return The principal full path.
113: */
114: String getFullPath();
115:
116: /**
117: * <p>
118: * Setter for the principal name.
119: * </p>
120: * <p>
121: * The full path allows to retrieve the principal preferences from the
122: * preferences services.
123: * </p>
124: *
125: * @param fullPath The principal full path.
126: */
127: void setFullPath(String fullPath);
128:
129: /**
130: * <p>
131: * Getter for the principal permissions.
132: * </p>
133: *
134: * @return The principal permissions.
135: */
136: Collection getPermissions();
137:
138: /**
139: * <p>
140: * Setter for the principal permissions.
141: * </p>
142: *
143: * @param permissions The principal permissions.
144: */
145: void setPermissions(Collection permissions);
146:
147: /**
148: * <p>
149: * Getter for creation date.
150: * </p>
151: *
152: * @return The creation date.
153: */
154: Timestamp getCreationDate();
155:
156: /**
157: * <p>
158: * Setter for the creation date.
159: * </p>
160: *
161: * @param creationDate The creation date.
162: */
163: void setCreationDate(Timestamp creationDate);
164:
165: /**
166: * <p>
167: * Getter for the modified date.
168: * </p>
169: *
170: * @return The modified date.
171: */
172: Timestamp getModifiedDate();
173:
174: /**
175: * <p>
176: * Setter for the modified date.
177: * </p>
178: *
179: * @param modifiedDate The modified date.
180: */
181: void setModifiedDate(Timestamp modifiedDate);
182:
183: /**
184: * <p>Getter for the enabled state</p>
185: * @return true if enabled
186: */
187: boolean isEnabled();
188:
189: /**
190: * Setter for the enabled state</p>
191: * @param enabled The enabled state
192: */
193: void setEnabled(boolean enabled);
194: }
|