Backend support for operation milestone filters
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / enums / JsonPresentationFields.java
index 40d6a70..e96477d 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.openecomp.sdc.be.datatypes.enums;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.ToString;
 
+@AllArgsConstructor
+@Getter
+@ToString(onlyExplicitlyIncluded = true)
 public enum JsonPresentationFields {
-
+    // @formatter:off
     UNIQUE_ID("uniqueId", GraphPropertyEnum.UNIQUE_ID),
     HIGHEST_VERSION("highestVersion", GraphPropertyEnum.IS_HIGHEST_VERSION),
     LIFECYCLE_STATE("lifecycleState", GraphPropertyEnum.STATE),
@@ -42,6 +47,10 @@ public enum JsonPresentationFields {
     DERIVED_FROM("derivedFrom", null),
     VENDOR_NAME("vendorName", null),
     VENDOR_RELEASE("vendorRelease", null),
+    CATEGORY("category", null),
+    SUB_CATEGORY("subcategory", null),
+    RESOURCE_VENDOR("resourceVendor", null),
+    RESOURCE_VENDOR_RELEASE("resourceVendorRelease", null),
     RESOURCE_VENDOR_MODEL_NUMBER("reourceVendorModelNumber", null),
     SERVICE_TYPE("serviceType", null),
     SERVICE_ROLE("serviceRole", null),
@@ -52,16 +61,21 @@ public enum JsonPresentationFields {
     INVARIANT_UUID("invariantUuid", GraphPropertyEnum.INVARIANT_UUID),
     CSAR_UUID("csarUuid", GraphPropertyEnum.CSAR_UUID),
     CSAR_VERSION("csarVersion", null),
+    CSAR_VERSION_ID("csarVersionId", null),
     IMPORTED_TOSCA_CHECKSUM("importedToscaChecksum", null),
     CONTACT_ID("contactId", null),
     PROJECT_CODE("projectCode", null),
     DISTRIBUTION_STATUS("distributionStatus", GraphPropertyEnum.DISTRIBUTION_STATUS),
     DERIVED_FROM_GENERIC_TYPE("derivedFromGenericType", null),
     DERIVED_FROM_GENERIC_VERSION("derivedFromGenericVersion", null),
+    SERVICE_FUNCTION("serviceFunction", null),
+    MODEL("model", null),
+    NORMATIVE("normative", null),
+    DATA_TYPES("data_types", GraphPropertyEnum.DATA_TYPES),
+    TENANT("tenant", null),
 
     ////Inputs
     ANNOTATIONS("annotations", null),
-
     ////Artifact
     ARTIFACT_TYPE("artifactType", null),
     ARTIFACT_REF("artifactRef", null),
@@ -92,19 +106,19 @@ public enum JsonPresentationFields {
     HEAT_PARAMETERS("heatParameters", null),
     GENERATED_FROM_ID("generatedFromId", null),
 
-
     // end artifacts
 
-
     //property
     DEFINITION("definition", null),
     DEFAULT_VALUE("defaultValue", null),
+    DEFAULT("default", null),
     REQUIRED("required", null),
     PASSWORD("password", null),
     CONSTRAINTS("constraints", null),
     PROPERTIES("properties", null),
     PROPERTY("property", null),
     SCHEMA("schema", null),
+    ENTRY_SCHEMA("entry_schema", null),
     VALUE("value", null),
     PARENT_UNIQUE_ID("parentUniqueId", null),
 
@@ -120,7 +134,7 @@ public enum JsonPresentationFields {
     CAPABILITY_SOURCES("capabilitySources", null),
     MAX_OCCURRENCES("maxOccurrences", null),
     MIN_OCCURRENCES("minOccurrences", null),
-    OWNER_TYPE("ownerType",null),
+    OWNER_TYPE("ownerType", null),
     OWNER_NAME("ownerName", null),
     OWNER_ID("ownerId", null),
     LEFT_OCCURRENCES("leftOccurences", null),
@@ -129,23 +143,32 @@ public enum JsonPresentationFields {
     SOURCE("source", null),
 
     //Requirement
-    CAPAPILITY("capability", null),
+    CAPABILITY("capability", null),
     NODE("node", null),
     RELATIONSHIP("relationship", null),
     VALID_SOURCE_TYPES("validSourceTypes", null),
+    VALID_TARGET_TYPES("validTargetTypes", null),
     REQUIREMENT_ID("requirementId", null),
     PARENT_NAME("parentName", null),
     PREVIOUS_NAME("previousName", null),
+    NODE_FILTER_CAPABILITIES("capabilities", null),
+    PROPERTY_FILTER_NAME("propertyName", null),
+    PROPERTY_FILTER_CONSTRAINT("propertyFilterConstraint", null),
+    EQUAL_CONSTRAINT("equal", null),
+    CONSTRAINT_VALUE("constraintValue", null),
+    CONSTRAINT_FUNCTION("constraintFunction", null),
+    NODE_FILTER("nodeFilter", null),
+    TOSCA_ID("tosca_id", null),
+
     //Relation
     CAPABILTY_OWNER_ID("capabilityOwnerId", null),
     REQUIREMENT_OWNER_ID("requirementOwnerId", null),
     FROM_ID("fromId", null),
     TO_ID("toId", null),
     REQUIREMENT("requirement", null),
-    ORIGIN_UI("originUI",null),
+    ORIGIN_UI("originUI", null),
 
     //Groups
-
     GROUP_INVARIANT_UUID("invariantUUID", null),
     GROUP_UUID("groupUUID", null),
     GROUP_MEMBER("members", null),
@@ -163,7 +186,6 @@ public enum JsonPresentationFields {
     GROUP_INSTANCE_PROPERTIES("groupInstancesProperties", null),
 
     //Component instance
-
     CI_COMPONENT_UID("componentUid", null),
     CI_POS_X("posX", null),
     CI_POS_Y("posY", null),
@@ -181,7 +203,11 @@ public enum JsonPresentationFields {
     CI_SOURCE_MODEL_INVARIANT("sourceModelInvariant", null),
     CI_SOURCE_MODEL_NAME("sourceModelName", null),
     CI_IS_PROXY("isProxy", null),
-
+    CI_DIRECTIVES("directives", null),
+    CI_ARTIFACTS("artifacts", null),
+    CI_MAX_OCCURRENCES("maxOccurrences", null),
+    CI_MIN_OCCURRENCES("minOccurrences", null),
+    CI_INSTANCE_COUNT("instanceCount", null),
 
     //path
     FORWARDING_PATH("forwardingPath", null),
@@ -201,9 +227,7 @@ public enum JsonPresentationFields {
     TARGETS("targets", null),
 
     //External Refs
-    EXTERNAL_REF("externalRef", null),
-    CREATED_FROM("createdFrom", null),
-
+    EXTERNAL_REF("externalRef", null), CREATED_FROM("createdFrom", null),
     //Archive
     IS_ARCHIVED("isArchived", GraphPropertyEnum.IS_ARCHIVED),
     ARCHIVE_TIME("archiveTime", GraphPropertyEnum.ARCHIVE_TIME),
@@ -211,39 +235,48 @@ public enum JsonPresentationFields {
     CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null),
 
     //Interface Operation
+    IO_OPERATION_TYPE("operationType", null),
+    IO_INPUT_PARAMETERS("inputParams", null),
+    IO_OUTPUT_PARAMETERS("outputParams", null),
+    IO_PARAM_NAME("paramName", null),
+    IO_PARAM_ID("paramId", null),
+    IO_NAME("name", null),
+    IO_MANDATORY("mandatory", null),
+    IO_TYPE("type", null),
+    IO_PROPERTY("property", null),
+    IO_WORKFLOW_NAME("workflowName", null),
+    IO_WORKFLOW_VERSION("workflowVersion", null),
     IO_WORKFLOW_ID("workflowId", null),
     IO_WORKFLOW_VERSION_ID("workflowVersionId", null),
     IO_WORKFLOW_ASSOCIATION_TYPE("workflowAssociationType", null),
+
+    //Interface
     INTERFACES("interfaces", null),
+    INTERFACE_INPUT("input", null),
     OPERATIONS("operations", null),
-    OPERATION_IMPLEMENTATION("implementation",null),
-    OPERATION_INPUTS("inputs",null),
-    OPERATION_OUTPUTS("outputs", null);
-
-    private String presentation;
-    private GraphPropertyEnum storedAs;
-
-    JsonPresentationFields(String presentation, GraphPropertyEnum storedAs) {
-        this.presentation = presentation;
-        this.storedAs = storedAs;
-    }
-
-    @JsonValue
-    public String getPresentation() {
-        return presentation;
-    }
-
-    public void setPresentation(String presentation) {
-        this.presentation = presentation;
-    }
-
-    public GraphPropertyEnum getStoredAs() {
-        return storedAs;
-    }
-
-    public void setStoredAs(GraphPropertyEnum storedAs) {
-        this.storedAs = storedAs;
-    }
+    OPERATION_IMPLEMENTATION("implementation", null),
+    OPERATION_INPUTS("inputs", null),
+    OPERATION_OUTPUTS("outputs", null),
+    OPERATION_MILESTONES("milestones", null),
+    OPERATION_FILTERS("filters", null),
+    OPERATION_ACTIVITIES("activities", null),
+    OPERATION_ACTIVITIES_WORKFLOW("workflow", null),
+    INPUTS("inputs", null),
+
+    GET_PROPERTY("get_property", null),
+    GET_INPUT("get_input", null),
+    GET_OPERATION_OUTPUT("get_operation_output", null),
+
+    ATTRIBUTES("attributes", null),
+
+    TEMPLATE_VERSION("template_version", null),
+    TOSCA_DEFINITIONS_VERSION("tosca_definitions_version", null);
+    // @formatter:on
+
+    @ToString.Include
+    private final String presentation;
+    @ToString.Exclude
+    private final GraphPropertyEnum storedAs;
 
     public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
         for (JsonPresentationFields currPresentation : JsonPresentationFields.values()) {
@@ -254,12 +287,6 @@ public enum JsonPresentationFields {
         return null;
     }
 
-    @Override
-    public String toString() {
-        // TODO Auto-generated method stub
-        return presentation;
-    }
-
     @JsonCreator
     public static JsonPresentationFields getByPresentation(String presentation) {
         for (JsonPresentationFields inst : JsonPresentationFields.values()) {
@@ -270,4 +297,8 @@ public enum JsonPresentationFields {
         return null;
     }
 
+    @JsonValue
+    public String getPresentation() {
+        return presentation;
+    }
 }