summaryrefslogtreecommitdiffstats
path: root/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java
blob: 1f3c511228520b8e8a19bdc47b34353f5611a5ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*-
 * ============LICENSE_START=======================================================
 * openECOMP : SDN-C
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights
 *             reserved.
 * Modifications Copyright © 2018 IBM.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */
/**
 * @author Rich Tabedzki
 *
 */
package org.onap.ccsdk.sli.adaptors.aai;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

import org.onap.aai.inventory.v25.*;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;

public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {

    public SearchResults requestServiceInstanceURL(String svcInstanceId) throws AAIServiceException;

    // VServers
    public Vserver requestVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId) throws AAIServiceException;

    public URL requestVserverURLNodeQuery(String vserverName) throws AAIServiceException;
    public String getTenantIdFromVserverUrl(URL url);
    public String getCloudOwnerFromVserverUrl(URL url);
    public String getCloudRegionFromVserverUrl(URL url);
    public String getVServerIdFromVserverUrl(URL url, String tennantId);
    public Vserver requestVServerDataByURL(URL url) throws AAIServiceException;



    // ----------------- Release 1510 ----------------------
    //    // GenericVNF
    public GenericVnf requestGenericVnfData(String vnfId) throws AAIServiceException;
    public boolean postGenericVnfData(String vnfId, GenericVnf request) throws AAIServiceException;

    // Physical Link
    public PhysicalLink requestPhysicalLinkData(String vnfId) throws AAIServiceException;
    public boolean postPhysicalLinkData(String vnfId, PhysicalLink request) throws AAIServiceException;
    public boolean deletePhysicalLinkData(String vnfId, String resourceVersion) throws AAIServiceException;

    // UBB Notify
    public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;

    // Node Query - 1602
    public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException;
    public String requestDataByURL(URL url) throws AAIServiceException;
    public GenericVnf requestGenericVnfeNodeQuery(String vnfName) throws AAIServiceException;

    public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
    public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;

    public void logKeyError(String keys);

    public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix,  SvcLogicContext ctx, Map<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ;
    public String getPathTemplateForResource(String resoourceName, String join, SvcLogicContext ctx) throws MalformedURLException;
    public boolean isDeprecatedFormat(String resource, Map<String, String> nameValues);

    String query(AAIRequest request) throws AAIServiceException;
    String save(AAIRequest request) throws AAIServiceException;
    boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException;
    boolean update(AAIRequest request, String resourceVersion) throws AAIServiceException;

}