diff options
99 files changed, 684 insertions, 537 deletions
diff --git a/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java b/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java index 50600f99f..dbf8f3844 100644 --- a/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java +++ b/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java @@ -35,17 +35,17 @@ public class CgStringRenderer implements AttributeRenderer { /* * (non-Javadoc) - * + * * @see org.stringtemplate.v4.AttributeRenderer#toString(java.lang.Object, java.lang.String, * java.util.Locale) */ @Override - public String toString(final Object o, final String format, final Locale locale) { + public String toString(final Object obj, final String format, final Locale locale) { if ("doQuotes".equals(format)) { - if (o == null) { + if (obj == null) { return null; } - String ret = o.toString(); + String ret = obj.toString(); if (ret.length() == 0) { return "\"\""; } @@ -56,16 +56,16 @@ public class CgStringRenderer implements AttributeRenderer { } if ("doDescription".equals(format)) { - String ret = o.toString(); + String ret = obj.toString(); if (ret.contains("\n") || ret.contains("\"")) { ret = "LS" + "\n" + ret + "\n" + "LE"; } else { - ret = this.toString(o, "doQuotes", locale); + ret = this.toString(obj, "doQuotes", locale); } return ret; } // return the default string renderer if we don't know otherwise - return new StringRenderer().toString(o, format, locale); + return new StringRenderer().toString(obj, format, locale); } } diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java index ed703da82..28e32bca6 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java @@ -39,8 +39,8 @@ public class StErrorListener implements STErrorListener { @Override public void IOError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -50,8 +50,8 @@ public class StErrorListener implements STErrorListener { @Override public void compileTimeError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -61,8 +61,8 @@ public class StErrorListener implements STErrorListener { @Override public void internalError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -72,18 +72,18 @@ public class StErrorListener implements STErrorListener { @Override public void runTimeError(final STMessage msg) { switch (msg.error) { - case NO_SUCH_PROPERTY: - case ARGUMENT_COUNT_MISMATCH: - case ANON_ARGUMENT_MISMATCH: - break; - default: - this.registerErrors(msg); + case NO_SUCH_PROPERTY: + case ARGUMENT_COUNT_MISMATCH: + case ANON_ARGUMENT_MISMATCH: + break; + default: + this.registerErrors(msg); } } /** * Registers an error with the local error listener and increases the error count. - * + * * @param msg error message */ protected void registerErrors(final STMessage msg) { diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java index e484ff03f..c7f7c7bb1 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java @@ -152,7 +152,8 @@ public class ApexCLIEditorMain { if (errorCount == 0) { LOGGER.info("Apex CLI editor completed execution"); } else { - LOGGER.error("execution of Apex command line editor failed: {} command execution failure(s) occurred", errorCount); + LOGGER.error("execution of Apex command line editor failed: {} command execution failure(s) occurred", + errorCount); } } catch (final IOException e) { LOGGER.error("execution of Apex command line editor failed: " + e.getMessage()); @@ -160,7 +161,7 @@ public class ApexCLIEditorMain { } /** - * Get the number of errors encountered in command processing + * Get the number of errors encountered in command processing. * * @return the number of errors */ diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java index 8e1104c3b..94b8c14a6 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java @@ -41,9 +41,9 @@ public class CLIException extends IllegalArgumentException { * Create a CLIException with a message and an exception. * * @param message the message - * @param t the t + * @param th the throwable */ - public CLIException(final String message, final Throwable t) { - super(message, t); + public CLIException(final String message, final Throwable th) { + super(message, th); } } diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java index bbeface32..70c2f834b 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java @@ -36,9 +36,9 @@ public class CLILineParser { * single words followed by an '=' character Arguments are single words or a block of quoted * text following an '=' character. * - * Format: command [command....] parameter=argument [parameter = argument] + * <p>Format: command [command....] parameter=argument [parameter = argument] * - * Examples entity create name=hello description="description of hello" help entity list + * <p>Examples entity create name=hello description="description of hello" help entity list * * @param line The line to parse * @param logicBlock A block of logic code to be taken literally diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java index 382f23fb0..8a0c6eff3 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java @@ -57,7 +57,8 @@ public class CLIParameterParser { .desc("name of a file containing editor commands to run into the editor").hasArg() .argName("COMMAND_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("l").longOpt("log-file") - .desc("name of a file that will contain command logs from the editor, will log to standard output if not specified or suppressed with \"-nl\" flag") + .desc("name of a file that will contain command logs from the editor, will log to standard output " + + "if not specified or suppressed with \"-nl\" flag") .hasArg().argName("LOG_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("nl").longOpt("no-log") .desc("if specified, no logging or output of commands to standard output or log file is carried out") @@ -74,10 +75,12 @@ public class CLIParameterParser { + "will output model to standard output if not specified or suppressed with \"-nm\" flag") .hasArg().argName("OUTPUT_MODEL_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("if").longOpt("ignore-failures") - .desc("true or false, ignore failures of commands in command files and continue executing the command file") + .desc("true or false, ignore failures of commands in command files and continue executing the " + + "command file") .hasArg().argName("IGNORE_FAILURES_FLAG").required(false).type(Boolean.class).build()); options.addOption(Option.builder("wd").longOpt("working-directory") - .desc("the working directory that is the root for the CLI editor and is the root from which to look for included macro files") + .desc("the working directory that is the root for the CLI editor and is the root from which to " + + "look for included macro files") .hasArg().argName("WORKING_DIRECTORY").required(false).type(String.class).build()); } diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java index ebaa6c572..24356d128 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java @@ -522,7 +522,7 @@ public class CLIParameters { } /** - * Check if the command failures flag is set + * Check if the command failures flag is set. * * @return true if the command failures flag has been set */ diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java index 87618e18d..2056c9239 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java @@ -235,7 +235,7 @@ public class TestCLIEditorOptions { // Generate input model final String[] cliArgsIn = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", - "-l", tempLogFileIn.getAbsolutePath(), "-o", tempModelFileIn.getAbsolutePath()}; + "-l", tempLogFileIn.getAbsolutePath(), "-o", tempModelFileIn.getAbsolutePath()}; final ApexCLIEditorMain cliEditorIn = new ApexCLIEditorMain(cliArgsIn); assertEquals(0, cliEditorIn.getErrorCount()); @@ -252,8 +252,8 @@ public class TestCLIEditorOptions { assertEquals(2924, tempModelFileInCharCount); final String[] cliArgsOut = new String[] {"-i", tempModelFileIn.getAbsolutePath(), "-c", - "src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l", - tempLogFileOut.getAbsolutePath(), "-o", tempModelFileOut.getAbsolutePath()}; + "src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l", + tempLogFileOut.getAbsolutePath(), "-o", tempModelFileOut.getAbsolutePath()}; final ApexCLIEditorMain cliEditorOut = new ApexCLIEditorMain(cliArgsOut); assertEquals(0, cliEditorOut.getErrorCount()); diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java index 3de41e8d4..1b99fce16 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java @@ -45,13 +45,8 @@ public class TestContextAlbums { public void createTempFiles() throws IOException { tempModelFile = File.createTempFile("TestPolicyModel", ".json"); - logicBlockArgs = new String[] { - "-c", - "src/test/resources/scripts/ContextAlbums.apex", - "-o", - tempModelFile.getAbsolutePath(), - "-nl" - }; + logicBlockArgs = new String[] {"-c", "src/test/resources/scripts/ContextAlbums.apex", "-o", + tempModelFile.getAbsolutePath(), "-nl"}; } /** @@ -81,7 +76,8 @@ public class TestContextAlbums { final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream()); assertNotNull(writtenModel); - final URL compareModelURL = ResourceUtils.getLocalFile("src/test/resources/compare/ContextAlbumsModel_Compare.json"); + final URL compareModelURL = + ResourceUtils.getLocalFile("src/test/resources/compare/ContextAlbumsModel_Compare.json"); final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); // Ignore key info UUIDs diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java index 6ff85e71c..eb2f2a46b 100644 --- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java +++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java @@ -41,75 +41,65 @@ import org.onap.policy.common.utils.resources.ResourceUtils; * Test FileMacro in the CLI. */ public class TestFileMacro { - private String[] fileMacroArgs; - - private File tempModelFile; - private File tempLogFile; - - @Before - public void createTempFiles() throws IOException { - tempModelFile = File.createTempFile("TestPolicyModel", ".json"); - tempLogFile = File.createTempFile("TestPolicyModel", ".log"); - - fileMacroArgs = new String[] { - "-c", - "src/test/resources/scripts/FileMacro.apex", - "-l", - tempLogFile.getCanonicalPath(), - "-o", - tempModelFile.getCanonicalPath(), - "-if", - "true" - }; - } - - @After - public void removeGeneratedModels() { - tempModelFile.delete(); - } - - /** - * Test logic block macro in CLI scripts. - * - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexModelException if there is an Apex error - */ - @Test - public void testLogicBlock() throws IOException, ApexModelException { - final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(fileMacroArgs); - // We expect eight errors - assertEquals(8, cliEditor.getErrorCount()); - - // Read the file from disk - final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class); - modelReader.setValidateFlag(false); - - final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath()); - final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream()); - - final URL compareModelURL = ResourceUtils.getLocalFile("src/test/resources/compare/FileMacroModel_Compare.json"); - final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); - - // Ignore key info UUIDs - writtenModel.getKeyInformation().getKeyInfoMap().clear(); - compareModel.getKeyInformation().getKeyInfoMap().clear(); - - assertTrue(writtenModel.equals(compareModel)); - - // The output event is in this file - final File outputLogFile = new File(tempLogFile.getCanonicalPath()); - - final String outputLogString = TextFileUtils - .getTextFileAsString(outputLogFile.getCanonicalPath()) - .replace(Paths.get("").toAbsolutePath().toString() + File.separator, "") - .replaceAll("\\s+", ""); - - // We compare the log to what we expect to get - final String outputLogCompareString = TextFileUtils - .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log") - .replaceAll("\\s+", ""); - - // Check what we got is what we expected to get - assertEquals(outputLogCompareString, outputLogString); - } + private String[] fileMacroArgs; + + private File tempModelFile; + private File tempLogFile; + + @Before + public void createTempFiles() throws IOException { + tempModelFile = File.createTempFile("TestPolicyModel", ".json"); + tempLogFile = File.createTempFile("TestPolicyModel", ".log"); + + fileMacroArgs = new String[] {"-c", "src/test/resources/scripts/FileMacro.apex", "-l", + tempLogFile.getCanonicalPath(), "-o", tempModelFile.getCanonicalPath(), "-if", "true"}; + } + + @After + public void removeGeneratedModels() { + tempModelFile.delete(); + } + + /** + * Test logic block macro in CLI scripts. + * + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexModelException if there is an Apex error + */ + @Test + public void testLogicBlock() throws IOException, ApexModelException { + final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(fileMacroArgs); + // We expect eight errors + assertEquals(8, cliEditor.getErrorCount()); + + // Read the file from disk + final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class); + modelReader.setValidateFlag(false); + + final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath()); + final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream()); + + final URL compareModelURL = + ResourceUtils.getLocalFile("src/test/resources/compare/FileMacroModel_Compare.json"); + final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); + + // Ignore key info UUIDs + writtenModel.getKeyInformation().getKeyInfoMap().clear(); + compareModel.getKeyInformation().getKeyInfoMap().clear(); + + assertTrue(writtenModel.equals(compareModel)); + + // The output event is in this file + final File outputLogFile = new File(tempLogFile.getCanonicalPath()); + + final String outputLogString = TextFileUtils.getTextFileAsString(outputLogFile.getCanonicalPath()) + .replace(Paths.get("").toAbsolutePath().toString() + File.separator, "").replaceAll("\\s+", ""); + + // We compare the log to what we expect to get + final String outputLogCompareString = TextFileUtils + .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log").replaceAll("\\s+", ""); + + // Check what we got is what we expected to get + assertEquals(outputLogCompareString, outputLogString); + } } 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); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java index 7f019f57c..3afd5c89d 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java @@ -32,7 +32,7 @@ public class TestContextBooleanItem implements Serializable { private static final long serialVersionUID = 7241008665286367796L; - private boolean flag = false;; + private boolean flag = false; /** * The Constructor. diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java index 888394be2..b4e9ad37d 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java @@ -273,9 +273,8 @@ public class ContextInstantiation { try { externalContextAlbum.put("TestExternalContextItem00A", null); } catch (final ContextRuntimeException e) { - assertEquals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()", - e.getMessage()); + assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItem00A\" for put()", e.getMessage()); } assertEquals(tciAA, externalContextItem.getTestExternalContextItem00A()); @@ -302,25 +301,24 @@ public class ContextInstantiation { try { externalContextAlbum.put("TestExternalContextItem00A", null); } catch (final ContextRuntimeException e) { - assert (e.getMessage().equals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()")); + assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItem00A\" for put()")); } assertTrue(externalContextAlbum.get(EXTERNAL_CONTEXT).equals(externalContext)); try { externalContextAlbum.put("TestExternalContextItemFFF", null); } catch (final ContextRuntimeException e) { - assert (e.getMessage().equals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()")); + assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItemFFF\" for put()")); } assertEquals(1, externalContextAlbum.size()); try { externalContextAlbum.put("TestExternalContextItemFFF", null); } catch (final ContextRuntimeException e) { - assertEquals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()", - e.getMessage()); + assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItemFFF\" for put()", e.getMessage()); } assertEquals(1, externalContextAlbum.size()); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java index 33100165b..8f066c8e3 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java @@ -94,9 +94,9 @@ public class ContextUpdate { longContextAlbum.put(_0, ZERO); fail(EXCEPTION_MESSAGE); } catch (final ContextRuntimeException e) { - assertEquals( - "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", - e.getMessage()); + assertEquals("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\":" + + " LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with" + + " class \"java.lang.Long\"", e.getMessage()); } try { @@ -104,7 +104,8 @@ public class ContextUpdate { fail(EXCEPTION_MESSAGE); } catch (final ContextRuntimeException e) { assertEquals( - "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", + "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum" + + ":0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", e.getMessage()); } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java index 24e633109..14ceba425 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import org.onap.policy.apex.context.ContextAlbum; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java index 0dd0e7224..c0ac36264 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import org.onap.policy.apex.context.ContextRuntimeException; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java index b6ee1b8eb..6c273a0ae 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java index 57c6b7524..854179ccd 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java index a41de8dd7..959e93c67 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import static org.onap.policy.apex.context.test.utils.Constants.TEST_VALUE; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java index 09e280026..d1f5ec17e 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java index fc1c830e7..020bc4169 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java @@ -120,8 +120,8 @@ public final class ConcurrentContextJVM { // An even number of arguments greater than 3 if (args.length < 9) { LOGGER.error("invalid arguments: " + Arrays.toString(args)); - LOGGER.error( - "usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize lockType [parameterKey parameterJson].... "); + LOGGER.error("usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize " + + "lockType [parameterKey parameterJson].... "); return; } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java index d17f32269..b842f7aca 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.Map; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java index 50429099e..f04cf5b39 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.HashMap; @@ -135,7 +136,7 @@ public class ConfigrationProviderImpl implements ConfigrationProvider { public Map<String, Object> getContextAlbumInitValues() { final Map<String, Object> values = new HashMap<>(); for (int i = 0; i < albumSize; i++) { - values.put(Integer.toString(i), new TestContextLongItem(0l)); + values.put(Integer.toString(i), new TestContextLongItem(0L)); } return values; } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java index 933c68b11..118586437 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java @@ -59,7 +59,7 @@ public class Constants { private static final AxArtifactKey KEY3 = new AxArtifactKey("testC-bot", VERSION); private static final AxArtifactKey KEY2 = new AxArtifactKey("testC-next", VERSION); - private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3};; + private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3}; public static final AxArtifactKey[] getAxArtifactKeyArray() { return USED_ARTIFACT_STACK_ARRAY; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java index b5ea84d2f..d815c6b74 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.concurrent.ThreadFactory; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java index 01331f2a7..8d2c89254 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.net.InetAddress; @@ -36,7 +37,7 @@ public class NetworkUtils { * function sets the address to be the first non-loopback IPv4 address on a host * * @return Set of IPv4 addresses - * @throws SocketException + * @throws SocketException throw socket exception if error occurs */ public static TreeSet<String> getIPv4NonLoopAddresses() throws SocketException { final TreeSet<String> ipAddressSet = new TreeSet<String>(); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java index 67bb8878b..ffcbb351c 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.io.File; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java index 105b59e8e..5487a0934 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Test; import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java index 565a39f97..409033ad4 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java index 28bd7eb01..6e7430756 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java index c29353caf..9d0210e38 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java @@ -20,7 +20,6 @@ package org.onap.policy.apex.context.test.locking; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -131,7 +130,7 @@ public class TestConcurrentContext { @Override public Map<String, Object> getContextAlbumInitValues() { final Map<String, Object> initValues = super.getContextAlbumInitValues(); - initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0l)); + initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0L)); return initValues; } }; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java index a05928591..5d41eee85 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java @@ -40,9 +40,9 @@ import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; import org.onap.policy.apex.context.parameters.ContextParameters; import org.onap.policy.apex.context.parameters.PersistorParameters; -import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.context.test.concepts.TestContextDateItem; import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem; import org.onap.policy.apex.context.test.factory.TestContextAlbumFactory; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; @@ -118,7 +118,8 @@ public class TestPersistentContextInstantiation { contextAlbumForMap.putAll(valueMap0); - assertEquals(((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"), + assertEquals( + ((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"), "This is a policy context string"); contextAlbumForMap.flush(); diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/EngineParameters.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/EngineParameters.java index ff616979d..62fe6a552 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/EngineParameters.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/EngineParameters.java @@ -28,18 +28,18 @@ import org.onap.policy.apex.model.basicmodel.service.AbstractParameters; import org.onap.policy.apex.model.basicmodel.service.ParameterService; /** - * This class holds the parameters for a single Apex engine. This parameter class holds parameters for context schemas - * and context albums for the engine and a map of the logic flavour executors defined for the engine and the parameters - * for each of those executors. - * <p> - * The context parameters for the engine are held in a {@link ContextParameters} instance. This instance holds the - * parameters for context schema handling that will be used by the engine as well as the context album distribution, - * locking, and persistence parameters. - * <p> - * In Apex, an engine can be configured to use many logic flavours. The executors for each logic flavour are identified - * by their name. Each logic flavour executor must have an instance of {@link ExecutorParameters} defined for it, which - * specifies the executor plugins to use for that logic flavour executor and specific parameters for those executor - * plugins. + * This class holds the parameters for a single Apex engine. This parameter class holds parameters + * for context schemas and context albums for the engine and a map of the logic flavour executors + * defined for the engine and the parameters for each of those executors. + * + * <p>The context parameters for the engine are held in a {@link ContextParameters} instance. This + * instance holds the parameters for context schema handling that will be used by the engine as well + * as the context album distribution, locking, and persistence parameters. + * + * <p>In Apex, an engine can be configured to use many logic flavours. The executors for each logic + * flavour are identified by their name. Each logic flavour executor must have an instance of + * {@link ExecutorParameters} defined for it, which specifies the executor plugins to use for that + * logic flavour executor and specific parameters for those executor plugins. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -50,7 +50,8 @@ public class EngineParameters extends AbstractParameters { private Map<String, ExecutorParameters> executorParameterMap = new TreeMap<String, ExecutorParameters>(); /** - * Constructor to create an engine parameters instance and register the instance with the parameter service. + * Constructor to create an engine parameters instance and register the instance with the + * parameter service. */ public EngineParameters() { super(EngineParameters.class.getCanonicalName()); diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/ExecutorParameters.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/ExecutorParameters.java index d3a8ed5ac..53cac399e 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/ExecutorParameters.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/ExecutorParameters.java @@ -24,10 +24,11 @@ import org.onap.policy.apex.model.basicmodel.service.AbstractParameters; import org.onap.policy.apex.model.basicmodel.service.ParameterService; /** - * This class provides the executors for a logic flavour. Plugin classes for execution of task logic, task selection - * logic, and state finalizer logic for the logic flavour must be specified. - * <p> - * Specializations of this class may provide extra parameters for their specific logic flavour executors. + * This class provides the executors for a logic flavour. Plugin classes for execution of task + * logic, task selection logic, and state finalizer logic for the logic flavour must be specified. + * + * <p>Specializations of this class may provide extra parameters for their specific logic flavour + * executors. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -38,7 +39,8 @@ public class ExecutorParameters extends AbstractParameters { private String stateFinalizerExecutorPluginClass; /** - * Constructor to create an executor parameters instance and register the instance with the parameter service. + * Constructor to create an executor parameters instance and register the instance with the + * parameter service. */ public ExecutorParameters() { super(ExecutorParameters.class.getCanonicalName()); @@ -46,8 +48,8 @@ public class ExecutorParameters extends AbstractParameters { } /** - * Constructor to create an executor parameters instance with the name of a sub class of this class and register the - * instance with the parameter service. + * Constructor to create an executor parameters instance with the name of a sub class of this + * class and register the instance with the parameter service. * * @param parameterClassName the class name of a sub class of this class */ @@ -85,7 +87,8 @@ public class ExecutorParameters extends AbstractParameters { /** * Sets the task selection executor plugin class for the executor. * - * @param taskSelectionExecutorPluginClass the task selection executor plugin class for the executor + * @param taskSelectionExecutorPluginClass the task selection executor plugin class for the + * executor */ public void setTaskSelectionExecutorPluginClass(final String taskSelectionExecutorPluginClass) { this.taskSelectionExecutorPluginClass = taskSelectionExecutorPluginClass; @@ -103,7 +106,8 @@ public class ExecutorParameters extends AbstractParameters { /** * Sets the state finalizer executor plugin class for the executor. * - * @param stateFinalizerExecutorPluginClass the state finalizer executor plugin class for the executor + * @param stateFinalizerExecutorPluginClass the state finalizer executor plugin class for the + * executor */ public void setStateFinalizerExecutorPluginClass(final String stateFinalizerExecutorPluginClass) { this.stateFinalizerExecutorPluginClass = stateFinalizerExecutorPluginClass; diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/ApexEngine.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/ApexEngine.java index 9e27e5e86..b25192cd0 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/ApexEngine.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/ApexEngine.java @@ -30,20 +30,21 @@ import org.onap.policy.apex.model.enginemodel.concepts.AxEngineState; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; /** - * The Interface ApexEngine is used to control the execution of a single Apex engine thread. This engine instance - * executes the policies in an {@link AxPolicyModel}, which defines the policies that are executed by the engine and the - * context in which they execute. Many instances of an Apex engine may run on the same Apex model, in which case they - * operate the same policy set in parallel over the same context. When the {@code handleEvent} method is passed to the - * Apex engine, the engine executes the policy triggered by that event. A single Apex engine instance does not executed - * multiple policies in parallel, it receives a trigger event and executes the policy for that event to completion - * before it is available to execute another policy. + * The Interface ApexEngine is used to control the execution of a single Apex engine thread. This + * engine instance executes the policies in an {@link AxPolicyModel}, which defines the policies + * that are executed by the engine and the context in which they execute. Many instances of an Apex + * engine may run on the same Apex model, in which case they operate the same policy set in parallel + * over the same context. When the {@code handleEvent} method is passed to the Apex engine, the + * engine executes the policy triggered by that event. A single Apex engine instance does not + * executed multiple policies in parallel, it receives a trigger event and executes the policy for + * that event to completion before it is available to execute another policy. * * @author Liam Fallon (liam.fallon@ericsson.com) */ public interface ApexEngine { /** - * The amount of milliseconds to wait for the current Apex engine to timeout on engine stop requests. If the timeout - * is exceeded, the stop aborts. + * The amount of milliseconds to wait for the current Apex engine to timeout on engine stop + * requests. If the timeout is exceeded, the stop aborts. */ int APEX_ENGINE_STOP_EXECUTION_WAIT_TIMEOUT = 3000; @@ -51,10 +52,10 @@ public interface ApexEngine { int APEX_ENGINE_STOP_EXECUTION_WAIT_INCREMENT = 100; /** - * Update the Apex model to be used by the Apex engine. The engine must be in state "STOPPED" when the model is - * updated. The engine will replace the current model with the incoming model if the model of the engine was - * previously updated and the value of common context is transferred if there is common context in the old and new - * models. + * Update the Apex model to be used by the Apex engine. The engine must be in state "STOPPED" + * when the model is updated. The engine will replace the current model with the incoming model + * if the model of the engine was previously updated and the value of common context is + * transferred if there is common context in the old and new models. * * @param apexModel the apex model * @throws ApexException on model update errors @@ -83,7 +84,8 @@ public interface ApexEngine { void clear() throws ApexException; /** - * This method constructs an event with the correct event context so that it can later be sent to the Apex engine. + * This method constructs an event with the correct event context so that it can later be sent + * to the Apex engine. * * @param eventKey The key of the event in the Apex model * @return the created event @@ -91,11 +93,11 @@ public interface ApexEngine { EnEvent createEvent(AxArtifactKey eventKey); /** - * This method passes an event to the Apex model to invoke a policy. If the event matches a policy, then that policy - * is executed. + * This method passes an event to the Apex model to invoke a policy. If the event matches a + * policy, then that policy is executed. * - * @return return true if a policy was invoked without error, otherwise false. * @param incomingEvent the incoming event + * @return return true if a policy was invoked without error, otherwise false. */ boolean handleEvent(EnEvent incomingEvent); diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineFactory.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineFactory.java index 4920486de..754181485 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineFactory.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineFactory.java @@ -24,8 +24,8 @@ import org.onap.policy.apex.core.engine.engine.ApexEngine; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; /** - * A factory class to create APEX engines of a given type. As there is only a single type of Apex engine in existence, - * this class is trivial. + * A factory class to create APEX engines of a given type. As there is only a single type of Apex + * engine in existence, this class is trivial. * * @author Liam Fallon */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java index 12ba76afb..235140863 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java @@ -428,7 +428,8 @@ public class ApexEngineImpl implements ApexEngine { * @return the exception event */ private EnEvent createExceptionEvent(final EnEvent incomingEvent, final Exception eventException) { - // The exception event is a clone of the incoming event with the exception suffix added to its name and an extra + // The exception event is a clone of the incoming event with the exception suffix added to + // its name and an extra // field "ExceptionMessage" added final EnEvent exceptionEvent = (EnEvent) incomingEvent.clone(); diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java index 856136bab..f17d7f825 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java @@ -38,12 +38,13 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This handler holds and manages state machines for each policy in an Apex engine. When the class is instantiated, an - * executor {@link StateMachineExecutor} is created for each policy in the policy model the state machine handler will - * execute. The executors for each policy are held in a map indexed by event. - * <p> - * When an event is received on the policy, the state machine executor to execute that event is looked up on the - * executor map and the event is passed to the executor for execution. + * This handler holds and manages state machines for each policy in an Apex engine. When the class + * is instantiated, an executor {@link StateMachineExecutor} is created for each policy in the + * policy model the state machine handler will execute. The executors for each policy are held in a + * map indexed by event. + * + * <p>When an event is received on the policy, the state machine executor to execute that event is + * looked up on the executor map and the event is passed to the executor for execution. * * @author Liam Fallon * @@ -58,7 +59,8 @@ public class StateMachineHandler { // The state machines in this engine private final HashMap<AxEvent, StateMachineExecutor> stateMachineExecutorMap = new HashMap<>(); - // The executor factory is used to get logic executors for the particular type of executor we need for task + // The executor factory is used to get logic executors for the particular type of executor we + // need for task // selection logic or task logic private final ExecutorFactory executorFactory; @@ -109,7 +111,8 @@ public class StateMachineHandler { } /** - * This constructor starts the state machines for each policy, carrying out whatever initialization executors need. + * This constructor starts the state machines for each policy, carrying out whatever + * initialization executors need. * * @throws StateMachineException On state machine initiation errors */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/package-info.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/package-info.java index ce86e2745..d8e1329e7 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/package-info.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/package-info.java @@ -19,7 +19,8 @@ */ /** - * Provides the implementation of the {@link org.onap.policy.apex.core.engine.engine.ApexEngine} interface. + * Provides the implementation of the {@link org.onap.policy.apex.core.engine.engine.ApexEngine} + * interface. * * @author Liam Fallon (liam.fallon@ericsson.com) */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java index b072a89d0..6fbf647b4 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java @@ -40,8 +40,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * Instances of the Class EnEvent are events being passed through the Apex system. All events in the system are - * instances of this class. + * Instances of the Class EnEvent are events being passed through the Apex system. All events in the + * system are instances of this class. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -62,7 +62,8 @@ public class EnEvent extends HashMap<String, Object> { private static Random rand = new Random(System.nanoTime()); - // An identifier for the current event execution. The default value here will always be a random number, and should + // An identifier for the current event execution. The default value here will always be a random + // number, and should // be reset private long executionID = rand.nextLong(); @@ -126,10 +127,11 @@ public class EnEvent extends HashMap<String, Object> { } /** - * Get the currently set value for the ExecutionID for this event. A ExecutionID in an EnEvent is used identify all - * EnEvents (input, internal and output events) used in a single Engine invocation. Therefore, a ExecutionID can be - * used to match which output event is the result of a particular input event. The default initialized value for the - * ExecutionID is always unique in a single JVM. + * Get the currently set value for the ExecutionID for this event. A ExecutionID in an EnEvent + * is used identify all EnEvents (input, internal and output events) used in a single Engine + * invocation. Therefore, a ExecutionID can be used to match which output event is the result of + * a particular input event. The default initialized value for the ExecutionID is always unique + * in a single JVM. * * @return the currently set value for the ExecutionID for this event. */ @@ -138,10 +140,11 @@ public class EnEvent extends HashMap<String, Object> { } /** - * Set the value for the ExecutionID for this event. A ExecutionID in an EnEvent is used identify all EnEvents - * (input, internal and output events) used in a single Engine invocation. Therefore, a ExecutionID can be used to - * match which output event is the result of a particular input event. The default initialised value for the - * ExecutionID is always unique in a single JVM. + * Set the value for the ExecutionID for this event. A ExecutionID in an EnEvent is used + * identify all EnEvents (input, internal and output events) used in a single Engine invocation. + * Therefore, a ExecutionID can be used to match which output event is the result of a + * particular input event. The default initialised value for the ExecutionID is always unique in + * a single JVM. * * @param executionID the new value for the ExecutionID for this event. */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnException.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnException.java index 79a65cba4..d9520336b 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnException.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnException.java @@ -43,9 +43,9 @@ public class EnException extends ApexRuntimeException { * Instantiates a new engine event exception. * * @param message the message - * @param e the e + * @param ex the exception */ - public EnException(final String message, final Exception e) { - super(message, e); + public EnException(final String message, final Exception ex) { + super(message, ex); } } diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/package-info.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/package-info.java index e94362a75..23d51a41a 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/package-info.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/package-info.java @@ -19,8 +19,8 @@ */ /** - * Provides the event handling classes that an APEX engine uses and which uses use to send and receive events to and - * from an APEX engine. + * Provides the event handling classes that an APEX engine uses and which uses use to send and + * receive events to and from an APEX engine. * * @author Liam Fallon (liam.fallon@ericsson.com) */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java index d659002b2..4c969f76e 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/Executor.java @@ -26,11 +26,13 @@ import org.onap.policy.apex.core.engine.executor.exception.StateMachineException import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; /** - * This interface defines what operations must be provided by an executing entity in Apex. It is implemented by classes - * that execute logic in a state machine. Each executor has an incoming entity {@code IN} that triggers execution, an - * outgoing entity {@code OUT} that is produced by execution, a subject {@code SUBJECT} that is being executed, and a - * context {@code CONTEXT} in which execution is being carried out. An executor can be part of a chain of executors and - * the {@code setNext} method is used to set the next executor to be executed after this executor has completed. + * This interface defines what operations must be provided by an executing entity in Apex. It is + * implemented by classes that execute logic in a state machine. Each executor has an incoming + * entity {@code IN} that triggers execution, an outgoing entity {@code OUT} that is produced by + * execution, a subject {@code SUBJECT} that is being executed, and a context {@code CONTEXT} in + * which execution is being carried out. An executor can be part of a chain of executors and the + * {@code setNext} method is used to set the next executor to be executed after this executor has + * completed. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) * @author Liam Fallon (liam.fallon@ericsson.com) @@ -45,7 +47,8 @@ public interface Executor<IN, OUT, SUBJECT, CONTEXT> { /** * Save the subject and context of the executor. * - * @param parent the parent executor of this executor or null if this executor is the top executor + * @param parent the parent executor of this executor or null if this executor is the top + * executor * @param executorSubject the executor subject, the subject of execution * @param executorContext the executor context, the context in which execution takes place */ @@ -80,10 +83,11 @@ public interface Executor<IN, OUT, SUBJECT, CONTEXT> { void executePre(long executionID, IN incomingEntity) throws StateMachineException, ContextException; /** - * Carry out the post work for execution, the returning entity should be set by the child execution object. + * Carry out the post work for execution, the returning entity should be set by the child + * execution object. * - * @param returnValue the return value indicates whether the execution was successful and, if it failed, how it - * failed + * @param returnValue the return value indicates whether the execution was successful and, if it + * failed, how it failed * @throws StateMachineException on an execution error * @throws ContextException On context errors */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/ExecutorFactory.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/ExecutorFactory.java index 1bb0b0578..f092ce716 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/ExecutorFactory.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/ExecutorFactory.java @@ -26,7 +26,8 @@ import org.onap.policy.apex.model.policymodel.concepts.AxStateFinalizerLogic; import org.onap.policy.apex.model.policymodel.concepts.AxTask; /** - * This class is used by the state machine to get implementations of task selection and task executors. + * This class is used by the state machine to get implementations of task selection and task + * executors. * * @author Liam Fallon */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java index ab5b66969..cad83d6bc 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java @@ -84,7 +84,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap /** * Constructor, save the executor factory. * - * @param executorFactory the executor factory to use for getting executors for task selection logic + * @param executorFactory the executor factory to use for getting executors for task selection + * logic */ public StateExecutor(final ExecutorFactory executorFactory) { this.executorFactory = executorFactory; @@ -93,9 +94,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap /* * (non-Javadoc) * - * @see - * org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core.engine.executor.Executor, - * java.lang.Object, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core. + * engine.executor.Executor, java.lang.Object, java.lang.Object) */ @Override public void setContext(final Executor<?, ?, ?, ?> incomingParent, final AxState incomingAxState, @@ -167,7 +167,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, + * java.lang.Object) */ @Override public StateOutput execute(final long executionID, final EnEvent incomingEvent) @@ -190,7 +191,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap taskKey = taskSelectExecutor.execute(executionID, incomingEvent); } - // If there's no task selection logic or the TSL returned no task, just use the default task + // If there's no task selection logic or the TSL returned no task, just use the default + // task if (taskKey == null) { taskKey = axState.getDefaultTask(); } @@ -205,7 +207,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap // Check if this task has direct output String stateOutputName = directStateOutputMap.get(taskKey); - // If a direct state output name was not found, state finalizer logic should be defined for the task + // If a direct state output name was not found, state finalizer logic should be defined + // for the task if (stateOutputName == null) { // State finalizer logic should exist for the task final StateFinalizerExecutor finalizerLogicExecutor = task2StateFinalizerMap.get(taskKey); @@ -214,7 +217,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap + "\" not found for state \"" + axState.getID() + "\""); } - // Execute the state finalizer logic to select a state output and to adjust the taskExecutionResultMap + // Execute the state finalizer logic to select a state output and to adjust the + // taskExecutionResultMap stateOutputName = finalizerLogicExecutor.execute(incomingEvent.getExecutionID(), taskExecutionResultMap); } @@ -254,7 +258,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, + * java.lang.Object) */ @Override public final void executePre(final long executionID, final EnEvent incomingEntity) throws StateMachineException { @@ -353,7 +358,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap * (non-Javadoc) * * @see - * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine.executor.Executor) + * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine. + * executor.Executor) */ @Override public final void setNext(final Executor<EnEvent, StateOutput, AxState, ApexInternalContext> incomingNextExecutor) { @@ -373,8 +379,9 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core.engine. - * ExecutorParameters) + * @see + * org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core. + * engine. ExecutorParameters) */ @Override public void setParameters(final ExecutorParameters parameters) {} diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java index 17691011f..0d37b0bb7 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java @@ -36,8 +36,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This abstract class executes state finalizer logic in a state of an Apex policy and is specialized by classes that - * implement execution of state finalizer logic. + * This abstract class executes state finalizer logic in a state of an Apex policy and is + * specialized by classes that implement execution of state finalizer logic. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) * @author Liam Fallon (liam.fallon@ericsson.com) @@ -59,7 +59,8 @@ public abstract class StateFinalizerExecutor // The next state finalizer executor private Executor<Map<String, Object>, String, AxStateFinalizerLogic, ApexInternalContext> nextExecutor = null; - // The execution context; contains the facades for events and context to be used by tasks executed by this task + // The execution context; contains the facades for events and context to be used by tasks + // executed by this task // executor private StateFinalizerExecutionContext executionContext = null; @@ -75,9 +76,8 @@ public abstract class StateFinalizerExecutor /* * (non-Javadoc) * - * @see - * org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core.engine.executor.Executor, - * java.lang.Object, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core. + * engine.executor.Executor, java.lang.Object, java.lang.Object) */ @Override public void setContext(final Executor<?, ?, ?, ?> incomingParent, @@ -103,7 +103,8 @@ public abstract class StateFinalizerExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, + * java.lang.Object) */ @Override public String execute(final long executionID, final Map<String, Object> newIncomingFields) @@ -115,7 +116,8 @@ public abstract class StateFinalizerExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, + * java.lang.Object) */ @Override public final void executePre(final long executionID, final Map<String, Object> newIncomingFields) @@ -243,11 +245,12 @@ public abstract class StateFinalizerExecutor * (non-Javadoc) * * @see - * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine.executor.Executor) + * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine. + * executor.Executor) */ @Override - public void setNext( - final Executor<Map<String, Object>, String, AxStateFinalizerLogic, ApexInternalContext> incomingNextExecutor) { + public void setNext(final Executor<Map<String, Object>, String, AxStateFinalizerLogic, ApexInternalContext> + incomingNextExecutor) { this.nextExecutor = incomingNextExecutor; } @@ -264,8 +267,9 @@ public abstract class StateFinalizerExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core.engine. - * ExecutorParameters) + * @see + * org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core. + * engine. ExecutorParameters) */ @Override public void setParameters(final ExecutorParameters parameters) {} diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java index 05e1b3b4b..7a9594bf8 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java @@ -59,7 +59,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy private ExecutorFactory executorFactory = null; /** - * Constructor, save the executor factory that will give us executors for task selection logic and task logic. + * Constructor, save the executor factory that will give us executors for task selection logic + * and task logic. * * @param executorFactory the executor factory * @param owner the artifact key of the owner of this state machine @@ -71,9 +72,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy /* * (non-Javadoc) * - * @see - * org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core.engine.executor.Executor, - * java.lang.Object, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core. + * engine.executor.Executor, java.lang.Object, java.lang.Object) */ @Override public void setContext(final Executor<?, ?, ?, ?> newParent, final AxPolicy newAxPolicy, @@ -124,7 +124,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executeDirected(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executeDirected(java.lang.long, + * java.lang.Object) */ @Override public EnEvent execute(final long executionID, final EnEvent incomingEvent) @@ -139,7 +140,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy throw new StateMachineException("first state not defined on state machine"); } - // Get the first state of the state machine and define a state output that starts state execution + // Get the first state of the state machine and define a state output that starts state + // execution StateExecutor stateExecutor = firstExecutor; StateOutput stateOutput = new StateOutput(new AxStateOutput(firstExecutor.getSubject().getKey(), incomingEvent.getKey(), firstExecutor.getSubject().getKey()), incomingEvent); @@ -169,7 +171,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, + * java.lang.Object) */ @Override public final void executePre(final long executionID, final EnEvent incomingEntity) throws StateMachineException { @@ -262,7 +265,8 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy * (non-Javadoc) * * @see - * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine.executor.Executor) + * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine. + * executor.Executor) */ @Override public final void setNext(final Executor<EnEvent, EnEvent, AxPolicy, ApexInternalContext> newNextExecutor) { @@ -282,8 +286,9 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core.engine. - * ExecutorParameters) + * @see + * org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core. + * engine. ExecutorParameters) */ @Override public void setParameters(final ExecutorParameters parameters) {} diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java index 4a105b03f..9f6f92d4e 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java @@ -41,8 +41,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This abstract class executes a task in a state of an Apex policy and is specialized by classes that implement - * execution of task logic. + * This abstract class executes a task in a state of an Apex policy and is specialized by classes + * that implement execution of task logic. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) * @author Liam Fallon (liam.fallon@ericsson.com) @@ -64,7 +64,8 @@ public abstract class TaskExecutor // The next task executor private Executor<Map<String, Object>, Map<String, Object>, AxTask, ApexInternalContext> nextExecutor = null; - // The task execution context; contains the facades for events and context to be used by tasks executed by this task + // The task execution context; contains the facades for events and context to be used by tasks + // executed by this task // executor private TaskExecutionContext executionContext = null; @@ -80,9 +81,8 @@ public abstract class TaskExecutor /* * (non-Javadoc) * - * @see - * org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core.engine.executor.Executor, - * java.lang.Object, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core. + * engine.executor.Executor, java.lang.Object, java.lang.Object) */ @Override public void setContext(final Executor<?, ?, ?, ?> newParent, final AxTask newAxTask, @@ -107,7 +107,8 @@ public abstract class TaskExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, + * java.lang.Object) */ @Override public Map<String, Object> execute(final long executionID, final Map<String, Object> newIncomingFields) @@ -119,7 +120,8 @@ public abstract class TaskExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, + * java.lang.Object) */ @Override public final void executePre(final long executionID, final Map<String, Object> newIncomingFields) @@ -175,14 +177,16 @@ public abstract class TaskExecutor throw new StateMachineException(errorMessage); } - // Copy any unset fields from the input to the output if their data type and names are identical + // Copy any unset fields from the input to the output if their data type and names are + // identical for (final String field : axTask.getOutputFields().keySet()) { // Check if the field exists and is not set on the output if (!getOutgoing().containsKey(field) || getOutgoing().get(field) != null) { continue; } - // This field is not in the output, check if it's on the input and is the same type (Note here, the output + // This field is not in the output, check if it's on the input and is the same type + // (Note here, the output // field definition has to exist so it's not // null checked) final AxInputField inputFieldDef = axTask.getInputFields().get(field); @@ -195,7 +199,8 @@ public abstract class TaskExecutor getOutgoing().put(field, getIncoming().get(field)); } - // Finally, check that the outgoing fields have all the output fields defined for this state and, if not, output + // Finally, check that the outgoing fields have all the output fields defined for this state + // and, if not, output // a list of missing fields final Set<String> missingTaskOutputFields = new TreeSet<>(axTask.getOutputFields().keySet()); missingTaskOutputFields.removeAll(outgoingFields.keySet()); @@ -213,7 +218,8 @@ public abstract class TaskExecutor + "\" are missing for task \"" + axTask.getKey().getID() + "\""); } - // Finally, check that the outgoing field map don't have any extra fields, if present, raise exception with the + // Finally, check that the outgoing field map don't have any extra fields, if present, raise + // exception with the // list of extra fields final Set<String> extraTaskOutputFields = new TreeSet<>(outgoingFields.keySet()); extraTaskOutputFields.removeAll(axTask.getOutputFields().keySet()); @@ -299,7 +305,8 @@ public abstract class TaskExecutor * (non-Javadoc) * * @see - * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine.executor.Executor) + * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine. + * executor.Executor) */ @Override public void setNext( @@ -320,8 +327,9 @@ public abstract class TaskExecutor /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core.engine. - * ExecutorParameters) + * @see + * org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core. + * engine. ExecutorParameters) */ @Override public void setParameters(final ExecutorParameters parameters) {} diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java index 1aaa5ccf5..f3ac1f6b0 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java @@ -35,8 +35,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This abstract class executes a the task selection logic of a state of an Apex policy and is specialized by classes - * that implement execution of task selection logic. + * This abstract class executes a the task selection logic of a state of an Apex policy and is + * specialized by classes that implement execution of task selection logic. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) * @author Liam Fallon (liam.fallon@ericsson.com) @@ -57,7 +57,8 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact // The next task selection executor private Executor<EnEvent, AxArtifactKey, AxState, ApexInternalContext> nextExecutor = null; - // The task selection execution context; contains the facades for events and context to be used by tasks executed by + // The task selection execution context; contains the facades for events and context to be used + // by tasks executed by // this task selection executor private TaskSelectionExecutionContext executionContext; @@ -73,9 +74,8 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact /* * (non-Javadoc) * - * @see - * org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core.engine.executor.Executor, - * java.lang.Object, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#setContext(org.onap.policy.apex.core. + * engine.executor.Executor, java.lang.Object, java.lang.Object) */ @Override public void setContext(final Executor<?, ?, ?, ?> newParent, final AxState newAxState, @@ -100,7 +100,8 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#execute(java.lang.long, + * java.lang.Object) */ @Override public AxArtifactKey execute(final long executionID, final EnEvent newIncomingEvent) @@ -111,7 +112,8 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, java.lang.Object) + * @see org.onap.policy.apex.core.engine.executor.Executor#executePre(java.lang.long, + * java.lang.Object) */ @Override public final void executePre(final long executionID, final EnEvent newIncomingEvent) throws StateMachineException { @@ -215,7 +217,8 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact * (non-Javadoc) * * @see - * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine.executor.Executor) + * org.onap.policy.apex.core.engine.executor.Executor#setNext(org.onap.policy.apex.core.engine. + * executor.Executor) */ @Override public void setNext(final Executor<EnEvent, AxArtifactKey, AxState, ApexInternalContext> newNextExecutor) { @@ -255,8 +258,9 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact /* * (non-Javadoc) * - * @see org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core.engine. - * ExecutorParameters) + * @see + * org.onap.policy.apex.core.engine.executor.Executor#setParameters(org.onap.policy.apex.core. + * engine. ExecutorParameters) */ @Override public void setParameters(final ExecutorParameters parameters) {} diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java index 80d7e651b..e63bd3db8 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java @@ -31,8 +31,8 @@ import org.onap.policy.apex.model.policymodel.concepts.AxState; import org.onap.policy.apex.model.policymodel.concepts.AxTasks; /** - * The Class AxStateFacade acts as a facade into the AxState class so that task logic can easily access information in - * an AxState instance. + * The Class AxStateFacade acts as a facade into the AxState class so that task logic can easily + * access information in an AxState instance. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java index 85bf96c8d..a9e93a3b2 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java @@ -31,8 +31,8 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class AxTaskFacade acts as a facade into the AxTask class so that task logic can easily access information in an - * AxTask instance. + * The Class AxTaskFacade acts as a facade into the AxTask class so that task logic can easily + * access information in an AxTask instance. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ @@ -43,8 +43,8 @@ public class AxTaskFacade { // CHECKSTYLE:OFF: checkstyle:visibilityModifier Logic has access to this field /** - * The full definition of the task we are presenting a facade to, executing logic has full access to the task - * definition. + * The full definition of the task we are presenting a facade to, executing logic has full + * access to the task definition. */ public final AxTask task; diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContext.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContext.java index 874d4def1..be1b311c2 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContext.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/StateFinalizerExecutionContext.java @@ -38,15 +38,16 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * Container class for the execution context for state finalizer logic executions in a state being executed in an Apex - * engine. The state finalizer must have easy access to the state definition, the fields, as well as the policy, global, - * and external context. + * Container class for the execution context for state finalizer logic executions in a state being + * executed in an Apex engine. The state finalizer must have easy access to the state definition, + * the fields, as well as the policy, global, and external context. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ public class StateFinalizerExecutionContext { /** - * Logger for state finalizer execution, state finalizer logic can use this field to access and log to Apex logging. + * Logger for state finalizer execution, state finalizer logic can use this field to access and + * log to Apex logging. */ private static final XLogger EXCEUTION_LOGGER = XLoggerFactory.getXLogger("org.onap.policy.apex.executionlogging.StateFinalizerExecutionLogging"); @@ -60,15 +61,16 @@ public class StateFinalizerExecutionContext { public final Long executionID; /** - * The list of state outputs for this state finalizer. The purpose of a state finalizer is to select a state output - * for a state from this list of state output names. + * The list of state outputs for this state finalizer. The purpose of a state finalizer is to + * select a state output for a state from this list of state output names. */ public final Set<String> stateOutputNames; /** - * The fields of this state finalizer. A state finalizer receives this list of fields from a task and may use these - * fields to determine what state output to select. Once a state finalizer has selected a state output, it must - * marshal these fields so that they match the fields required for the event defined in the state output. + * The fields of this state finalizer. A state finalizer receives this list of fields from a + * task and may use these fields to determine what state output to select. Once a state + * finalizer has selected a state output, it must marshal these fields so that they match the + * fields required for the event defined in the state output. */ public final Map<String, Object> fields; @@ -76,13 +78,15 @@ public class StateFinalizerExecutionContext { private String message; /** - * The state output that the state finalizer logic has selected for a state. The state finalizer logic sets this - * field in its logic after executing and the Apex engine uses this state output for this state. + * The state output that the state finalizer logic has selected for a state. The state finalizer + * logic sets this field in its logic after executing and the Apex engine uses this state output + * for this state. */ private String selectedStateOutputName; /** - * Logger for state finalizer execution, state finalizer logic can use this field to access and log to Apex logging. + * Logger for state finalizer execution, state finalizer logic can use this field to access and + * log to Apex logging. */ public final XLogger logger = EXCEUTION_LOGGER; @@ -98,8 +102,10 @@ public class StateFinalizerExecutionContext { * @param executionID the execution ID for the current APEX policy execution instance * @param axState the state definition that is the subject of execution * @param fields the fields to be manipulated by the state finalizer - * @param stateOutputNames the state output names, one of which will be selected by the state finalizer - * @param internalContext the execution context of the Apex engine in which the task is being executed + * @param stateOutputNames the state output names, one of which will be selected by the state + * finalizer + * @param internalContext the execution context of the Apex engine in which the task is being + * executed */ public StateFinalizerExecutionContext(final StateFinalizerExecutor stateFinalizerExecutor, final long executionID, final AxState axState, final Map<String, Object> fields, final Set<String> stateOutputNames, @@ -141,7 +147,8 @@ public class StateFinalizerExecutionContext { * * @param contextAlbumName The context album name * @return The context album - * @throws ContextRuntimeException if the context album does not exist on the state for this executor + * @throws ContextRuntimeException if the context album does not exist on the state for this + * executor */ public ContextAlbum getContextAlbum(final String contextAlbumName) throws ContextRuntimeException { // Find the context album diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContext.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContext.java index 2251cf5c1..a9a157082 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContext.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskExecutionContext.java @@ -38,9 +38,9 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * Container class for the execution context for Task logic executions in a task being executed in an Apex engine. The - * task must have easy access to the task definition, the incoming and outgoing field contexts, as well as the policy, - * global, and external context. + * Container class for the execution context for Task logic executions in a task being executed in + * an Apex engine. The task must have easy access to the task definition, the incoming and outgoing + * field contexts, as well as the policy, global, and external context. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ @@ -54,7 +54,9 @@ public class TaskExecutionContext { /** A constant <code>boolean true</code> value available for reuse e.g., for the return value */ public final Boolean TRUE = true; - /** A constant <code>boolean false</code> value available for reuse e.g., for the return value */ + /** + * A constant <code>boolean false</code> value available for reuse e.g., for the return value + */ public final Boolean FALSE = false; /** A facade to the full task definition for the task logic being executed. */ @@ -64,18 +66,20 @@ public class TaskExecutionContext { public final Long executionID; /** - * The incoming fields from the trigger event for the task. The task logic can access these fields when executing - * its logic. + * The incoming fields from the trigger event for the task. The task logic can access these + * fields when executing its logic. */ public final Map<String, Object> inFields; /** - * The outgoing fields from the task. The task logic can access and set these fields with its logic. A task outputs - * its result using these fields. + * The outgoing fields from the task. The task logic can access and set these fields with its + * logic. A task outputs its result using these fields. */ public final Map<String, Object> outFields; - /** Logger for task execution, task logic can use this field to access and log to Apex logging. */ + /** + * Logger for task execution, task logic can use this field to access and log to Apex logging. + */ public final XLogger logger = EXECUTION_LOGGER; // CHECKSTYLE:ON: checkstyle:VisibilityModifier @@ -97,7 +101,8 @@ public class TaskExecutionContext { * @param axTask the task definition that is the subject of execution * @param inFields the in fields * @param outFields the out fields - * @param internalContext the execution context of the Apex engine in which the task is being executed + * @param internalContext the execution context of the Apex engine in which the task is being + * executed */ public TaskExecutionContext(final TaskExecutor taskExecutor, final long executionID, final AxTask axTask, final Map<String, Object> inFields, final Map<String, Object> outFields, @@ -139,7 +144,8 @@ public class TaskExecutionContext { * * @param contextAlbumName The context album name * @return The context album - * @throws ContextRuntimeException if the context album does not exist on the task for this executor + * @throws ContextRuntimeException if the context album does not exist on the task for this + * executor */ public ContextAlbum getContextAlbum(final String contextAlbumName) throws ContextRuntimeException { // Find the context album diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskSelectionExecutionContext.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskSelectionExecutionContext.java index a196e360e..3194e3fce 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskSelectionExecutionContext.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/TaskSelectionExecutionContext.java @@ -38,9 +38,9 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * Container class for the execution context for Task Selection logic executions in a task being executed in an Apex - * engine. The task must have easy access to the state definition, the incoming and outgoing event contexts, as well as - * the policy, global, and external context. + * Container class for the execution context for Task Selection logic executions in a task being + * executed in an Apex engine. The task must have easy access to the state definition, the incoming + * and outgoing event contexts, as well as the policy, global, and external context. * * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ @@ -54,7 +54,9 @@ public class TaskSelectionExecutionContext { /** A constant <code>boolean true</code> value available for reuse e.g., for the return value */ public final Boolean TRUE = true; - /** A constant <code>boolean false</code> value available for reuse e.g., for the return value */ + /** + * A constant <code>boolean false</code> value available for reuse e.g., for the return value + */ public final Boolean FALSE = false; /** A facade to the full state definition for the task selection logic being executed. */ @@ -64,19 +66,21 @@ public class TaskSelectionExecutionContext { public final Long executionID; /** - * The incoming fields from the trigger event for the state. The task selection logic can access these fields to - * decide what task to select for the state. + * The incoming fields from the trigger event for the state. The task selection logic can access + * these fields to decide what task to select for the state. */ public final Map<String, Object> inFields; /** - * The task that the task selection logic has selected for a state. The task selection logic sets this field in its - * logic prior to executing and the Apex engine executes this task as the task for this state. + * The task that the task selection logic has selected for a state. The task selection logic + * sets this field in its logic prior to executing and the Apex engine executes this task as the + * task for this state. */ public final AxArtifactKey selectedTask; /** - * Logger for task selection execution, task selection logic can use this field to access and log to Apex logging. + * Logger for task selection execution, task selection logic can use this field to access and + * log to Apex logging. */ public final XLogger logger = EXECUTION_LOGGER; @@ -96,7 +100,8 @@ public class TaskSelectionExecutionContext { * @param axState the state definition that is the subject of execution * @param incomingEvent the incoming event for the state * @param outgoingKey the outgoing key for the task to execute in this state - * @param internalContext the execution context of the Apex engine in which the task is being executed + * @param internalContext the execution context of the Apex engine in which the task is being + * executed */ public TaskSelectionExecutionContext(final TaskSelectExecutor taskSelectExecutor, final long executionID, final AxState axState, final EnEvent incomingEvent, final AxArtifactKey outgoingKey, @@ -145,7 +150,8 @@ public class TaskSelectionExecutionContext { * * @param contextAlbumName The context album name * @return The context albumxxxxxx - * @throws ContextRuntimeException if the context album does not exist on the state for this executor + * @throws ContextRuntimeException if the context album does not exist on the state for this + * executor */ public ContextAlbum getContextAlbum(final String contextAlbumName) throws ContextRuntimeException { // Find the context album diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/package-info.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/package-info.java index 6dc555107..656ab49ce 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/package-info.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/package-info.java @@ -19,13 +19,14 @@ */ /** - * Provides context and facades for executing tasks, task selection logic, and state finalizer logic. The public fields - * and methods of {@link TaskExecutionContext}, {@link TaskSelectionExecutionContext} and - * {@link StateFinalizerExecutionContext} are available to task logic, task selection logic, and state finalizer logic - * respectively when that logic is executing in an executor plugin under the control of an APEX engine. + * Provides context and facades for executing tasks, task selection logic, and state finalizer + * logic. The public fields and methods of {@link TaskExecutionContext}, + * {@link TaskSelectionExecutionContext} and {@link StateFinalizerExecutionContext} are available to + * task logic, task selection logic, and state finalizer logic respectively when that logic is + * executing in an executor plugin under the control of an APEX engine. * - * The {@link AxStateFacade} and {@link AxTaskFacade} classes provide facades and convenience methods for state and task - * definition information for logic at execution time. + * The {@link AxStateFacade} and {@link AxTaskFacade} classes provide facades and convenience + * methods for state and task definition information for logic at execution time. * * @author Liam Fallon (liam.fallon@ericsson.com) */ diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineException.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineException.java index 9d6c55900..0b64eb481 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineException.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineException.java @@ -43,9 +43,9 @@ public class StateMachineException extends ApexException { * Instantiates a new state machine exception. * * @param message the message - * @param e the e + * @param ex the exception */ - public StateMachineException(final String message, final Exception e) { - super(message, e); + public StateMachineException(final String message, final Exception ex) { + super(message, ex); } } diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineRuntimeException.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineRuntimeException.java index 9ce2d7499..447c88bf9 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineRuntimeException.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/exception/StateMachineRuntimeException.java @@ -43,9 +43,9 @@ public class StateMachineRuntimeException extends ApexRuntimeException { * Instantiates a new state machine exception. * * @param message the message - * @param e the e + * @param ex the exception */ - public StateMachineRuntimeException(final String message, final Exception e) { - super(message, e); + public StateMachineRuntimeException(final String message, final Exception ex) { + super(message, ex); } } diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java index 58ee4c6cc..ae1f551a4 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/impl/ExecutorFactoryImpl.java @@ -201,7 +201,8 @@ public class ExecutorFactoryImpl extends ExecutorFactory { private Executor<?, ?, ?, ?> createExecutor(final String logicFlavour, final Class<Executor<?, ?, ?, ?>> executorClass, final Class<? extends Executor<?, ?, ?, ?>> executorSuperClass) { - // It's OK for an executor class not to be defined but it's not all right to try and create a non-defined + // It's OK for an executor class not to be defined but it's not all right to try and create + // a non-defined // executor class if (executorClass == null) { final String errorMessage = "Executor plugin class not defined for \"" + logicFlavour diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/package-info.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/package-info.java index 530041a23..38834687d 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/package-info.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/package-info.java @@ -19,8 +19,8 @@ */ /** - * Provides monitoring of APEX policy execution. It monitors events as they trigger Apex policies, pass between the - * various states of a policy, and are emitted by a policy. + * Provides monitoring of APEX policy execution. It monitors events as they trigger Apex policies, + * pass between the various states of a policy, and are emitted by a policy. * * @author Liam Fallon (liam.fallon@ericsson.com) */ |