2 * Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
15 * Unless otherwise specified, all documentation contained herein is licensed under the Creative
16 * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
17 * in compliance with the License. You may obtain a copy of the License at
19 * https://creativecommons.org/licenses/by/4.0/
21 * Unless required by applicable law or agreed to in writing, documentation distributed under the
22 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
23 * express or implied. See the License for the specific language governing permissions and
24 * limitations under the License.
27 package org.onap.optf.cmso.optimizer.clients.topology.models;
29 import com.att.eelf.configuration.EELFLogger;
30 import com.att.eelf.configuration.EELFManager;
31 import com.fasterxml.jackson.core.JsonProcessingException;
32 import com.fasterxml.jackson.databind.ObjectMapper;
33 import io.swagger.annotations.ApiModel;
34 import io.swagger.annotations.ApiModelProperty;
35 import java.io.Serializable;
36 import java.util.ArrayList;
37 import java.util.List;
38 import org.onap.optf.cmso.optimizer.service.rs.models.NameValue;
40 @ApiModel(value = "Topology Request",
41 description = "Request to retrieve topology information for the provided elements.")
42 public class TopologyRequest implements Serializable {
43 private static final long serialVersionUID = 1L;
44 private static EELFLogger log = EELFManager.getInstance().getLogger(TopologyRequest.class);
46 @ApiModelProperty(value = "Unique Id of the request")
47 private String requestId;
49 @ApiModelProperty(value = "Implementation specific name value pairs.")
50 private List<NameValue> commonData;
52 @ApiModelProperty(value = "List of the elements for which topology information is requested.")
53 private List<ElementCriteria> elements = new ArrayList<>();
55 @ApiModelProperty(value = "List of the policies to control topology retrieve.")
56 private List<TopologyPolicyInfo> policies = new ArrayList<>();
58 public String getRequestId() {
63 public void setRequestId(String requestId) {
64 this.requestId = requestId;
68 public List<NameValue> getCommonData() {
73 public void setCommonData(List<NameValue> commonData) {
74 this.commonData = commonData;
78 public List<ElementCriteria> getElements() {
83 public void setElements(List<ElementCriteria> elements) {
84 this.elements = elements;
88 public List<TopologyPolicyInfo> getPolicies() {
93 public void setPolicies(List<TopologyPolicyInfo> policies) {
94 this.policies = policies;
104 public String toString() {
105 ObjectMapper mapper = new ObjectMapper();
107 return mapper.writeValueAsString(this);
108 } catch (JsonProcessingException e) {
109 log.debug("Error in toString()", e);