aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java')
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java174
1 files changed, 86 insertions, 88 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java
index ac0aba3c36..406ff09952 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java
@@ -21,96 +21,94 @@
package org.onap.so.client.aai.entities.uri;
import java.net.URI;
-
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
public class AAIUriFactory {
-
- /**
- * values are filled into the URI template specified in {@link AAIObjectType} in order
- * <br>
- * There are two special lookups performed on certain types when a single value is specified:
- * <br>
- * Service Instance and AllottedResources
- * <br>
- * These can be retrieved without all their required keys but an HTTP call is required to do so
- * @param type
- * @param values
- * @return
- */
- public static AAIResourceUri createResourceUri(AAIObjectType type, Object... values) {
- if (AAIObjectType.SERVICE_INSTANCE.equals(type)) {
- return new ServiceInstanceUri(values);
- } else if (AAIObjectType.ALLOTTED_RESOURCE.equals(type)) {
- return new AllottedResourceLookupUri(values);
- } else {
- return new AAISimpleUri(type, values);
- }
- }
-
- public static AAIResourceUri createNodesUri(AAIObjectType type, Object... values) {
- return new NodesUri(type, values);
-
- }
-
- public static AAIResourceUri createNodesUri(AAIObjectPlurals type) {
- return new NodesUri(type);
-
- }
-
- /**
- * This method should only be used to wrap a URI retrieved from A&AI contained within an object response
- *
- * @param type
- * @param uri
- * @return
- */
- public static AAIResourceUri createResourceFromExistingURI(AAIObjectType type, URI uri) {
- return new AAISimpleUri(type, uri);
- }
-
-
- /**
- * creates an AAIResourceUri from a parentUri
- *
- * @param parentUri
- * @param childType
- * @param childValues
- * @return
- */
- public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectType childType, Object... childValues) {
-
- return new AAISimpleUri(parentUri, childType, childValues);
- }
-
- public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectPlurals childType) {
-
- return new AAISimpleUri(parentUri, childType);
- }
-
- /**
- * Creates a uri for a plural type e.g. /cloud-infrastructure/pservers
- *
- * @param type
- * @return
- */
- public static AAIResourceUri createResourceUri(AAIObjectPlurals type) {
-
- return new AAISimpleUri(type);
-
- }
-
- /**
- * Creates a uri for a plural type with values e.g. /cloud-infrastructure/pservers
- *
- * @param type
- * @return
- */
- public static AAIResourceUri createResourceUri(AAIObjectPlurals type, Object... values) {
-
- return new AAISimpleUri(type, values);
-
- }
-} \ No newline at end of file
+
+ /**
+ * values are filled into the URI template specified in {@link AAIObjectType} in order <br>
+ * There are two special lookups performed on certain types when a single value is specified: <br>
+ * Service Instance and AllottedResources <br>
+ * These can be retrieved without all their required keys but an HTTP call is required to do so
+ *
+ * @param type
+ * @param values
+ * @return
+ */
+ public static AAIResourceUri createResourceUri(AAIObjectType type, Object... values) {
+ if (AAIObjectType.SERVICE_INSTANCE.equals(type)) {
+ return new ServiceInstanceUri(values);
+ } else if (AAIObjectType.ALLOTTED_RESOURCE.equals(type)) {
+ return new AllottedResourceLookupUri(values);
+ } else {
+ return new AAISimpleUri(type, values);
+ }
+ }
+
+ public static AAIResourceUri createNodesUri(AAIObjectType type, Object... values) {
+ return new NodesUri(type, values);
+
+ }
+
+ public static AAIResourceUri createNodesUri(AAIObjectPlurals type) {
+ return new NodesUri(type);
+
+ }
+
+ /**
+ * This method should only be used to wrap a URI retrieved from A&AI contained within an object response
+ *
+ * @param type
+ * @param uri
+ * @return
+ */
+ public static AAIResourceUri createResourceFromExistingURI(AAIObjectType type, URI uri) {
+ return new AAISimpleUri(type, uri);
+ }
+
+
+ /**
+ * creates an AAIResourceUri from a parentUri
+ *
+ * @param parentUri
+ * @param childType
+ * @param childValues
+ * @return
+ */
+ public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectType childType,
+ Object... childValues) {
+
+ return new AAISimpleUri(parentUri, childType, childValues);
+ }
+
+ public static AAIResourceUri createResourceFromParentURI(AAIResourceUri parentUri, AAIObjectPlurals childType) {
+
+ return new AAISimpleUri(parentUri, childType);
+ }
+
+ /**
+ * Creates a uri for a plural type e.g. /cloud-infrastructure/pservers
+ *
+ * @param type
+ * @return
+ */
+ public static AAIResourceUri createResourceUri(AAIObjectPlurals type) {
+
+ return new AAISimpleUri(type);
+
+ }
+
+ /**
+ * Creates a uri for a plural type with values e.g. /cloud-infrastructure/pservers
+ *
+ * @param type
+ * @return
+ */
+ public static AAIResourceUri createResourceUri(AAIObjectPlurals type, Object... values) {
+
+ return new AAISimpleUri(type, values);
+
+ }
+}