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