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