Update the license for 2017-2018 license
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / extensions / AAIExtensionMap.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.aai.extensions;
21
22 import org.apache.tinkerpop.gremlin.structure.Graph;
23 import org.apache.tinkerpop.gremlin.structure.Vertex;
24 import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
25 import org.onap.aai.domain.responseMessage.AAIResponseMessages;
26 import org.onap.aai.introspection.Loader;
27 import org.onap.aai.rest.db.DBRequest;
28 import org.onap.aai.rest.db.HttpEntry;
29 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
30
31 import javax.servlet.http.HttpServletRequest;
32 import javax.ws.rs.core.HttpHeaders;
33 import javax.ws.rs.core.UriInfo;
34 import java.lang.reflect.Method;
35 import java.util.ArrayList;
36 import java.util.HashMap;
37
38 public class AAIExtensionMap {
39         // =======================================================================
40         // Attribute | Type
41         // =======================================================================
42         // message | java.lang.String (RW)
43         // ----------------------------------------------------------------------
44         // templateVars | java.lang.ArrayList<String> (RW)
45         // -----------------------------------------------------------------------
46         // preExtException | java.lang.Exception (RW)
47         // -----------------------------------------------------------------------
48         // preExtErrorCallback | java.lang.reflect.Method (RW)
49         // -----------------------------------------------------------------------
50         // postExtException | java.lang.Exception (RW)
51         // -----------------------------------------------------------------------
52         // postExtErrorCallback | java.lang.reflect.Method (RW)
53         // -----------------------------------------------------------------------
54         // servletRequest | javax.servlet.http.HttpServletRequest (RO)
55         // -----------------------------------------------------------------------
56         // headers | javax.ws.rs.core.HttpHeaders (RO)
57         // -----------------------------------------------------------------------
58         // objFromRequestType | String (ex. ?org.onap.aai.domain.yang.Vce?) (RO)
59         // -----------------------------------------------------------------------
60         // objFromRequest | $TYPE {ObjFromRequestType) (RO)
61         // -----------------------------------------------------------------------
62         // preExtFailOnError | java.lang.Boolean (RW)
63         // -----------------------------------------------------------------------
64         // postExtFailOnError | java.lang.Boolean (RW)
65         // -----------------------------------------------------------------------
66         // preExtSkipErrorCallback | java.lang.Boolean (RW)
67         // -----------------------------------------------------------------------
68         // postExtSkipErrorCallback | java.lang.Boolean (RW)
69         // -----------------------------------------------------------------------
70         // graph | com.thinkaurelius.titan.core.TitanGraph (RW)
71         // -----------------------------------------------------------------------
72         // objectFromResponse | Object
73         // -----------------------------------------------------------------------
74         // precheckAddedList | java.util.HashMap
75         // -----------------------------------------------------------------------
76         // precheckResponseMessages | org.onap.aai.extensions.AAIResponseMessages
77         // =======================================================================
78
79         private String message;
80         private ArrayList<String> templateVars;
81         private Exception preExtException;
82         private Exception postExtException;
83         private Method preExtErrorCallback;
84         private Method postExtErrorCallback;
85         private HttpServletRequest servletRequest;
86         private HttpHeaders httpHeaders;
87         private String objectFromRequestType;
88         private Object objectFromRequest;
89         private boolean preExtFailOnError = true;
90         private boolean postExtFailOnError = true;
91         private boolean preExtSkipErrorCallback = true;
92         private boolean postExtSkipErrorCallback = true;
93         private String fromAppId;
94         private String transId;
95         private Graph graph;
96         private Object objectFromResponse;
97         private HashMap<String, Object> lookupHashMap;
98         private HashMap<String, ArrayList<String>> precheckAddedList;
99         private AAIResponseMessages precheckResponseMessages;
100         private HashMap<String, Object> topology;
101         private HashMap<String, Vertex> vertexCache;
102         private String baseObject;
103         private String namespace;
104         private String fullResourceName;
105         private String topObjectFullResourceName;
106         private String uri;
107         private String notificationUri;
108         private String apiVersion;
109         private long startTime;
110         private long checkpointTime;
111         private DynamicJAXBContext jaxbContext;
112         private String objectFromResponseType;
113         private String eventAction;
114         private TransactionalGraphEngine dbEngine;
115         private Loader loader;
116         private UriInfo uriInfo;
117         private DBRequest dbRequest;
118         private HttpEntry httpEntry;
119         /**
120          * Sets the message.
121          *
122          * @param _message the new message
123          */
124         public void setMessage(String _message) {
125                 this.message = _message;
126         }
127
128         /**
129          * Sets the template vars.
130          *
131          * @param _templateVars the new template vars
132          */
133         public void setTemplateVars(ArrayList<String> _templateVars) {
134                 this.templateVars = _templateVars;
135         }
136
137         /**
138          * Sets the pre ext exception.
139          *
140          * @param _exception the new pre ext exception
141          */
142         public void setPreExtException(Exception _exception) {
143                 this.preExtException = _exception;
144         }
145
146         /**
147          * Sets the pre ext error callback.
148          *
149          * @param _errorCallback the new pre ext error callback
150          */
151         public void setPreExtErrorCallback(Method _errorCallback) {
152                 this.preExtErrorCallback = _errorCallback;
153         }
154
155         /**
156          * Sets the post ext exception.
157          *
158          * @param _exception the new post ext exception
159          */
160         public void setPostExtException(Exception _exception) {
161                 this.postExtException = _exception;
162         }
163
164         /**
165          * Sets the post ext error callback.
166          *
167          * @param _errorCallback the new post ext error callback
168          */
169         public void setPostExtErrorCallback(Method _errorCallback) {
170                 this.postExtErrorCallback = _errorCallback;
171         }
172
173         /**
174          * Sets the servlet request.
175          *
176          * @param _httpServletRequest the new servlet request
177          */
178         public void setServletRequest(HttpServletRequest _httpServletRequest) {
179                 this.servletRequest = _httpServletRequest;
180         }
181
182         /**
183          * Sets the http headers.
184          *
185          * @param _httpHeaders the new http headers
186          */
187         public void setHttpHeaders(HttpHeaders _httpHeaders) {
188                 this.httpHeaders = _httpHeaders;
189         }
190
191         /**
192          * Sets the object from request type.
193          *
194          * @param _objectFromRequestType the new object from request type
195          */
196         public void setObjectFromRequestType(String _objectFromRequestType) {
197                 this.objectFromRequestType = _objectFromRequestType;
198         }
199
200         /**
201          * Sets the object from request.
202          *
203          * @param _objectFromRequest the new object from request
204          */
205         public void setObjectFromRequest(Object _objectFromRequest) {
206                 this.objectFromRequest = _objectFromRequest;
207         }
208
209         /**
210          * Sets the object from response type.
211          *
212          * @param resourceClassName the new object from response type
213          */
214         public void setObjectFromResponseType(String resourceClassName) {
215                 // TODO Auto-generated method stub
216                 this.objectFromResponseType = resourceClassName;
217         }
218         
219         /**
220          * Gets the object from response type.
221          *
222          * @return the object from response type
223          */
224         public String getObjectFromResponseType() {
225                 // TODO Auto-generated method stub
226                 return this.objectFromResponseType;
227         }
228         
229         /**
230          * Sets the pre ext fail on error.
231          *
232          * @param _failOnError the new pre ext fail on error
233          */
234         public void setPreExtFailOnError(boolean _failOnError) {
235                 this.preExtFailOnError = _failOnError;
236         }
237
238         /**
239          * Sets the post ext fail on error.
240          *
241          * @param _failOnError the new post ext fail on error
242          */
243         public void setPostExtFailOnError(boolean _failOnError) {
244                 this.postExtFailOnError = _failOnError;
245         }
246
247         /**
248          * Gets the message.
249          *
250          * @return the message
251          */
252         public String getMessage() {
253                 return this.message;
254         }
255
256         /**
257          * Gets the template vars.
258          *
259          * @return the template vars
260          */
261         public ArrayList<String> getTemplateVars() {
262                 if (this.templateVars == null) {
263                         this.templateVars = new ArrayList<String>();
264                 }
265                 return this.templateVars;
266         }
267
268         /**
269          * Gets the pre ext exception.
270          *
271          * @return the pre ext exception
272          */
273         public Exception getPreExtException() {
274                 return this.preExtException;
275         }
276
277         /**
278          * Gets the pre ext error callback.
279          *
280          * @return the pre ext error callback
281          */
282         public Method getPreExtErrorCallback() {
283                 return this.preExtErrorCallback;
284         }
285
286         /**
287          * Gets the post ext exception.
288          *
289          * @return the post ext exception
290          */
291         public Exception getPostExtException() {
292                 return this.postExtException;
293         }
294
295         /**
296          * Gets the post ext error callback.
297          *
298          * @return the post ext error callback
299          */
300         public Method getPostExtErrorCallback() {
301                 return this.postExtErrorCallback;
302         }
303
304         /**
305          * Gets the http servlet request.
306          *
307          * @return the http servlet request
308          */
309         public HttpServletRequest getHttpServletRequest() {
310                 return this.servletRequest;
311         }
312
313         /**
314          * Gets the http headers.
315          *
316          * @return the http headers
317          */
318         public HttpHeaders getHttpHeaders() {
319                 return this.httpHeaders;
320         }
321
322         /**
323          * Gets the object from request type.
324          *
325          * @return the object from request type
326          */
327         public String getObjectFromRequestType() {
328                 return this.objectFromRequestType;
329         }
330
331         /**
332          * Gets the object from request.
333          *
334          * @return the object from request
335          */
336         public Object getObjectFromRequest() {
337                 return this.objectFromRequest;
338         }
339
340         /**
341          * Gets the pre ext fail on error.
342          *
343          * @return the pre ext fail on error
344          */
345         public boolean getPreExtFailOnError() {
346                 return this.preExtFailOnError;
347         }
348
349         /**
350          * Gets the post ext fail on error.
351          *
352          * @return the post ext fail on error
353          */
354         public boolean getPostExtFailOnError() {
355                 return this.postExtFailOnError;
356         }
357
358         /**
359          * Gets the from app id.
360          *
361          * @return the from app id
362          */
363         public String getFromAppId() {
364                 return this.fromAppId;
365         }
366
367         /**
368          * Sets the from app id.
369          *
370          * @param fromAppId the new from app id
371          */
372         public void setFromAppId(String fromAppId) {
373                 this.fromAppId = fromAppId;
374         }
375
376         /**
377          * Gets the trans id.
378          *
379          * @return the trans id
380          */
381         public String getTransId() {
382                 return this.transId;
383         }
384
385         /**
386          * Sets the trans id.
387          *
388          * @param transId the new trans id
389          */
390         public void setTransId(String transId) {
391                 this.transId = transId;
392         }
393         
394         /**
395          * Gets the pre ext skip error callback.
396          *
397          * @return the pre ext skip error callback
398          */
399         public boolean getPreExtSkipErrorCallback() {
400                 return preExtSkipErrorCallback;
401         }
402
403         /**
404          * Sets the pre ext skip error callback.
405          *
406          * @param preExtSkipErrorCallback the new pre ext skip error callback
407          */
408         public void setPreExtSkipErrorCallback(boolean preExtSkipErrorCallback) {
409                 this.preExtSkipErrorCallback = preExtSkipErrorCallback;
410         }
411
412         /**
413          * Gets the post ext skip error callback.
414          *
415          * @return the post ext skip error callback
416          */
417         public boolean getPostExtSkipErrorCallback() {
418                 return postExtSkipErrorCallback;
419         }
420
421         /**
422          * Sets the post ext skip error callback.
423          *
424          * @param postExtSkipErrorCallback the new post ext skip error callback
425          */
426         public void setPostExtSkipErrorCallback(boolean postExtSkipErrorCallback) {
427                 this.postExtSkipErrorCallback = postExtSkipErrorCallback;
428         }
429
430         /**
431          * Gets the graph.
432          *
433          * @return the graph
434          */
435         public Graph getGraph() {
436                 return graph;
437         }
438
439         /**
440          * Sets the graph.
441          *
442          * @param graph the new graph
443          */
444         public void setGraph(Graph graph) {
445                 this.graph = graph;
446         }
447
448         /**
449          * Gets the object from response.
450          *
451          * @return the object from response
452          */
453         public Object getObjectFromResponse() {
454                 return objectFromResponse;
455         }
456
457         /**
458          * Sets the object from response.
459          *
460          * @param objectFromResponse the new object from response
461          */
462         public void setObjectFromResponse(Object objectFromResponse) {
463                 this.objectFromResponse = objectFromResponse;
464         }
465
466         /**
467          * Gets the lookup hash map.
468          *
469          * @return the lookup hash map
470          */
471         public HashMap<String, Object> getLookupHashMap() {
472                 if (this.lookupHashMap == null) {
473                         this.lookupHashMap = new HashMap<String, Object>();
474                 }
475                 return this.lookupHashMap;
476         }
477
478         /**
479          * Sets the lookup hash map.
480          *
481          * @param lookupHashMap the lookup hash map
482          */
483         public void setLookupHashMap(HashMap<String, Object> lookupHashMap) {
484                 this.lookupHashMap = lookupHashMap;
485         }
486
487         /**
488          * Gets the precheck added list.
489          *
490          * @return the precheck added list
491          */
492         public HashMap<String, ArrayList<String>> getPrecheckAddedList() {
493                 if (this.precheckAddedList == null) {
494                         this.precheckAddedList = new HashMap<String, ArrayList<String>>();
495                 }
496                 return precheckAddedList;
497         }
498
499         /**
500          * Sets the precheck added list.
501          *
502          * @param precheckAddedList the precheck added list
503          */
504         public void setPrecheckAddedList(HashMap<String, ArrayList<String>> precheckAddedList) {
505                 this.precheckAddedList = precheckAddedList;
506         }
507
508         /**
509          * Gets the precheck response messages.
510          *
511          * @return the precheck response messages
512          */
513         public AAIResponseMessages getPrecheckResponseMessages() {
514                 if (this.precheckResponseMessages == null) { 
515                         this.precheckResponseMessages = new AAIResponseMessages();
516                 }
517                 return precheckResponseMessages;
518         }
519
520         /**
521          * Sets the precheck response messages.
522          *
523          * @param precheckResponseData the new precheck response messages
524          */
525         public void setPrecheckResponseMessages(AAIResponseMessages precheckResponseData) {
526                 this.precheckResponseMessages = precheckResponseData;
527         }
528
529         /**
530          * Gets the topology.
531          *
532          * @return the topology
533          */
534         public HashMap<String, Object> getTopology() {
535                 if (this.topology == null) { 
536                         this.topology = new HashMap<String, Object>();
537                 }
538                 return topology;
539         }
540         
541         /**
542          * Gets the vertex cache.
543          *
544          * @return the vertex cache
545          */
546         public HashMap<String, Vertex> getVertexCache() {
547                 if (this.vertexCache == null) { 
548                         this.vertexCache = new HashMap<String, Vertex>();
549                 }
550                 return vertexCache;
551         }
552
553         /**
554          * Gets the base object.
555          *
556          * @return the base object
557          */
558         public String getBaseObject() {
559                 return baseObject;
560         }
561
562         /**
563          * Sets the base object.
564          *
565          * @param baseObject the new base object
566          */
567         public void setBaseObject(String baseObject) {
568                 this.baseObject = baseObject;
569         }
570
571         /**
572          * Gets the namespace.
573          *
574          * @return the namespace
575          */
576         public String getNamespace() {
577                 return namespace;
578         }
579
580         /**
581          * Sets the namespace.
582          *
583          * @param namespace the new namespace
584          */
585         public void setNamespace(String namespace) {
586                 this.namespace = namespace;
587         }
588
589         /**
590          * Gets the full resource name.
591          *
592          * @return the full resource name
593          */
594         public String getFullResourceName() {
595                 return fullResourceName;
596         }
597
598         /**
599          * Sets the full resource name.
600          *
601          * @param fullResourceName the new full resource name
602          */
603         public void setFullResourceName(String fullResourceName) {
604                 this.fullResourceName = fullResourceName;
605         }
606
607         /**
608          * Gets the top object full resource name.
609          *
610          * @return the top object full resource name
611          */
612         public String getTopObjectFullResourceName() {
613                 return topObjectFullResourceName;
614         }
615
616         /**
617          * Sets the top object full resource name.
618          *
619          * @param topObjectFullResourceName the new top object full resource name
620          */
621         public void setTopObjectFullResourceName(String topObjectFullResourceName) {
622                 this.topObjectFullResourceName = topObjectFullResourceName;
623         }
624
625         /**
626          * Gets the uri.
627          *
628          * @return the uri
629          */
630         public String getUri() {
631                 return uri;
632         }
633
634         /**
635          * Sets the uri.
636          *
637          * @param uri the new uri
638          */
639         public void setUri(String uri) {
640                 this.uri = uri;
641         }
642
643         /**
644          * Gets the api version.
645          *
646          * @return the api version
647          */
648         public String getApiVersion() {
649                 return apiVersion;
650         }
651
652         /**
653          * Sets the api version.
654          *
655          * @param apiVersion the new api version
656          */
657         public void setApiVersion(String apiVersion) {
658                 this.apiVersion = apiVersion;
659         }
660
661         /**
662          * Sets the notification uri.
663          *
664          * @param uri the new notification uri
665          */
666         public void setNotificationUri(String uri) {
667                 this.notificationUri = uri;
668                 
669         }
670         
671         /**
672          * Gets the notification uri.
673          *
674          * @return the notification uri
675          */
676         public String getNotificationUri() {
677                 return this.notificationUri;
678                 
679         }
680
681         /**
682          * Gets the start time.
683          *
684          * @return the start time
685          */
686         public long getStartTime() {
687                 return startTime;
688         }
689
690         /**
691          * Sets the start time.
692          *
693          * @param startTime the new start time
694          */
695         public void setStartTime(long startTime) {
696                 this.startTime = startTime;
697         }
698
699         /**
700          * Gets the checkpoint time.
701          *
702          * @return the checkpoint time
703          */
704         public long getCheckpointTime() {
705                 return checkpointTime;
706         }
707
708         /**
709          * Sets the checkpoint time.
710          *
711          * @param checkpointTime the new checkpoint time
712          */
713         public void setCheckpointTime(long checkpointTime) {
714                 this.checkpointTime = checkpointTime;
715         }
716
717         /**
718          * Gets the jaxb context.
719          *
720          * @return the jaxb context
721          */
722         public DynamicJAXBContext getJaxbContext() {
723                 return jaxbContext;
724         }
725
726         /**
727          * Sets the jaxb context.
728          *
729          * @param jaxbContext the new jaxb context
730          */
731         public void setJaxbContext(DynamicJAXBContext jaxbContext) {
732                 this.jaxbContext = jaxbContext;
733         }
734
735         /**
736          * Sets the event action.
737          *
738          * @param eventAction the new event action
739          */
740         public void setEventAction(String eventAction) {
741                 this.eventAction = eventAction;
742         }
743         
744         /**
745          * Gets the event action.
746          *
747          * @return the event action
748          */
749         public String getEventAction() {
750                 return this.eventAction;
751         }
752
753         /**
754          * Gets the transactional graph engine.
755          *
756          * @return the transactional graph engine
757          */
758         public TransactionalGraphEngine getTransactionalGraphEngine() {
759                 return this.dbEngine;
760                 
761         }
762         
763         /**
764          * Sets the transactional graph engine.
765          *
766          * @param dbEngine the new transactional graph engine
767          */
768         public void setTransactionalGraphEngine(TransactionalGraphEngine dbEngine) {
769                 this.dbEngine = dbEngine;
770
771         }
772
773         /**
774          * Gets the loader.
775          *
776          * @return the loader
777          */
778         public Loader getLoader() {
779                 return loader;
780         }
781
782         /**
783          * Sets the loader.
784          *
785          * @param loader the new loader
786          */
787         public void setLoader(Loader loader) {
788                 this.loader = loader;
789         }
790
791         /**
792          * Gets the uri info.
793          *
794          * @return the uri info
795          */
796         public UriInfo getUriInfo() {
797                 return uriInfo;
798         }
799
800         /**
801          * Sets the uri info.
802          *
803          * @param uriInfo the new uri info
804          */
805         public void setUriInfo(UriInfo uriInfo) {
806                 this.uriInfo = uriInfo;
807         }
808
809         public DBRequest getDbRequest() {
810                 return dbRequest;
811         }
812
813         public void setDbRequest(DBRequest dbRequest) {
814                 this.dbRequest = dbRequest;
815         }
816
817         public HttpEntry getHttpEntry() {
818                 return httpEntry;
819         }
820
821         public void setHttpEntry(HttpEntry httpEntry) {
822                 this.httpEntry = httpEntry;
823         }       
824 }