553c1e0db018fd2e34171b876a36438df6f26ed2
[so.git] / common / src / main / java / org / onap / so / client / aai / AAIObjectPlurals.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.so.client.aai;
22
23 import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
24
25 import com.google.common.base.CaseFormat;
26
27 public enum AAIObjectPlurals implements GraphInventoryObjectPlurals {
28
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/");
38
39
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;
45         }
46
47         @Override
48         public String toString() {
49                 return this.uriTemplate();
50         }
51
52         @Override
53         public String uriTemplate() {
54                 return this.uriTemplate;
55         }
56
57         @Override
58         public String partialUri() {
59                 return this.partialUri;
60         }
61
62         @Override
63         public String typeName() {
64                 return this.typeName(CaseFormat.LOWER_HYPHEN);
65         }
66         @Override
67         public String typeName(CaseFormat format) {
68                 return CaseFormat.UPPER_UNDERSCORE.to(format, this.name());
69         }
70 }