01: /*
02: * JOSSO: Java Open Single Sign-On
03: *
04: * Copyright 2004-2008, Atricore, Inc.
05: *
06: * This is free software; you can redistribute it and/or modify it
07: * under the terms of the GNU Lesser General Public License as
08: * published by the Free Software Foundation; either version 2.1 of
09: * the License, or (at your option) any later version.
10: *
11: * This software is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this software; if not, write to the Free
18: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
20: */
21: package org.josso.gateway.identity.service;
22:
23: import org.josso.gateway.identity.SSORole;
24: import org.josso.gateway.identity.SSOUser;
25: import org.josso.gateway.identity.exceptions.NoSuchUserException;
26: import org.josso.gateway.identity.exceptions.SSOIdentityException;
27: import org.josso.gateway.identity.service.store.IdentityStore;
28: import org.josso.gateway.identity.service.store.IdentityStoreKeyAdapter;
29:
30: /**
31: * Single Sing-On Identity Manager Business Interface.
32: *
33: * @author <a href="mailto:sgonzalez@josso.org">Sebastian Gonzalez Oyuela</a>
34: * @version $Id: SSOIdentityManager.java 508 2008-02-18 13:32:29Z sgonzalez $
35: */
36: public interface SSOIdentityManager {
37:
38: /**
39: * Initializes this manager
40: */
41: void initialize();
42:
43: /**
44: * Finds a user based on its name. The name is a unique identifier of the user, probably the user login.
45: * @param name
46: *
47: * @throws org.josso.gateway.identity.exceptions.NoSuchUserException if the user does not exist.
48: */
49: SSOUser findUser(String name) throws NoSuchUserException,
50: SSOIdentityException;
51:
52: /**
53: * Finds the user associated to a sso session
54: * @param sessionId the sso session identifier
55: *
56: * @throws org.josso.gateway.identity.exceptions.NoSuchUserException if no user is associated to this session id.
57: */
58: SSOUser findUserInSession(String sessionId)
59: throws NoSuchUserException, SSOIdentityException;
60:
61: /**
62: * Finds an array of user's roles.
63: * Elements in the collection are SSORole instances.
64: *
65: * @param username
66: *
67: * @throws org.josso.gateway.identity.exceptions.SSOIdentityException
68: */
69: SSORole[] findRolesByUsername(String username)
70: throws SSOIdentityException;
71:
72: /**
73: * This method validates that the received username matchs an existing user
74: * @param username
75: *
76: * @throws NoSuchUserException if the user does not exists or is invalid.
77: * @throws SSOIdentityException if an error occurs while checking if user exists.
78: */
79: void userExists(String username) throws NoSuchUserException,
80: SSOIdentityException;
81:
82: void setIdentityStore(IdentityStore is);
83:
84: void setIdentityStoreKeyAdapter(IdentityStoreKeyAdapter a);
85:
86: }
|