aboutsummaryrefslogtreecommitdiffstats
path: root/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service
diff options
context:
space:
mode:
Diffstat (limited to 'cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service')
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminTool.java23
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java16
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java85
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterfaceImpl.java124
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheck.java20
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java16
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java79
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagementImpl.java166
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java64
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java78
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java16
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java29
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java4
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java8
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java36
15 files changed, 363 insertions, 401 deletions
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminTool.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminTool.java
index d7e0c94..1ab6db0 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminTool.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminTool.java
@@ -31,6 +31,11 @@
package org.onap.optf.ticketmgt.service.rs;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -38,17 +43,10 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
@Api("Administration")
@Path("/{apiVersion}")
@@ -61,11 +59,10 @@ public interface AdminTool {
@Produces({MediaType.TEXT_PLAIN})
@RequestMapping(value = "/{apiVersion}/admin/{id}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN)
@ApiOperation(value = "", notes = "Returns encrypted value of id.", response = String.class)
- @ApiResponses(
- value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 400, message = "Request failed")})
- public Response exec(
- @ApiParam(value = "v1|v2") @PathVariable @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Identifier") @PathVariable @PathParam("id") String id);
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
+ @ApiResponse(code = 400, message = "Request failed")})
+ public Response exec(@ApiParam(
+ value = "v1|v2") @PathVariable @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Identifier") @PathVariable @PathParam("id") String id);
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java
index 89ecdab..f619711 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java
@@ -31,28 +31,26 @@
package org.onap.optf.ticketmgt.service.rs;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
import org.onap.optf.cmso.common.PropertiesManagement;
import org.springframework.stereotype.Controller;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
@Controller
public class AdminToolImpl implements AdminTool {
private static EELFLogger log = EELFManager.getInstance().getLogger(AdminToolImpl.class);
-
- @Context
+
+ @Context
UriInfo uri;
-
- @Context
+
+ @Context
HttpServletRequest request;
-
+
@Override
public Response exec(String apiVersion, String id) {
log.info("AdminTool.exec entered " + uri.getPath());
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java
index 60fccd1..cf9c269 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java
@@ -31,6 +31,11 @@
package org.onap.optf.ticketmgt.service.rs;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
@@ -40,7 +45,6 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.optf.cmso.common.CMSRequestError;
import org.onap.optf.ticketmgt.service.rs.models.ActiveTicketsRequest;
import org.onap.optf.ticketmgt.service.rs.models.ActiveTicketsResponse;
@@ -48,72 +52,65 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
@Api("Availability Interface")
@Path("/{apiVersion}")
@Produces({MediaType.APPLICATION_JSON})
public interface AvailabilityInterface {
// ******************************************************************
-
+
@POST
@Path("/activetickets")
@Produces({MediaType.APPLICATION_JSON})
- @RequestMapping(value = "/{apiVersion}/activetickets", method = RequestMethod.POST,
- consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Request Active Tickets", notes = "API to support conflict avoidance. Retrieves the active ticket data for the "
- + "passed criteria to detemine availability of passed elements within the passed time window."
- + "\nIf the request results in asynchronous processging, IN_PROGRESS status will be returned and the "
- + "optimizer will begin to poll the request until COMPLETED.",
- response = ActiveTicketsResponse.class)
- @ApiResponses(
- value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
+ @RequestMapping(value = "/{apiVersion}/activetickets", method = RequestMethod.POST,
+ consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Request Active Tickets",
+ notes = "API to support conflict avoidance. Retrieves the active ticket data for the "
+ + "passed criteria to detemine availability of passed elements within the passed time window."
+ + "\nIf the request results in asynchronous processging, IN_PROGRESS status will be returned and the "
+ + "optimizer will begin to poll the request until COMPLETED.",
+ response = ActiveTicketsResponse.class)
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
+ @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
@ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
public Response getActiveTickets(
- @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Active ticket criteria (elements and change windows).") ActiveTicketsRequest activeTicketsRequest
- );
+ @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(
+ value = "v1") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Active ticket criteria (elements and change windows).") ActiveTicketsRequest activeTicketsRequest);
@GET
@Path("/activetickets/{id}")
@Produces({MediaType.APPLICATION_JSON})
- @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.GET,
- consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Poll Active Tickets Request", notes = "Poll for the status of the request id. Optimizser will "
- + " poll until status is COMPLETED and issue acknowledge (DELETE) API to acknowledge the "
- + "receipt of the response.",
- response = ActiveTicketsResponse.class)
- @ApiResponses(
- value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 404, message = "Not found.", response = CMSRequestError.class),
+ @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.GET,
+ consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Poll Active Tickets Request",
+ notes = "Poll for the status of the request id. Optimizser will "
+ + " poll until status is COMPLETED and issue acknowledge (DELETE) API to acknowledge the "
+ + "receipt of the response.",
+ response = ActiveTicketsResponse.class)
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
+ @ApiResponse(code = 404, message = "Not found.", response = CMSRequestError.class),
@ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
public Response pollActiveTickets(
- @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Active tickets request id.") @PathParam("id") String id
- );
+ @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(
+ value = "v1") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Active tickets request id.") @PathParam("id") String id);
@DELETE
@Path("/activetickets/{id}")
@Produces({MediaType.APPLICATION_JSON})
- @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.DELETE,
- consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
+ @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.DELETE,
+ consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
@ApiOperation(value = "Acknowledge Active Tickets Response", notes = "API call used to acknowledge the receipt"
- + " of a COMPLETED asynchronous request to enable the Ticket Management service to remove it from their cache."
- + " The service may remove from the cache on the poll request. The optimizer will treat Not found reponse on as normal.",
- response = ActiveTicketsResponse.class)
- @ApiResponses(
- value = {@ApiResponse(code = 204, message = "OK"),
- @ApiResponse(code = 404, message = "Not found", response = CMSRequestError.class),
+ + " of a COMPLETED asynchronous request to enable the Ticket Management service to remove it from their cache."
+ + " The service may remove from the cache on the poll request. The optimizer will treat Not found reponse on as normal.",
+ response = ActiveTicketsResponse.class)
+ @ApiResponses(value = {@ApiResponse(code = 204, message = "OK"),
+ @ApiResponse(code = 404, message = "Not found", response = CMSRequestError.class),
@ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
public Response deleteActiveTicketsRequest(
- @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(value="v1") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Active tickets request id.") @PathParam("id") String id
- );
+ @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable(
+ value = "v1") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Active tickets request id.") @PathParam("id") String id);
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterfaceImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterfaceImpl.java
index 9538f46..06c9e42 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterfaceImpl.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterfaceImpl.java
@@ -1,27 +1,27 @@
/*
* Copyright © 2017-2019 AT&T Intellectual Property.
* Modifications Copyright © 2018 IBM.
- *
+ *
* 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.
- *
- *
+ *
+ *
* Unless otherwise specified, all documentation contained herein is licensed
* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* https://creativecommons.org/licenses/by/4.0/
- *
+ *
* Unless required by applicable law or agreed to in writing, documentation
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,11 +31,12 @@
package org.onap.optf.ticketmgt.service.rs;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
import org.onap.observations.Observation;
import org.onap.optf.ticketmgt.common.LogMessages;
import org.onap.optf.ticketmgt.service.rs.models.ActiveTicketsRequest;
@@ -46,93 +47,90 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
@Controller
-public class AvailabilityInterfaceImpl implements AvailabilityInterface {
+public class AvailabilityInterfaceImpl implements AvailabilityInterface {
+ @SuppressWarnings("unused")
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@Autowired
Environment env;
-
- @Context
+
+ @Context
UriInfo uri;
-
- @Context
+
+ @Context
HttpServletRequest request;
- @Override
- public Response getActiveTickets(String apiVersion, ActiveTicketsRequest activeTicketsRequest)
- {
- // TODO Auto-generated method stub
- String id = activeTicketsRequest.getRequestId();
+ @Override
+ public Response getActiveTickets(String apiVersion, ActiveTicketsRequest activeTicketsRequest) {
+ // TODO Auto-generated method stub
+ String id = activeTicketsRequest.getRequestId();
Observation.report(LogMessages.GET_ACTIVE_TICKETS, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
- ActiveTicketsResponse atr = new ActiveTicketsResponse();
- atr.setRequestId(activeTicketsRequest.getRequestId());
- atr.setStatus(ActiveTicketResponseStatus.COMPLETED);
+ try {
+ ActiveTicketsResponse atr = new ActiveTicketsResponse();
+ atr.setRequestId(activeTicketsRequest.getRequestId());
+ atr.setStatus(ActiveTicketResponseStatus.COMPLETED);
response = Response.ok(atr).build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.GET_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.GET_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
+ return response;
+ }
- @Override
- public Response pollActiveTickets(String apiVersion, String id) {
- // TODO Auto-generated method stub
+ @Override
+ public Response pollActiveTickets(String apiVersion, String id) {
+ // TODO Auto-generated method stub
Observation.report(LogMessages.POLL_ACTIVE_TICKETS, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
- ActiveTicketsResponse atr = new ActiveTicketsResponse();
- atr.setRequestId(id);
- atr.setStatus(ActiveTicketResponseStatus.COMPLETED);
+ try {
+ ActiveTicketsResponse atr = new ActiveTicketsResponse();
+ atr.setRequestId(id);
+ atr.setStatus(ActiveTicketResponseStatus.COMPLETED);
response = Response.ok(atr).build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.POLL_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.POLL_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
+ return response;
+ }
- @Override
- public Response deleteActiveTicketsRequest(String apiVersion, String id) {
- // TODO Auto-generated method stub
+ @Override
+ public Response deleteActiveTicketsRequest(String apiVersion, String id) {
+ // TODO Auto-generated method stub
Observation.report(LogMessages.DELETE_ACTIVE_TICKETS, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
+ try {
response = Response.noContent().build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.DELETE_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.DELETE_ACTIVE_TICKETS, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
+ return response;
+ }
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheck.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheck.java
index d15c858..6819d99 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheck.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheck.java
@@ -31,6 +31,11 @@
package org.onap.optf.ticketmgt.service.rs;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -39,17 +44,10 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.optf.ticketmgt.service.rs.models.HealthCheckMessage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
@Api("Administration")
@Path("/{apiVersion}")
@Produces({MediaType.APPLICATION_JSON})
@@ -62,8 +60,8 @@ public interface HealthCheck {
@RequestMapping(value = "/{apiVersion}/health", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON)
@ApiOperation(value = "", notes = "Returns health status of server.", response = HealthCheckMessage.class)
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 400, message = "Not healthy", response = HealthCheckMessage.class)})
- public Response healthCheck(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Check Interfaces") @QueryParam("checkInterfaces") @DefaultValue(value = "true") Boolean checkInterfaces);
+ @ApiResponse(code = 400, message = "Not healthy", response = HealthCheckMessage.class)})
+ public Response healthCheck(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Check Interfaces") @QueryParam("checkInterfaces") @DefaultValue(
+ value = "true") Boolean checkInterfaces);
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java
index c23e092..efc57ec 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java
@@ -31,20 +31,18 @@
package org.onap.optf.ticketmgt.service.rs;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
import org.onap.optf.ticketmgt.service.rs.models.HealthCheckComponent;
import org.onap.optf.ticketmgt.service.rs.models.HealthCheckMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
@Controller
public class HealthCheckImpl implements HealthCheck {
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@@ -53,11 +51,11 @@ public class HealthCheckImpl implements HealthCheck {
@Autowired
Environment env;
-
- @Context
+
+ @Context
UriInfo uri;
-
- @Context
+
+ @Context
HttpServletRequest request;
@Override
@@ -90,7 +88,7 @@ public class HealthCheckImpl implements HealthCheck {
String url = env.getProperty("spring.datasource.url");
hcc.setUrl(url);
try {
- //List<ApprovalType> approvalTypes = approvalTypeDAO.findByDomain("HealthCheck");
+ // List<ApprovalType> approvalTypes = approvalTypeDAO.findByDomain("HealthCheck");
hcc.setHealthy(true);
hcc.setStatus("OK");
} catch (Exception e) {
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java
index 13e7f6d..96c2ada 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java
@@ -31,6 +31,11 @@
package org.onap.optf.ticketmgt.service.rs;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
@@ -42,16 +47,9 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.optf.cmso.common.CMSRequestError;
import org.onap.optf.ticketmgt.service.rs.models.TicketData;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
@Api("Ticket Management")
@Path("/{apiVersion}")
@Produces({MediaType.APPLICATION_JSON})
@@ -61,39 +59,36 @@ public interface TicketManagement {
@Path("/ticket/{id}")
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "Fetch Ticket", notes = "Returns ticket information for the provided ticket id.",
- response = TicketData.class)
+ response = TicketData.class)
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class),
- @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
- public Response fetchTicket(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Unique ticket identifier") @PathParam("id") String id);
+ @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class),
+ @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
+ public Response fetchTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Unique ticket identifier") @PathParam("id") String id);
// ******************************************************************
@POST
@Path("/ticket/")
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "Create Ticket", notes = "Creates a ticket for the passed data")
- @ApiResponses(
- value = {@ApiResponse(code = 200, message = "Ticket Created. Ticket Id returned.", response=TicketData.class),
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Ticket Created. Ticket Id returned.",
+ response = TicketData.class),
@ApiResponse(code = 400, message = "Bad request.", response = CMSRequestError.class),
@ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
- public Response createTicket(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Data for creating a ticket") TicketData ticketData);
+ public Response createTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Data for creating a ticket") TicketData ticketData);
// ******************************************************************
@PUT
@Path("/ticket/")
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "Update Ticket", notes = "Updates a ticket to the passed data")
- @ApiResponses(
- value = {@ApiResponse(code = 204, message = "Ticket Updated."),
+ @ApiResponses(value = {@ApiResponse(code = 204, message = "Ticket Updated."),
@ApiResponse(code = 400, message = "Bad request.", response = CMSRequestError.class),
@ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
- public Response updateTicket(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Data for updating a ticket") TicketData ticketData);
+ public Response updateTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Data for updating a ticket") TicketData ticketData);
// ******************************************************************
@DELETE
@@ -101,35 +96,33 @@ public interface TicketManagement {
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "Cancel the ticket", notes = "Cancels the ticket.")
@ApiResponses(value = {@ApiResponse(code = 204, message = "Delete successful"),
- @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class),
- @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
- @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
+ @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class),
+ @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
+ @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
public Response deleteScheduleRequest(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") @PathParam("id") String id);
+ @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") @PathParam("id") String id);
+
-
// ******************************************************************
@GET
@Path("/tickets")
@Produces({MediaType.APPLICATION_JSON})
@ApiOperation(value = "Search Tickets", notes = "Returns a list of based upon the filter criteria.",
- response = TicketData.class, responseContainer = "List")
+ response = TicketData.class, responseContainer = "List")
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
- @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
+ @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class),
+ @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
public Response searchTcikets(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Ticket identifier",
- allowMultiple = true) @QueryParam("id") String id,
- @ApiParam(value = "Element Id",
- allowMultiple = true) @QueryParam("elementId") String elementId,
- @ApiParam(value = "Start time <low>,<high>",
- allowMultiple = true) @QueryParam("startTime") String startTime,
- @ApiParam(value = "Finish time <low>,<high>",
- allowMultiple = true) @QueryParam("finishTime") String finishTime,
- @ApiParam(value = "Maximum number of tickets to return") @QueryParam("maxTickets") Integer maxTickets,
- @ApiParam(value = "Return tickets > last id") @QueryParam("lastId") String lastId);
+ @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
+ @ApiParam(value = "Ticket identifier", allowMultiple = true) @QueryParam("id") String id,
+ @ApiParam(value = "Element Id", allowMultiple = true) @QueryParam("elementId") String elementId,
+ @ApiParam(value = "Start time <low>,<high>",
+ allowMultiple = true) @QueryParam("startTime") String startTime,
+ @ApiParam(value = "Finish time <low>,<high>",
+ allowMultiple = true) @QueryParam("finishTime") String finishTime,
+ @ApiParam(value = "Maximum number of tickets to return") @QueryParam("maxTickets") Integer maxTickets,
+ @ApiParam(value = "Return tickets > last id") @QueryParam("lastId") String lastId);
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagementImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagementImpl.java
index 4346f0b..6583c5e 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagementImpl.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagementImpl.java
@@ -1,27 +1,27 @@
/*
* Copyright © 2017-2019 AT&T Intellectual Property.
* Modifications Copyright © 2018 IBM.
- *
+ *
* 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.
- *
- *
+ *
+ *
* Unless otherwise specified, all documentation contained herein is licensed
* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* https://creativecommons.org/licenses/by/4.0/
- *
+ *
* Unless required by applicable law or agreed to in writing, documentation
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,15 +31,15 @@
package org.onap.optf.ticketmgt.service.rs;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
import org.onap.observations.Observation;
import org.onap.optf.ticketmgt.common.LogMessages;
import org.onap.optf.ticketmgt.service.rs.models.TicketData;
@@ -48,133 +48,131 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
@Controller
-public class TicketManagementImpl implements TicketManagement {
+public class TicketManagementImpl implements TicketManagement {
+ @SuppressWarnings("unused")
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@Autowired
Environment env;
-
- @Context
+
+ @Context
UriInfo uri;
-
- @Context
+
+ @Context
HttpServletRequest request;
- @Override
- public Response fetchTicket(String apiVersion, String id) {
- // TODO Auto-generated method stub
+ @Override
+ public Response fetchTicket(String apiVersion, String id) {
+ // TODO Auto-generated method stub
Observation.report(LogMessages.FETCH_TICKET, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
- TicketData td = new TicketData();
- td.setId(id);
+ try {
+ TicketData td = new TicketData();
+ td.setId(id);
response = Response.ok(td).build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.FETCH_TICKET, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
+ Observation.report(LogMessages.FETCH_TICKET, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
return response;
- }
+ }
- @Override
- public Response createTicket(String apiVersion, TicketData ticketData) {
- // TODO Auto-generated method stub
+ @Override
+ public Response createTicket(String apiVersion, TicketData ticketData) {
+ // TODO Auto-generated method stub
String id = UUID.randomUUID().toString();
Observation.report(LogMessages.CREATE_TICKET, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
- ticketData.setId(id);
+ try {
+ ticketData.setId(id);
response = Response.ok(ticketData).build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.CREATE_TICKET, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
+ Observation.report(LogMessages.CREATE_TICKET, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
return response;
- }
+ }
- @Override
- public Response updateTicket(String apiVersion, TicketData ticketData) {
- // TODO Auto-generated method stub
+ @Override
+ public Response updateTicket(String apiVersion, TicketData ticketData) {
+ // TODO Auto-generated method stub
String id = ticketData.getId();
Observation.report(LogMessages.UPDATE_TICKET, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
+ try {
response = Response.noContent().build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.UPDATE_TICKET, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.UPDATE_TICKET, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
+ return response;
+ }
- @Override
- public Response searchTcikets(String apiVersion, String id, String elementId, String startTime, String finishTime,
- Integer maxTickets, String lastId) {
- // TODO Auto-generated method stub
- // TODO Auto-generated method stub
+ @Override
+ public Response searchTcikets(String apiVersion, String id, String elementId, String startTime, String finishTime,
+ Integer maxTickets, String lastId) {
+ // TODO Auto-generated method stub
+ // TODO Auto-generated method stub
Observation.report(LogMessages.SEARCH_TICKETS, "Received", request.getRemoteAddr(), uri.getPath(), "");
Response response = null;
List<TicketData> list = new ArrayList<>();
- try
- {
+ try {
response = Response.ok(list).build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.SEARCH_TICKETS, "Returned", request.getRemoteAddr(), uri.getPath(), response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.SEARCH_TICKETS, "Returned", request.getRemoteAddr(), uri.getPath(),
+ response.getStatusInfo().toString());
+ return response;
+ }
- @Override
- public Response deleteScheduleRequest(String apiVersion, String id) {
+ @Override
+ public Response deleteScheduleRequest(String apiVersion, String id) {
Observation.report(LogMessages.CANCEL_TICKET, "Received", request.getRemoteAddr(), id, "");
Response response = null;
- try
- {
+ try {
response = Response.noContent().build();
-// } catch (CMSException e) {
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-// Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
-// response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
+ // } catch (CMSException e) {
+ // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+ // Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());
+ // response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
} catch (Exception e) {
- Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
response = Response.serverError().build();
}
- Observation.report(LogMessages.CANCEL_TICKET, "Returned", request.getRemoteAddr(), id, response.getStatusInfo().toString());
- return response;
- }
+ Observation.report(LogMessages.CANCEL_TICKET, "Returned", request.getRemoteAddr(), id,
+ response.getStatusInfo().toString());
+ return response;
+ }
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java
index 9c979de..34093f9 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java
@@ -31,19 +31,18 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
-@ApiModel(value = "Ticket Management Request", description = "Request to retrieve active tickets for the provided elements.")
+@ApiModel(value = "Ticket Management Request",
+ description = "Request to retrieve active tickets for the provided elements.")
public class ActiveTicketsRequest implements Serializable {
private static final long serialVersionUID = 1L;
private static EELFLogger log = EELFManager.getInstance().getLogger(ActiveTicketsRequest.class);
@@ -52,57 +51,56 @@ public class ActiveTicketsRequest implements Serializable {
private String requestId;
@ApiModelProperty(
- value = "Implementation specific name value pairs provided to be passed to Ticket Management query .")
+ value = "Implementation specific name value pairs provided to be passed to Ticket Management query .")
private List<NameValue> commonData;
- @ApiModelProperty(
- value = "Lists of desired change windows for which TicketData will be returned.")
+ @ApiModelProperty(value = "Lists of desired change windows for which TicketData will be returned.")
private List<ChangeWindow> changeWindows = new ArrayList<>();
@ApiModelProperty(value = "List of the elements for which TicketData will be returned.")
private List<ElementCriteria> elements = new ArrayList<>();
public String getRequestId() {
- return requestId;
- }
+ return requestId;
+ }
- public void setRequestId(String requestId) {
- this.requestId = requestId;
- }
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
- public List<NameValue> getCommonData() {
- return commonData;
- }
+ public List<NameValue> getCommonData() {
+ return commonData;
+ }
- public void setCommonData(List<NameValue> commonData) {
- this.commonData = commonData;
- }
+ public void setCommonData(List<NameValue> commonData) {
+ this.commonData = commonData;
+ }
- public List<ChangeWindow> getChangeWindows() {
- return changeWindows;
- }
+ public List<ChangeWindow> getChangeWindows() {
+ return changeWindows;
+ }
- public void setChangeWindows(List<ChangeWindow> changeWindows) {
- this.changeWindows = changeWindows;
- }
+ public void setChangeWindows(List<ChangeWindow> changeWindows) {
+ this.changeWindows = changeWindows;
+ }
- public List<ElementCriteria> getElements() {
- return elements;
- }
+ public List<ElementCriteria> getElements() {
+ return elements;
+ }
- public void setElements(List<ElementCriteria> elements) {
- this.elements = elements;
- }
+ public void setElements(List<ElementCriteria> elements) {
+ this.elements = elements;
+ }
- public String toString() {
+ public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java
index d3d5f7d..fe661ca 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java
@@ -31,73 +31,73 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
-@ApiModel(value = "Ticket Management Response", description = "Response to active ticket query for the requested elements.")
+@ApiModel(value = "Ticket Management Response",
+ description = "Response to active ticket query for the requested elements.")
public class ActiveTicketsResponse implements Serializable {
private static final long serialVersionUID = 1L;
private static EELFLogger log = EELFManager.getInstance().getLogger(ActiveTicketsResponse.class);
- public enum ActiveTicketResponseStatus
- {
- IN_PROGESS,
- COMPLETED,
+ public enum ActiveTicketResponseStatus {
+ IN_PROGESS, COMPLETED,
}
+
@ApiModelProperty(value = "Unique Id of the request")
private String requestId;
- @ApiModelProperty(value = "List of TicketData for the requested elements. A single ticket may apply to more than 1 passed elementId.")
+ @ApiModelProperty(
+ value = "List of TicketData for the requested elements. A single ticket may apply to more than 1 passed elementId.")
private List<TicketData> elements = new ArrayList<>();
-
- @ApiModelProperty(value = "Status of ticket request. IN_PROGRESS will indicate asynchronous processing is required.")
+
+ @ApiModelProperty(
+ value = "Status of ticket request. IN_PROGRESS will indicate asynchronous processing is required.")
private ActiveTicketResponseStatus status;
-
+
@ApiModelProperty(value = "If request is asynchronous (IN_PROGRESS), suggested interval to the next poll.")
private Integer pollingSeconds;
-
+
public String getRequestId() {
- return requestId;
- }
+ return requestId;
+ }
- public void setRequestId(String requestId) {
- this.requestId = requestId;
- }
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
- public List<TicketData> getElements() {
- return elements;
- }
+ public List<TicketData> getElements() {
+ return elements;
+ }
- public void setElements(List<TicketData> elements) {
- this.elements = elements;
- }
+ public void setElements(List<TicketData> elements) {
+ this.elements = elements;
+ }
- public ActiveTicketResponseStatus getStatus() {
- return status;
- }
+ public ActiveTicketResponseStatus getStatus() {
+ return status;
+ }
- public void setStatus(ActiveTicketResponseStatus status) {
- this.status = status;
- }
+ public void setStatus(ActiveTicketResponseStatus status) {
+ this.status = status;
+ }
- public Integer getPollingSeconds() {
- return pollingSeconds;
- }
+ public Integer getPollingSeconds() {
+ return pollingSeconds;
+ }
- public void setPollingSeconds(Integer pollingSeconds) {
- this.pollingSeconds = pollingSeconds;
- }
+ public void setPollingSeconds(Integer pollingSeconds) {
+ this.pollingSeconds = pollingSeconds;
+ }
- public String toString() {
+ public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java
index 9b88cf2..31a49de 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java
@@ -31,31 +31,27 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-import java.util.Date;
-
-import org.springframework.format.annotation.DateTimeFormat;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Date;
+import org.springframework.format.annotation.DateTimeFormat;
-@ApiModel(value = "Change Window",
- description = "Time window for which tickets are to returned")
+@ApiModel(value = "Change Window", description = "Time window for which tickets are to returned")
public class ChangeWindow implements Serializable {
private static final long serialVersionUID = 1L;
private static EELFLogger log = EELFManager.getInstance().getLogger(ChangeWindow.class);
@ApiModelProperty(value = "Earliest time for which changes may begin.")
- @DateTimeFormat(pattern="yyyy-MM-dd'T'hh:mm:ss'Z'")
+ @DateTimeFormat(pattern = "yyyy-MM-dd'T'hh:mm:ss'Z'")
private Date startTime;
@ApiModelProperty(value = "Latest time by which all changes must be completed.")
- @DateTimeFormat(pattern="yyyy-MM-dd'T'hh:mm:ss'Z'")
+ @DateTimeFormat(pattern = "yyyy-MM-dd'T'hh:mm:ss'Z'")
private Date endTime;
public Date getStartTime() {
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java
index 8b812a2..0043dd3 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java
@@ -30,13 +30,12 @@
******************************************************************************/
package org.onap.optf.ticketmgt.service.rs.models;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
@ApiModel(value = "Element Critera", description = "Element criteria for retrieving active tickets.")
public class ElementCriteria implements Serializable {
private static final long serialVersionUID = 1L;
@@ -47,20 +46,20 @@ public class ElementCriteria implements Serializable {
@ApiModelProperty(value = "Implementation specific element data.")
public List<NameValue> elementData = new ArrayList<>();
- public String getElementId() {
- return elementId;
- }
+ public String getElementId() {
+ return elementId;
+ }
- public void setElementId(String elementId) {
- this.elementId = elementId;
- }
+ public void setElementId(String elementId) {
+ this.elementId = elementId;
+ }
- public List<NameValue> getElementData() {
- return elementData;
- }
+ public List<NameValue> getElementData() {
+ return elementData;
+ }
- public void setElementData(List<NameValue> elementData) {
- this.elementData = elementData;
- }
+ public void setElementData(List<NameValue> elementData) {
+ this.elementData = elementData;
+ }
}
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java
index 8717987..dafe38e 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java
@@ -31,14 +31,12 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
+import java.io.Serializable;
@ApiModel
public class HealthCheckComponent implements Serializable {
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java
index fd313fd..e36f54e 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java
@@ -31,16 +31,14 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
@ApiModel
public class HealthCheckMessage implements Serializable {
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java
index dbbcac7..c5c53b2 100644
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java
+++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java
@@ -31,19 +31,15 @@
package org.onap.optf.ticketmgt.service.rs.models;
-import java.io.Serializable;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
-@ApiModel(value = "Name Value Data",
- description = "Instance of a name/value")
+@ApiModel(value = "Name Value Data", description = "Instance of a name/value")
public class NameValue implements Serializable {
private static final long serialVersionUID = 1L;
private static EELFLogger log = EELFManager.getInstance().getLogger(NameValue.class);
@@ -53,29 +49,29 @@ public class NameValue implements Serializable {
@ApiModelProperty(value = "Value.")
private Object value;
-
-
+
+
public String getName() {
- return name;
- }
+ return name;
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
- public Object getValue() {
- return value;
- }
+ public Object getValue() {
+ return value;
+ }
- public void setValue(Object value) {
- this.value = value;
- }
+ public void setValue(Object value) {
+ this.value = value;
+ }
- public String toString() {
+ public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);