2 * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.aaa.federation;
11 import java.util.List;
12 import java.util.Vector;
13 import org.opendaylight.aaa.api.ClaimAuth;
14 import org.opendaylight.aaa.api.IdMService;
15 import org.opendaylight.aaa.api.TokenStore;
18 * A service locator to bridge between the web world and OSGi world.
23 public class ServiceLocator {
25 private static final ServiceLocator instance = new ServiceLocator();
27 protected volatile List<ClaimAuth> claimAuthCollection = new Vector<>();
29 protected volatile TokenStore tokenStore;
31 protected volatile IdMService idmService;
33 private ServiceLocator() {
36 public static ServiceLocator getInstance() {
41 * Called through reflection from the federation Activator
43 * @see org.opendaylight.aaa.federation.ServiceLocator
44 * @param ca the injected claims implementation
46 protected void claimAuthAdded(ClaimAuth ca) {
47 this.claimAuthCollection.add(ca);
51 * Called through reflection from the federation Activator
53 * @see org.opendaylight.aaa.federation.Activator
54 * @param ca the claims implementation to remove
56 protected void claimAuthRemoved(ClaimAuth ca) {
57 this.claimAuthCollection.remove(ca);
60 public List<ClaimAuth> getClaimAuthCollection() {
61 return claimAuthCollection;
64 public void setClaimAuthCollection(List<ClaimAuth> claimAuthCollection) {
65 this.claimAuthCollection = claimAuthCollection;
68 public TokenStore getTokenStore() {
72 public void setTokenStore(TokenStore tokenStore) {
73 this.tokenStore = tokenStore;
76 public IdMService getIdmService() {
80 public void setIdmService(IdMService idmService) {
81 this.idmService = idmService;