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.sql.Timestamp;
021: import java.util.Collection;
022:
023: /**
024: * <p>Interface representing a policy permission. This will be used by the
025: * {@link org.apache.jetspeed.security.impl.RdbmsPolicy} to retrieve a permission
026: * policy according to JAAS where permission are used in JAAS:</p>
027: * <pre>
028: * <code>grant [SignedBy "signer_names"] [, CodeBase "URL"]
029: * [, InternalPrincipal [principal_class_name] "principal_name"]
030: * [, InternalPrincipal [principal_class_name] "principal_name"] ...
031: * {
032: * permission permission_class_name [ "target_name" ]
033: * [, "action"] [, SignedBy "signer_names"];
034: * permission ...
035: * };
036: * </code>
037: * </pre>
038: * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
039: */
040: public interface InternalPermission extends Serializable, Cloneable {
041:
042: /**
043: * <p>Getter for the permission id.</p>
044: * @return The permission id.
045: */
046: long getPermissionId();
047:
048: /**
049: * <p>Setter for the permission id.</p>
050: * @param permissionId The permission id.
051: */
052: void setPermissionId(long permissionId);
053:
054: /**
055: * <p>Getter for the permission classname.</p>
056: * @return The permission classname.
057: */
058: String getClassname();
059:
060: /**
061: * <p>Setter for the permission classname.</p>
062: * @param classname The permission classname.
063: */
064: void setClassname(String classname);
065:
066: /**
067: * <p>Getter for the permission resource name.</p>
068: * @return The permission resource name.
069: */
070: String getName();
071:
072: /**
073: * <p>Setter for the permission resource name.</p>
074: * @param name The permission resource name.
075: */
076: void setName(String name);
077:
078: /**
079: * <p>Getter for the permission actions.</p>
080: * @return The permission actions.
081: */
082: String getActions();
083:
084: /**
085: * <p>Setter for the permission actions.</p>
086: * @param actions The permission actions.
087: */
088: void setActions(String actions);
089:
090: /**
091: * <p>Getter for the permission principals.</p>
092: * @return The permission principals.
093: */
094: Collection getPrincipals();
095:
096: /**
097: * <p>Setter for the permission principals.</p>
098: * @param principals The permission principals.
099: */
100: void setPrincipals(Collection principals);
101:
102: /**
103: * <p>Getter for creation date.</p>
104: * @return The creation date.
105: */
106: Timestamp getCreationDate();
107:
108: /**
109: * <p>Setter for the creation date.</p>
110: * @param creationDate The creation date.
111: */
112: void setCreationDate(Timestamp creationDate);
113:
114: /**
115: * <p>Getter for the modified date.</p>
116: * @return The modified date.
117: */
118: Timestamp getModifiedDate();
119:
120: /**
121: * <p>Setter for the modified date.</p>
122: * @param modifiedDate The modified date.
123: */
124: void setModifiedDate(Timestamp modifiedDate);
125:
126: /**
127: * <p>Equals method used to appropriately compare 2 {@link InternalPermission} objects.</p>
128: * @param object The object to compare with.
129: * @return The comparison result.
130: */
131: boolean equals(Object object);
132: }
|