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;
23 import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
25 import com.google.common.base.CaseFormat;
27 public enum AAIObjectPlurals implements GraphInventoryObjectPlurals {
29 GENERIC_VNF(AAINamespaceConstants.NETWORK, "/generic-vnfs"),
30 PSERVER(AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/pservers"),
31 P_INTERFACE(AAIObjectType.PSERVER.uriTemplate(), "/p-interfaces"),
32 L3_NETWORK(AAINamespaceConstants.NETWORK, "/l3-networks"),
33 SERVICE_SUBSCRIPTION(AAIObjectType.CUSTOMER.uriTemplate(), "/service-subscriptions"),
34 SERVICE_INSTANCE(AAIObjectType.SERVICE_SUBSCRIPTION.uriTemplate(), "/service-instances"),
35 OWNING_ENTITIES(AAINamespaceConstants.BUSINESS, "/owning-entities"),
36 VOLUME_GROUP(AAIObjectType.CLOUD_REGION.uriTemplate(), "/volume-groups/"),
37 AVAILIBILITY_ZONE(AAIObjectType.CLOUD_REGION.uriTemplate(), "/availability-zones/");
40 private final String uriTemplate;
41 private final String partialUri;
42 private AAIObjectPlurals(String parentUri, String partialUri) {
43 this.uriTemplate = parentUri + partialUri;
44 this.partialUri = partialUri;
48 public String toString() {
49 return this.uriTemplate();
53 public String uriTemplate() {
54 return this.uriTemplate;
58 public String partialUri() {
59 return this.partialUri;
63 public String typeName() {
64 return this.typeName(CaseFormat.LOWER_HYPHEN);
67 public String typeName(CaseFormat format) {
68 return CaseFormat.UPPER_UNDERSCORE.to(format, this.name());