AAI url addition for Metadatum
[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 java.io.Serializable;
24 import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals;
25 import org.onap.so.constants.Defaults;
26 import com.google.common.base.CaseFormat;
27
28 public class AAIObjectPlurals implements GraphInventoryObjectPlurals, Serializable {
29
30     private static final long serialVersionUID = 5312713297525740746L;
31
32     public static final AAIObjectPlurals CUSTOMER =
33             new AAIObjectPlurals(AAINamespaceConstants.BUSINESS, "/customers", "customer");
34     public static final AAIObjectPlurals GENERIC_VNF =
35             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/generic-vnfs", "generic-vnf");
36     public static final AAIObjectPlurals PORT_GROUP =
37             new AAIObjectPlurals(AAIObjectType.VCE.uriTemplate(), "/port-groups", "port-group");
38     public static final AAIObjectPlurals PSERVER =
39             new AAIObjectPlurals(AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/pservers", "pserver");
40     public static final AAIObjectPlurals P_INTERFACE =
41             new AAIObjectPlurals(AAIObjectType.PSERVER.uriTemplate(), "/p-interfaces", "p-interface");
42     public static final AAIObjectPlurals L3_NETWORK =
43             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/l3-networks", "l3-network");
44     public static final AAIObjectPlurals NETWORK_POLICY =
45             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/network-policies", "network-policy");
46     public static final AAIObjectPlurals VPN_BINDING =
47             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/vpn-bindings", "vpn-binding");
48     public static final AAIObjectPlurals SERVICE_SUBSCRIPTION = new AAIObjectPlurals(
49             AAIObjectType.CUSTOMER.uriTemplate(), "/service-subscriptions", "service-subscription");
50     public static final AAIObjectPlurals SERVICE_INSTANCE = new AAIObjectPlurals(
51             AAIObjectType.SERVICE_SUBSCRIPTION.uriTemplate(), "/service-instances", "service-instance");
52     public static final AAIObjectPlurals OWNING_ENTITY =
53             new AAIObjectPlurals(AAINamespaceConstants.BUSINESS, "/owning-entities", "owning-entity");
54     public static final AAIObjectPlurals VOLUME_GROUP =
55             new AAIObjectPlurals(AAIObjectType.CLOUD_REGION.uriTemplate(), "/volume-groups", "volume-group");
56     public static final AAIObjectPlurals AVAILIBILITY_ZONE =
57             new AAIObjectPlurals(AAIObjectType.CLOUD_REGION.uriTemplate(), "/availability-zones", "availability-zone");
58     public static final AAIObjectPlurals VF_MODULE =
59             new AAIObjectPlurals(AAIObjectType.GENERIC_VNF.uriTemplate(), "/vf-modules", "vf-module");
60     public static final AAIObjectPlurals CONFIGURATION =
61             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/configurations", "configuration");
62     public static final AAIObjectPlurals DEFAULT_TENANT =
63             new AAIObjectPlurals(AAINamespaceConstants.CLOUD_INFRASTRUCTURE + "/cloud-regions/cloud-region/"
64                     + Defaults.CLOUD_OWNER + "/AAIAIC25", "/tenants", "default-tenant");
65     public static final AAIObjectPlurals NETWORK_TECHNOLOGY = new AAIObjectPlurals(
66             AAINamespaceConstants.CLOUD_INFRASTRUCTURE, "/network-technologies", "network-technology");
67     public static final AAIObjectPlurals LOGICAL_LINK =
68             new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/logical-links", "logical-link");
69     public static final AAIObjectPlurals L_INTERFACE =
70             new AAIObjectPlurals(AAIObjectType.VSERVER.uriTemplate(), "/l-interfaces", "l-interface");
71     public static final AAIObjectPlurals SUB_L_INTERFACE =
72             new AAIObjectPlurals(AAIObjectType.L_INTERFACE.uriTemplate(), "/l-interfaces", "l-interface");
73     public static final AAIObjectPlurals PNF = new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/pnfs", "pnfs");
74
75     private final String uriTemplate;
76     private final String partialUri;
77     private final String name;
78
79     protected AAIObjectPlurals(String parentUri, String partialUri, String name) {
80         this.uriTemplate = parentUri + partialUri;
81         this.partialUri = partialUri;
82         this.name = name;
83     }
84
85     @Override
86     public String toString() {
87         return this.uriTemplate();
88     }
89
90     @Override
91     public String uriTemplate() {
92         return this.uriTemplate;
93     }
94
95     @Override
96     public String partialUri() {
97         return this.partialUri;
98     }
99
100     @Override
101     public String typeName() {
102         return this.typeName(CaseFormat.LOWER_HYPHEN);
103     }
104
105     @Override
106     public String typeName(CaseFormat format) {
107         return CaseFormat.LOWER_HYPHEN.to(format, this.name);
108     }
109 }