aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/appc/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-05-08 14:33:57 -0400
committerJim Hahn <jrh3@att.com>2019-05-08 16:24:35 -0400
commit10b21aae2bde224ab7f91f4b5ab1b89369c8fd1c (patch)
tree0417099e379e8be69f90221e8fd066fc40def62b /controlloop/common/model-impl/appc/src/main
parent01841878936986bc80a974977ccdeaceaf7f9a78 (diff)
Add payload to vFW policy yaml
Added new "streams" payload to vFW policy yaml files. Removed references to pg-streams. Also deleted directories that were moved to policy/models. Also removed references to trafficgenerator. Updated licenses. Removed some trailing whitespace. Change-Id: I6becaa573628eee677f0959fadf86f9a9f032f88 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/model-impl/appc/src/main')
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java216
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java165
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java136
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseCode.java68
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java110
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseValue.java70
-rw-r--r--controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java85
-rw-r--r--controlloop/common/model-impl/appc/src/main/resources/definitions.yaml118
8 files changed, 0 insertions, 968 deletions
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java
deleted file mode 100644
index e58c45b5b..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-import java.util.UUID;
-
-public class CommonHeader implements Serializable {
- private static final long serialVersionUID = -3581658269910980336L;
-
- @SerializedName("TimeStamp")
- private Instant timeStamp = Instant.now();
-
- @SerializedName("APIver")
- private String apiVer = "1.01";
-
- @SerializedName("OriginatorID")
- private String originatorId;
-
- @SerializedName("RequestID")
- private UUID requestId;
-
- @SerializedName("SubRequestID")
- private String subRequestId;
-
- @SerializedName("RequestTrack")
- private Collection<String> requestTrack = new ArrayList<>();
-
- @SerializedName("Flags")
- private Collection<Map<String, String>> flags = new ArrayList<>();
-
- public CommonHeader() {}
-
- /**
- * Construct an instance from an existing instance.
- *
- * @param commonHeader the existing instance
- */
- public CommonHeader(CommonHeader commonHeader) {
- this.originatorId = commonHeader.originatorId;
- this.requestId = commonHeader.requestId;
- this.subRequestId = commonHeader.subRequestId;
- if (commonHeader.requestTrack != null) {
- this.requestTrack.addAll(commonHeader.requestTrack);
- }
- if (commonHeader.flags != null) {
- this.flags.addAll(commonHeader.flags);
- }
- }
-
- public Instant getTimeStamp() {
- return timeStamp;
- }
-
- public void setTimeStamp(Instant timeStamp) {
- this.timeStamp = timeStamp;
- }
-
- public String getApiVer() {
- return apiVer;
- }
-
- public void setApiVer(String apiVer) {
- this.apiVer = apiVer;
- }
-
- public String getOriginatorId() {
- return originatorId;
- }
-
- public void setOriginatorId(String originatorId) {
- this.originatorId = originatorId;
- }
-
- public UUID getRequestId() {
- return requestId;
- }
-
- public void setRequestId(UUID requestId) {
- this.requestId = requestId;
- }
-
- public String getSubRequestId() {
- return subRequestId;
- }
-
- public void setSubRequestId(String subRequestId) {
- this.subRequestId = subRequestId;
- }
-
- public Collection<String> getRequestTrack() {
- return requestTrack;
- }
-
- public void setRequestTrack(Collection<String> requestTrack) {
- this.requestTrack = requestTrack;
- }
-
- public Collection<Map<String, String>> getFlags() {
- return flags;
- }
-
- public void setFlags(Collection<Map<String, String>> flags) {
- this.flags = flags;
- }
-
- @Override
- public String toString() {
- return "CommonHeader [TimeStamp=" + timeStamp + ", APIver=" + apiVer + ", OriginatorId=" + originatorId
- + ", RequestId=" + requestId + ", SubrequestId=" + subRequestId + ", RequestTrack=" + requestTrack
- + ", Flags=" + flags + "]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((apiVer == null) ? 0 : apiVer.hashCode());
- result = prime * result + ((flags == null) ? 0 : flags.hashCode());
- result = prime * result + ((originatorId == null) ? 0 : originatorId.hashCode());
- result = prime * result + ((requestId == null) ? 0 : requestId.hashCode());
- result = prime * result + ((requestTrack == null) ? 0 : requestTrack.hashCode());
- result = prime * result + ((subRequestId == null) ? 0 : subRequestId.hashCode());
- result = prime * result + ((timeStamp == null) ? 0 : timeStamp.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- CommonHeader other = (CommonHeader) obj;
- if (apiVer == null) {
- if (other.apiVer != null) {
- return false;
- }
- } else if (!apiVer.equals(other.apiVer)) {
- return false;
- }
- if (flags == null) {
- if (other.flags != null) {
- return false;
- }
- } else if (!flags.equals(other.flags)) {
- return false;
- }
- if (originatorId == null) {
- if (other.originatorId != null) {
- return false;
- }
- } else if (!originatorId.equals(other.originatorId)) {
- return false;
- }
- if (requestId == null) {
- if (other.requestId != null) {
- return false;
- }
- } else if (!requestId.equals(other.requestId)) {
- return false;
- }
- if (requestTrack == null) {
- if (other.requestTrack != null) {
- return false;
- }
- } else if (!requestTrack.equals(other.requestTrack)) {
- return false;
- }
- if (subRequestId == null) {
- if (other.subRequestId != null) {
- return false;
- }
- } else if (!subRequestId.equals(other.subRequestId)) {
- return false;
- }
- if (timeStamp == null) {
- if (other.timeStamp != null) {
- return false;
- }
- } else if (!timeStamp.equals(other.timeStamp)) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java
deleted file mode 100644
index cbf5b44d6..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-public class Request implements Serializable {
- private static final long serialVersionUID = -3912323643990646431L;
-
- @SerializedName("CommonHeader")
- private CommonHeader commonHeader;
-
- @SerializedName("Action")
- private String action;
-
- @SerializedName("TargetID")
- private String targetId;
-
- @SerializedName("ObjectID")
- private String objectId;
-
- @SerializedName("Payload")
- private HashMap<String, Object> payload = new HashMap<>();
-
- public Request() {
- // Initiate an empty Request instance
- }
-
- public CommonHeader getCommonHeader() {
- return commonHeader;
- }
-
- public Map<String, Object> getPayload() {
- return payload;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getTargetId() {
- return targetId;
- }
-
- public void setTargetId(String targetId) {
- this.targetId = targetId;
- }
-
- public String getObjectId() {
- return objectId;
- }
-
- public void setObjectId(String objectId) {
- this.objectId = objectId;
- }
-
- public void setCommonHeader(CommonHeader commonHeader) {
- this.commonHeader = commonHeader;
- }
-
- public void setPayload(Map<String, Object> payload) {
- this.payload = new HashMap<>(payload);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((action == null) ? 0 : action.hashCode());
- result = prime * result + ((commonHeader == null) ? 0 : commonHeader.hashCode());
- result = prime * result + ((objectId == null) ? 0 : objectId.hashCode());
- result = prime * result + ((payload == null) ? 0 : payload.hashCode());
- result = prime * result + ((targetId == null) ? 0 : targetId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- Request other = (Request) obj;
- if (action == null) {
- if (other.action != null) {
- return false;
- }
- } else if (!action.equals(other.action)) {
- return false;
- }
-
- if (commonHeader == null) {
- if (other.commonHeader != null) {
- return false;
- }
- } else if (!commonHeader.equals(other.commonHeader)) {
- return false;
- }
-
- if (objectId == null) {
- if (other.objectId != null) {
- return false;
- }
- } else if (!objectId.equals(other.objectId)) {
- return false;
- }
-
- if (payload == null) {
- if (other.payload != null) {
- return false;
- }
- } else if (!payload.equals(other.payload)) {
- return false;
- }
-
- if (targetId == null) {
- if (other.targetId != null) {
- return false;
- }
- } else if (!targetId.equals(other.targetId)) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public String toString() {
- return "Request [CommonHeader=" + commonHeader + ", Action=" + action + ", TargetId=" + targetId + ", ObjectId="
- + objectId + ", Payload=" + payload + "]";
- }
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java
deleted file mode 100644
index af503b104..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-public class Response implements Serializable {
- private static final long serialVersionUID = 434953706339865151L;
-
- @SerializedName("CommonHeader")
- private CommonHeader commonHeader;
-
- @SerializedName("Status")
- private ResponseStatus status = new ResponseStatus();
-
- @SerializedName("Payload")
- private HashMap<String, Object> payload = new HashMap<>();
-
- public Response() {
-
- }
-
- /**
- * Construct an instance from an existing instance.
- *
- * @param request the existing instance
- */
- public Response(Request request) {
- if (request.getCommonHeader() != null) {
- this.commonHeader = new CommonHeader(request.getCommonHeader());
- }
- if (request.getPayload() != null) {
- this.payload.putAll(request.getPayload());
- }
- }
-
- public CommonHeader getCommonHeader() {
- return commonHeader;
- }
-
- public void setCommonHeader(CommonHeader commonHeader) {
- this.commonHeader = commonHeader;
- }
-
- public ResponseStatus getStatus() {
- return status;
- }
-
- public void setStatus(ResponseStatus status) {
- this.status = status;
- }
-
- public Map<String, Object> getPayload() {
- return payload;
- }
-
- public void setPayload(Map<String, Object> payload) {
- this.payload = new HashMap<>(payload);
- }
-
- @Override
- public String toString() {
- return "Response [CommonHeader=" + commonHeader + ", Status=" + status + ", Payload=" + payload + "]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((commonHeader == null) ? 0 : commonHeader.hashCode());
- result = prime * result + ((payload == null) ? 0 : payload.hashCode());
- result = prime * result + ((status == null) ? 0 : status.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- Response other = (Response) obj;
- if (commonHeader == null) {
- if (other.commonHeader != null) {
- return false;
- }
- } else if (!commonHeader.equals(other.commonHeader)) {
- return false;
- }
- if (payload == null) {
- if (other.payload != null) {
- return false;
- }
- } else if (!payload.equals(other.payload)) {
- return false;
- }
- if (status == null) {
- if (other.status != null) {
- return false;
- }
- } else if (!status.equals(other.status)) {
- return false;
- }
- return true;
- }
-
-
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseCode.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseCode.java
deleted file mode 100644
index b62f917ba..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseCode.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-public enum ResponseCode {
- ACCEPT(100), ERROR(200), REJECT(300), SUCCESS(400), FAILURE(500);
-
- @SerializedName("Code")
- private Integer code;
-
- private ResponseCode(int code) {
- this.code = code;
- }
-
- public int getValue() {
- return this.code;
- }
-
- @Override
- public String toString() {
- return Integer.toString(this.code);
- }
-
- /**
- * Convert an integer code to a ResponseCode.
- *
- * @param code the integer code
- * @return the ResponseCode
- */
- public static ResponseCode toResponseCode(int code) {
- if (code == ACCEPT.code) {
- return ACCEPT;
- }
- if (code == ERROR.code) {
- return ERROR;
- }
- if (code == REJECT.code) {
- return REJECT;
- }
- if (code == SUCCESS.code) {
- return SUCCESS;
- }
- if (code == FAILURE.code) {
- return FAILURE;
- }
- return null;
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java
deleted file mode 100644
index f54117862..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-
-public class ResponseStatus implements Serializable {
- private static final long serialVersionUID = 2421770469587860452L;
-
- @SerializedName("Code")
- private int code;
-
- @SerializedName("Value")
- private String value;
-
- @SerializedName("Description")
- private String description;
-
- @Override
- public String toString() {
- return "ResponseStatus [Code=" + code + ", Value=" + value + ", Description=" + description + "]";
- }
-
- public int getCode() {
- return code;
- }
-
- public void setCode(int code) {
- this.code = code;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + code;
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((value == null) ? 0 : value.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ResponseStatus other = (ResponseStatus) obj;
- if (code != other.code) {
- return false;
- }
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
- return false;
- }
- if (value == null) {
- if (other.value != null) {
- return false;
- }
- } else if (!value.equals(other.value)) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseValue.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseValue.java
deleted file mode 100644
index a12f9d139..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseValue.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import com.google.gson.annotations.SerializedName;
-
-public enum ResponseValue {
- ACCEPT("ACCEPT"), ERROR("ERROR"), REJECT("REJECT"), SUCCESS("SUCCESS"), FAILURE("FAILURE");
-
- @SerializedName("Value")
- private String value;
-
- private ResponseValue(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return this.value;
- }
-
- /**
- * Convert a String value to a ResponseValue.
- *
- * @param value the String value
- * @return the ResponseValue
- */
- public static ResponseValue toResponseValue(String value) {
- if (value == null) {
- return null;
- }
-
- if (value.equals(ACCEPT.toString())) {
- return ACCEPT;
- }
- if (value.equals(ERROR.toString())) {
- return ERROR;
- }
- if (value.equals(REJECT.toString())) {
- return REJECT;
- }
- if (value.equals(SUCCESS.toString())) {
- return SUCCESS;
- }
- if (value.equals(FAILURE.toString())) {
- return FAILURE;
- }
-
- return null;
- }
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java b/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java
deleted file mode 100644
index d8a397dca..000000000
--- a/controlloop/common/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc.util;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-
-import java.lang.reflect.Type;
-import java.time.Instant;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public final class Serialization {
- public static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSxxx");
-
- public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
- .registerTypeAdapter(ZonedDateTime.class, new GsonUtcAdapter())
- .registerTypeAdapter(Instant.class, new GsonInstantAdapter())
- // .registerTypeAdapter(CommonHeader1607.class, new gsonCommonHeaderInstance())
- // .registerTypeAdapter(ResponseStatus1607.class, new gsonResponseStatus())
- .create();
-
- private Serialization() {}
-
- public static class GsonUtcAdapter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
- private static final Logger logger = LoggerFactory.getLogger(GsonUtcAdapter.class);
-
- @Override
- public ZonedDateTime deserialize(JsonElement element, Type type, JsonDeserializationContext context) {
- try {
- return ZonedDateTime.parse(element.getAsString(), format);
- } catch (Exception e) {
- logger.error("deserialize threw: ", e);
- }
- return null;
- }
-
- @Override
- public JsonElement serialize(ZonedDateTime datetime, Type type, JsonSerializationContext context) {
- return new JsonPrimitive(datetime.format(format));
- }
- }
-
- public static class GsonInstantAdapter implements JsonSerializer<Instant>, JsonDeserializer<Instant> {
-
- @Override
- public Instant deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
- return Instant.ofEpochMilli(json.getAsLong());
- }
-
- @Override
- public JsonElement serialize(Instant src, Type typeOfSrc, JsonSerializationContext context) {
- return new JsonPrimitive(src.toEpochMilli());
- }
-
- }
-
-}
diff --git a/controlloop/common/model-impl/appc/src/main/resources/definitions.yaml b/controlloop/common/model-impl/appc/src/main/resources/definitions.yaml
deleted file mode 100644
index 680a9929c..000000000
--- a/controlloop/common/model-impl/appc/src/main/resources/definitions.yaml
+++ /dev/null
@@ -1,118 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# appc
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-Request:
- type: object
- properties:
- CommonHeader:
- type: object
- properties:
- TimeStamp:
- type: string
- APIver:
- type: string
- value: '1.01'
- OriginatorID:
- type: string
- RequestID:
- type: string
- pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
- SubRequestID:
- type: string
- Flags:
- type: object
- required:
- - TimeStamp
- - APIver
- - OriginatorID
- - RequestID
- Action:
- type: string
- enum:
- - Audit
- - ActionStatus
- - BlockAudits
- - Configure
- - HealthCheck
- - Install
- - LiveUpgrade
- - Migrate
- - ModifyConfig
- - Query
- - Rebuild
- - Reconfigure
- - Restart
- - Rollback
- - Scale
- - Start
- - Stop
- - Sync
- - Terminate
- - Test
- - Upgrade
- TargetID:
- type: string
- ObjectID:
- type: string
- Payload:
- type: object
- required:
- - CommonHeader
- - Action
- - TargetID
-Response:
- type: object
- properties:
- CommonHeader:
- type: object
- properties:
- TimeStamp:
- type: string
- APIver:
- type: string
- OriginatorID:
- type: string
- RequestID:
- type: string
- SubRequestID:
- type: string
- Flags:
- type: object
- required:
- - TimeStamp
- - APIver
- - OriginatorID
- - RequestID
- Status:
- type: object
- properties:
- Code:
- type: integer
- Value:
- type: string
- required:
- - Code
- - Value
- Payload:
- type: object
- required:
- - CommonHeader
- - Status
-