diff options
author | Dinh Danh Le <dinh.danh.le@ericsson.com> | 2018-08-13 11:20:21 +0100 |
---|---|---|
committer | Dinh Danh Le <dinh.danh.le@ericsson.com> | 2018-08-14 12:27:52 +0100 |
commit | 933af17963b47650fe9864d03e63a06aa08e31a9 (patch) | |
tree | 96525e225a4637b1a97fe4931811ba8f6c5d0bd8 /client | |
parent | 15dcabb76fd31f54452a94498e84516485dd838a (diff) |
Fix checkstyle warnings in the client module
Change-Id: I3263a833cc9dd6d86afdf2ae53de0e53c92850c9
Signed-off-by: Dinh Danh Le <dinh.danh.le@ericsson.com>
Issue-ID: POLICY-1034
Diffstat (limited to 'client')
41 files changed, 282 insertions, 198 deletions
diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRest.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRest.java index b6ed37d80..1fb7a2259 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRest.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRest.java @@ -29,7 +29,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This class is used to launch the services. It creates a Grizzly embedded web server and runs the services. + * This class is used to launch the services. It creates a Grizzly embedded web server and runs the + * services. */ public class ApexDeploymentRest { // Logger for this class @@ -39,16 +40,17 @@ public class ApexDeploymentRest { private HttpServer server; /** - * Starts the HTTP server for the Apex services client on the default base URI and with the default REST packages + * Starts the HTTP server for the Apex services client on the default base URI and with the + * default REST packages. */ public ApexDeploymentRest() { this(new ApexDeploymentRestParameters()); } /** - * Starts the HTTP server for the Apex services client + * Starts the HTTP server for the Apex services client. * - * @param parameters: The Apex parameters to use to start the server + * @param parameters The Apex parameters to use to start the server */ public ApexDeploymentRest(final ApexDeploymentRestParameters parameters) { Assertions.argumentNotNull(parameters, "parameters may not be null"); @@ -74,7 +76,7 @@ public class ApexDeploymentRest { } /** - * Shut down the web server + * Shut down the web server. */ public void shutdown() { logger.debug("Apex services RESTful client shutting down . . ."); diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestMain.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestMain.java index 6e7220487..a0e6641db 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestMain.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestMain.java @@ -23,13 +23,15 @@ package org.onap.policy.apex.client.deployment.rest; import java.io.PrintStream; /** - * User: ewatkmi Date: 31 Jul 2017 + * The main class for ApexDeploymentRest. + * + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexDeploymentRestMain { // Services state public enum ServicesState { STOPPED, READY, INITIALIZING, RUNNING - }; + } private ServicesState state = ServicesState.STOPPED; @@ -43,7 +45,7 @@ public class ApexDeploymentRestMain { private ApexDeploymentRest apexDeploymentRest = null; /** - * Main method, main entry point for command + * Main method, main entry point for command. * * @param args The command line arguments for the client */ @@ -57,7 +59,7 @@ public class ApexDeploymentRestMain { } /** - * Constructor, kicks off the rest service + * Constructor, kicks off the rest service. * * @param args The command line arguments for the RESTful service * @param outStream The stream for output messages @@ -95,7 +97,7 @@ public class ApexDeploymentRestMain { } /** - * Initialize the rest service + * Initialize the rest service. */ public void init() { outStream.println("Apex Services REST endpoint (" + this.toString() + ") starting at " @@ -161,7 +163,7 @@ public class ApexDeploymentRestMain { } /** - * Explicitly shut down the services + * Explicitly shut down the services. */ public void shutdown() { if (apexDeploymentRest != null) { @@ -173,7 +175,7 @@ public class ApexDeploymentRestMain { } /** - * This class is a shutdown hook for the Apex services command + * This class is a shutdown hook for the Apex services command. */ private class ApexServicesShutdownHook implements Runnable { /* diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterException.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterException.java index 87785b7f3..325128dfb 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterException.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterException.java @@ -23,13 +23,13 @@ package org.onap.policy.apex.client.deployment.rest; /** * A run time exception used to report parsing and parameter input errors. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexDeploymentRestParameterException extends IllegalArgumentException { private static final long serialVersionUID = 6520231162404452427L; /** - * Create an ApexServicesRestParameterException with a message + * Create an ApexServicesRestParameterException with a message. * * @param message the message */ diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterParser.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterParser.java index 35ad9cdde..564be435c 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterParser.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameterParser.java @@ -32,16 +32,16 @@ import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexDeploymentRestParameterParser { // Apache Commons CLI options Options options; /** - * Construct the options for the CLI RESTful services + * Construct the options for the CLI RESTful services. */ public ApexDeploymentRestParameterParser() { options = new Options(); @@ -54,7 +54,7 @@ public class ApexDeploymentRestParameterParser { } /** - * Parse the command line options + * Parse the command line options. * * @param args the arguments * @return the parsed arguments @@ -99,7 +99,7 @@ public class ApexDeploymentRestParameterParser { } /** - * Get help information + * Get help information. * * @param mainClassName the main class name for the help output * @return help string diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameters.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameters.java index 952492f53..af8cc5ab4 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameters.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestParameters.java @@ -23,9 +23,9 @@ package org.onap.policy.apex.client.deployment.rest; import java.net.URI; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexDeploymentRestParameters { public static final int DEFAULT_REST_PORT = 18989; diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java index 810b59cc1..13192aa2a 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java @@ -42,11 +42,12 @@ import org.slf4j.ext.XLoggerFactory; /** * The class represents the root resource exposed at the base URL<br> - * The url to access this resource would be in the form {@code <baseURL>/rest/....} <br> + * + * <p>The url to access this resource would be in the form {@code <baseURL>/rest/....} <br> * For example: a GET request to the following URL * {@code http://localhost:18989/apexservices/rest/?hostName=localhost&port=12345} * - * <b>Note:</b> An allocated {@code hostName} and {@code port} query parameter must be included in all requests. + * <p><b>Note:</b> An allocated {@code hostName} and {@code port} query parameter must be included in all requests. * Datasets for different {@code hostName} are completely isolated from one another. * */ @@ -64,7 +65,7 @@ public class ApexDeploymentRestResource { public ApexDeploymentRestResource() {} /** - * Query the engine service for data + * Query the engine service for data. * * @param hostName the host name of the engine service to connect to. * @param port the port number of the engine service to connect to. diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java index 87e76cdf7..50117e52b 100644 --- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java +++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java @@ -40,7 +40,7 @@ public final class ParameterCheck { private ParameterCheck() {} /** - * The Enum StartStop is used to hold . + * The Enum StartStop is used to hold. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -49,7 +49,7 @@ public final class ParameterCheck { START, /** Stop of an Apex engine has been ordered. */ STOP - }; + } private static final XLogger LOGGER = XLoggerFactory.getXLogger(ParameterCheck.class); diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorException.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorException.java index b674e6021..18dcc9f99 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorException.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorException.java @@ -53,21 +53,21 @@ public class ApexEditorException extends ApexException { * Instantiates a new apex editor exception. * * @param message the message on the exception - * @param e the exception that caused this Apex exception + * @param ex the exception that caused this Apex exception */ - public ApexEditorException(final String message, final Exception e) { - super(message, e); + public ApexEditorException(final String message, final Exception ex) { + super(message, ex); } /** * Instantiates a new apex editor exception. * * @param message the message on the exception - * @param e the exception that caused this Apex exception + * @param ex the exception that caused this Apex exception * @param object the object that the exception was thrown on */ - public ApexEditorException(final String message, final Exception e, final Object object) { - super(message, e, object); + public ApexEditorException(final String message, final Exception ex, final Object object) { + super(message, ex, object); } } diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorMain.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorMain.java index ee7199fda..0fa8011c5 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorMain.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorMain.java @@ -40,7 +40,7 @@ public class ApexEditorMain { INITIALIZING, /** The editor is running. */ RUNNING - }; + } private static final int EDITOR_RNNING_CHECK_TIMEOUT = 1000; diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorParameterException.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorParameterException.java index 921b4c068..0ba12dec6 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorParameterException.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorParameterException.java @@ -41,9 +41,9 @@ public class ApexEditorParameterException extends IllegalArgumentException { * Create an ApexEditorParameterException with a message and an exception. * * @param message the message - * @param t the t + * @param th the Throwable instance */ - public ApexEditorParameterException(final String message, final Throwable t) { - super(message, t); + public ApexEditorParameterException(final String message, final Throwable th) { + super(message, th); } } diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorRestResource.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorRestResource.java index 09b34ebe4..83ca529f6 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorRestResource.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/ApexEditorRestResource.java @@ -1000,7 +1000,8 @@ public class ApexEditorRestResource { if (p.getValue() == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null event parameter information for parameter \"" + p.getKey() + "\" in event " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The event was created, but there was an error adding the event parameters. The event has only been partially defined."); + + ". The event was created, but there was an error adding the event parameters." + + " The event has only been partially defined."); return ret; } final ApexAPIResult rettmp = @@ -1009,7 +1010,8 @@ public class ApexEditorRestResource { if (rettmp.isNOK()) { rettmp.addMessage("Failed to add event parameter information for parameter \"" + p.getKey() + "\" in event " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The event was created, but there was an error adding the event parameters. The event has only been partially defined."); + + ". The event was created, but there was an error adding the event parameters." + + " The event has only been partially defined."); ret = rettmp; return ret; } @@ -1240,7 +1242,8 @@ public class ApexEditorRestResource { if (fin.getValue() == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null task input field information for field \"" + fin.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the input fields. The task has only been partially defined."); + + ". The task was created, but there was an error adding the input fields." + + " The task has only been partially defined."); return ret; } if (fin.getKey() == null || !fin.getKey().equals(fin.getValue().getLocalName())) { @@ -1248,7 +1251,8 @@ public class ApexEditorRestResource { + fin.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() + ". The localName of the field (\"" + fin.getValue().getLocalName() + "\") is not the same as the field name. " - + "The task was created, but there was an error adding the input fields. The task has only been partially defined."); + + "The task was created, but there was an error adding the input fields." + + " The task has only been partially defined."); return ret; } tempres = sessionApexModel.createTaskInputField(jsonbean.getName(), jsonbean.getVersion(), @@ -1257,7 +1261,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task input field information for field \"" + fin.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the input fields. The task has only been partially defined."); + + ". The task was created, but there was an error adding the input fields." + + " The task has only been partially defined."); ret = tempres; return ret; } @@ -1268,7 +1273,8 @@ public class ApexEditorRestResource { if (fout.getValue() == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null task output field information for field \"" + fout.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the output fields. The task has only been partially defined."); + + ". The task was created, but there was an error adding the output fields." + + " The task has only been partially defined."); return ret; } if (fout.getKey() == null || !fout.getKey().equals(fout.getValue().getLocalName())) { @@ -1276,7 +1282,8 @@ public class ApexEditorRestResource { + fout.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() + ". The localName of the field (\"" + fout.getValue().getLocalName() + "\") is not the same as the field name. " - + "The task was created, but there was an error adding the output fields. The task has only been partially defined."); + + "The task was created, but there was an error adding the output fields." + + " The task has only been partially defined."); return ret; } tempres = sessionApexModel.createTaskOutputField(jsonbean.getName(), jsonbean.getVersion(), @@ -1285,7 +1292,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task output field information for field \"" + fout.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the output fields. The task has only been partially defined."); + + ". The task was created, but there was an error adding the output fields." + + " The task has only been partially defined."); ret = tempres; return ret; } @@ -1298,7 +1306,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task logic in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the logic. The task has only been partially defined."); + + ". The task was created, but there was an error adding the logic." + + " The task has only been partially defined."); ret = tempres; return ret; } @@ -1310,7 +1319,8 @@ public class ApexEditorRestResource { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid task parameter information for parameter \"" + param.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the parameters. The task has only been partially defined."); + + ". The task was created, but there was an error adding the parameters." + + " The task has only been partially defined."); return ret; } tempres = sessionApexModel.createTaskParameter(jsonbean.getName(), jsonbean.getVersion(), @@ -1318,7 +1328,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task parameter \"" + param.getKey() + "\" in task " + jsonbean.getName() + ":" + jsonbean.getVersion() - + ". The task was created, but there was an error adding the parameters. The task has only been partially defined."); + + ". The task was created, but there was an error adding the parameters." + + " The task has only been partially defined."); ret = tempres; return ret; } @@ -1577,7 +1588,8 @@ public class ApexEditorRestResource { if (jsonbean.getStates() == null || jsonbean.getStates().isEmpty()) { ret = new ApexAPIResult(RESULT.FAILED, "Null or empty state map; no states defined for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding states. The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding states." + + " The policy has only been partially defined."); return ret; } @@ -1589,19 +1601,22 @@ public class ApexEditorRestResource { if (state == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid state information for state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the state. The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the state." + + " The policy has only been partially defined."); return ret; } if (state.getTrigger() == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid state trigger for state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the state. The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the state." + + " The policy has only been partially defined."); return ret; } if (state.getDefaultTask() == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid default task for state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the state. The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the state." + + " The policy has only been partially defined."); return ret; } tempres = sessionApexModel.createPolicyState(policyname, policyversion, statename, @@ -1624,8 +1639,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task selection logic for state \"" + statename + "\" for" + " policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the task selection logic for " - + "the state. The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the task selection logic " + + "for the state. The policy has only been partially defined."); ret = tempres; return ret; } @@ -1638,8 +1653,8 @@ public class ApexEditorRestResource { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid context reference \"" + c + "\" for" + " state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the context reference for the state." - + " The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the context " + + "reference for the state. The policy has only been partially defined."); return ret; } tempres = sessionApexModel.createPolicyStateContextRef(policyname, policyversion, statename, @@ -1647,8 +1662,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add context reference \"" + c + "\" for state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the context reference for the state." - + " The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the context reference " + + "for the state. The policy has only been partially defined."); ret = tempres; return ret; } @@ -1663,10 +1678,10 @@ public class ApexEditorRestResource { if (finalizername == null || finalizer == null) { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid finalizer information for finalizer " + "named \"" + finalizername - + "\" in state \"" + statename + "\" for policy \"" + policyname + ":" + + "\" in state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy and state were created, but there was an error adding the finalizer." - + " The policy has only been partially defined."); + + "\". The policy and state were created, but there was an error adding the" + + " finalizer. The policy has only been partially defined."); return ret; } tempres = sessionApexModel.createPolicyStateFinalizerLogic(policyname, policyversion, statename, @@ -1675,8 +1690,8 @@ public class ApexEditorRestResource { tempres.addMessage("Failed to add finalizer information for finalizer named \"" + finalizername + "\" in" + " state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy and state were created, but there was an error adding the finalizer." - + " The policy has only been partially defined."); + + "\". The policy and state were created, but there was an error adding the" + + " finalizer. The policy has only been partially defined."); ret = tempres; return ret; } @@ -1687,8 +1702,8 @@ public class ApexEditorRestResource { ret = new ApexAPIResult(RESULT.FAILED, "No state outputs have been defined in state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy and state were created, but there was an error adding state outputs." - + " The policy has only been partially defined."); + + "\". The policy and state were created, but there was an error adding state" + + " outputs. The policy has only been partially defined."); return ret; } for (final Map.Entry<String, BeanStateOutput> o : outputs.entrySet()) { @@ -1698,8 +1713,8 @@ public class ApexEditorRestResource { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid output information for output named \"" + outputname + "\" in state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy and state were created, but there was an error adding the output." - + " The policy has only been partially defined."); + + "\". The policy and state were created, but there was an error adding the" + + " output. The policy has only been partially defined."); return ret; } tempres = sessionApexModel.createPolicyStateOutput(policyname, policyversion, statename, outputname, @@ -1730,8 +1745,8 @@ public class ApexEditorRestResource { ret = new ApexAPIResult(RESULT.FAILED, "Null or invalid task information for task named \"" + tasklocalname + "\" in state \"" + statename + "\" for for policy \"" + policyname + ":" + policyversion - + "\". The policy and state were created, but there was an error adding the task. " - + "The policy has only been partially defined."); + + "\". The policy and state were created, but there was an error adding the " + + "task. The policy has only been partially defined."); return ret; } tempres = sessionApexModel.createPolicyStateTaskRef(policyname, policyversion, statename, @@ -1740,8 +1755,8 @@ public class ApexEditorRestResource { if (tempres.isNOK()) { tempres.addMessage("Failed to add task reference \"" + t + "\" for state \"" + statename + "\" for policy \"" + policyname + ":" + policyversion - + "\". The policy was created, but there was an error adding the task reference for the state." - + " The policy has only been partially defined."); + + "\". The policy was created, but there was an error adding the task reference for" + + " the state. The policy has only been partially defined."); ret = tempres; return ret; } @@ -1799,7 +1814,11 @@ public class ApexEditorRestResource { final ApexAPIResult existingPeriodicEvent = sessionApexModel.listEvent("PeriodicEvent", null); if (existingPeriodicEvent.isNOK()) { final String periodicEventString = - "{\"name\":\"PeriodicEvent\",\"version\":\"0.0.1\",\"uuid\":\"44236da1-3d47-4988-8033-b6fee9d6a0f4\",\"description\":\"Generated description for concept referred to by key 'PeriodicEvent:0.0.1'\",\"source\":\"System\",\"target\":\"Apex\",\"nameSpace\":\"org.onap.policy.apex.domains.aadm.events\",\"parameters\":{}}"; + "{\"name\":\"PeriodicEvent\",\"version\":\"0.0.1\"," + + "\"uuid\":\"44236da1-3d47-4988-8033-b6fee9d6a0f4\"," + + "\"description\":\"Generated description for concept referred to by key " + + "'PeriodicEvent:0.0.1'\",\"source\":\"System\",\"target\":\"Apex\"," + + "\"nameSpace\":\"org.onap.policy.apex.domains.aadm.events\",\"parameters\":{}}"; ret = createEvent(periodicEventString); if (ret.isNOK()) { return ret; diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/RestUtils.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/RestUtils.java index 2c5b6e89a..02779a4d7 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/RestUtils.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/RestUtils.java @@ -97,7 +97,8 @@ public abstract class RestUtils { } /** - * Apex HTTP PUT requests send simple single level JSON strings, this method reads those strings into a map. + * Apex HTTP PUT requests send simple single level JSON strings, this method reads those strings + * into a map. * * @param jsonString the incoming JSON string * @return a map of the JSON strings @@ -116,7 +117,8 @@ public abstract class RestUtils { } /** - * Apex HTTP PUT requests send simple single level JSON strings, this method reads those strings into a map. + * Apex HTTP PUT requests send simple single level JSON strings, this method reads those strings + * into a map. * * @param <CLZ> the generic type * @param jsonString the incoming JSON string @@ -137,13 +139,11 @@ public abstract class RestUtils { } // Regular expressions for checking input types - private static final String XML_INPUT_TYPE_REGEXP = "^\\s*<\\?xml.*>\\s*"; // (starts with <?xml...> - private static final String JSON_INPUT_TYPE_REGEXP = "^\\s*[\\(\\{\\[][\\s+\\S]*[\\)\\}\\]]"; // starts with some - // kind of bracket [ - // or ( or {, then has - // something, then has - // and has a close - // bracket + private static final String XML_INPUT_TYPE_REGEXP = "^\\s*<\\?xml.*>\\s*"; //starts with <?xml...> + /** + * starts with some kind of bracket [ or ( or {, then has something, then has bracket. + */ + private static final String JSON_INPUT_TYPE_REGEXP = "^\\s*[\\(\\{\\[][\\s+\\S]*[\\)\\}\\]]"; /** * Gets the concept from JSON. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextAlbum.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextAlbum.java index 848665a0f..1cc6c7c35 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextAlbum.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextAlbum.java @@ -27,8 +27,11 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanContextAlbum extends BeanBase { - - private String name = null, version = null, scope = null, uuid = null, description = null; + private String name = null; + private String version = null; + private String scope = null; + private String uuid = null; + private String description = null; private BeanKeyRef itemSchema = null; private boolean writeable; @@ -105,5 +108,4 @@ public class BeanContextAlbum extends BeanBase { return "ContextAlbum [name=" + name + ", version=" + version + ", scope=" + scope + ", uuid=" + uuid + ", description=" + description + ", itemSchema=" + itemSchema + ", writeable=" + writeable + "]"; } - } diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextSchema.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextSchema.java index 0d86c2791..95b296fef 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextSchema.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanContextSchema.java @@ -27,9 +27,12 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanContextSchema extends BeanBase { - - private String name = null, version = null, schemaFlavour = null, schemaDefinition = null, uuid = null, - description = null; + private String name = null; + private String version = null; + private String schemaFlavour = null; + private String schemaDefinition = null; + private String uuid = null; + private String description = null; /** * Gets the name. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanEvent.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanEvent.java index 8b7c6bce2..c867beab1 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanEvent.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanEvent.java @@ -29,9 +29,13 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanEvent extends BeanBase { - - private String name = null, version = null, nameSpace = null, source = null, target = null, uuid = null, - description = null; + private String name = null; + private String version = null; + private String nameSpace = null; + private String source = null; + private String target = null; + private String uuid = null; + private String description = null; private Map<String, BeanField> parameters = null; /** @@ -109,12 +113,12 @@ public class BeanEvent extends BeanBase { /** * Gets the parameter. * - * @param p the p + * @param ps the parameter string * @return the parameter */ - public BeanField getParameter(final String p) { + public BeanField getParameter(final String ps) { if (parameters != null) { - return parameters.get(p); + return parameters.get(ps); } return null; } diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanKeyRef.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanKeyRef.java index a498b9467..dfe8ac6d2 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanKeyRef.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanKeyRef.java @@ -27,8 +27,8 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanKeyRef extends BeanBase { - - private String name = null, version = null; + private String name = null; + private String version = null; /** * Gets the name. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanLogic.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanLogic.java index 48fba16a8..ef8e3c726 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanLogic.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanLogic.java @@ -27,8 +27,8 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanLogic extends BeanBase { - - private String logic = null, logicFlavour = null; + private String logic = null; + private String logicFlavour = null; /** * Gets the logic flavour. @@ -57,5 +57,4 @@ public class BeanLogic extends BeanBase { public String toString() { return "Logic [logicFlavour=" + logicFlavour + ", logic=" + logic + "]"; } - } diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanModel.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanModel.java index 3170ea303..0d69be971 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanModel.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanModel.java @@ -28,7 +28,10 @@ import javax.xml.bind.annotation.XmlType; @XmlType public class BeanModel extends BeanBase { - private String name = null, version = null, uuid = null, description = null; + private String name = null; + private String version = null; + private String uuid = null; + private String description = null; /** * Gets the name. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanPolicy.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanPolicy.java index bdbfb6dea..fad64f6ac 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanPolicy.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanPolicy.java @@ -29,8 +29,12 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanPolicy extends BeanBase { - - private String name = null, version = null, uuid = null, description = null, firstState = null, template = null; + private String name = null; + private String version = null; + private String uuid = null; + private String description = null; + private String firstState = null; + private String template = null; private Map<String, BeanState> states = null; /** diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanStateTaskRef.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanStateTaskRef.java index 9d446e7c7..c3525b0c8 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanStateTaskRef.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanStateTaskRef.java @@ -27,9 +27,9 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanStateTaskRef extends BeanBase { - private BeanKeyRef task = null; - private String outputType = null, outputName = null; + private String outputType = null; + private String outputName = null; /** * Gets the task. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTask.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTask.java index 0df810caf..bf148386d 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTask.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTask.java @@ -30,8 +30,10 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanTask extends BeanBase { - - private String name = null, version = null, uuid = null, description = null; + private String name = null; + private String version = null; + private String uuid = null; + private String description = null; private BeanLogic taskLogic = null; private Map<String, BeanField> inputFields = null; private Map<String, BeanField> outputFields = null; diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTaskParameter.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTaskParameter.java index 2de1c7a28..ef4f39af3 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTaskParameter.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/bean/BeanTaskParameter.java @@ -28,7 +28,8 @@ import javax.xml.bind.annotation.XmlType; @XmlType public class BeanTaskParameter extends BeanBase { - private String parameterName = null, defaultValue = null; + private String parameterName = null; + private String defaultValue = null; /** * Gets the parameter name. diff --git a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/package-info.java b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/package-info.java index e9bf636cf..7e61cc9e6 100644 --- a/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/package-info.java +++ b/client/client-editor/src/main/java/org/onap/policy/apex/client/editor/rest/package-info.java @@ -20,8 +20,8 @@ /** * Implements the RESTful editor for Apex. It implements a RESTful service towards the - * {@link org.onap.policy.apex.model.modelapi.ApexEditorAPI} Java interface for use by clients over REST. It also - * provides a web-based client written in Javascript. + * {@link org.onap.policy.apex.model.modelapi.ApexEditorAPI} Java interface for use by clients over + * REST. It also provides a web-based client written in Javascript. * * @author Liam Fallon (liam.fallon@ericsson.com) */ diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorRestResource.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorRestResource.java index ee156e02b..1fb3a0a00 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorRestResource.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorRestResource.java @@ -37,6 +37,7 @@ import org.onap.policy.apex.model.modelapi.ApexAPIResult.RESULT; import org.onap.policy.apex.model.utilities.TextFileUtils; /** + * Test Apex Editor Rest Resource. * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestApexEditorRestResource extends JerseyTest { @@ -537,7 +538,8 @@ public class TestApexEditorRestResource extends JerseyTest { entityString = "{" + "\"name\" : \"HowsItGoing\"," + "\"version\" : \"0.0.2\"," + "\"namespace\" : \"somewhere.over.the.rainbow\"," + "\"source\" : \"beginning\"," + "\"target\" : \"end\"," - + "\"parameters\" : {\"Par0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", \"localName\" : \"Par0\", \"optional\" : false}}," + + "\"parameters\" : {\"Par0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"Par0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -556,7 +558,8 @@ public class TestApexEditorRestResource extends JerseyTest { entityString = "{" + "\"name\" : \"GoodDay\"," + "\"version\" : \"0.0.2\"," + "\"namespace\" : \"somewhere.over.the.rainbow\"," + "\"source\" : \"beginning\"," + "\"target\" : \"end\"," - + "\"parameters\" : {\"Par0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", \"localName\" : \"Par0\", \"optional\" : false}}," + + "\"parameters\" : {\"Par0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"Par0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -725,7 +728,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult()); entityString = "{" + "\"name\" : \"HowsItGoing\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", \"localName\" : \"IField0\", \"optional\" : false}}," + + "\"inputFields\" : {\"IField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"IField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -741,7 +745,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"GoodDay\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", \"localName\" : \"IField0\", \"optional\" : false}}," + + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"IField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -749,7 +754,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); entityString = "{" + "\"name\" : \"Howdy\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", \"localName\" : \"NotIField0\", \"optional\" : false}}," + + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"NotIField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -757,7 +763,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"HowsItGoing2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", \"localName\" : \"OField0\", \"optional\" : false}}," + + "\"outputFields\" : {\"OField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"OField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -773,7 +780,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"GoodDay2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", \"localName\" : \"OField0\", \"optional\" : false}}," + + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\"," + + " \"localName\" : \"OField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -781,7 +789,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, result.getResult()); entityString = "{" + "\"name\" : \"Howdy2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", \"localName\" : \"NotOField0\", \"optional\" : false}}," + + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " + + "\"localName\" : \"NotOField0\", \"optional\" : false}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -789,8 +798,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"HowsItGoing3\"," + "\"version\" : \"0.0.2\"," - + "\"taskLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + + "\"taskLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons," + + " lots of lime\"}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); result = target("editor/" + sessionId + "/Task/Create").request().post(entity, ApexAPIResult.class); @@ -806,8 +815,8 @@ public class TestApexEditorRestResource extends JerseyTest { entityString = "{" + "\"name\" : \"GoodDay3\"," + "\"version\" : \"0.0.2\"," + "\"namespace\" : \"somewhere.over.the.rainbow\"," + "\"source\" : \"beginning\"," + "\"target\" : \"end\"," - + "\"taskLogic\" : {\"logicFlavour\" : \"UNDEFINED\", \"logic\" : \"lots of lemons, lots of lime\"}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + + "\"taskLogic\" : {\"logicFlavour\" : \"UNDEFINED\", \"logic\" : \"lots of lemons," + + " lots of lime\"}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); result = target("editor/" + sessionId + "/Task/Create").request().post(entity, ApexAPIResult.class); @@ -822,7 +831,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"HowsItGoing4\"," + "\"version\" : \"0.0.2\"," - + "\"parameters\" : {\"Par0\" : {\"parameterName\" : \"Par0\", \"defaultValue\" : \"Parameter Defaultvalue\"}}," + + "\"parameters\" : {\"Par0\" : {\"parameterName\" : \"Par0\", " + + "\"defaultValue\" : \"Parameter Defaultvalue\"}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -838,7 +848,8 @@ public class TestApexEditorRestResource extends JerseyTest { assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult()); entityString = "{" + "\"name\" : \"GoodDay4\"," + "\"version\" : \"0.0.2\"," - + "\"parameters\" : {\"Par0\" : {\"parameterName\" : \"NotPar0\", \"defaultValue\" : \"Parameter Defaultvalue\"}}," + + "\"parameters\" : {\"Par0\" : {\"parameterName\" : \"NotPar0\", \"defaultValue\" : " + + "\"Parameter Defaultvalue\"}}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -1223,8 +1234,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," - + " \"stateOutputs\" : {" + " \"so0\" : {" + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"nextState\" : null" + " }" + " }," + " \"tasks\" : {" + " \"tr0\" : {" @@ -1261,7 +1272,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [{\"name\" : \"contextAlbum0\", \"version\" : \"0.0.1\"}]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," @@ -1281,7 +1293,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [{\"name\" : \"IDontExist\", \"version\" : \"0.0.1\"}]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," @@ -1301,7 +1314,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [null]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"nextState\" : null" + " }" + " }," + " \"tasks\" : {" @@ -1320,7 +1334,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [{\"name\" : \"contextAlbum0\", \"version\" : \"0.0.1\"}]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," @@ -1329,7 +1344,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"task\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," + " \"outputType\" : \"DIRECT\"," + " \"outputName\" : \"so0\"" + " }" + " }," + " \"finalizers\" : {" - + " \"sf0\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}" + + " \"sf0\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}" + " }" + " }" + "}," + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002671\"," + "\"description\" : \"A description of hello\"" + "}"; entity = Entity.entity(entityString, MediaType.APPLICATION_JSON); @@ -1342,7 +1358,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [{\"name\" : \"contextAlbum0\", \"version\" : \"0.0.1\"}]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," @@ -1363,7 +1380,8 @@ public class TestApexEditorRestResource extends JerseyTest { + " \"name\" : \"state\"," + " \"trigger\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," + " \"defaultTask\" : {\"name\" : \"task\", \"version\" : \"0.0.1\"}," - + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, lots of lime\"}," + + " \"taskSelectionLogic\" : {\"logicFlavour\" : \"LemonAndLime\", \"logic\" : \"lots of lemons, " + + "lots of lime\"}," + " \"contexts\" : [{\"name\" : \"contextAlbum0\", \"version\" : \"0.0.1\"}]," + " \"stateOutputs\" : {" + " \"so0\" : {" + " \"event\" : {\"name\" : \"inEvent\", \"version\" : \"0.0.1\"}," diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java index d61d43b01..699505aa8 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.onap.policy.apex.client.editor.rest.ApexEditorMain.EditorState; /** - * The Class TestApexEditorStartup. + * Test Apex Editor Startup. */ public class TestApexEditorStartup { // CHECKSTYLE:OFF: MagicNumber @@ -54,7 +54,8 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], " + "State=RUNNING) started at http://localhost:18989/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec]," + + " State=STOPPED) shut down ")); } /** @@ -71,8 +72,9 @@ public class TestApexEditorStartup { runEditor(args); fail("test should throw an exception here"); } catch (final Exception e) { - assertTrue(e.getLocalizedMessage().startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[null], State=STOPPED) parameter error, too many command line arguments specified : [12321]")); + assertTrue(e.getLocalizedMessage().startsWith( + "Apex Editor REST endpoint (ApexEditorMain: Config=[null], State=STOPPED) parameter error," + + " too many command line arguments specified : [12321]")); } } @@ -90,8 +92,9 @@ public class TestApexEditorStartup { runEditor(args); fail("test should throw an exception here"); } catch (final Exception e) { - assertTrue(e.getLocalizedMessage().startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[null], State=STOPPED) parameter error, too many command line arguments specified : [12321 12322 12323]")); + assertTrue(e.getLocalizedMessage().startsWith( + "Apex Editor REST endpoint (ApexEditorMain: Config=[null], State=STOPPED) parameter error," + + " too many command line arguments specified : [12321 12322 12323]")); } } @@ -109,8 +112,9 @@ public class TestApexEditorStartup { runEditor(args); fail("test should throw an exception here"); } catch (final Exception e) { - assertTrue(e.getLocalizedMessage().startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[null], State=STOPPED) parameter error, invalid command line arguments specified : Unrecognized option: -z")); + assertTrue(e.getLocalizedMessage().startsWith( + "Apex Editor REST endpoint (ApexEditorMain: Config=[null], State=STOPPED) parameter error," + + " invalid command line arguments specified : Unrecognized option: -z")); } } @@ -128,8 +132,9 @@ public class TestApexEditorStartup { runEditor(args); fail("test should throw an exception here"); } catch (final Exception e) { - assertTrue(e.getLocalizedMessage().startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[null], State=STOPPED) parameter error, invalid command line arguments specified : Unrecognized option: --hello")); + assertTrue(e.getLocalizedMessage().startsWith( + "Apex Editor REST endpoint (ApexEditorMain: Config=[null], State=STOPPED) parameter error," + + " invalid command line arguments specified : Unrecognized option: --hello")); } } @@ -213,7 +218,8 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + "State=RUNNING) started at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec]," + + " State=STOPPED) shut down ")); } /** @@ -235,7 +241,8 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + "State=RUNNING) started at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("(ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec]," + + " State=STOPPED) shut down ")); } @@ -253,8 +260,9 @@ public class TestApexEditorStartup { runEditor(args); fail("test should throw an exception here"); } catch (final Exception e) { - assertTrue(e.getMessage().startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[null], State=STOPPED) parameter error, error parsing argument \"port\" :For input string: \" 12321\"")); + assertTrue(e.getMessage().startsWith( + "Apex Editor REST endpoint (ApexEditorMain: Config=[null], State=STOPPED) parameter error," + + " error parsing argument \"port\" :For input string: \" 12321\"")); } } @@ -337,9 +345,11 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], " + "State=READY) starting at http://localhost:18989/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=RUNNING)" + + " started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=STOPPED)" + + " shut down ")); } /** @@ -358,9 +368,11 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], " + "State=READY) starting at http://localhost:18989/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=RUNNING)" + + " started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=STOPPED)" + + " shut down ")); } /** @@ -379,9 +391,11 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], " + "State=READY) starting at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=RUNNING)" + + " started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=STOPPED)" + + " shut down ")); } @@ -401,9 +415,11 @@ public class TestApexEditorStartup { + "Config=[ApexEditorParameters: URI=http://127.0.0.1:12321/apexservices/, TTL=10sec], " + "State=READY) starting at http://127.0.0.1:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://127.0.0.1:12321/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://127.0.0.1:12321/apexservices/, TTL=10sec], State=RUNNING)" + + " started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://127.0.0.1:12321/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://127.0.0.1:12321/apexservices/, TTL=10sec], State=STOPPED)" + + " shut down ")); } /** diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestExceptions.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestExceptions.java index c60fb8f4c..e63fb9e45 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestExceptions.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestExceptions.java @@ -27,6 +27,7 @@ import java.io.IOException; import org.junit.Test; /** + * Test Apex Editor Exceptions. * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestExceptions { diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/BeanFake.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/BeanFake.java index 5648e306f..c166dc267 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/BeanFake.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/BeanFake.java @@ -27,9 +27,11 @@ import javax.xml.bind.annotation.XmlType; */ @XmlType public class BeanFake extends BeanBase { - - private String name = null, version = null, field1 = null; - private int field2 = 0, field3 = 0; + private String name = null; + private String version = null; + private String field1 = null; + private int field2 = 0; + private int field3 = 0; public String getName() { field1 = name; diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/TestBeans.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/TestBeans.java index 50d330bf8..df08dbaf2 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/TestBeans.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/bean/TestBeans.java @@ -27,6 +27,7 @@ import static org.junit.Assert.fail; import org.junit.Test; /** + * Test the beans. * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestBeans { diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRest.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRest.java index 3a38dc082..c6460d2c9 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRest.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRest.java @@ -29,7 +29,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This class is used to launch the services. It creates a Grizzly embedded web server and runs the services. + * This class is used to launch the services. It creates a Grizzly embedded web server and runs the + * services. */ public class ApexServicesRest { // Logger for this class @@ -39,16 +40,17 @@ public class ApexServicesRest { private HttpServer server; /** - * Starts the HTTP server for the Apex services client on the default base URI and with the default REST packages + * Starts the HTTP server for the Apex services client on the default base URI and with the + * default REST packages. */ public ApexServicesRest() { this(new ApexServicesRestParameters()); } /** - * Starts the HTTP server for the Apex services client + * Starts the HTTP server for the Apex services client. * - * @param parameters: The Apex parameters to use to start the server + * @param parameters The Apex parameters to use to start the server */ public ApexServicesRest(final ApexServicesRestParameters parameters) { Assertions.argumentNotNull(parameters, "parameters may not be null"); @@ -74,7 +76,7 @@ public class ApexServicesRest { } /** - * Shut down the web server + * Shut down the web server. */ public void shutdown() { logger.debug("Apex services RESTful client shutting down . . ."); diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestMain.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestMain.java index a9e5db9d0..a2fb0ac73 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestMain.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestMain.java @@ -40,7 +40,7 @@ public class ApexServicesRestMain { INITIALIZING, /** The editor is running. */ RUNNING - }; + } private static final int EDITOR_RNNING_CHECK_TIMEOUT = 1000; diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterException.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterException.java index 8b966b13f..f78de67c6 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterException.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterException.java @@ -23,13 +23,13 @@ package org.onap.policy.apex.client.full.rest; /** * A run time exception used to report parsing and parameter input errors. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexServicesRestParameterException extends IllegalArgumentException { private static final long serialVersionUID = 6520231162404452427L; /** - * Create an ApexServicesRestParameterException with a message + * Create an ApexServicesRestParameterException with a message. * * @param message the message */ diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterParser.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterParser.java index 28b0d4cf4..8a90aa633 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterParser.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameterParser.java @@ -32,16 +32,16 @@ import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexServicesRestParameterParser { // Apache Commons CLI options Options options; /** - * Construct the options for the CLI RESTful services + * Construct the options for the CLI RESTful services. */ public ApexServicesRestParameterParser() { options = new Options(); diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameters.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameters.java index ab81d4b05..52ad885fd 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameters.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ApexServicesRestParameters.java @@ -23,9 +23,9 @@ package org.onap.policy.apex.client.full.rest; import java.net.URI; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexServicesRestParameters { public static final int DEFAULT_REST_PORT = 18989; diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java index 3384a17f8..8e7cbea71 100644 --- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java +++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java @@ -40,7 +40,7 @@ public final class ParameterCheck { private ParameterCheck() {} /** - * The Enum StartStop is used to hold . + * The Enum StartStop is used to hold. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -49,7 +49,7 @@ public final class ParameterCheck { START, /** Stop of an Apex engine has been ordered. */ STOP - }; + } private static final XLogger LOGGER = XLoggerFactory.getXLogger(ParameterCheck.class); diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRest.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRest.java index d6f7e64ad..e7802ae3f 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRest.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRest.java @@ -38,16 +38,16 @@ public class ApexMonitoringRest { private HttpServer server; /** - * Starts the HTTP server for the Apex services client on the default base URI and with the default REST packages + * Starts the HTTP server for the Apex services client on the default base URI and with the default REST packages. */ public ApexMonitoringRest() { this(new ApexMonitoringRestParameters()); } /** - * Starts the HTTP server for the Apex services client + * Starts the HTTP server for the Apex services client. * - * @param parameters: The Apex parameters to use to start the server + * @param parameters The Apex parameters to use to start the server. */ public ApexMonitoringRest(final ApexMonitoringRestParameters parameters) { Assertions.argumentNotNull(parameters, "parameters may not be null"); @@ -70,7 +70,7 @@ public class ApexMonitoringRest { } /** - * Shut down the web server + * Shut down the web server. */ public void shutdown() { logger.debug("Apex services RESTful client shutting down . . ."); diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestMain.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestMain.java index fcc29ed29..bf2365f46 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestMain.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestMain.java @@ -23,13 +23,15 @@ package org.onap.policy.apex.client.monitoring.rest; import java.io.PrintStream; /** - * User: ewatkmi Date: 31 Jul 2017 + * The main class for Apex Restful Monitoring. + * + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexMonitoringRestMain { // Services state public enum ServicesState { STOPPED, READY, INITIALIZING, RUNNING - }; + } private ServicesState state = ServicesState.STOPPED; @@ -43,7 +45,7 @@ public class ApexMonitoringRestMain { private ApexMonitoringRest apexMonitoringRest = null; /** - * Main method, main entry point for command + * Main method, main entry point for command. * * @param args The command line arguments for the client */ @@ -57,7 +59,7 @@ public class ApexMonitoringRestMain { } /** - * Constructor, kicks off the rest service + * Constructor, kicks off the rest service. * * @param args The command line arguments for the RESTful service * @param outStream The stream for output messages @@ -95,7 +97,7 @@ public class ApexMonitoringRestMain { } /** - * Initialize the rest service + * Initialize the rest service. */ public void init() { outStream.println("Apex Services REST endpoint (" + this.toString() + ") starting at " @@ -161,7 +163,7 @@ public class ApexMonitoringRestMain { } /** - * Explicitly shut down the services + * Explicitly shut down the services. */ public void shutdown() { if (apexMonitoringRest != null) { @@ -173,7 +175,7 @@ public class ApexMonitoringRestMain { } /** - * This class is a shutdown hook for the Apex services command + * This class is a shutdown hook for the Apex services command. */ private class ApexServicesShutdownHook implements Runnable { /* diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterException.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterException.java index cbbc2940a..9ca309f13 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterException.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterException.java @@ -21,9 +21,9 @@ package org.onap.policy.apex.client.monitoring.rest; /** - * A run time exception used to report parsing and parameter input errors + * A run time exception used to report parsing and parameter input errors. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexMonitoringRestParameterException extends IllegalArgumentException { private static final long serialVersionUID = 6520231162404452427L; diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterParser.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterParser.java index 35ee6b4fa..af2ff6821 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterParser.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameterParser.java @@ -32,16 +32,16 @@ import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexMonitoringRestParameterParser { // Apache Commons CLI options Options options; /** - * Construct the options for the CLI RESTful services + * Construct the options for the CLI RESTful services. */ public ApexMonitoringRestParameterParser() { options = new Options(); diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameters.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameters.java index cb6d76fab..fea7ae4a8 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameters.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestParameters.java @@ -23,9 +23,9 @@ package org.onap.policy.apex.client.monitoring.rest; import java.net.URI; /** - * This class reads and handles command line parameters to the Apex RESTful services + * This class reads and handles command line parameters to the Apex RESTful services. * - * User: ewatkmi Date: 31 Jul 2017 + * @author Michael Watkins (michael.watkins@ericsson.com) */ public class ApexMonitoringRestParameters { public static final int DEFAULT_REST_PORT = 18989; diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java index 84f29dfe2..6a614f326 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java @@ -81,7 +81,7 @@ public class ApexMonitoringRestResource { public ApexMonitoringRestResource() {} /** - * Query the engine service for data + * Query the engine service for data. * * @param hostName the host name of the engine service to connect to. * @param port the port number of the engine service to connect to. @@ -163,7 +163,7 @@ public class ApexMonitoringRestResource { } /** - * Start/Stop and Apex engine + * Start/Stop and Apex engine. * * @param hostName the host name of the engine service to connect to. * @param port the port number of the engine service to connect to. @@ -210,7 +210,7 @@ public class ApexMonitoringRestResource { } /** - * Start/Stop and Apex engine + * Start/Stop and Apex engine. * * @param hostName the host name of the engine service to connect to. * @param port the port number of the engine service to connect to. @@ -252,7 +252,7 @@ public class ApexMonitoringRestResource { } /** - * Check if periodic events are running + * Check if periodic events are running. * * @param host the engine's host url * @return a boolean stating if periodic events are running for a given host @@ -262,7 +262,7 @@ public class ApexMonitoringRestResource { } /** - * Sets the state of periodic events for a host + * Sets the state of periodic events for a host. * * @param host the engine's host url * @param boolean that states if periodic events have been started or stopped @@ -273,7 +273,7 @@ public class ApexMonitoringRestResource { /** * This method takes in the latest data entry for an engine, adds it to an existing data set and returns the full - * map for that host and engine + * map for that host and engine. * * @param host the engine's host url * @param id the engines id @@ -314,12 +314,12 @@ public class ApexMonitoringRestResource { } @Override - public boolean add(final V e) { + public boolean add(final V elm) { if (this.size() > (maxEntries - 1)) { this.removeFirst(); } - return super.add(e); - }; + return super.add(elm); + } } diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java index 8edeb54f1..5bc40c8db 100644 --- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java +++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java @@ -49,7 +49,7 @@ public final class ParameterCheck { START, /** Stop of an Apex engine has been ordered. */ STOP - }; + } private static final XLogger LOGGER = XLoggerFactory.getXLogger(ParameterCheck.class); |