2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.mso.adapters.catalogdb.catalogrest;
22 import java.util.ArrayList;
23 import java.util.List;
25 import javax.xml.bind.annotation.XmlRootElement;
27 import org.codehaus.jackson.map.ObjectMapper;
28 import org.jboss.resteasy.annotations.providers.NoJackson;
30 import org.openecomp.mso.db.catalog.beans.VfModule;
31 import org.openecomp.mso.logger.MsoLogger;
33 @XmlRootElement(name = "vfModules")
35 public class QueryVfModules {
36 private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
37 private List<VfModule> vfModules;
39 public QueryVfModules() { super(); vfModules = new ArrayList<VfModule>(); }
40 public QueryVfModules(List<VfModule> vlist) {
41 LOGGER.debug ("QueryVfModules:");
42 vfModules = new ArrayList<VfModule>();
43 for (VfModule o : vlist) {
44 LOGGER.debug ("-- o is a vfModules ----");
45 LOGGER.debug (o.toString());
47 LOGGER.debug ("-------------------");
51 public List<VfModule> getVfModules(){ return this.vfModules; }
53 public void setVfModules(List<VfModule> v) { this.vfModules = v; }
56 public String toString () {
57 StringBuffer buf = new StringBuffer();
61 for (VfModule o : vfModules) {
63 if (!first) buf.append("\n"); first = false;
66 return buf.toString();
69 public String toJsonString() {
70 String jsonString = null;
72 ObjectMapper mapper = new ObjectMapper();
73 jsonString = mapper.writeValueAsString(this);
74 LOGGER.debug ("QueryVfModules jsonString: "+jsonString);
77 LOGGER.debug ("QueryVfModules jsonString exception:"+e.getMessage());