2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.openecomp.appc.listener.CL1607.model;
24 import com.fasterxml.jackson.annotation.JsonIgnore;
25 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
26 import com.fasterxml.jackson.annotation.JsonProperty;
27 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
28 import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
31 * This class represents a message coming in from DCAE.
34 @JsonSerialize(include = Inclusion.NON_NULL)
35 @JsonIgnoreProperties(ignoreUnknown = true)
36 public class IncomingMessage extends CommonMessage {
38 private static final long serialVersionUID = 1L;
41 * The action being requested. Its presence signals that it is an incoming message and it is not present on outgoing
45 @JsonProperty("Action")
46 private String action;
49 public String getRequest() {
54 public Action getAction() {
55 return Action.toAction(action);
58 public void setRequest(String request) {
59 this.action = request;
63 // public String toString() {
64 // String time = getRequestTime() != null ? getRequestTime() : "N/A";
65 // // String req = request != null ? request : "N/A";
66 // return String.format("[%s - %s]", time, getId());
69 // public String toOutgoing(Status status) {
70 // return toOutgoing(status);
73 public String toOutgoing(Status status) {
74 OutgoingMessage out = new OutgoingMessage(this);
75 out.setResponse(status);
76 return out.toResponse().toString();
80 * Determines if this message should be parsed parsed. Will eventually check that the message is well formed, has
81 * all required fields, and had not exceeded any timing restrictions.
83 * @return True if the message should be parsed. False otherwise
85 public boolean isValid() {