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