KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > commonimpl > AuthenticatedUser


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.commonimpl;
17
18 import org.outerx.daisy.x10.UserInfoDocument;
19
20 /**
21  * A user object representing an authenticated user.
22  *
23  * <p>This user object is obtained after successful authentication
24  * from the {@link org.outerj.daisy.authentication.UserAuthenticator UserAuthenticator}.
25  * This user object is different from {@link org.outerj.daisy.repository.user.User User}
26  * which is used for managing users, while this user object is rather
27  * a proof of successful authentication used inside the implementation.
28  * If you are a user of the repository API, you should never be in
29  * contact with this object, this object is only relevant to the internal
30  * implementation.
31  *
32  */

33 public interface AuthenticatedUser {
34     public long getId();
35
36     /**
37      * The login string for this user. See the explanation for
38      * {@link #getPassword()} for why this can sometimes be needed.
39      */

40     public String JavaDoc getLogin();
41
42     /**
43      * The password can sometimes be needed if the the Repository implementation
44      * itself needs to connect to other services using this user. This is the
45      * case e.g. for remote implementations of the repository API. If it's known
46      * to be unneeded, this method may return null.
47      */

48     public String JavaDoc getPassword();
49
50     /**
51      * The currently active role of the user. While a user can have multiple roles,
52      * there can only be one role 'active' at a time.
53      */

54     public long[] getActiveRoleIds();
55
56     public boolean isInRole(long roleId);
57
58     public boolean isInAdministratorRole();
59
60     /**
61      * The roles this user has. These are the roles that can be supplied
62      * to the {@link #setActiveRoleIds(long[])} method.
63      */

64     public long[] getAvailableRoleIds();
65
66     /**
67      * Changes the active roles.
68      */

69     public void setActiveRoleIds(long[] roleIds);
70
71     public UserInfoDocument getXml();
72 }
73
Popular Tags