a6c7bc83d141a474003a30681e639c58653b4601
[groupbasedpolicy.git] / renderers / ios-xe / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ios_xe_provider / impl / manager / PolicyConfigurationContext.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.renderer.ios_xe_provider.impl.manager;
10
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.groupbasedpolicy.renderer.ios_xe_provider.impl.writer.PolicyWriter;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.renderer.policy.Status;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.renderer.policy.configuration.renderer.endpoints.RendererEndpoint;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.renderer.policy.status.unconfigured.endpoints.UnconfiguredRendererEndpoint;
17
18 /**
19  * Purpose: placeholder for
20  * <ul>
21  *     <li>{@link PolicyWriter}</li>
22  *     <li>{@link Status} parts</li>
23  * </ul>
24  */
25 public class PolicyConfigurationContext {
26
27     private final List<UnconfiguredRendererEndpoint> unconfiguredRendererEPBag;
28     private PolicyWriter policyWriter;
29     private RendererEndpoint currentRendererEP;
30
31     public PolicyConfigurationContext() {
32         unconfiguredRendererEPBag = new ArrayList<>();
33     }
34
35     /**
36      * @return policyWriter for mountpoint currently being configured
37      */
38     public PolicyWriter getPolicyWriter() {
39         return policyWriter;
40     }
41
42     /**
43      * @param policyWriter for mountpoint currently being configured
44      */
45     public void setPolicyWriter(final PolicyWriter policyWriter) {
46         this.policyWriter = policyWriter;
47     }
48
49     /**
50      * @return list of not configurable policies
51      */
52     public List<UnconfiguredRendererEndpoint> getUnconfiguredRendererEPBag() {
53         return unconfiguredRendererEPBag;
54     }
55
56     /**
57      * append given endpoint to collection of not configurable policies
58      * @param endpoint not configurable endpoint
59      */
60     public void appendUnconfiguredRendererEP(UnconfiguredRendererEndpoint endpoint) {
61         unconfiguredRendererEPBag.add(endpoint);
62     }
63
64     /**
65      * @param currentRendererEP endpoint currently being configured
66      */
67     public void setCurrentRendererEP(final RendererEndpoint currentRendererEP) {
68         this.currentRendererEP = currentRendererEP;
69     }
70
71     /**
72      * @return endpoint currently being configured
73      */
74     public RendererEndpoint getCurrentRendererEP() {
75         return currentRendererEP;
76     }
77 }