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:34:25 UTC

cvs commit: jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi RoleSecurityHandler.java CredentialHandler.java UserSecurityHandler.java GroupSecurityHandler.java

dlestrat    2004/09/18 12:34:25

  Added:       components/security/src/java/org/apache/jetspeed/security/spi
                        RoleSecurityHandler.java CredentialHandler.java
                        UserSecurityHandler.java GroupSecurityHandler.java
  Log:
  http://nagoya.apache.org/jira/browse/JS2-114#action_53185
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/RoleSecurityHandler.java
  
  Index: RoleSecurityHandler.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.spi;
  
  import java.util.Set;
  
  import org.apache.jetspeed.security.HierarchyResolver;
  
  /**
   * <p>
   * This interface encapsulates the persistence of security roles.
   * </p>
   * <p>
   * This provides a central placeholder for changing the persistence of roles
   * security information.
   * </p>
   * <p>
   * A security implementation wanting to store role security implementation in
   * LDAP for instance would need to provide an LDAP implementation of this
   * interface.
   * </p>
   * 
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
   */
  public interface RoleSecurityHandler
  {
      
      /**
       * <p>
       * Sets the {@link HierarchyResolver} to be used for resolving role hierachy.
       * </p>
       * 
       * @param roleHierarchyResolver The role {@link HierarchyResolver}.
       */
      void setRoleHierarchyResolver(HierarchyResolver roleHierarchyResolver);
      
      /**
       * <p>
       * Gets the role principals for the given user.
       * </p>
       * 
       * @param username The user name.
       * @return A set of <code>RolePrincipal</p>
       */
      Set getRolePrincipals(String username);
  
  }
  
  
  
  1.1                  jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/CredentialHandler.java
  
  Index: CredentialHandler.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.spi;
  
  import java.util.Set;
  
  import org.apache.jetspeed.security.PasswordCredential;
  import org.apache.jetspeed.security.SecurityException;
  
  /**
   * <p>
   * This interface encapsulates the handling of security credentials.
   * </p>
   * <p>
   * This provides a central placeholder for changing the mapping of user
   * credentials.  The default implementation only supports <code>PasswordCredential</code>
   * </p>
   * <p>
   * A security implementation wanting to map additional credentials should do so
   * here.
   * </p>
   * 
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
   */
  public interface CredentialHandler
  {
      /**
       * <p>
       * Gets the public credentials for the user.
       * </p>
       * 
       * @param username The username.
       * @return The set of public credentials.
       */
      Set getPublicCredentials(String username);
      
      /**
       * <p>
       * Sets a public password credential.
       * </p>
       * 
       * @param oldPwdCredential The old {@link PasswordCredential}.
       * @param newPwdCredential The new {@link PasswordCredential}.
       * @throws SecurityException Throws a {@link SecurityException}.
       */
      void setPublicPasswordCredential(PasswordCredential oldPwdCredential, PasswordCredential newPwdCredential) throws SecurityException;
      
      /**
       * <p>
       * Gets the private credentials for the user.
       * </p>
       * 
       * @param username The username.
       * @return The set of private credentials.
       */
      Set getPrivateCredentials(String username);
      
      /**
       * <p>
       * Sets a private password credential.  If <code>oldPwdCredential</code> is not null, the new
       * password credential will replace the old one.
       * </p>
       * 
       * @param oldPwdCredential The old {@link PasswordCredential}.
       * @param newPwdCredential The new {@link PasswordCredential}.
       * @throws SecurityException Throws a {@link SecurityException}.
       */
      void setPrivatePasswordCredential(PasswordCredential oldPwdCredential, PasswordCredential newPwdCredential) throws SecurityException;
  }
  
  
  1.1                  jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/UserSecurityHandler.java
  
  Index: UserSecurityHandler.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.spi;
  
  import java.security.Principal;
  import java.util.Iterator;
  
  import org.apache.jetspeed.security.SecurityException;
  import org.apache.jetspeed.security.UserPrincipal;
  
  /**
   * <p>
   * This interface encapsulates the persistence of a user security.
   * </p>
   * <p>
   * This provides a central placeholder for changing the persistence of user
   * security information.
   * </p>
   * <p>
   * A security implementation wanting to store user security implementation in
   * LDAP for instance would need to provide an LDAP implementation of this
   * interface.
   * </p>
   * 
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
   */
  public interface UserSecurityHandler
  {
      
      /**
       * <p>
       * Gets the user principal for the given user name.
       * </p>
       * 
       * @param username The user name.
       * @return The <code>Principal</p>
       */
      Principal getUserPrincipal(String username);
      
      /**
       * <p>
       * Gets the an iterator of user principals for a given filter.
       * </p>
       * 
       * @param filter The filter.
       * @return The Iterator of <code>Principal</p>
       */
      Iterator getUserPrincipals(String filter);
      
      /**
       * <p>
       * Sets the user principal in the backing store.
       * </p>
       * 
       * @param userPrincipal The <code>UserPrincipal</code>.
       * @throws SecurityException Throws a {@link SecurityException}.
       */
      void setUserPrincipal(UserPrincipal userPrincipal) throws SecurityException;
      
      /**
       * <p>
       * Remove the user principal.
       * </p>
       * 
       * @param userPrincipal The <code>UserPrincipal</code>.
       * @throws SecurityException Throws a {@link SecurityException}.
       */
      void removeUserPrincipal(UserPrincipal userPrincipal) throws SecurityException;
  }
  
  
  
  1.1                  jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/spi/GroupSecurityHandler.java
  
  Index: GroupSecurityHandler.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.spi;
  
  import java.util.Set;
  
  import org.apache.jetspeed.security.HierarchyResolver;
  
  /**
   * <p>
   * This interface encapsulates the persistence of security groups.
   * </p>
   * <p>
   * This provides a central placeholder for changing the persistence of groups
   * security information.
   * </p>
   * <p>
   * A security implementation wanting to store group security implementation in
   * LDAP for instance would need to provide an LDAP implementation of this
   * interface.
   * </p>
   * 
   * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
   */
  public interface GroupSecurityHandler
  {
      
      /**
       * <p>
       * Sets the {@link HierarchyResolver} used for resolving group hierarchy.
       * </p>
       * 
       * @param groupHierarchyResolver The group {@link HierarchyResolver}.
       */
      void setGroupHierarchyResolver(HierarchyResolver groupHierarchyResolver);
      
      /**
       * <p>
       * Gets the group principals for the given user.
       * </p>
       * 
       * @param username The user name.
       * @return A set of <code>GroupPrincipal</p>
       */
      Set getGroupPrincipals(String username);
  
  }
  
  
  

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