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.net.InetAddress;
20 import java.util.ArrayList;
21 import java.util.HashMap;
22 import java.util.List;
25 import edu.internet2.middleware.shibboleth.common.session.impl.AbstractSession;
26 import edu.internet2.middleware.shibboleth.idp.session.AuthenticationMethodInformation;
27 import edu.internet2.middleware.shibboleth.idp.session.ServiceInformation;
28 import edu.internet2.middleware.shibboleth.idp.session.Session;
31 * Session information for user logged into the IdP.
33 public class SessionImpl extends AbstractSession implements Session {
35 /** Serial version UID. */
36 private static final long serialVersionUID = 2927868242208211623L;
38 /** The list of methods used to authentictate the user. */
39 private List<AuthenticationMethodInformation> authnMethods;
41 /** The list of services to which the user has logged in. */
42 private Map<String, ServiceInformation> servicesInformation;
45 * Default constructor.
47 * @param presenter IP address of the presenter
48 * @param principal principal ID of the user
50 public SessionImpl(InetAddress presenter, String principal) {
51 super(presenter, principal);
53 authnMethods = new ArrayList<AuthenticationMethodInformation>();
54 servicesInformation = new HashMap<String, ServiceInformation>();
58 public List<AuthenticationMethodInformation> getAuthenticationMethods() {
63 public ServiceInformation getServiceInformation(String entityId) {
64 return servicesInformation.get(entityId);
68 public List<ServiceInformation> getServicesInformation() {
69 ArrayList<ServiceInformation> info = new ArrayList<ServiceInformation>();
70 for(Map.Entry<String, ServiceInformation> entry : servicesInformation.entrySet()){
71 info.add(entry.getValue());