2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.client.aai.entities;
23 import java.util.List;
25 import javax.ws.rs.core.UriBuilder;
27 import org.onap.so.client.aai.AAIObjectType;
28 import org.onap.so.client.aai.AAIResourcesClient;
29 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
30 import org.onap.so.client.aai.entities.uri.AAIUriFactory;
31 import org.onap.so.client.graphinventory.GraphInventoryObjectName;
32 import org.onap.so.client.graphinventory.entities.GraphInventoryRelationships;
34 public class Relationships extends GraphInventoryRelationships<AAIResultWrapper, AAIResourceUri, AAIObjectType>{
36 public Relationships(String json) {
42 * Use getRelatedUris instead
45 public List<AAIResourceUri> getRelatedAAIUris() {
46 return this.getRelatedUris();
51 * Use getRelatedUris instead
54 public List<AAIResourceUri> getRelatedAAIUris(GraphInventoryObjectName type) {
55 return this.getRelatedUris(type);
59 protected AAIResultWrapper get(AAIResourceUri uri) {
60 return new AAIResourcesClient().get(uri);
65 protected AAIResourceUri createUri(AAIObjectType type, String relatedLink) {
67 return AAIUriFactory.createResourceFromExistingURI(type, UriBuilder.fromPath(relatedLink).build());
71 protected AAIObjectType fromTypeName(String name) {
72 return AAIObjectType.fromTypeName(name);