2 * Copyright [2006] [University Corporation for Advanced Internet Development, Inc.]
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package edu.internet2.middleware.shibboleth.idp.session.impl;
19 import java.util.List;
21 import javolution.util.FastList;
23 import edu.internet2.middleware.shibboleth.idp.session.AuthenticationMethodInformation;
24 import edu.internet2.middleware.shibboleth.idp.session.ServiceInformation;
25 import edu.internet2.middleware.shibboleth.idp.session.Session;
27 // implementation note:
28 // pay attention to package names in this file!
30 // this class is shib.idp.session.impl.SessionImpl. It implements the shib.idp.session.Session
31 // interface. that interface, in turn, extends shib.common.session.Session, which is implemented
32 // in shib.common.session.impl.SessionImpl.
36 * Session information for user logged into the IdP.
38 public class SessionImpl
39 extends edu.internet2.middleware.shibboleth.common.session.impl.SessionImpl
42 /** The list of methods used to authentictate the user */
43 private List<AuthenticationMethodInformation> authnMethods =
44 new FastList<AuthenticationMethodInformation>();
46 /** The list of services to which the user has logged in */
47 private List<ServiceInformation> servicesInformation =
48 new FastList<ServiceInformation>();
52 * Default constructor.
54 * @param principalID The principal ID of the user
56 public SessionImpl(String principalID) {
63 public List<AuthenticationMethodInformation> getAuthenticationMethods() {
65 // XXX : This is suspect. One should not return
66 // a reference to a private mutable object. The Session
67 // interface should have methods for adding and removing
68 // AuthenticationMethodInformation and ServicesInformation
69 // entries. Further, the Session interface assumes that
70 // the implementation will return a thread-safe List. Not
71 // all List implementations are thread-safe.
73 return this.authnMethods;
78 public List<ServiceInformation> getServicesInformation() {
80 // XXX: warning: Potentially dangerous. see above note.
82 return this.servicesInformation;