Isolate deprecated code in CCSDK aai-service
[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.HashMap;
28 import java.util.Map;
29
30 import org.openecomp.aai.inventory.v11.*;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
34 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
35 import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;
36
37 import com.fasterxml.jackson.core.JsonParseException;
38 import com.fasterxml.jackson.databind.JsonMappingException;
39
40 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
41
42         public SearchResults requestServiceInstanceURL(String svc_instanceId) throws AAIServiceException;
43
44     // VServers
45     public Vserver requestVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId) throws AAIServiceException;
46
47     public URL requestVserverURLNodeQuery(String vserverName) throws AAIServiceException;
48     public String getTenantIdFromVserverUrl(URL url);
49     public String getCloudOwnerFromVserverUrl(URL url);
50     public String getCloudRegionFromVserverUrl(URL url);
51     public String getVServerIdFromVserverUrl(URL url, String tennantId);
52     public Vserver requestVServerDataByURL(URL url) throws AAIServiceException;
53
54
55
56     // ----------------- Release 1510 ----------------------
57     //    // GenericVNF
58     public GenericVnf requestGenericVnfData(String vnfId) throws AAIServiceException;
59     public boolean postGenericVnfData(String vnfId, GenericVnf request) throws AAIServiceException;
60
61     // Physical Link
62     public PhysicalLink requestPhysicalLinkData(String vnfId) throws AAIServiceException;
63     public boolean postPhysicalLinkData(String vnfId, PhysicalLink request) throws AAIServiceException;
64     public boolean deletePhysicalLinkData(String vnfId, String resourceVersion) throws AAIServiceException;
65
66     // UBB Notify
67     public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
68
69     // Node Query - 1602
70     public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException;
71     public String requestDataByURL(URL url) throws AAIServiceException;
72         public GenericVnf requestGenericVnfeNodeQuery(String vnfName) throws AAIServiceException;
73
74     public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
75     public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
76
77     public void logKeyError(String keys);
78
79     public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix,  SvcLogicContext ctx, HashMap<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ;
80     public String getPathTemplateForResource(String resoourceName, String join, SvcLogicContext ctx) throws MalformedURLException;
81     public boolean isDeprecatedFormat(String resource, HashMap<String, String> nameValues);
82
83     String query(AAIRequest request) throws AAIServiceException;
84     String save(AAIRequest request) throws AAIServiceException;
85     boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException;
86         boolean update(AAIRequest request, String resourceVersion) throws AAIServiceException;
87
88 }