BUG-6858: adapt to ise api, change lookup from ise
[groupbasedpolicy.git] / sxp-integration / sxp-ise-adapter / src / main / java / org / opendaylight / groupbasedpolicy / sxp_ise_adapter / impl / IseContext.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.groupbasedpolicy.sxp_ise_adapter.impl;
10
11 import java.util.HashMap;
12 import java.util.Map;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.groupbasedpolicy.sxp.integration.sxp.ise.adapter.model.rev160630.gbp.sxp.ise.adapter.IseSourceConfig;
14
15 /**
16  * Purpose: keeper of {@link IseSourceConfig}, UUID-to-SGT map
17  * <br>
18  * Unique identifier is tenant-id (expect 1 tenant = 1 ise-source)
19  */
20 public class IseContext {
21
22     private final IseSourceConfig iseSourceConfig;
23     private final Map<String, Integer> uuidToSgtMap;
24
25     /**
26      * default ctor
27      * @param iseSourceConfig ise provider coordinates
28      */
29     public IseContext(final IseSourceConfig iseSourceConfig) {
30         this.iseSourceConfig = iseSourceConfig;
31         this.uuidToSgtMap = new HashMap<>();
32     }
33
34     /**
35      * @return ise coordinates
36      */
37     public IseSourceConfig getIseSourceConfig() {
38         return iseSourceConfig;
39     }
40
41     /**
42      * @return known UUID-to-SGT relations
43      */
44     public Map<String, Integer> getUuidToSgtMap() {
45         return uuidToSgtMap;
46     }
47 }