fd5a6f4b7843b4da3d4c279835185b01b22998e4
[ccsdk/sli/adaptors.git] / aai-service / provider / src / main / java / org / onap / ccsdk / sli / adaptors / aai / AAIClient.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : SDN-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *             reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.ccsdk.sli.adaptors.aai;
23
24 import java.io.IOException;
25 import java.net.MalformedURLException;
26 import java.net.URL;
27 import java.util.Map;
28
29 import org.openecomp.aai.inventory.v13.*;
30 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
34 import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;
35
36 import com.fasterxml.jackson.core.JsonParseException;
37 import com.fasterxml.jackson.databind.JsonMappingException;
38
39 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
40
41     public SearchResults requestServiceInstanceURL(String svcInstanceId) throws AAIServiceException;
42
43     // VServers
44     public Vserver requestVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId) throws AAIServiceException;
45
46     public URL requestVserverURLNodeQuery(String vserverName) throws AAIServiceException;
47     public String getTenantIdFromVserverUrl(URL url);
48     public String getCloudOwnerFromVserverUrl(URL url);
49     public String getCloudRegionFromVserverUrl(URL url);
50     public String getVServerIdFromVserverUrl(URL url, String tennantId);
51     public Vserver requestVServerDataByURL(URL url) throws AAIServiceException;
52
53
54
55     // ----------------- Release 1510 ----------------------
56     //    // GenericVNF
57     public GenericVnf requestGenericVnfData(String vnfId) throws AAIServiceException;
58     public boolean postGenericVnfData(String vnfId, GenericVnf request) throws AAIServiceException;
59
60     // Physical Link
61     public PhysicalLink requestPhysicalLinkData(String vnfId) throws AAIServiceException;
62     public boolean postPhysicalLinkData(String vnfId, PhysicalLink request) throws AAIServiceException;
63     public boolean deletePhysicalLinkData(String vnfId, String resourceVersion) throws AAIServiceException;
64
65     // UBB Notify
66     public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
67
68     // Node Query - 1602
69     public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException;
70     public String requestDataByURL(URL url) throws AAIServiceException;
71     public GenericVnf requestGenericVnfeNodeQuery(String vnfName) throws AAIServiceException;
72
73     public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
74     public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
75
76     public void logKeyError(String keys);
77
78     public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix,  SvcLogicContext ctx, Map<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ;
79     public String getPathTemplateForResource(String resoourceName, String join, SvcLogicContext ctx) throws MalformedURLException;
80     public boolean isDeprecatedFormat(String resource, Map<String, String> nameValues);
81
82     String query(AAIRequest request) throws AAIServiceException;
83     String save(AAIRequest request) throws AAIServiceException;
84     boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException;
85     boolean update(AAIRequest request, String resourceVersion) throws AAIServiceException;
86
87 }