5d5583ff6449581a3e87f59898aa2f5e86526668
[policy/apex-pdp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.core.engine.executor.context;
22
23 import java.util.Collection;
24 import java.util.Map;
25 import java.util.Set;
26
27 import org.apache.commons.lang3.NotImplementedException;
28 import org.onap.policy.apex.context.ContextAlbum;
29 import org.onap.policy.apex.context.ContextException;
30 import org.onap.policy.apex.context.SchemaHelper;
31 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
32 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
33 import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum;
34
35 /**
36  * Dummy context album for testing.
37  */
38 public class DummyContextAlbum implements ContextAlbum {
39     private final AxArtifactKey key;
40
41     /**
42      * Constructor.
43      * @param key the key
44      */
45     public DummyContextAlbum(AxArtifactKey key) {
46         super();
47         this.key = key;
48     }
49
50     /*
51      * (non-Javadoc)
52      * 
53      * @see java.util.Map#clear()
54      */
55     @Override
56     public void clear() {
57         throw new NotImplementedException("Not implemented on dummy class");
58     }
59     
60     /*
61      * (non-Javadoc)
62      * 
63      * @see java.util.Map#containsKey(java.lang.Object)
64      */
65     @Override
66     public boolean containsKey(Object key) {
67         throw new NotImplementedException("Not implemented on dummy class");
68     }
69
70     /*
71      * (non-Javadoc)
72      * 
73      * @see java.util.Map#containsValue(java.lang.Object)
74      */
75     @Override
76     public boolean containsValue(Object value) {
77         throw new NotImplementedException("Not implemented on dummy class");
78     }
79
80     /*
81      * (non-Javadoc)
82      * 
83      * @see java.util.Map#entrySet()
84      */
85     @Override
86     public Set<Entry<String, Object>> entrySet() {
87         throw new NotImplementedException("Not implemented on dummy class");
88     }
89
90     /*
91      * (non-Javadoc)
92      * 
93      * @see java.util.Map#get(java.lang.Object)
94      */
95     @Override
96     public Object get(Object key) {
97         throw new NotImplementedException("Not implemented on dummy class");
98     }
99
100     /*
101      * (non-Javadoc)
102      * 
103      * @see java.util.Map#isEmpty()
104      */
105     @Override
106     public boolean isEmpty() {
107         throw new NotImplementedException("Not implemented on dummy class");
108     }
109
110     /*
111      * (non-Javadoc)
112      * 
113      * @see java.util.Map#keySet()
114      */
115     @Override
116     public Set<String> keySet() {
117         throw new NotImplementedException("Not implemented on dummy class");
118     }
119
120     /*
121      * (non-Javadoc)
122      * 
123      * @see java.util.Map#put(java.lang.Object, java.lang.Object)
124      */
125     @Override
126     public Object put(String key, Object value) {
127         throw new NotImplementedException("Not implemented on dummy class");
128     }
129
130     /*
131      * (non-Javadoc)
132      * 
133      * @see java.util.Map#putAll(java.util.Map)
134      */
135     @Override
136     public void putAll(Map<? extends String, ? extends Object> map) {
137         throw new NotImplementedException("Not implemented on dummy class");
138     }
139
140     /*
141      * (non-Javadoc)
142      * 
143      * @see java.util.Map#remove(java.lang.Object)
144      */
145     @Override
146     public Object remove(Object key) {
147         throw new NotImplementedException("Not implemented on dummy class");
148     }
149
150     /*
151      * (non-Javadoc)
152      * 
153      * @see java.util.Map#size()
154      */
155     @Override
156     public int size() {
157         throw new NotImplementedException("Not implemented on dummy class");
158     }
159
160     /*
161      * (non-Javadoc)
162      * 
163      * @see java.util.Map#values()
164      */
165     @Override
166     public Collection<Object> values() {
167         throw new NotImplementedException("Not implemented on dummy class");
168     }
169
170     /*
171      * (non-Javadoc)
172      * 
173      * @see org.onap.policy.apex.context.ContextAlbum#getKey()
174      */
175     @Override
176     public AxArtifactKey getKey() {
177         return key;
178     }
179
180     /*
181      * (non-Javadoc)
182      * 
183      * @see org.onap.policy.apex.context.ContextAlbum#getName()
184      */
185     @Override
186     public String getName() {
187         throw new NotImplementedException("Not implemented on dummy class");
188     }
189
190     /*
191      * (non-Javadoc)
192      * 
193      * @see org.onap.policy.apex.context.ContextAlbum#getAlbumDefinition()
194      */
195     @Override
196     public AxContextAlbum getAlbumDefinition() {
197         throw new NotImplementedException("Not implemented on dummy class");
198     }
199
200     /*
201      * (non-Javadoc)
202      * 
203      * @see org.onap.policy.apex.context.ContextAlbum#getSchemaHelper()
204      */
205     @Override
206     public SchemaHelper getSchemaHelper() {
207         throw new NotImplementedException("Not implemented on dummy class");
208     }
209
210     /*
211      * (non-Javadoc)
212      * 
213      * @see org.onap.policy.apex.context.ContextAlbum#lockForReading(java.lang.String)
214      */
215     @Override
216     public void lockForReading(String key) throws ContextException {
217         throw new NotImplementedException("Not implemented on dummy class");
218     }
219
220     /*
221      * (non-Javadoc)
222      * 
223      * @see org.onap.policy.apex.context.ContextAlbum#lockForWriting(java.lang.String)
224      */
225     @Override
226     public void lockForWriting(String key) throws ContextException {
227         throw new NotImplementedException("Not implemented on dummy class");
228     }
229
230     /*
231      * (non-Javadoc)
232      * 
233      * @see org.onap.policy.apex.context.ContextAlbum#unlockForReading(java.lang.String)
234      */
235     @Override
236     public void unlockForReading(String key) throws ContextException {
237         throw new NotImplementedException("Not implemented on dummy class");
238     }
239
240     /*
241      * (non-Javadoc)
242      * 
243      * @see org.onap.policy.apex.context.ContextAlbum#unlockForWriting(java.lang.String)
244      */
245     @Override
246     public void unlockForWriting(String key) throws ContextException {
247         throw new NotImplementedException("Not implemented on dummy class");
248     }
249
250     /*
251      * (non-Javadoc)
252      * 
253      * @see org.onap.policy.apex.context.ContextAlbum#getUserArtifactStack()
254      */
255     @Override
256     public AxConcept[] getUserArtifactStack() {
257         throw new NotImplementedException("Not implemented on dummy class");
258     }
259
260     /*
261      * (non-Javadoc)
262      * 
263      * @see
264      * org.onap.policy.apex.context.ContextAlbum#setUserArtifactStack(org.onap.policy.apex.model.basicmodel.concepts.
265      * AxConcept[])
266      */
267     @Override
268     public void setUserArtifactStack(AxConcept[] userArtifactStack) {
269         // Do nothing
270     }
271
272     /*
273      * (non-Javadoc)
274      * 
275      * @see org.onap.policy.apex.context.ContextAlbum#flush()
276      */
277     @Override
278     public void flush() throws ContextException {
279         throw new NotImplementedException("Not implemented on dummy class");
280     }
281 }