cc855e444af3549b57da13f53d6cb92cbe81ad96
[so.git] / common / src / main / java / org / onap / so / client / aai / AAIQueryClient.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 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
21 package org.onap.so.client.aai;
22
23 import org.onap.so.client.aai.entities.AAIResultWrapper;
24 import org.onap.so.client.aai.entities.CustomQuery;
25 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
26 import org.onap.so.client.graphinventory.GraphInventoryQueryClient;
27 import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
28
29 public class AAIQueryClient extends GraphInventoryQueryClient<AAIQueryClient, CustomQuery, AAIResultWrapper, AAIObjectType> {
30
31         public AAIQueryClient() {
32                 super(new AAIClient());
33         }
34         
35         public AAIQueryClient(AAIVersion version) {
36                 super(new AAIClient(version));
37         }
38
39         @Override
40         protected GraphInventoryUri getQueryUri() {
41                 return AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY);
42         }
43         
44         @Override
45         protected GraphInventoryUri setupQueryParams(GraphInventoryUri uri) {
46                 return super.setupQueryParams(uri);
47         }
48
49         @Override
50         public AAIResultWrapper createWrapper(String json) {
51                 return new AAIResultWrapper(json);
52         }
53
54         @Override
55         public AAIObjectType createType(String name) {
56                 return AAIObjectType.fromTypeName(name);
57         }
58         
59 }