From 5ac1e8648e03877d72e145ba59d2c6f9cca78ad2 Mon Sep 17 00:00:00 2001 From: "beili.zhou" Date: Fri, 11 Aug 2017 21:48:22 -0400 Subject: OAM operations 1 - miscellaneous OAM operations changes are large, need to break down to multiple submissions based on size and compilability. This is the first set which covers: feature installation, audit log message, listener instantiation and etc. Includes these user stories: APPC-39/41/43/44/45/46/52/77. Issue Id: APPC-38 Change-Id: Ifc0f5bd2468732d04ae462be09a6ad720aefba2b Signed-off-by: beili.zhou --- .../appc/configuration/ConfigurationFactory.java | 8 ++-- .../src/main/java/org/openecomp/appc/i18n/Msg.java | 46 +++++++++++++++--- .../appc/i18n/MessageResources.properties | 54 ++++++++++++++++++---- .../org/openecomp/appc/org.ops4j.pax.logging.cfg | 4 ++ 4 files changed, 92 insertions(+), 20 deletions(-) (limited to 'appc-common') diff --git a/appc-common/src/main/java/org/openecomp/appc/configuration/ConfigurationFactory.java b/appc-common/src/main/java/org/openecomp/appc/configuration/ConfigurationFactory.java index a2dd55702..fa8b5ee0b 100644 --- a/appc-common/src/main/java/org/openecomp/appc/configuration/ConfigurationFactory.java +++ b/appc-common/src/main/java/org/openecomp/appc/configuration/ConfigurationFactory.java @@ -116,14 +116,14 @@ public final class ConfigurationFactory { /** * The default properties resource to be loaded */ - private static final String DEFAULT_PROPERTIES = "/opt/openecomp/appc/data/properties/appc.properties"; + private static final String DEFAULT_PROPERTIES = "org/openecomp/appc/default.properties"; /** * This collection allows for special configurations to be created and maintained, organized by some identification * (such as an object reference to the StackBuilder to which they apply), and then obtained from the configuration * factory when needed. */ - private static HashMap localConfigs = new HashMap(); + private static HashMap localConfigs = new HashMap<>(); /** * The reentrant shared lock used to serialize access to the properties. @@ -355,7 +355,9 @@ public final class ConfigurationFactory { logger.error(EELFResourceManager.format(e)); } finally { try { - stream.close(); + if (stream != null) { + stream.close(); + } } catch (IOException e) { // not much we can do since logger may not be configured // yet diff --git a/appc-common/src/main/java/org/openecomp/appc/i18n/Msg.java b/appc-common/src/main/java/org/openecomp/appc/i18n/Msg.java index 7306b4c5d..5f0aa3258 100644 --- a/appc-common/src/main/java/org/openecomp/appc/i18n/Msg.java +++ b/appc-common/src/main/java/org/openecomp/appc/i18n/Msg.java @@ -756,28 +756,60 @@ public enum Msg implements EELFResolvableErrorEnum { OAM_OPERATION_EXCEPTION, /** - * Application {0} is stopping... Waiting for {1} LCM request to complete + * Application {0} is {1} + */ + OAM_OPERATION_ENTERING_MAINTENANCE_MODE, + + /** + * Application {0} is in {1} + */ + OAM_OPERATION_MAINTENANCE_MODE, + + /** + * Application {0} is {1} + */ + OAM_OPERATION_STARTING, + + /** + * Application {0} is {1} + */ + OAM_OPERATION_STARTED, + + /** + * Application {0} is {1} */ OAM_OPERATION_STOPPING, /** - * Application {0} is stopped + * Application {0} is {1} */ OAM_OPERATION_STOPPED, + /** + * A {1} API is not allowed when {0} is in the {2} state + */ + INVALID_STATE_TRANSITION, + /** + * Application {0} was unable to find the Request Handler service + */ + REQUEST_HANDLER_UNAVAILABLE, /** - * Application {0} is started + * Application {0} is {1} */ - OAM_OPERATION_STARTING, + OAM_OPERATION_RESTARTING, /** - * Application {0} is started + * Application {0} is {1} for restart */ - OAM_OPERATION_STARTED, + OAM_OPERATION_RESTARTED, - ; /** + * {0} + */ + OAM_OPERATION_INVALID_INPUT + ; + /* * Static initializer to ensure the resource bundles for this class are loaded... */ static { diff --git a/appc-common/src/main/resources/org/openecomp/appc/i18n/MessageResources.properties b/appc-common/src/main/resources/org/openecomp/appc/i18n/MessageResources.properties index 28971c7b0..86d9b5515 100644 --- a/appc-common/src/main/resources/org/openecomp/appc/i18n/MessageResources.properties +++ b/appc-common/src/main/resources/org/openecomp/appc/i18n/MessageResources.properties @@ -956,24 +956,58 @@ OAM_OPERATION_EXCEPTION=APPC0153E|\ state of the thread at the time of the exception.|\ Correct the cause of the exception and rerun. -OAM_OPERATION_STOPPING=APPC0154W|\ - Application {0} is stopping... |\ +OAM_OPERATION_ENTERING_MAINTENANCE_MODE=APPC0154W|\ + Application {0} is {1}|\ No recovery required|\ The APPC will no longer accept new LCM requests. Previously accepted LCM requests will be allowed to complete. -OAM_OPERATION_STOPPED=APPC0155W|\ - Application {0} is stopped|\ +OAM_OPERATION_MAINTENANCE_MODE=APPC0155W|\ + Application {0} is in {1}|\ No recovery required|\ - The APPC is not accepting new LCM requests and all previously accepted LCM requests have completed. + The APPC is not accepting new LCM requests and all previously accepted LCM requests have completed. OAM_OPERATION_STARTING=APPC0156I|\ - Application {0} is starting...|\ + Application {0} is {1}|\ No recovery required|\ - The APPC has initiated its startup procedure. Its internal components are coming online. Once completed it will start accepting LCM requests. \ - + The APPC has initiated its startup procedure. Its internal components are coming online. Once completed it will start accepting LCM requests. + OAM_OPERATION_STARTED=APPC0157I|\ - Application {0} is started|\ + Application {0} is {1}|\ + No recovery required|\ + The APPC will now accept new LCM requests for processing. + +INVALID_STATE_TRANSITION=APPC0158E|\ + A {1} API is not allowed when {0} in the {2} state|\ + No recovery required|\ + The Operation requested cannot be performed as per the current state of APPC. + +OAM_OPERATION_STOPPING=APPC0159W|\ + Application {0} is {1}|\ + No recovery required|\ + The APPC has initiated its stop procedure. Its internal LCM bundles are stopping. + +OAM_OPERATION_STOPPED=APPC0160W|\ + Application {0} is {1}|\ + No recovery required|\ + The APPC LCM bundles have now stopped. + +REQUEST_HANDLER_UNAVAILABLE=APPC0161E|\ + Application {0} was unable to find the Request Handler service |\ + The application controller attempted to get a handle on Request Handler service \ + but was unable to locate it in the OSGi Service Registry.|\ + Verify if the Request Handler bundle is running. + +OAM_OPERATION_RESTARTING=APPC0162W|\ + Application {0} is {1}|\ No recovery required|\ - The APPC will now accept new LCM requests for processing. + The APPC has initiated its restart procedure. Its internal LCM bundles are stopping and will then start again. +OAM_OPERATION_RESTARTED=APPC0163W|\ + Application {0} is {1} for restart|\ + No recovery required|\ + The APPC LCM bundles have been restared (stopped and then started). +OAM_OPERATION_INVALID_INPUT=APPC0162E|\ + {0}|\ + No recovery required|\ + Fix the input parameter and retry. diff --git a/appc-common/src/main/resources/org/openecomp/appc/org.ops4j.pax.logging.cfg b/appc-common/src/main/resources/org/openecomp/appc/org.ops4j.pax.logging.cfg index 78b50cf55..a3a3f5837 100644 --- a/appc-common/src/main/resources/org/openecomp/appc/org.ops4j.pax.logging.cfg +++ b/appc-common/src/main/resources/org/openecomp/appc/org.ops4j.pax.logging.cfg @@ -110,6 +110,10 @@ #Store to the same log file messages from upper level appender or not log4j.additivity.org.openecomp=false + #org.openecomp logger + log4j.logger.org.openecomp=TRACE, debug, error + log4j.additivity.org.openecomp=false + #EELFManager loggers #EELF parent logger log4j.logger.com.att.eelf=TRACE, debug -- cgit 1.2.3-korg