From 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 31 Dec 2018 17:21:27 +0200 Subject: Merge from ECOMP's repository Main Features -------------- - Async-Instantiation jobs mechanism major update; still WIP (package `org.onap.vid.job`) - New features in View/Edit: Activate fabric configuration; show related networks; soft delete - Support AAI service-tree traversal (`AAIServiceTree`) - In-memory cache for SDC models and certain A&AI queries (`CacheProviderWithLoadingCache`) - Upgrade TOSCA Parser and add parsing options; fix malformed TOSCA models - Resolve Cloud-Owner values for MSO - Pass X-ONAP headers to MSO Infrastructure -------------- - Remove codehaus' jackson mapper; use soley fasterxml 2.9.7 - Surefire invokes both TestNG and JUnit tests - Support Kotlin source files - AaiController2 which handles errors in a "Spring manner" - Inline generated-sources and remove jsonschema2pojo Quality -------- - Cumulative bug fixes (A&AI API, UI timeouts, and many more) - Many Sonar issues cleaned-up - Some unused classes removed - Minor changes in vid-automation project, allowing some API verification to run Hard Merges ------------ - HTTP Clients (MSO, A&AI, WebConfig, OutgoingRequestHeadersTest) - Moved `package org.onap.vid.controllers` to `controller`, without plural -- just to keep semantic sync with ECOMP. Reference commit in ECOMP: 3d1141625 Issue-ID: VID-378 Change-Id: I9c8d1e74caa41815891d441fc0760bb5f29c5788 Signed-off-by: Ittay Stern --- .../java/org/onap/vid/policy/PolicyProperties.java | 26 --- .../org/onap/vid/policy/PolicyResponseWrapper.java | 56 ----- .../java/org/onap/vid/policy/PolicyRestInt.java | 66 ------ .../org/onap/vid/policy/PolicyRestInterface.java | 230 --------------------- .../vid/policy/PolicyRestInterfaceFactory.java | 14 -- .../onap/vid/policy/PolicyRestInterfaceIfc.java | 58 ------ .../main/java/org/onap/vid/policy/PolicyUtil.java | 71 ------- .../main/java/org/onap/vid/policy/RestObject.java | 68 ------ .../org/onap/vid/policy/rest/RequestDetails.java | 107 ---------- 9 files changed, 696 deletions(-) delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java delete mode 100644 vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java (limited to 'vid-app-common/src/main/java/org/onap/vid/policy') diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java deleted file mode 100644 index 940adddb3..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.onap.vid.policy; - -import org.onap.portalsdk.core.util.SystemProperties; - - -public class PolicyProperties extends SystemProperties { - - public static final String POLICY_CLIENTAUTH_VAL = "policy.ClientAuth"; - - public static final String POLICY_CLIENT_MECHID_VAL = "policy.client.mechId"; - - public static final String POLICY_CLIENT_PASSWORD_VAL = "policy.client.password"; - - public static final String POLICY_USERNAME_VAL = "policy.username"; - - public static final String POLICY_PASSWORD_VAL = "policy.password"; - - public static final String POLICY_AUTHORIZATION_VAL = "policy.Authorization"; - - public static final String POLICY_SERVER_URL_VAL = "policy.server.url"; - - public static final String POLICY_ENVIRONMENT_VAL = "policy.environment"; - - public static final String POLICY_GET_CONFIG_VAL = "policy.get.config"; - -} diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java deleted file mode 100644 index d5a4d124c..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.onap.vid.policy; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.apache.commons.lang.builder.ToStringBuilder; - -/** - * This wrapper encapsulates the Policy response - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "status", - "entity" -}) - -public class PolicyResponseWrapper { - - @JsonProperty("status") - private int status; - - @JsonProperty("entity") - private String entity; - - @JsonProperty("entity") - public String getEntity() { - return entity; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("status") - public void setStatus(int v) { - this.status = v; - } - - @JsonProperty("entity") - public void setEntity(String v) { - this.entity = v; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - - public String getResponse () { - - StringBuilder b = new StringBuilder ("{ \"status\": "); - b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}"); - return (b.toString()); - } -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java deleted file mode 100644 index 65dcb8180..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * 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========================================================= - */ - -package org.onap.vid.policy; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.vid.policy.rest.RequestDetails; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -public class PolicyRestInt { - - /** The logger. */ - private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInt.class); - - /** The Constant dateFormat. */ - final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS"); - - /** The request date format. */ - public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z"); - - public PolicyRestInt() { - requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); - } - - /** - * Log request. - * - * @param r the r - */ - public void logRequest ( RequestDetails r ) { - String methodName = "logRequest"; - ObjectMapper mapper = new ObjectMapper(); - String r_json_str = ""; - if ( r != null ) { - r_json_str = r.toString(); - try { - r_json_str = mapper.writeValueAsString(r); - } - catch ( com.fasterxml.jackson.core.JsonProcessingException j ) { - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse request as json"); - } - } - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Request=(" + r_json_str + ")"); - } -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java deleted file mode 100644 index e550f0262..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java +++ /dev/null @@ -1,230 +0,0 @@ -package org.onap.vid.policy; - -import org.apache.commons.codec.binary.Base64; -import org.eclipse.jetty.util.security.Password; -import org.json.simple.JSONObject; -import org.onap.vid.client.HttpBasicClient; -import org.onap.vid.exceptions.GenericUncheckedException; -import org.onap.vid.policy.rest.RequestDetails; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.portalsdk.core.util.SystemProperties; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.Response; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Collections; -import java.util.Date; - -public class PolicyRestInterface extends PolicyRestInt implements PolicyRestInterfaceIfc { - - /** The logger. */ - private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class); - - public static final String APPLICATION_JSON = "application/json"; - - /** The client. */ - private static Client client = null; - - /** The common headers. */ - private MultivaluedHashMap commonHeaders; - public PolicyRestInterface() { - super(); - } - - /** The Constant dateFormat. */ - static final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS"); - - public void initRestClient() - { - final String methodname = "initRestClient()"; - - final String mechId = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL); - final String clientPassword = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL); - final String username = SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL); - final String password = SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL); - final String environment = SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL); - - final String decrypted_client_password = Password.deobfuscate(clientPassword); - String mechAuthString = mechId + ":" + decrypted_client_password; - byte[] mechAuthEncBytes = Base64.encodeBase64(mechAuthString.getBytes()); - String clientAuth = new String(mechAuthEncBytes); - - final String decrypted_password = Password.deobfuscate(password); - String authString = username + ":" + decrypted_password; - byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); - String authorization = new String(authEncBytes); - - commonHeaders = new MultivaluedHashMap<> (); - commonHeaders.put("ClientAuth", Collections.singletonList((Object) ("Basic " + clientAuth))); - commonHeaders.put("Authorization", Collections.singletonList((Object) ("Basic " + authorization))); - commonHeaders.put("Environment", Collections.singletonList((Object) (environment))); - - if (client == null) { - - try { - client = HttpBasicClient.getClient(); - } catch (Exception e) { - System.out.println( methodname + " Unable to get the SSL client"); - } - } - } - - @SuppressWarnings("unchecked") - public void Get (T t, String sourceId, String path, RestObject restObject ) { - String methodName = "Get"; - - logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start"); - - String url=""; - restObject.set(t); - - url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path; - logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url); - - initRestClient(); - - final Response cres = client.target(url) - .request() - .accept(APPLICATION_JSON) - .headers(commonHeaders) - .get(); - - int status = cres.getStatus(); - restObject.setStatusCode (status); - - if (status == 200) { - t = (T) cres.readEntity(t.getClass()); - restObject.set(t); - logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!"); - - } else { - throw new GenericUncheckedException(methodName + " with status="+ status + ", url= " + url ); - } - - logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status ); - - return; - } - - @SuppressWarnings("unchecked") - public void Delete(T t, RequestDetails r, String sourceID, String path, RestObject restObject) { - - String methodName = "Delete"; - String url=""; - Response cres = null; - - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start"); - logRequest (r); - - try { - initRestClient(); - - url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path; - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url); - - cres = client.target(url) - .request() - .accept(APPLICATION_JSON) - .headers(commonHeaders) - //.entity(r) - .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke(); - - int status = cres.getStatus(); - restObject.setStatusCode (status); - - if (status == 404) { // resource not found - String msg = "Resource does not exist...: " + cres.getStatus(); - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg); - } else if (status == 200 || status == 204){ - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted"); - } else if (status == 202) { - String msg = "Delete in progress: " + status; - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg); - } - else { - String msg = "Deleting Resource failed: " + status; - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg); - } - - try { - t = (T) cres.readEntity(t.getClass()); - restObject.set(t); - } - catch ( Exception e ) { - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e=" - + e.getMessage()); - } - - } - catch (Exception e) - { - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString()); - throw e; - - } - } - - @SuppressWarnings("unchecked") - public void Post(T t, JSONObject requestDetails, String uuid, String path, RestObject restObject) { - - String methodName = "Post"; - String url=""; - - System.out.println( "POST policy rest interface"); - - try { - - initRestClient(); - - url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path; - System.out.println( "<== " + methodName + " sending request to url= " + url); - // Change the content length - final Response cres = client.target(url) - .request() - .accept(APPLICATION_JSON) - .headers(commonHeaders) - //.header("content-length", 201) - //.header("X-FromAppId", sourceID) - .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON)); - - try { - t = (T) cres.readEntity(t.getClass()); - restObject.set(t); - } - catch ( Exception e ) { - - System.out.println("<== " + methodName + " No response entity, this is probably ok, e=" + e.getMessage()); - } - - int status = cres.getStatus(); - restObject.setStatusCode (status); - - if ( status >= 200 && status <= 299 ) { - System.out.println( "<== " + methodName + " REST api POST was successful!"); - - } else { - System.out.println( "<== " + methodName + " with status="+status+", url="+url); - } - - } catch (Exception e) - { - System.out.println( "<== " + methodName + " with url="+url+ ", Exception: " + e.toString()); - throw e; - - } - } - - public T getInstance(Class clazz) throws IllegalAccessException, InstantiationException - { - return clazz.newInstance(); - } - - @Override - public void logRequest(RequestDetails r) { - // TODO Auto-generated method stub - } -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java deleted file mode 100644 index 40cb854bf..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java +++ /dev/null @@ -1,14 +0,0 @@ - -package org.onap.vid.policy; - -public class PolicyRestInterfaceFactory { - - - public static PolicyRestInterfaceIfc getInstance () { - PolicyRestInterfaceIfc obj = null; - - obj = new PolicyRestInterface(); - - return ( obj ); - } -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java deleted file mode 100644 index 61108fc53..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java +++ /dev/null @@ -1,58 +0,0 @@ - -package org.onap.vid.policy; - -import org.json.simple.JSONObject; -import org.onap.vid.policy.rest.RequestDetails; - -public interface PolicyRestInterfaceIfc { - /** - * Inits the rest client. - */ - public void initRestClient(); - - /** - * Gets the. - * - * @param the generic type - * @param t the t - * @param sourceId the source id - * @param path the path - * @param restObject the rest object - * @throws Exception the exception - */ - public void Get (T t, String sourceId, String path, RestObject restObject ); - - /** - * Delete. - * - * @param the generic type - * @param t the t - * @param r the r - * @param sourceID the source ID - * @param path the path - * @param restObject the rest object - * @throws Exception the exception - */ - public void Delete(T t, RequestDetails r, String sourceID, String path, RestObject restObject); - - /** - * Post. - * - * @param the generic type - * @param t the t - * @param r the r - * @param sourceID the source ID - * @param path the path - * @param restObject the rest object - * @throws Exception the exception - */ - public void Post(T t, JSONObject r, String sourceID, String path, RestObject restObject); - - /*** - * Log request. - * - * @param r the r - */ - public void logRequest ( RequestDetails r ); - -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java deleted file mode 100644 index 740569754..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.onap.vid.policy; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.glassfish.jersey.client.ClientResponse; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.vid.policy.PolicyResponseWrapper; -import org.onap.vid.policy.PolicyUtil; -import org.onap.vid.policy.RestObject; - -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PolicyUtil { - - private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyUtil.class); - - final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS"); - - public static PolicyResponseWrapper wrapResponse ( String body, int statusCode ) { - - PolicyResponseWrapper w = new PolicyResponseWrapper(); - w.setStatus (statusCode); - w.setEntity(body); - - return w; - } - - public static PolicyResponseWrapper wrapResponse (ClientResponse cres) { - String resp_str = ""; - if ( cres != null ) { - resp_str = cres.readEntity(String.class); - } - int statuscode = cres.getStatus(); - PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode ); - return (w); - } - - public static PolicyResponseWrapper wrapResponse (RestObject rs) { - String resp_str = ""; - int status = 0; - if ( rs != null ) { - resp_str = rs.get(); - status = rs.getStatusCode(); - } - PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, status ); - return (w); - } - - public static String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException { - - String methodName = "convertPojoToString"; - ObjectMapper mapper = new ObjectMapper(); - String r_json_str = ""; - if ( t != null ) { - try { - r_json_str = mapper.writeValueAsString(t); - } - catch ( com.fasterxml.jackson.core.JsonProcessingException j ) { - logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json"); - } - } - return (r_json_str); - } - - - public static void main(String[] args) { - // TODO Auto-generated method stub - } -} diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java deleted file mode 100644 index 81b354eb0..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * 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========================================================= - */ - -package org.onap.vid.policy; - -/** - * The Class RestObject. - * - * @param the generic type - */ -public class RestObject { - - /** - * Generic version of the RestObject class. - * - */ - // T stands for "Type" - private T t; - - /** The status code. */ - private int statusCode= 0; - - /** - * Sets the. - * - * @param t the t - */ - public void set(T t) { this.t = t; } - - /** - * Gets the. - * - * @return the t - */ - public T get() { return t; } - - /** - * Sets the status code. - * - * @param v the new status code - */ - public void setStatusCode(int v) { this.statusCode = v; } - - /** - * Gets the status code. - * - * @return the status code - */ - public int getStatusCode() { return this.statusCode; } - -} \ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java deleted file mode 100644 index 81e2f2d8b..000000000 --- a/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * 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========================================================= - */ - -package org.onap.vid.policy.rest; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/* - [ - { - "policyConfigMessage": "Config Retrieved! ", - "policyConfigStatus": "CONFIG_RETRIEVED", - "type": "JSON", - "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}", - "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml", - "policyVersion": "1", - "matchingConditions": { - "ECOMPName": "SNIRO-Placement", - "ConfigName": "", - "service": "TimeLimitAndVerticalTopology", - "uuid": "", - "Location": "" - }, - "responseAttributes": {}, - "property": null - }, - { - "policyConfigMessage": "Config Retrieved! ", - "policyConfigStatus": "CONFIG_RETRIEVED", - "type": "JSON", - "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}", - "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml", - "policyVersion": "1", - "matchingConditions": { - "ECOMPName": "SNIRO-Placement", - "ConfigName": "", - "service": "TimeLimitAndVerticalTopology", - "uuid": "", - "Location": "" - }, - "responseAttributes": {}, - "property": null - }, - { - "policyConfigMessage": "Config Retrieved! ", - "policyConfigStatus": "CONFIG_RETRIEVED", - "type": "JSON", - "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}", - "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml", - "policyVersion": "1", - "matchingConditions": { - "ECOMPName": "SNIRO-Placement", - "ConfigName": "", - "service": "TimeLimitAndVerticalTopology", - "uuid": "", - "Location": "" - }, - "responseAttributes": {}, - "property": null - } - ] -*/ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "policyConfigMessage", - "policyConfigStatus", - "type", - "config", - "policyName", - "policyVersion", - "matchingConditions" -}) -public class RequestDetails { - - @JsonProperty("policyName") - private String policyName; - - @JsonProperty("policyName") - public String getPolicyName() { - return policyName; - } - - @JsonProperty("policyName") - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - -} \ No newline at end of file -- cgit 1.2.3-korg