All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.jetspeed.sso.spi.SSOUserManagerSPI Maven / Gradle / Ivy

The newest version!
/* 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.sso.spi;

import java.util.Collection;

import org.apache.jetspeed.security.JetspeedPrincipal;
import org.apache.jetspeed.security.PasswordCredential;
import org.apache.jetspeed.security.PrincipalTypeManager;
import org.apache.jetspeed.security.SecurityException;
import org.apache.jetspeed.sso.SSOUser;

/**
 * @author Dennis Dam
 * @version $Id$
 */
public interface SSOUserManagerSPI extends PrincipalTypeManager {

    SSOUser newUser(String name, Long domainId);

    /**
     * 

* Add a new user *

*

* If an external security storage manager is used, the user will be mapped/replicated to it as well. *

* @param userName The user name. * @param domainId The domain ID of the remote domain * @param localPrincipal The portal principal (e.g. user / group) related to this SSO User * @return the new {@link SSOUser} * @throws Throws a security exception. */ SSOUser addUser(String userName, Long domainId, JetspeedPrincipal ownerPrincipal) throws SecurityException; /** *

* Remove a user. If there user attributes associated with this user, they will be removed as well. *

*

* {@link java.security.Permission}for this user will be removed as well. *

* * @param userName The user name. * @throws Throws a security exception. */ void removeUser(String userName, Long domainId) throws SecurityException; /** *

* Whether or not a user exists. *

* * @param userName The user name. * @return Whether or not a user exists. */ boolean userExists(String userName, Long domainId); /** *

* Get a {@link SSOUser}for a given user name. *

* * @param userName The user name. * @return The {@link SSOUser}. * @throws Throws a security exception idomainPrincipalAccessf the user cannot be found. */ SSOUser getUser(String userName, Long domainId) throws SecurityException; /** *

* Retrieves a detached and modifiable {@link SSOUser} list matching the corresponding * user name filter. *

* * @param nameFilter The filter used to retrieve matching users. * @return a list of {@link SSOUser}. */ Collection getUsers(String nameFilter, Long domainId) throws SecurityException; Collection getUsers(JetspeedPrincipal principal) throws SecurityException; Collection getUsers(JetspeedPrincipal principal, Long domainId) throws SecurityException; /** *

* Retrieves a a detached and modifiable List user names, finding users matching the corresponding * user name filter. *

* * @param nameFilter The filter used to retrieve matching users. * @return A list of user names */ Collection getUserNames(String nameFilter, Long domainId) throws SecurityException; /** * Updates a user and all its attributes * @param user * @throws SecurityException */ void updateUser(SSOUser user) throws SecurityException; /** * Returns the current PasswordCredential for a User or a new one if the doesn't have one yet * @param user the user * @return null if the SSOUserManager doesn't support PasswordCredentials */ PasswordCredential getPasswordCredential(SSOUser user) throws SecurityException; void storePasswordCredential(PasswordCredential credential) throws SecurityException; void addSSOUserToPrincipal(SSOUser user, JetspeedPrincipal principal) throws SecurityException; Collection getPortalPrincipals(SSOUser remoteUser, Long portalPrincipalDomain); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy