import java.util.List;
import java.util.UUID;
-public class ElementFactory {
+public final class ElementFactory {
private static final String CI_SERVICE = "ciService";
private static final String CI_RES = "ciRes";
private static final String RESOURCE_INSTANCE_POS_X = "20";
private static final String RESOURCE_INSTANCE_POS_Y = "20";
private static final String RESOURCE_INSTANCE_DESCRIPTION = "description";
+
+ private ElementFactory() {
+
+ }
// *** Getters ***
}
public static ResourceReqDetails getDefaultResource(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId) {
- resourceName = (resourceName + generateUUIDforSufix());
+ resourceName = addRandomSuffixToName(resourceName);
String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
ArrayList<String> resourceTags = new ArrayList<>();
resourceTags.add(resourceName);
}
public static ResourceReqDetails getDefaultResource(String resourceName, Resource derived, ResourceCategoryEnum category, String contactId) {
- resourceName = (resourceName + generateUUIDforSufix());
+ resourceName = addRandomSuffixToName(resourceName);
String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
ArrayList<String> resourceTags = new ArrayList<>();
resourceTags.add(resourceName);
}
+ public static String addRandomSuffixToName(final String name) {
+ return name + generateUUIDforSufix();
+ }
+
public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, ResourceTypeEnum resourceType) {
return getDefaultResourceByType(resourceName, derived, category, contactId, resourceType.toString());
}
}
public static String generateUUIDforSufix() {
-
- String uniqueSufix = UUID.randomUUID().toString();
- String[] split = uniqueSufix.split("-");
- return uniqueSufix = split[4];
+ final String uniqueSuffix = UUID.randomUUID().toString();
+ return uniqueSuffix.split("-")[4];
}
private static String normalizeArtifactLabel(String label) {