You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by dl...@apache.org on 2004/09/18 21:36:10 UTC

cvs commit: jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om InternalGroupPrincipal.java InternalCredential.java InternalUserPrincipal.java InternalPrincipal.java InternalRolePrincipal.java InternalPermission.java JetspeedRolePrincipal.java JetspeedCredential.java JetspeedGroupPrincipal.java JetspeedPrincipal.java JetspeedUserPrincipal.java JetspeedPermission.java

dlestrat    2004/09/18 12:36:10

  Added:       jetspeed-api/src/java/org/apache/jetspeed/security/om
                        InternalGroupPrincipal.java InternalCredential.java
                        InternalUserPrincipal.java InternalPrincipal.java
                        InternalRolePrincipal.java InternalPermission.java
  Removed:     jetspeed-api/src/java/org/apache/jetspeed/security/om
                        JetspeedRolePrincipal.java JetspeedCredential.java
                        JetspeedGroupPrincipal.java JetspeedPrincipal.java
                        JetspeedUserPrincipal.java JetspeedPermission.java
  Log:
  http://nagoya.apache.org/jira/browse/JS2-114#action_53185
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalGroupPrincipal.java
  
  Index: InternalGroupPrincipal.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.util.Collection;
  
  /**
   * <p>Interface representing a Jetspeed security group principal object model.</p>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   */
  public interface InternalGroupPrincipal extends InternalPrincipal
  {
      /**
       * <p>Getter for the user principals.</p>
       * @return The user principals.
       */
      Collection getUserPrincipals();
  
      /**
       * <p>Setter for the user principals.</p>
       * @param userPrincipals The user principals.
       */
      void setUserPrincipals(Collection userPrincipals);
  
      /**
       * <p>Getter for the role principals.</p>
       * @return The role principals.
       */
      Collection getRolePrincipals();
  
      /**
       * <p>Setter for the role principals.</p>
       * @param rolePrincipals The role principals.
       */
      void setRolePrincipals(Collection rolePrincipals);
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalCredential.java
  
  Index: InternalCredential.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.io.Serializable;
  import java.sql.Timestamp;
  
  /**
   * <p>Interface representing a security credential.</p>
   * <p>The credential value represents the value of the credential
   * such as a password.</p>
   * <p>For now, we do not have custom credentials classes and 
   * credentials support only 1 credential (i.e. 1 password).<p>
   * <p>The credential type represents whether a credential is private or
   * public:</p>
   * <ul>
   *  <li>Private credential: type == 0</li>
   *  <li>Public credential: type == 1</li>
   * </ul>
   * <p>The credential classname represent the class of credential.  For password
   * this field is null.
   * </p>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   * TODO Add multiple credentials support.
   */
  public interface InternalCredential extends Serializable, Cloneable
  {
      /**
       * <p>Getter for the credential id.</p>
       * @return The credential id.
       */
      long getCredentialId();
  
      /**
       * <p>Setter for the credential id.</p>
       * @param credentialId The credential id.
       */
      void setCredentialId(long credentialId);
  
      /**
       * <p>Getter for the principal id.</p>
       * @return The principal id.
       */
      long getPrincipalId();
  
      /**
       * <p>Setter for the principal id.</p>
       * @param principalId The principal id.
       */
      void setPrincipalId(long principalId);
  
      /**
       * <p>Getter for the credential value.</p>
       * @return The credential value.
       */
      String getValue();
  
      /**
       * <p>Setter for the credential value.</p>
       * @param value The credential value.
       */
      void setValue(String value);
  
      /**
       * <p>Getter for the credential type.</p>
       * <ul>
       *  <li>Private credential: type == 0</li>
       *  <li>Public credential: type == 1</li>
       * </ul>
       * @return The credential type.
       */
      int getType();
  
      /**
       * <p>Setter for the credential type.</p>
       * <ul>
       *  <li>Private credential: type == 0</li>
       *  <li>Public credential: type == 1</li>
       * </ul>
       * @param type The credential type.
       */
      void setType(int type);
  
      /**
       * <p>Getter for the principal classname.</p>
       * @return The principal classname.
       */
      String getClassname();
  
      /**
       * <p>Setter for the principal classname.</p>
       * @param classname The principal classname.
       */
      void setClassname(String classname);
  
      /**
       * <p>Getter for creation date.</p>
       * @return The creation date.
       */
      Timestamp getCreationDate();
  
      /**
       * <p>Setter for the creation date.</p>
       * @param creationDate The creation date.
       */
      void setCreationDate(Timestamp creationDate);
  
      /**
       * <p>Getter for the modified date.</p>
       * @return The modified date.
       */
      Timestamp getModifiedDate();
  
      /**
       * <p>Setter for the modified date.</p>
       * @param modifiedDate The modified date.
       */
      void setModifiedDate(Timestamp modifiedDate);
  
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalUserPrincipal.java
  
  Index: InternalUserPrincipal.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.util.Collection;
  
  /**
   * <p>Interface representing Jetspeed security user principal object model.</p>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   */
  public interface InternalUserPrincipal extends InternalPrincipal
  {
      /**
       * <p>Getter for the security credentials.</p>
       * @return The credentials.
       */
      Collection getCredentials();
  
      /**
       * <p>Setter for the security credentials.</p>
       * @param credentials The credentials.
       */
      void setCredentials(Collection credentials);
  
      /**
       * <p>Getter for the role principals.</p>
       * @return The role principals.
       */
      Collection getRolePrincipals();
  
      /**
       * <p>Setter for the role principals.</p>
       * @param rolePrincipals The role principals.
       */
      void setRolePrincipals(Collection rolePrincipals);
  
      /**
       * <p>Getter for the group principals.</p>
       * @return The group principals.
       */
      Collection getGroupPrincipals();
  
      /**
       * <p>Setter for the group principals.</p>
       * @param groupPrincipals The group principals.
       */
      void setGroupPrincipals(Collection groupPrincipals);
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalPrincipal.java
  
  Index: InternalPrincipal.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.io.Serializable;
  import java.util.Collection;
  import java.sql.Timestamp;
  
  /**
   * <p>Interface representing a policy principal.  This will be used by the 
   * {@link org.apache.jetspeed.security.impl.RdbmsPolicy} to retrieve specify
   * which permissions are applied on which principal according to the JAAS policy:</p>
   * <pre>
   * <code>grant [SignedBy "signer_names"] [, CodeBase "URL"]
   *             [, InternalPrincipal [principal_class_name] "principal_name"]
   *             [, InternalPrincipal [principal_class_name] "principal_name"] ... 
   *       {
   *                  permission permission_class_name [ "target_name" ] 
   *                                                   [, "action"] [, SignedBy "signer_names"];
   *                  permission ...
   *       };
   * </code>
   * </pre>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   */
  public interface InternalPrincipal extends Serializable, Cloneable
  {
  
      /**
       * <p>Getter for the principal id.</p>
       * @return The principal id.
       */
      long getPrincipalId();
  
      /**
       * <p>Setter for the principal id.</p>
       * @param principalId The principal id.
       */
      void setPrincipalId(long principalId);
  
      /**
       * <p>Getter for the principal classname.</p>
       * @return The principal classname.
       */
      String getClassname();
  
      /**
       * <p>Setter for the principal classname.</p>
       * @param classname The principal classname.
       */
      void setClassname(String classname);
  
   
      /**
       * <p>Getter for the principal full path.</p>
       * <p>The full path allows to retrieve the principal preferences from
       * the preferences services.</p>
       * @return The principal full path.
       */
      String getFullPath();
  
      /**
       * <p>Setter for the principal name.</p>
       * <p>The full path allows to retrieve the principal preferences from
       * the preferences services.</p>
       * @param fullPath The principal full path.
       */
      void setFullPath(String fullPath);
  
      /**
       * <p>Getter for the principal permissions.</p>
       * @return The principal permissions.
       */
      Collection getPermissions();
  
      /**
       * <p>Setter for the principal permissions.</p>
       * @param permissions The principal permissions.
       */
      void setPermissions(Collection permissions);
  
      /**
       * <p>Getter for creation date.</p>
       * @return The creation date.
       */
      Timestamp getCreationDate();
  
      /**
       * <p>Setter for the creation date.</p>
       * @param creationDate The creation date.
       */
      void setCreationDate(Timestamp creationDate);
  
      /**
       * <p>Getter for the modified date.</p>
       * @return The modified date.
       */
      Timestamp getModifiedDate();
  
      /**
       * <p>Setter for the modified date.</p>
       * @param modifiedDate The modified date.
       */
      void setModifiedDate(Timestamp modifiedDate);
  
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalRolePrincipal.java
  
  Index: InternalRolePrincipal.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.util.Collection;
  
  /**
   * <p>Interface representing Jetspeed security role principal object model.</p>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   */
  public interface InternalRolePrincipal extends InternalPrincipal
  {
      /**
       * <p>Getter for the user principals.</p>
       * @return The user principals.
       */
      Collection getUserPrincipals();
  
      /**
       * <p>Setter for the user principals.</p>
       * @param userPrincipals The user principals.
       */
      void setUserPrincipals(Collection userPrincipals);
  
      /**
       * <p>Getter for the group principals.</p>
       * @return The group principals.
       */
      Collection getGroupPrincipals();
  
      /**
       * <p>Setter for the group principals.</p>
       * @param groupPrincipals The group principals.
       */
      void setGroupPrincipals(Collection groupPrincipals);
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/security/om/InternalPermission.java
  
  Index: InternalPermission.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.security.om;
  
  import java.io.Serializable;
  import java.sql.Timestamp;
  import java.util.Collection;
  
  /**
   * <p>Interface representing a policy permission.  This will be used by the 
   * {@link org.apache.jetspeed.security.impl.RdbmsPolicy} to retrieve a permission
   * policy according to JAAS where permission are used in JAAS:</p>
   * <pre>
   * <code>grant [SignedBy "signer_names"] [, CodeBase "URL"]
   *             [, InternalPrincipal [principal_class_name] "principal_name"]
   *             [, InternalPrincipal [principal_class_name] "principal_name"] ... 
   *       {
   *                  permission permission_class_name [ "target_name" ] 
   *                                                   [, "action"] [, SignedBy "signer_names"];
   *                  permission ...
   *       };
   * </code>
   * </pre>
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
   */
  public interface InternalPermission extends Serializable, Cloneable
  {
  
      /**
       * <p>Getter for the permission id.</p>
       * @return The permission id.
       */
      long getPermissionId();
  
      /**
       * <p>Setter for the permission id.</p>
       * @param permissionId The permission id.
       */
      void setPermissionId(long permissionId);
  
      /**
       * <p>Getter for the permission classname.</p>
       * @return The permission classname.
       */
      String getClassname();
  
      /**
       * <p>Setter for the permission classname.</p>
       * @param classname The permission classname.
       */
      void setClassname(String classname);
  
      /**
       * <p>Getter for the permission resource name.</p>
       * @return The permission resource name.
       */
      String getName();
  
      /**
       * <p>Setter for the permission resource name.</p>
       * @param name The permission resource name.
       */
      void setName(String name);
      
      /**
       * <p>Getter for the permission actions.</p>
       * @return The permission actions.
       */
      String getActions();
  
      /**
       * <p>Setter for the permission actions.</p>
       * @param actions The permission actions.
       */
      void setActions(String actions);
  
      /**
       * <p>Getter for the permission principals.</p>
       * @return The permission principals.
       */
      Collection getPrincipals();
  
      /**
       * <p>Setter for the permission principals.</p>
       * @param principals The permission principals.
       */
      void setPrincipals(Collection principals);
  
      /**
       * <p>Getter for creation date.</p>
       * @return The creation date.
       */
      Timestamp getCreationDate();
  
      /**
       * <p>Setter for the creation date.</p>
       * @param creationDate The creation date.
       */
      void setCreationDate(Timestamp creationDate);
  
      /**
       * <p>Getter for the modified date.</p>
       * @return The modified date.
       */
      Timestamp getModifiedDate();
  
      /**
       * <p>Setter for the modified date.</p>
       * @param modifiedDate The modified date.
       */
      void setModifiedDate(Timestamp modifiedDate);
  
      /**
       * <p>Equals method used to appropriately compare 2 {@link InternalPermission} objects.</p>
       * @param object The object to compare with.
       * @return The comparison result.
       */
      boolean equals(Object object);
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org