diff options
Diffstat (limited to 'common-app-api/src/main/java/org/openecomp/sdc/be')
14 files changed, 2088 insertions, 1461 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/BeEcompErrorManager.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/BeEcompErrorManager.java index 0a3d50f848..75da11155b 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/BeEcompErrorManager.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/BeEcompErrorManager.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,417 +26,412 @@ import org.openecomp.sdc.common.config.IEcompConfigurationManager; public class BeEcompErrorManager extends AbsEcompErrorManager { - public enum ComponentName { - SERVICE, PRODUCT, VF - } - - public enum ErrorSeverity { - INFO, WARNING, ERROR, FATAL - } - - private static volatile BeEcompErrorManager instance; - private static ConfigurationManager configurationManager; - - private BeEcompErrorManager() { - } - - public static BeEcompErrorManager getInstance() { - if (instance == null) { - synchronized (BeEcompErrorManager.class) { - if (instance == null) { - instance = init(); - } - } - } - return instance; - } - - private static synchronized BeEcompErrorManager init() { - if (instance == null) { - instance = new BeEcompErrorManager(); - configurationManager = ConfigurationManager.getConfigurationManager(); - } - return instance; - } - - @Override - public IEcompConfigurationManager getConfigurationManager() { - return configurationManager; - } - - public void logBeUebAuthenticationError(String context, String reason) { - processEcompError(context, EcompErrorEnum.BeUebAuthenticationError, reason); - } - - public void logBeHealthCheckRecovery(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckRecovery); - } - - public void logBeHealthCheckJanusGraphRecovery(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckJanusGraphRecovery); - } - - public void logBeHealthCheckElasticSearchRecovery(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckElasticSearchRecovery); - } - - public void logBeHealthCheckUebClusterRecovery(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckUebClusterRecovery); - } - - public void logDmaapHealthCheckError(String context) { - processEcompError(context, EcompErrorEnum.DmaapHealthCheckError); - } - - public void logDmaapHealthCheckRecovery(String context) { - processEcompError(context, EcompErrorEnum.DmaapHealthCheckRecovery); - } - - public void logFeHealthCheckRecovery(String context) { - processEcompError(context, EcompErrorEnum.FeHealthCheckRecovery); - } - - public void logBeHealthCheckError(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckError); - } - - public void logBeHealthCheckJanusGraphError(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckJanusGraphError); - } - - public void logBeHealthCheckElasticSearchError(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckElasticSearchError); - } - - public void logBeHealthCheckUebClusterError(String context) { - processEcompError(context, EcompErrorEnum.BeHealthCheckUebClusterError); - } - - public void logFeHealthCheckError(String context) { - processEcompError(context, EcompErrorEnum.FeHealthCheckError); - } - - /** - * @param context - * @param reason - */ - public void logBeUebConnectionError(String context, String reason) { - processEcompError(context, EcompErrorEnum.BeUebConnectionError, reason); - } - - public void logBeUebUnkownHostError(String context, String host) { - processEcompError(context, EcompErrorEnum.BeUebUnkownHostError, host); - } - - public void logBeComponentMissingError(String context, String componentType, String name) { - processEcompError(context, EcompErrorEnum.BeComponentMissingError, componentType, name); - } - - public void logBeIncorrectComponentError(String context, String componentType, String name) { - processEcompError(context, EcompErrorEnum.BeIncorrectComponentError, componentType, name); - } - - public void logBeInvalidConfigurationError(String context, String parameterName, String parameterValue) { - processEcompError(context, EcompErrorEnum.BeInvalidConfigurationError, parameterName, parameterValue); - } - - public void logBeUebObjectNotFoundError(String context, String notFoundObjectName) { - processEcompError(context, EcompErrorEnum.BeUebObjectNotFoundError, notFoundObjectName); - } - - public void logBeDistributionEngineInvalidArtifactType(String context, String artifactType, - String validArtifactTypes) { - processEcompError(context, EcompErrorEnum.BeDistributionEngineInvalidArtifactType, artifactType, - validArtifactTypes); - } - - public void logBeMissingConfigurationError(String context, String parameterName) { - processEcompError(context, EcompErrorEnum.BeMissingConfigurationError, parameterName); - } - - public void logBeConfigurationInvalidListSizeError(String context, String parameterName, int listMinimumSize) { - processEcompError(context, EcompErrorEnum.BeConfigurationInvalidListSizeError, parameterName, - String.valueOf(listMinimumSize)); - } - - public void logErrorConfigFileFormat(String context, String description) { - processEcompError(context, EcompErrorEnum.ErrorConfigFileFormat, description); - } - - public void logBeMissingArtifactInformationError(String context, String missingInfo) { - processEcompError(context, EcompErrorEnum.BeMissingArtifactInformationError, missingInfo); - } - - public void logBeArtifactMissingError(String context, String artifactName) { - processEcompError(context, EcompErrorEnum.BeArtifactMissingError, artifactName); - } - - public void logBeUserMissingError(String context, String userId) { - processEcompError(context, EcompErrorEnum.BeUserMissingError, userId); - } - - public void logBeInvalidTypeError(String context, String type, String name) { - processEcompError(context, EcompErrorEnum.BeInvalidTypeError, type, name); - } - - public void logBeInvalidValueError(String context, String value, String name, String type) { - processEcompError(context, EcompErrorEnum.BeInvalidValueError, value, name, type); - } - - public void logBeArtifactPayloadInvalid(String context) { - processEcompError(context, EcompErrorEnum.BeArtifactPayloadInvalid); - } - - public void logBeArtifactInformationInvalidError(String context) { - processEcompError(context, EcompErrorEnum.BeArtifactInformationInvalidError); - } - - public void logBeDistributionMissingError(String context, String distributionName) { - processEcompError(context, EcompErrorEnum.BeDistributionMissingError, "Distribution", distributionName); - } - - public void logBeGraphObjectMissingError(String context, String objectType, String objectName) { - processEcompError(context, EcompErrorEnum.BeGraphObjectMissingError, objectType, objectName); - } - - public void logBeInvalidJsonInput(String context) { - processEcompError(context, EcompErrorEnum.BeInvalidJsonInput); - } - - public void logBeInitializationError(String context) { - processEcompError(context, EcompErrorEnum.BeInitializationError); - } - - public void logBeFailedAddingResourceInstanceError(String context, String resourceName, String serviceId) { - processEcompError(context, EcompErrorEnum.BeFailedAddingResourceInstanceError, resourceName, serviceId); - } - - public void logBeUebSystemError(String context, String operation) { - processEcompError(context, EcompErrorEnum.BeUebSystemError, operation); - } - - public void logBeDistributionEngineSystemError(String context, String operation) { - processEcompError(context, EcompErrorEnum.BeDistributionEngineSystemError, operation); - } - - public void logBeFailedAddingNodeTypeError(String context, String nodeType) { - processEcompError(context, EcompErrorEnum.BeFailedAddingNodeTypeError, nodeType); - } - - public void logBeDaoSystemError(String context) { - processEcompError(context, EcompErrorEnum.BeDaoSystemError); - } - - public void logBeSystemError(String context) { - processEcompError(context, EcompErrorEnum.BeSystemError); - } - - public void logBeExecuteRollbackError(String context) { - processEcompError(context, EcompErrorEnum.BeExecuteRollbackError); - } - - public void logBeFailedLockObjectError(String context, String type, String id) { - processEcompError(context, EcompErrorEnum.BeFailedLockObjectError, type, id); - } - - public void logBeFailedCreateNodeError(String context, String nodeName, String status) { - processEcompError(context, EcompErrorEnum.BeFailedCreateNodeError, nodeName, status); - } - - public void logBeFailedUpdateNodeError(String context, String nodeName, String status) { - processEcompError(context, EcompErrorEnum.BeFailedUpdateNodeError, nodeName, status); - } - - public void logBeFailedDeleteNodeError(String context, String nodeName, String status) { - processEcompError(context, EcompErrorEnum.BeFailedDeleteNodeError, nodeName, status); - } - - public void logBeFailedRetrieveNodeError(String context, String nodeName, String status) { - processEcompError(context, EcompErrorEnum.BeFailedRetrieveNodeError, nodeName, status); - } - - public void logBeFailedFindParentError(String context, String node, String status) { - processEcompError(context, EcompErrorEnum.BeFailedFindParentError, node, status); - } - - public void logBeFailedFindAllNodesError(String context, String nodeType, String parentNode, String status) { - processEcompError(context, EcompErrorEnum.BeFailedFindAllNodesError, nodeType, parentNode, status); - } - - public void logBeFailedFindAssociationError(String context, String nodeType, String fromNode, String status) { - processEcompError(context, EcompErrorEnum.BeFailedFindAssociationError, nodeType, fromNode, status); - } - - public void logBeComponentCleanerSystemError(String context, String operation) { - processEcompError(context, EcompErrorEnum.BeComponentCleanerSystemError, operation); - } - - public void logBeRestApiGeneralError(String context) { - processEcompError(context, EcompErrorEnum.BeRestApiGeneralError); - } - - public void logFqdnResolveError(String context, String description) { - processEcompError(context, EcompErrorEnum.FqdnResolveError, description); - } - - public void logSiteSwitchoverInfo(String context, String description) { - processEcompError(context, EcompErrorEnum.SiteSwitchoverInfo, description); - } - - public void logInternalAuthenticationError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InternalAuthenticationError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InternalAuthenticationInfo, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InternalAuthenticationWarning, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InternalAuthenticationError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InternalAuthenticationFatal, description); - break; - - default: - break; - } - } - - } - - public void logInternalConnectionError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InternalConnectionError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InternalConnectionInfo, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InternalConnectionWarning, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InternalConnectionError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InternalConnectionFatal, description); - break; - - default: - break; - } - } - - } - - public void logInternalDataError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InternalDataError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InternalDataInfo, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InternalDataWarning, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InternalDataError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InternalDataFatal, description); - break; - - default: - break; - } - } - - } - - public void logInvalidInputError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InvalidInputError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InvalidInputWarning, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InvalidInputInfo, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InvalidInputError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InvalidInputFatal, description); - break; - - default: - break; - } - } - - } - - public void logInternalFlowError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InternalFlowError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InternalFlowInfo, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InternalFlowWarning, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InternalFlowError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InternalFlowFatal, description); - break; - - default: - break; - } - } - - } - - public void logInternalUnexpectedError(String context, String description, ErrorSeverity severity) { - - if (severity == null) { - processEcompError(context, EcompErrorEnum.InternalUnexpectedError, description); - } else { - switch (severity) { - case INFO: - processEcompError(context, EcompErrorEnum.InternalUnexpectedInfo, description); - break; - case WARNING: - processEcompError(context, EcompErrorEnum.InternalUnexpectedWarning, description); - break; - case ERROR: - processEcompError(context, EcompErrorEnum.InternalUnexpectedError, description); - break; - case FATAL: - processEcompError(context, EcompErrorEnum.InternalUnexpectedFatal, description); - break; - - default: - break; - } - } - - } + public enum ComponentName { + SERVICE, PRODUCT, VF + } + + public enum ErrorSeverity { + INFO, WARNING, ERROR, FATAL + } + + private static volatile BeEcompErrorManager instance; + private static ConfigurationManager configurationManager; + + private BeEcompErrorManager() { + }; + + public static BeEcompErrorManager getInstance() { + if (instance == null) { + synchronized (BeEcompErrorManager.class){ + if (instance == null) + instance = init(); + } + } + return instance; + } + + private static synchronized BeEcompErrorManager init() { + if (instance == null) { + instance = new BeEcompErrorManager(); + configurationManager = ConfigurationManager.getConfigurationManager(); + } + return instance; + } + + @Override + public IEcompConfigurationManager getConfigurationManager() { + return configurationManager; + } + + public void logBeUebAuthenticationError(String context, String reason) { + processEcompError(context, EcompErrorEnum.BeUebAuthenticationError, reason); + } + + public void logBeHealthCheckRecovery(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckRecovery); + } + + public void logBeHealthCheckJanusGraphRecovery(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckJanusGraphRecovery); + } + + public void logBeHealthCheckUebClusterRecovery(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckUebClusterRecovery); + } + + public void logDmaapHealthCheckError(String context) { + processEcompError(context, EcompErrorEnum.DmaapHealthCheckError); + } + + public void logUserSessionExpiredError(String context) { + processEcompError(context, EcompErrorEnum.SessionExpiredAuthenticationError); + } + + public void logDmaapHealthCheckRecovery(String context) { + processEcompError(context, EcompErrorEnum.DmaapHealthCheckRecovery); + } + + public void logFeHealthCheckRecovery(String context) { + processEcompError(context, EcompErrorEnum.FeHealthCheckRecovery); + } + + public void logBeHealthCheckError(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckError); + } + + public void logBeHealthCheckJanusGraphError(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckJanusGraphError); + } + + public void logBeHealthCheckUebClusterError(String context) { + processEcompError(context, EcompErrorEnum.BeHealthCheckUebClusterError); + } + + public void logFeHealthCheckError(String context) { + processEcompError(context, EcompErrorEnum.FeHealthCheckError); + } + + /** + * @param context + * @param reason + */ + public void logBeUebConnectionError(String context, String reason) { + processEcompError(context, EcompErrorEnum.BeUebConnectionError, reason); + } + + public void logBeUebUnkownHostError(String context, String host) { + processEcompError(context, EcompErrorEnum.BeUebUnkownHostError, host); + } + + public void logBeComponentMissingError(String context, String componentType, String name) { + processEcompError(context, EcompErrorEnum.BeComponentMissingError, componentType, name); + } + + public void logBeIncorrectComponentError(String context, String componentType, String name) { + processEcompError(context, EcompErrorEnum.BeIncorrectComponentError, componentType, name); + } + + public void logBeInvalidConfigurationError(String context, String parameterName, String parameterValue) { + processEcompError(context, EcompErrorEnum.BeInvalidConfigurationError, parameterName, parameterValue); + } + + public void logBeUebObjectNotFoundError(String context, String notFoundObjectName) { + processEcompError(context, EcompErrorEnum.BeUebObjectNotFoundError, notFoundObjectName); + } + + public void logBeDistributionEngineInvalidArtifactType(String context, String artifactType, + String validArtifactTypes) { + processEcompError(context, EcompErrorEnum.BeDistributionEngineInvalidArtifactType, artifactType, + validArtifactTypes); + } + + public void logBeMissingConfigurationError(String context, String parameterName) { + processEcompError(context, EcompErrorEnum.BeMissingConfigurationError, parameterName); + } + + public void logBeConfigurationInvalidListSizeError(String context, String parameterName, int listMinimumSize) { + processEcompError(context, EcompErrorEnum.BeConfigurationInvalidListSizeError, parameterName, + String.valueOf(listMinimumSize)); + } + + public void logErrorConfigFileFormat(String context, String description) { + processEcompError(context, EcompErrorEnum.ErrorConfigFileFormat, description); + } + + public void logBeMissingArtifactInformationError(String context, String missingInfo) { + processEcompError(context, EcompErrorEnum.BeMissingArtifactInformationError, missingInfo); + } + + public void logBeArtifactMissingError(String context, String artifactName) { + processEcompError(context, EcompErrorEnum.BeArtifactMissingError, artifactName); + } + + public void logBeUserMissingError(String context, String userId) { + processEcompError(context, EcompErrorEnum.BeUserMissingError, userId); + } + + public void logBeInvalidTypeError(String context, String type, String name) { + processEcompError(context, EcompErrorEnum.BeInvalidTypeError, type, name); + } + + public void logBeInvalidValueError(String context, String value, String name, String type) { + processEcompError(context, EcompErrorEnum.BeInvalidValueError, value, name, type); + } + + public void logBeArtifactPayloadInvalid(String context) { + processEcompError(context, EcompErrorEnum.BeArtifactPayloadInvalid); + } + + public void logBeArtifactInformationInvalidError(String context) { + processEcompError(context, EcompErrorEnum.BeArtifactInformationInvalidError); + } + + public void logBeDistributionMissingError(String context, String distributionName) { + processEcompError(context, EcompErrorEnum.BeDistributionMissingError, "Distribution", distributionName); + } + + public void logBeGraphObjectMissingError(String context, String objectType, String objectName) { + processEcompError(context, EcompErrorEnum.BeGraphObjectMissingError, objectType, objectName); + } + + public void logBeInvalidJsonInput(String context) { + processEcompError(context, EcompErrorEnum.BeInvalidJsonInput); + } + + public void logBeInitializationError(String context) { + processEcompError(context, EcompErrorEnum.BeInitializationError); + } + + public void logBeFailedAddingResourceInstanceError(String context, String resourceName, String serviceId) { + processEcompError(context, EcompErrorEnum.BeFailedAddingResourceInstanceError, resourceName, serviceId); + } + + public void logBeUebSystemError(String context, String operation) { + processEcompError(context, EcompErrorEnum.BeUebSystemError, operation); + } + + public void logBeDistributionEngineSystemError(String context, String operation) { + processEcompError(context, EcompErrorEnum.BeDistributionEngineSystemError, operation); + } + + public void logBeFailedAddingNodeTypeError(String context, String nodeType) { + processEcompError(context, EcompErrorEnum.BeFailedAddingNodeTypeError, nodeType); + } + + public void logBeDaoSystemError(String context) { + processEcompError(context, EcompErrorEnum.BeDaoSystemError); + } + + public void logBeSystemError(String context) { + processEcompError(context, EcompErrorEnum.BeSystemError); + } + + public void logBeExecuteRollbackError(String context) { + processEcompError(context, EcompErrorEnum.BeExecuteRollbackError); + } + + public void logBeFailedLockObjectError(String context, String type, String id) { + processEcompError(context, EcompErrorEnum.BeFailedLockObjectError, type, id); + } + + public void logBeFailedCreateNodeError(String context, String nodeName, String status) { + processEcompError(context, EcompErrorEnum.BeFailedCreateNodeError, nodeName, status); + } + + public void logBeFailedUpdateNodeError(String context, String nodeName, String status) { + processEcompError(context, EcompErrorEnum.BeFailedUpdateNodeError, nodeName, status); + } + + public void logBeFailedDeleteNodeError(String context, String nodeName, String status) { + processEcompError(context, EcompErrorEnum.BeFailedDeleteNodeError, nodeName, status); + } + + public void logBeFailedRetrieveNodeError(String context, String nodeName, String status) { + processEcompError(context, EcompErrorEnum.BeFailedRetrieveNodeError, nodeName, status); + } + + public void logBeFailedFindParentError(String context, String node, String status) { + processEcompError(context, EcompErrorEnum.BeFailedFindParentError, node, status); + } + + public void logBeFailedFindAllNodesError(String context, String nodeType, String parentNode, String status) { + processEcompError(context, EcompErrorEnum.BeFailedFindAllNodesError, nodeType, parentNode, status); + } + + public void logBeFailedFindAssociationError(String context, String nodeType, String fromNode, String status) { + processEcompError(context, EcompErrorEnum.BeFailedFindAssociationError, nodeType, fromNode, status); + } + + public void logBeComponentCleanerSystemError(String context, String operation) { + processEcompError(context, EcompErrorEnum.BeComponentCleanerSystemError, operation); + } + + public void logBeRestApiGeneralError(String context) { + processEcompError(context, EcompErrorEnum.BeRestApiGeneralError); + } + + public void logFqdnResolveError(String context, String description) { + processEcompError(context, EcompErrorEnum.FqdnResolveError, description); + } + + public void logSiteSwitchoverInfo(String context, String description) { + processEcompError(context, EcompErrorEnum.SiteSwitchoverInfo, description); + } + + public void logInternalAuthenticationError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InternalAuthenticationError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InternalAuthenticationInfo, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InternalAuthenticationWarning, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InternalAuthenticationError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InternalAuthenticationFatal, description); + break; + + default: + break; + } + } + + } + + public void logInternalConnectionError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InternalConnectionError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InternalConnectionInfo, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InternalConnectionWarning, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InternalConnectionError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InternalConnectionFatal, description); + break; + + default: + break; + } + } + + } + + public void logInternalDataError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InternalDataError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InternalDataInfo, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InternalDataWarning, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InternalDataError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InternalDataFatal, description); + break; + + default: + break; + } + } + + } + + public void logInvalidInputError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InvalidInputError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InvalidInputWarning, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InvalidInputInfo, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InvalidInputError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InvalidInputFatal, description); + break; + + default: + break; + } + } + + } + + public void logInternalFlowError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InternalFlowError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InternalFlowInfo, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InternalFlowWarning, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InternalFlowError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InternalFlowFatal, description); + break; + + default: + break; + } + } + + } + + public void logInternalUnexpectedError(String context, String description, ErrorSeverity severity) { + + if (severity == null) { + processEcompError(context, EcompErrorEnum.InternalUnexpectedError, description); + } else { + switch (severity) { + case INFO: + processEcompError(context, EcompErrorEnum.InternalUnexpectedInfo, description); + break; + case WARNING: + processEcompError(context, EcompErrorEnum.InternalUnexpectedWarning, description); + break; + case ERROR: + processEcompError(context, EcompErrorEnum.InternalUnexpectedError, description); + break; + case FATAL: + processEcompError(context, EcompErrorEnum.InternalUnexpectedFatal, description); + break; + + default: + break; + } + } + + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/CadiFilterParams.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/CadiFilterParams.java new file mode 100644 index 0000000000..39793fb2cd --- /dev/null +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/CadiFilterParams.java @@ -0,0 +1,142 @@ +package org.openecomp.sdc.be.config; + +public class CadiFilterParams { + + private String hostname; + private String csp_domain; + private String cadi_keyfile; + private String cadi_loglevel; + private String cadi_truststore; + private String cadi_truststore_password; + + private String aaf_id; + private String aaf_password; + private String aaf_env; + private String aafLocateUrl; + private String aaf_url; + private String AFT_LATITUDE; + private String AFT_LONGITUDE; + private String AFT_ENVIRONMENT; + private String cadiX509Issuers; + + public String getHostname() { + return hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + public String getCsp_domain() { + return csp_domain; + } + + public void setCsp_domain(String csp_domain) { + this.csp_domain = csp_domain; + } + + public String getCadi_keyfile() { + return cadi_keyfile; + } + + public void setCadi_keyfile(String cadi_keyfile) { + this.cadi_keyfile = cadi_keyfile; + } + + public String getCadi_loglevel() { + return cadi_loglevel; + } + + public void setCadi_loglevel(String cadi_loglevel) { + this.cadi_loglevel = cadi_loglevel; + } + + public String getCadi_truststore() { + return cadi_truststore; + } + + public void setCadi_truststore(String cadi_truststore) { + this.cadi_truststore = cadi_truststore; + } + + public String getCadi_truststore_password() { + return cadi_truststore_password; + } + + public void setCadi_truststore_password(String cadi_truststore_password) { + this.cadi_truststore_password = cadi_truststore_password; + } + + public String getAaf_id() { + return aaf_id; + } + + public void setAaf_id(String aaf_id) { + this.aaf_id = aaf_id; + } + + public String getAaf_password() { + return aaf_password; + } + + public void setAaf_password(String aaf_password) { + this.aaf_password = aaf_password; + } + + public String getAaf_env() { + return aaf_env; + } + + public void setAaf_env(String aaf_env) { + this.aaf_env = aaf_env; + } + + public String getAafLocateUrl() { + return aafLocateUrl; + } + + public void setAafLocateUrl(String aafLocateUrl) { + this.aafLocateUrl = aafLocateUrl; + } + + public String getAaf_url() { + return aaf_url; + } + + public void setAaf_url(String aaf_url) { + this.aaf_url = aaf_url; + } + + public String getAFT_LATITUDE() { + return AFT_LATITUDE; + } + + public void setAFT_LATITUDE(String aFT_LATITUDE) { + AFT_LATITUDE = aFT_LATITUDE; + } + + public String getAFT_LONGITUDE() { + return AFT_LONGITUDE; + } + + public void setAFT_LONGITUDE(String aFT_LONGITUDE) { + AFT_LONGITUDE = aFT_LONGITUDE; + } + + public String getAFT_ENVIRONMENT() { + return AFT_ENVIRONMENT; + } + + public void setAFT_ENVIRONMENT(String aFT_ENVIRONMENT) { + AFT_ENVIRONMENT = aFT_ENVIRONMENT; + } + + public String getCadiX509Issuers() { + return cadiX509Issuers; + } + + public void setCadiX509Issuers(String cadiX509Issuers) { + this.cadiX509Issuers = cadiX509Issuers; + } + +} diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/CleanComponentsConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/CleanComponentsConfiguration.java index dd0c6d0235..6411005449 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/CleanComponentsConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/CleanComponentsConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,23 +24,23 @@ import java.util.List; public class CleanComponentsConfiguration { - private long cleanIntervalInMinutes; - private List<String> componentsToClean; + private long cleanIntervalInMinutes; + private List<String> componentsToClean; - public long getCleanIntervalInMinutes() { - return cleanIntervalInMinutes; - } + public long getCleanIntervalInMinutes() { + return cleanIntervalInMinutes; + } - public void setCleanIntervalInMinutes(long cleanIntervalInMinutes) { - this.cleanIntervalInMinutes = cleanIntervalInMinutes; - } + public void setCleanIntervalInMinutes(long cleanIntervalInMinutes) { + this.cleanIntervalInMinutes = cleanIntervalInMinutes; + } - public List<String> getComponentsToClean() { - return componentsToClean; - } + public List<String> getComponentsToClean() { + return componentsToClean; + } - public void setComponentsToClean(List<String> componentsToClean) { - this.componentsToClean = componentsToClean; - } + public void setComponentsToClean(List<String> componentsToClean) { + this.componentsToClean = componentsToClean; + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java index a51b42fb24..5d5afe0c98 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java @@ -68,7 +68,6 @@ public class Configuration extends BasicConfiguration { private List<String> protocols; private Map<String, String> users; private Map<String, Object> neo4j; - private ElasticSearchConfig elasticSearch; private String janusGraphCfgFile; private String janusGraphMigrationKeySpaceCfgFile; private Boolean janusGraphInMemoryGraph; @@ -77,7 +76,6 @@ public class Configuration extends BasicConfiguration { private Long janusGraphReconnectIntervalInSeconds; private List<String> healthStatusExclude; private Long janusGraphHealthCheckReadTimeout; - private Long esReconnectIntervalInSeconds; private Long uebHealthCheckReconnectIntervalInSeconds; private Long uebHealthCheckReadTimeout; private List<Map<String, Map<String, String>>> defaultImports; @@ -100,14 +98,12 @@ public class Configuration extends BasicConfiguration { private Map<String, ArtifactTypeConfig> resourceInformationalDeployedArtifacts; private Map<String, Object> serviceApiArtifacts; private List<String> excludeServiceCategory; - private Map<String, Set<String>> requirementsToFulfillBeforeCert; - private Map<String, Set<String>> capabilitiesToConsumeBeforeCert; private List<String> artifactTypes; private List<String> licenseTypes; private Integer additionalInformationMaxNumberOfKeys; - private Integer defaultHeatArtifactTimeoutMinutes; + private HeatDeploymentArtifactTimeout heatArtifactDeploymentTimeout; private BeMonitoringConfig systemMonitoring; private CleanComponentsConfiguration cleanComponentsConfiguration; @@ -136,25 +132,26 @@ public class Configuration extends BasicConfiguration { private boolean disableAudit; + private Boolean consumerBusinessLogic; + private Map<String, VfModuleProperty> vfModuleProperties; private Map<String, String> genericAssetNodeTypes; private String appVersion; + private String artifactGeneratorConfig; - public String getAutoHealingOwner() { - return autoHealingOwner; - } + private CadiFilterParams cadiFilterParams; - public void setAutoHealingOwner(String autoHealingOwner) { - this.autoHealingOwner = autoHealingOwner; - } + private Boolean aafAuthNeeded; private String autoHealingOwner; private boolean enableAutoHealing; private Map<String, List<String>> resourcesForUpgrade; private DmaapConsumerConfiguration dmaapConsumerConfiguration; + private DmaapProducerConfiguration dmaapProducerConfiguration; + private boolean skipUpgradeFailedVfs; private boolean skipUpgradeVSPs; private DmeConfiguration dmeConfiguration; @@ -162,6 +159,22 @@ public class Configuration extends BasicConfiguration { private boolean supportAllottedResourcesAndProxy; private Integer deleteLockTimeoutInSeconds; private Integer maxDeleteComponents; + private CookieConfig authCookie; + + + private String aafNamespace; + private String workloadContext; + + private EnvironmentContext environmentContext; + + + public String getAutoHealingOwner() { + return autoHealingOwner; + } + + public void setAutoHealingOwner(String autoHealingOwner) { + this.autoHealingOwner = autoHealingOwner; + } public Integer getMaxDeleteComponents() { return maxDeleteComponents; @@ -202,14 +215,9 @@ public class Configuration extends BasicConfiguration { public void setDmeConfiguration(DmeConfiguration dmeConfiguration) { this.dmeConfiguration = dmeConfiguration; } + public void setSkipUpgradeVSPs(boolean skipUpgradeVSPs) { this.skipUpgradeVSPs = skipUpgradeVSPs; } - public void setSkipUpgradeVSPs(boolean skipUpgradeVSPs) { - this.skipUpgradeVSPs = skipUpgradeVSPs; - } - - public boolean getSkipUpgradeVSPsFlag() { - return skipUpgradeVSPs; - } + public boolean getSkipUpgradeVSPsFlag() { return skipUpgradeVSPs; } public boolean getSkipUpgradeFailedVfs() { return skipUpgradeFailedVfs; @@ -235,9 +243,13 @@ public class Configuration extends BasicConfiguration { this.appVersion = appVersion; } - private String workloadContext; + public String getArtifactGeneratorConfig() { + return artifactGeneratorConfig; + } - private EnvironmentContext environmentContext; + public void setArtifactGeneratorConfig(String artifactGeneratorConfig) { + this.artifactGeneratorConfig = artifactGeneratorConfig; + } private List<GabConfig> gabConfig; @@ -371,14 +383,6 @@ public class Configuration extends BasicConfiguration { this.neo4j = neo4j; } - public ElasticSearchConfig getElasticSearch() { - return elasticSearch; - } - - public void setElasticSearch(ElasticSearchConfig elasticSearch) { - this.elasticSearch = elasticSearch; - } - public String getJanusGraphCfgFile() { return janusGraphCfgFile; } @@ -443,18 +447,6 @@ public class Configuration extends BasicConfiguration { this.janusGraphReconnectIntervalInSeconds = janusGraphReconnectIntervalInSeconds; } - public Long getEsReconnectIntervalInSeconds() { - return esReconnectIntervalInSeconds; - } - - public Long getEsReconnectIntervalInSeconds(long defaultVal) { - return esReconnectIntervalInSeconds == null ? defaultVal : esReconnectIntervalInSeconds; - } - - public void setEsReconnectIntervalInSeconds(Long esReconnectIntervalInSeconds) { - this.esReconnectIntervalInSeconds = esReconnectIntervalInSeconds; - } - public List<String> getArtifactTypes() { return artifactTypes; } @@ -576,20 +568,20 @@ public class Configuration extends BasicConfiguration { this.additionalInformationMaxNumberOfKeys = additionalInformationMaxNumberOfKeys; } - public BeMonitoringConfig getSystemMonitoring() { - return systemMonitoring; + public HeatDeploymentArtifactTimeout getHeatArtifactDeploymentTimeout() { + return heatArtifactDeploymentTimeout; } - public void setSystemMonitoring(BeMonitoringConfig systemMonitoring) { - this.systemMonitoring = systemMonitoring; + public void setHeatArtifactDeploymentTimeout(HeatDeploymentArtifactTimeout heatArtifactDeploymentTimeout) { + this.heatArtifactDeploymentTimeout = heatArtifactDeploymentTimeout; } - public Integer getDefaultHeatArtifactTimeoutMinutes() { - return defaultHeatArtifactTimeoutMinutes; + public BeMonitoringConfig getSystemMonitoring() { + return systemMonitoring; } - public void setDefaultHeatArtifactTimeoutMinutes(Integer defaultHeatArtifactTimeoutMinutes) { - this.defaultHeatArtifactTimeoutMinutes = defaultHeatArtifactTimeoutMinutes; + public void setSystemMonitoring(BeMonitoringConfig systemMonitoring) { + this.systemMonitoring = systemMonitoring; } public Long getUebHealthCheckReconnectIntervalInSeconds() { @@ -632,66 +624,128 @@ public class Configuration extends BasicConfiguration { this.gabConfig = gabConfig; } - public static class ElasticSearchConfig { - private List<IndicesTimeFrequencyEntry> indicesTimeFrequency; + public static class CookieConfig { + String securityKey = ""; + long maxSessionTimeOut = 600*1000; + long sessionIdleTimeOut = 30*1000; + String cookieName = "AuthenticationCookie"; + String redirectURL = "https://www.e-access.att.com/ecomp_portal_ist/ecompportal/process_csp"; + List<String> excludedUrls; + List<String> onboardingExcludedUrls; + String domain = ""; + String path = ""; + boolean isHttpOnly = true; + + public String getSecurityKey() { + return securityKey; + } + + public void setSecurityKey(String securityKey) { + this.securityKey = securityKey; + } - public List<IndicesTimeFrequencyEntry> getIndicesTimeFrequency() { - return indicesTimeFrequency; + public long getMaxSessionTimeOut() { + return maxSessionTimeOut; } - public void setIndicesTimeFrequency(List<IndicesTimeFrequencyEntry> indicesTimeFrequency) { - this.indicesTimeFrequency = indicesTimeFrequency; + public void setMaxSessionTimeOut(long maxSessionTimeOut) { + this.maxSessionTimeOut = maxSessionTimeOut; } - public static class IndicesTimeFrequencyEntry { + public long getSessionIdleTimeOut() { + return sessionIdleTimeOut; + } - private String indexPrefix; - private String creationPeriod; + public void setSessionIdleTimeOut(long sessionIdleTimeOut) { + this.sessionIdleTimeOut = sessionIdleTimeOut; + } - public String getIndexPrefix() { - return indexPrefix; - } + public String getCookieName() { + return cookieName; + } - public void setIndexPrefix(String indexPrefix) { - this.indexPrefix = indexPrefix; - } + public void setCookieName(String cookieName) { + this.cookieName = cookieName; + } - public String getCreationPeriod() { - return creationPeriod; - } + public String getRedirectURL() { + return redirectURL; + } - public void setCreationPeriod(String creationPeriod) { - this.creationPeriod = creationPeriod; - } + public void setRedirectURL(String redirectURL) { + this.redirectURL = redirectURL; } - } - public static class CassandrConfig { - private static final Integer CASSANDRA_DEFAULT_PORT = 9042; + public List<String> getExcludedUrls() { + return excludedUrls; + } + + public void setExcludedUrls(List<String> excludedUrls) { + this.excludedUrls = excludedUrls; + } + + public String getDomain() { + return domain; + } - private List<String> cassandraHosts; - private Integer cassandraPort; - private String localDataCenter; - private Long reconnectTimeout; - private Integer socketReadTimeout; - private Integer socketConnectTimeout; - private List<KeyspaceConfig> keySpaces; - private boolean authenticate; - private String username; - private String password; - private boolean ssl; - private String truststorePath; - private String truststorePassword; + public void setDomain(String domain) { + this.domain = domain; + } - public Integer getCassandraPort() { - return cassandraPort != null ? cassandraPort : Configuration.CassandrConfig.CASSANDRA_DEFAULT_PORT; + public String getPath() { + return path; } - public void setCassandraPort(Integer cassandraPort) { - this.cassandraPort = cassandraPort; + public void setPath(String path) { + this.path = path; } + public boolean isHttpOnly() { + return isHttpOnly; + } + + public void setIsHttpOnly(boolean isHttpOnly) { + this.isHttpOnly = isHttpOnly; + } + + public List<String> getOnboardingExcludedUrls() { + return onboardingExcludedUrls; + } + + public void setOnboardingExcludedUrls(List<String> onboardingExcludedUrls) { + this.onboardingExcludedUrls = onboardingExcludedUrls; + } + } + + public CookieConfig getAuthCookie() { + return authCookie; + } + + public void setAuthCookie(CookieConfig authCookie) { + this.authCookie = authCookie; + } + + public static class CassandrConfig { + private static final Integer CASSANDRA_DEFAULT_PORT = 9042; + List<String> cassandraHosts; + Integer cassandraPort; + String localDataCenter; + Long reconnectTimeout; + Integer socketReadTimeout; + Integer socketConnectTimeout; + List<KeyspaceConfig> keySpaces; + boolean authenticate; + String username; + String password; + boolean ssl; + String truststorePath; + String truststorePassword; + + public Integer getCassandraPort() { return cassandraPort != null ? cassandraPort : Configuration.CassandrConfig.CASSANDRA_DEFAULT_PORT; } + + public void setCassandraPort(Integer cassandraPort) { this.cassandraPort = cassandraPort; } + public String getLocalDataCenter() { return localDataCenter; } @@ -756,21 +810,13 @@ public class Configuration extends BasicConfiguration { this.reconnectTimeout = reconnectTimeout; } - public Integer getSocketReadTimeout() { - return socketReadTimeout; - } + public Integer getSocketReadTimeout() { return socketReadTimeout; } - public void setSocketReadTimeout(Integer socketReadTimeout) { - this.socketReadTimeout = socketReadTimeout; - } + public void setSocketReadTimeout(Integer socketReadTimeout) { this.socketReadTimeout = socketReadTimeout;} - public Integer getSocketConnectTimeout() { - return socketConnectTimeout; - } + public Integer getSocketConnectTimeout() { return socketConnectTimeout;} - public void setSocketConnectTimeout(Integer socketConnectTimeout) { - this.socketConnectTimeout = socketConnectTimeout; - } + public void setSocketConnectTimeout(Integer socketConnectTimeout) { this.socketConnectTimeout = socketConnectTimeout; } public List<String> getCassandraHosts() { return cassandraHosts; @@ -790,9 +836,9 @@ public class Configuration extends BasicConfiguration { public static class KeyspaceConfig { - private String name; - private String replicationStrategy; - private List<String> replicationInfo; + String name; + String replicationStrategy; + List<String> replicationInfo; public String getName() { return name; @@ -822,19 +868,19 @@ public class Configuration extends BasicConfiguration { public static class SwitchoverDetectorConfig { - private String gBeFqdn; - private String gFeFqdn; - private String beVip; - private String feVip; - private int beResolveAttempts; - private int feResolveAttempts; - private Boolean enabled; - private long interval; - private String changePriorityUser; - private String changePriorityPassword; - private String publishNetworkUrl; - private String publishNetworkBody; - private Map<String, GroupInfo> groups; + String gBeFqdn; + String gFeFqdn; + String beVip; + String feVip; + int beResolveAttempts; + int feResolveAttempts; + Boolean enabled; + long interval; + String changePriorityUser; + String changePriorityPassword; + String publishNetworkUrl; + String publishNetworkBody; + Map<String, GroupInfo> groups; public String getgBeFqdn() { return gBeFqdn; @@ -942,8 +988,8 @@ public class Configuration extends BasicConfiguration { public static class GroupInfo { - private String changePriorityUrl; - private String changePriorityBody; + String changePriorityUrl; + String changePriorityBody; public String getChangePriorityUrl() { return changePriorityUrl; @@ -964,11 +1010,46 @@ public class Configuration extends BasicConfiguration { } + public static class HeatDeploymentArtifactTimeout { + Integer defaultMinutes; + Integer minMinutes; + Integer maxMinutes; + + public Integer getDefaultMinutes() { + return defaultMinutes; + } + + public void setDefaultMinutes(Integer defaultMinutes) { + this.defaultMinutes = defaultMinutes; + } + + public Integer getMinMinutes() { + return minMinutes; + } + + public void setMinMinutes(Integer minMinutes) { + this.minMinutes = minMinutes; + } + + public Integer getMaxMinutes() { + return maxMinutes; + } + + public void setMaxMinutes(Integer maxMinutes) { + this.maxMinutes = maxMinutes; + } + + @Override + public String toString() { + return "HeatDeploymentArtifactTimeout config [default=" + defaultMinutes + ", min=" + minMinutes + ", max=" + maxMinutes + "]"; + } + } + public static class BeMonitoringConfig { - private Boolean enabled; - private Boolean isProxy; - private Integer probeIntervalInSeconds; + Boolean enabled; + Boolean isProxy; + Integer probeIntervalInSeconds; public Boolean getEnabled() { return enabled; @@ -1001,8 +1082,8 @@ public class Configuration extends BasicConfiguration { public static class ArtifactTypeConfig { - private List<String> acceptedTypes; - private List<String> validForResourceTypes; + List<String> acceptedTypes; + List<String> validForResourceTypes; public List<String> getValidForResourceTypes() { return validForResourceTypes; @@ -1023,11 +1104,11 @@ public class Configuration extends BasicConfiguration { public static class OnboardingConfig { - private String protocol = "http"; - private String host; - private Integer port; - private String downloadCsarUri; - private String healthCheckUri; + String protocol = "http"; + String host; + Integer port; + String downloadCsarUri; + String healthCheckUri; public String getProtocol() { return protocol; @@ -1087,10 +1168,10 @@ public class Configuration extends BasicConfiguration { public static class DcaeConfig { - private String protocol = "http"; - private String host; - private Integer port; - private String healthCheckUri; + String protocol = "http"; + String host; + Integer port; + String healthCheckUri; public String getProtocol() { return protocol; @@ -1126,9 +1207,55 @@ public class Configuration extends BasicConfiguration { } public static class EcompPortalConfig { - + private String protocol = "https"; + private String host; + private Integer port; + private String healthCheckUri; private String defaultFunctionalMenu; + public void setPollingInterval(Integer pollingInterval) { + this.pollingInterval = pollingInterval; + } + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + private Integer pollingInterval; + private Integer timeoutMs; + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public String getHealthCheckUri() { + return healthCheckUri; + } + + public void setHealthCheckUri(String healthCheckUri) { + this.healthCheckUri = healthCheckUri; + } + public String getDefaultFunctionalMenu() { return defaultFunctionalMenu; } @@ -1137,6 +1264,14 @@ public class Configuration extends BasicConfiguration { this.defaultFunctionalMenu = defaultFunctionalMenu; } + public Integer getPollingInterval() { + return pollingInterval; + } + + public Integer getTimeoutMs() { + return timeoutMs; + } + @Override public String toString() { return "EcompPortalConfig [defaultFunctionalMenu=" + defaultFunctionalMenu + "]"; @@ -1146,7 +1281,7 @@ public class Configuration extends BasicConfiguration { public static class ApplicationL1CacheConfig { - private ApplicationL1CacheInfo datatypes; + ApplicationL1CacheInfo datatypes; public ApplicationL1CacheInfo getDatatypes() { return datatypes; @@ -1165,10 +1300,10 @@ public class Configuration extends BasicConfiguration { public static class ApplicationL2CacheConfig { - private boolean enabled; - private ApplicationL1CacheCatalogInfo catalogL1Cache; + boolean enabled; + ApplicationL1CacheCatalogInfo catalogL1Cache; - private QueueInfo queue; + QueueInfo queue; public boolean isEnabled() { return enabled; @@ -1222,9 +1357,9 @@ public class Configuration extends BasicConfiguration { public static class ApplicationL1CacheInfo { - private Boolean enabled; - private Integer firstRunDelay; - private Integer pollIntervalInSec; + Boolean enabled; + Integer firstRunDelay; + Integer pollIntervalInSec; public Boolean getEnabled() { return enabled; @@ -1259,10 +1394,10 @@ public class Configuration extends BasicConfiguration { public static class ApplicationL1CacheCatalogInfo { - private Boolean enabled; - private Integer resourcesSizeInCache; - private Integer servicesSizeInCache; - private Integer productsSizeInCache; + Boolean enabled; + Integer resourcesSizeInCache; + Integer servicesSizeInCache; + Integer productsSizeInCache; public Boolean getEnabled() { return enabled; @@ -1306,9 +1441,9 @@ public class Configuration extends BasicConfiguration { } public static class QueueInfo { - private Integer numberOfCacheWorkers; - private Integer waitOnShutDownInMinutes; - private Integer syncIntervalInSecondes; + Integer numberOfCacheWorkers; + Integer waitOnShutDownInMinutes; + Integer syncIntervalInSecondes; public Integer getWaitOnShutDownInMinutes() { return waitOnShutDownInMinutes; @@ -1343,8 +1478,8 @@ public class Configuration extends BasicConfiguration { public static class EnvironmentContext { - private String defaultValue; - private List<String> validValues; + String defaultValue; + List<String> validValues; public String getDefaultValue() { return defaultValue; @@ -1380,12 +1515,10 @@ public class Configuration extends BasicConfiguration { .append(format("backend protocol: %s%n", beProtocol)).append(format("Version: %s%n", version)) .append(format("Released: %s%n", released)).append(format("Supported protocols: %s%n", protocols)) .append(format("Users: %s%n", users)).append(format("Neo4j: %s%n", neo4j)) - .append(format("ElasticSearch: %s%n", elasticSearch)) .append(format("JanusGraph Cfg File: %s%n", janusGraphCfgFile)) .append(format("JanusGraph In memory: %s%n", janusGraphInMemoryGraph)) .append(format("JanusGraph lock timeout: %s%n", janusGraphLockTimeout)) - .append(format("JanusGraph reconnect interval seconds: %s%n", - janusGraphReconnectIntervalInSeconds)) + .append(format("JanusGraph reconnect interval seconds: %s%n", janusGraphReconnectIntervalInSeconds)) .append(format("excludeResourceCategory: %s%n", excludeResourceCategory)) .append(format("informationalResourceArtifacts: %s%n", informationalResourceArtifacts)) .append(format("deploymentResourceArtifacts: %s%n", deploymentResourceArtifacts)) @@ -1394,14 +1527,12 @@ public class Configuration extends BasicConfiguration { .append(format("Supported license types: %s%n", licenseTypes)) .append(format("Additional information Maximum number of preoperties: %s%n", additionalInformationMaxNumberOfKeys)) - .append(format("Default Heat Artifact Timeout in Minutes: %s%n", defaultHeatArtifactTimeoutMinutes)) + .append(format("Heat Artifact Timeout in Minutes: %s%n", heatArtifactDeploymentTimeout)) .append(format("URLs For HTTP Requests that will not be automatically logged : %s%n", unLoggedUrls)) .append(format("Service Api Artifacts: %s%n", serviceApiArtifacts)) .append(format("heat env artifact header: %s%n", heatEnvArtifactHeader)) .append(format("heat env artifact footer: %s%n", heatEnvArtifactFooter)) - .append(format("onboarding: %s%n", onboarding)) - .append(format("tosca conformance level: %s%n", toscaConformanceLevel)) - .toString(); + .append(format("onboarding: %s%n", onboarding)).toString(); } public List<String> getUnLoggedUrls() { @@ -1485,22 +1616,6 @@ public class Configuration extends BasicConfiguration { this.heatTranslatorPath = heatTranslatorPath; } - public Map<String, Set<String>> getRequirementsToFulfillBeforeCert() { - return requirementsToFulfillBeforeCert; - } - - public void setRequirementsToFulfillBeforeCert(Map<String, Set<String>> requirementsToFulfillBeforeCert) { - this.requirementsToFulfillBeforeCert = requirementsToFulfillBeforeCert; - } - - public Map<String, Set<String>> getCapabilitiesToConsumeBeforeCert() { - return capabilitiesToConsumeBeforeCert; - } - - public void setCapabilitiesToConsumeBeforeCert(Map<String, Set<String>> capabilitiesToConsumeBeforeCert) { - this.capabilitiesToConsumeBeforeCert = capabilitiesToConsumeBeforeCert; - } - public OnboardingConfig getOnboarding() { return onboarding; } @@ -1529,6 +1644,14 @@ public class Configuration extends BasicConfiguration { return disableAudit; } + public Boolean getConsumerBusinessLogic() { + return consumerBusinessLogic; + } + + public void setConsumerBusinessLogic(Boolean consumerBusinessLogic) { + this.consumerBusinessLogic = consumerBusinessLogic; + } + public void setDisableAudit(boolean enableAudit) { this.disableAudit = enableAudit; } @@ -1568,19 +1691,15 @@ public class Configuration extends BasicConfiguration { public static class VfModuleProperty { private String forBaseModule; private String forNonBaseModule; - public String getForBaseModule() { return forBaseModule; } - public void setForBaseModule(String forBaseModule) { this.forBaseModule = forBaseModule; } - public String getForNonBaseModule() { return forNonBaseModule; } - public void setForNonBaseModule(String forNonBaseModule) { this.forNonBaseModule = forNonBaseModule; } @@ -1603,7 +1722,7 @@ public class Configuration extends BasicConfiguration { } @SuppressWarnings("unchecked") - public static <K, V> Map<K, V> safeGetCapsInsensitiveMap(Map<K, V> map) { + public static <K,V> Map<K,V> safeGetCapsInsensitiveMap(Map<K,V> map) { return map == null ? emptyMap() : new CaseInsensitiveMap(map); } @@ -1616,6 +1735,38 @@ public class Configuration extends BasicConfiguration { this.healthStatusExclude = healthStatusExclude; } + public DmaapProducerConfiguration getDmaapProducerConfiguration() { + return dmaapProducerConfiguration; + } + + public void setDmaapProducerConfiguration(DmaapProducerConfiguration dmaapProducerConfiguration) { + this.dmaapProducerConfiguration = dmaapProducerConfiguration; + } + + public String getAafNamespace() { + return aafNamespace; + } + + public void setAafNamespace(String aafNamespace) { + this.aafNamespace = aafNamespace; + } + + public Boolean getAafAuthNeeded(){ + return aafAuthNeeded; + } + + public void setAafAuthNeeded(Boolean aafAuthNeeded){ + this.aafAuthNeeded = aafAuthNeeded; + } + + public CadiFilterParams getCadiFilterParams() { + return cadiFilterParams; + } + + public void setCadiFilterParams(CadiFilterParams cadiFilterParams) { + this.cadiFilterParams = cadiFilterParams; + } + public static class PathsAndNamesDefinition { private String friendlyName; @@ -1667,4 +1818,5 @@ public class Configuration extends BasicConfiguration { this.pathsAndNamesDefinitions = pathsAndNamesDefinitions; } } + } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ConfigurationManager.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ConfigurationManager.java index 9920b597a1..0e9fd24111 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ConfigurationManager.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ConfigurationManager.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,121 +33,113 @@ import java.util.Map; public class ConfigurationManager implements FileChangeCallback, IEcompConfigurationManager { + + ConfigurationSource configurationSource = null; + private static ConfigurationManager instance; + @VisibleForTesting public ConfigurationManager() { super(); instance = this; } - private ConfigurationSource configurationSource = null; - private static ConfigurationManager instance; - - public Map<String, Object> getConfigurations() { - return configurations; - } - - public void setConfigurations(Map<String, Object> configurations) { - this.configurations = configurations; - } - - private Map<String, Object> configurations = new HashMap<>(); - - public ConfigurationManager(ConfigurationSource configurationSource) { - super(); - this.configurationSource = configurationSource; - loadConfigurationFiles(); - instance = this; - } + Map<String, Object> configurations = new HashMap<>(); + public ConfigurationManager(ConfigurationSource configurationSource) { + super(); + this.configurationSource = configurationSource; + loadConfigurationFiles(); + instance = this; + } - private void loadConfigurationFiles() { + private void loadConfigurationFiles() { - loadConfigurationClass(Configuration.class); - loadConfigurationClass(ErrorConfiguration.class); - loadConfigurationClass(Neo4jErrorsConfiguration.class); - loadConfigurationClass(EcompErrorConfiguration.class); - loadConfigurationClass(DistributionEngineConfiguration.class); - } + loadConfigurationClass(Configuration.class); + loadConfigurationClass(ErrorConfiguration.class); + loadConfigurationClass(Neo4jErrorsConfiguration.class); + loadConfigurationClass(EcompErrorConfiguration.class); + loadConfigurationClass(DistributionEngineConfiguration.class); + } - private <T extends BasicConfiguration> void loadConfigurationClass(Class<T> clazz) { - ConfigurationListener configurationListener = new ConfigurationListener(clazz, this); + private <T extends BasicConfiguration> void loadConfigurationClass(Class<T> clazz) { + ConfigurationListener configurationListener = new ConfigurationListener(clazz, this); - T object = configurationSource.getAndWatchConfiguration(clazz, configurationListener); + T object = configurationSource.getAndWatchConfiguration(clazz, configurationListener); - configurations.put(getKey(clazz), object); - } + configurations.put(getKey(clazz), object); + } - private <T> String getKey(Class<T> class1) { + private <T> String getKey(Class<T> class1) { - return class1.getSimpleName(); + return class1.getSimpleName(); - } + } - public Configuration getConfiguration() { + public Configuration getConfiguration() { - return (Configuration) configurations.get(getKey(Configuration.class)); + return (Configuration) configurations.get(getKey(Configuration.class)); - } + } - public void setConfiguration(Configuration configuration) { + public void setConfiguration(Configuration configuration) { - configurations.put(getKey(Configuration.class), configuration); + configurations.put(getKey(Configuration.class), configuration); - } + } - public void setErrorConfiguration(ErrorConfiguration configuration) { + public void setErrorConfiguration(ErrorConfiguration configuration) { - configurations.put(getKey(ErrorConfiguration.class), configuration); + configurations.put(getKey(ErrorConfiguration.class), configuration); - } + } - public ErrorConfiguration getErrorConfiguration() { + public ErrorConfiguration getErrorConfiguration() { - return (ErrorConfiguration) configurations.get(getKey(ErrorConfiguration.class)); + return (ErrorConfiguration) configurations.get(getKey(ErrorConfiguration.class)); - } + } - public Neo4jErrorsConfiguration getNeo4jErrorsConfiguration() { - return (Neo4jErrorsConfiguration) configurations.get(getKey(Neo4jErrorsConfiguration.class)); - } + public Neo4jErrorsConfiguration getNeo4jErrorsConfiguration() { + return (Neo4jErrorsConfiguration) configurations.get(getKey(Neo4jErrorsConfiguration.class)); + } - @Override - public EcompErrorConfiguration getEcompErrorConfiguration() { + @Override + public EcompErrorConfiguration getEcompErrorConfiguration() { - return (EcompErrorConfiguration) configurations.get(getKey(EcompErrorConfiguration.class)); + return (EcompErrorConfiguration) configurations.get(getKey(EcompErrorConfiguration.class)); - } + } - public Configuration getConfigurationAndWatch(ConfigurationListener configurationListener) { + public Configuration getConfigurationAndWatch(ConfigurationListener configurationListener) { - if (configurationListener != null) { + if (configurationListener != null) { - configurationSource.addWatchConfiguration(Configuration.class, configurationListener); + configurationSource.addWatchConfiguration(Configuration.class, configurationListener); - } - return (Configuration) configurations.get(getKey(Configuration.class)); + } + return (Configuration) configurations.get(getKey(Configuration.class)); - } + } - public static ConfigurationManager getConfigurationManager() { - return instance; - } + public static ConfigurationManager getConfigurationManager() { + return instance; + } public void reconfigure(BasicConfiguration obj) { } - /** - * FOR TEST ONLY - * - * @param ecompErrorConfiguration - */ - public void setEcompErrorConfiguration(EcompErrorConfiguration ecompErrorConfiguration) { + /** + * FOR TEST ONLY + * + * @param ecompErrorConfiguration + */ + public void setEcompErrorConfiguration(EcompErrorConfiguration ecompErrorConfiguration) { - configurations.put(getKey(EcompErrorConfiguration.class), ecompErrorConfiguration); + configurations.put(getKey(EcompErrorConfiguration.class), ecompErrorConfiguration); - } + } - public DistributionEngineConfiguration getDistributionEngineConfiguration() { + public DistributionEngineConfiguration getDistributionEngineConfiguration() { - return (DistributionEngineConfiguration) configurations.get(getKey(DistributionEngineConfiguration.class)); + return (DistributionEngineConfiguration) configurations.get(getKey(DistributionEngineConfiguration.class)); - } + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DistributionEngineConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DistributionEngineConfiguration.java index b7b0e64189..b23e076334 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DistributionEngineConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DistributionEngineConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,461 +23,449 @@ package org.openecomp.sdc.be.config; import org.openecomp.sdc.common.api.BasicConfiguration; import org.openecomp.sdc.common.http.config.ExternalServiceConfig; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; public class DistributionEngineConfiguration extends BasicConfiguration { - private List<String> uebServers; + private List<String> uebServers; - private String distributionNotifTopicName; + private String distributionNotifTopicName; - private String distributionStatusTopicName; + private String distributionStatusTopicName; - private Integer initRetryIntervalSec; + private Integer initRetryIntervalSec; - private Integer initMaxIntervalSec; + private Integer initMaxIntervalSec; - private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes; + private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes; - private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes; + private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes; - private String uebPublicKey; + private String uebPublicKey; - private String uebSecretKey; + private String uebSecretKey; - private List<String> environments; + private List<String> environments; - private DistributionStatusTopicConfig distributionStatusTopic; + private DistributionStatusTopicConfig distributionStatusTopic; - private CreateTopicConfig createTopic; + private CreateTopicConfig createTopic; - private boolean startDistributionEngine; + private boolean startDistributionEngine; - private DistributionNotificationTopicConfig distributionNotificationTopic; + private DistributionNotificationTopicConfig distributionNotificationTopic; - private Integer defaultArtifactInstallationTimeout = 60; + private Integer defaultArtifactInstallationTimeout = 60; + + private Integer currentArtifactInstallationTimeout = 120; + private boolean useHttpsWithDmaap; - private Integer currentArtifactInstallationTimeout = 120; + private ExternalServiceConfig aaiConfig; - private boolean useHttpsWithDmaap; + private ExternalServiceConfig msoConfig; + + private Integer opEnvRecoveryIntervalSec; + + private Integer allowedTimeBeforeStaleSec; + + public static class DistribNotifServiceArtifacts { - private ExternalServiceConfig aaiConfig; + Map<String, Object> service; + Map<String, Object> resource; + + - private ExternalServiceConfig msoConfig; + public Map<String, Object> getService() { + return service; + } - private Integer opEnvRecoveryIntervalSec; + public void setService(Map<String, Object> service) { + this.service = service; + } - private Integer allowedTimeBeforeStaleSec; + public Map<String, Object> getResource() { + return resource; + } - public static class DistribNotifServiceArtifacts { + public void setResource(Map<String, Object> resource) { + this.resource = resource; + } - private Map<String, Object> service; - private Map<String, Object> resource; + } + public static class NotifArtifactTypes { - public Map<String, Object> getService() { - return service; - } + List<String> info; + List<String> lifecycle; - public void setService(Map<String, Object> service) { - this.service = service; - } + public List<String> getInfo() { + return info; + } - public Map<String, Object> getResource() { - return resource; - } + public void setInfo(List<String> info) { + this.info = info; + } - public void setResource(Map<String, Object> resource) { - this.resource = resource; - } + public List<String> getLifecycle() { + return lifecycle; + } - } - - public static class NotifArtifactTypes { - - private List<String> info; - private List<String> lifecycle; - - public List<String> getInfo() { - return info; - } - - public void setInfo(List<String> info) { - this.info = info; - } - - public List<String> getLifecycle() { - return lifecycle; - } - - public void setLifecycle(List<String> lifecycle) { - this.lifecycle = lifecycle; - } + public void setLifecycle(List<String> lifecycle) { + this.lifecycle = lifecycle; + } - } - - public static class NotifArtifactTypesResource { + } - private List<ArtifcatTypeEnum> lifecycle; + public static class NotifArtifactTypesResource { - public List<ArtifcatTypeEnum> getLifecycle() { - return lifecycle; - } - - public void setLifecycle(List<ArtifcatTypeEnum> lifecycle) { - this.lifecycle = lifecycle; - } - } + List<ArtifcatTypeEnum> lifecycle; - public enum ArtifcatTypeEnum { + } - MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML"); + public enum ArtifcatTypeEnum { - private String value; + MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML"); - ArtifcatTypeEnum(String value) { - this.value = value; - } + String value; - public String getValue() { + private ArtifcatTypeEnum(String value) { + this.value = value; + } - return value; - } - } - - public List<String> getUebServers() { - return uebServers; - } + public String getValue() { - public void setUebServers(List<String> uebServers) { - this.uebServers = uebServers; - } + return value; + } + } - public String getDistributionNotifTopicName() { - return distributionNotifTopicName; - } + public List<String> getUebServers() { + return uebServers; + } - public void setDistributionNotifTopicName(String distributionNotifTopicName) { - this.distributionNotifTopicName = distributionNotifTopicName; - } + public void setUebServers(List<String> uebServers) { + this.uebServers = uebServers; + } - public String getDistributionStatusTopicName() { - return distributionStatusTopicName; - } + public String getDistributionNotifTopicName() { + return distributionNotifTopicName; + } - public void setDistributionStatusTopicName(String distributionStatusTopicName) { - this.distributionStatusTopicName = distributionStatusTopicName; - } + public void setDistributionNotifTopicName(String distributionNotifTopicName) { + this.distributionNotifTopicName = distributionNotifTopicName; + } - public Integer getInitRetryIntervalSec() { - return initRetryIntervalSec; - } + public String getDistributionStatusTopicName() { + return distributionStatusTopicName; + } - public void setInitRetryIntervalSec(Integer initRetryIntervalSec) { - this.initRetryIntervalSec = initRetryIntervalSec; - } + public void setDistributionStatusTopicName(String distributionStatusTopicName) { + this.distributionStatusTopicName = distributionStatusTopicName; + } - public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() { - return distribNotifServiceArtifactTypes; - } + public Integer getInitRetryIntervalSec() { + return initRetryIntervalSec; + } - public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) { - this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes; - } + public void setInitRetryIntervalSec(Integer initRetryIntervalSec) { + this.initRetryIntervalSec = initRetryIntervalSec; + } - public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() { - return distribNotifResourceArtifactTypes; - } + public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() { + return distribNotifServiceArtifactTypes; + } - public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) { - this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes; - } + public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) { + this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes; + } - public String getUebPublicKey() { - return uebPublicKey; - } + public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() { + return distribNotifResourceArtifactTypes; + } - public void setUebPublicKey(String uebPublicKey) { - this.uebPublicKey = uebPublicKey; - } + public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) { + this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes; + } - public String getUebSecretKey() { - return uebSecretKey; - } + public String getUebPublicKey() { + return uebPublicKey; + } - public void setUebSecretKey(String uebSecretKey) { - this.uebSecretKey = uebSecretKey; - } + public void setUebPublicKey(String uebPublicKey) { + this.uebPublicKey = uebPublicKey; + } - public List<String> getEnvironments() { - return environments; - } + public String getUebSecretKey() { + return uebSecretKey; + } - public void setEnvironments(List<String> environments) { + public void setUebSecretKey(String uebSecretKey) { + this.uebSecretKey = uebSecretKey; + } - Set<String> set = new HashSet<>(); - if (environments != null) { - set.addAll(environments); - this.environments = new ArrayList<>(set); - } else { - this.environments = null; - } + public List<String> getEnvironments() { + return environments; + } - } + public void setEnvironments(List<String> environments) { - public DistributionStatusTopicConfig getDistributionStatusTopic() { - return distributionStatusTopic; - } + Set<String> set = new HashSet<>(); + if (environments != null) { + set.addAll(environments); + this.environments = new ArrayList<>(set); + } else { + this.environments = null; + } - public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) { - this.distributionStatusTopic = distributionStatusTopic; - } + } - public Integer getInitMaxIntervalSec() { - return initMaxIntervalSec; - } + public DistributionStatusTopicConfig getDistributionStatusTopic() { + return distributionStatusTopic; + } - public void setInitMaxIntervalSec(Integer initMaxIntervalSec) { - this.initMaxIntervalSec = initMaxIntervalSec; - } + public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) { + this.distributionStatusTopic = distributionStatusTopic; + } - public CreateTopicConfig getCreateTopic() { - return createTopic; - } + public Integer getInitMaxIntervalSec() { + return initMaxIntervalSec; + } - public void setCreateTopic(CreateTopicConfig createTopic) { - this.createTopic = createTopic; - } + public void setInitMaxIntervalSec(Integer initMaxIntervalSec) { + this.initMaxIntervalSec = initMaxIntervalSec; + } - public boolean isStartDistributionEngine() { - return startDistributionEngine; - } + public CreateTopicConfig getCreateTopic() { + return createTopic; + } - public void setStartDistributionEngine(boolean startDistributionEngine) { - this.startDistributionEngine = startDistributionEngine; - } + public void setCreateTopic(CreateTopicConfig createTopic) { + this.createTopic = createTopic; + } - public DistributionNotificationTopicConfig getDistributionNotificationTopic() { - return distributionNotificationTopic; - } + public boolean isStartDistributionEngine() { + return startDistributionEngine; + } - public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) { - this.distributionNotificationTopic = distributionNotificationTopic; - } + public void setStartDistributionEngine(boolean startDistributionEngine) { + this.startDistributionEngine = startDistributionEngine; + } - public int getDefaultArtifactInstallationTimeout() { - return defaultArtifactInstallationTimeout; - } - public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) { - this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout; - } - public int getCurrentArtifactInstallationTimeout() { - return currentArtifactInstallationTimeout; - } + public DistributionNotificationTopicConfig getDistributionNotificationTopic() { + return distributionNotificationTopic; + } - public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) { - this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout; - } + public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) { + this.distributionNotificationTopic = distributionNotificationTopic; + } - public boolean isUseHttpsWithDmaap() { - return useHttpsWithDmaap; - } + public int getDefaultArtifactInstallationTimeout() { + return defaultArtifactInstallationTimeout; + } + public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) { + this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout; + } + + public int getCurrentArtifactInstallationTimeout() { + return currentArtifactInstallationTimeout; + } + public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) { + this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout; + } + public boolean isUseHttpsWithDmaap() { + return useHttpsWithDmaap; + } - public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) { - this.useHttpsWithDmaap = useHttpsWithDmaap; - } + public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) { + this.useHttpsWithDmaap = useHttpsWithDmaap; + } - public static class CreateTopicConfig { + public static class CreateTopicConfig { - private Integer partitionCount; - private Integer replicationCount; + private Integer partitionCount; + private Integer replicationCount; - public Integer getPartitionCount() { - return partitionCount; - } + public Integer getPartitionCount() { + return partitionCount; + } - public void setPartitionCount(Integer partitionCount) { - this.partitionCount = partitionCount; - } + public void setPartitionCount(Integer partitionCount) { + this.partitionCount = partitionCount; + } - public Integer getReplicationCount() { - return replicationCount; - } + public Integer getReplicationCount() { + return replicationCount; + } - public void setReplicationCount(Integer replicationCount) { - this.replicationCount = replicationCount; - } + public void setReplicationCount(Integer replicationCount) { + this.replicationCount = replicationCount; + } - @Override - public String toString() { - return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount - + "]"; - } + @Override + public String toString() { + return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount + + "]"; + } - } + } - public static class EnvironmentConfig { + public static class EnvironmentConfig { - private String name; - private List<String> uebServers; + private String name; + private List<String> uebServers; - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public List<String> getUebServers() { - return uebServers; - } + public List<String> getUebServers() { + return uebServers; + } - public void setUebServers(List<String> uebServers) { - this.uebServers = uebServers; - } + public void setUebServers(List<String> uebServers) { + this.uebServers = uebServers; + } - @Override - public String toString() { - return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]"; - } + @Override + public String toString() { + return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]"; + } - } + } - public static class DistributionStatusTopicConfig { + public static class DistributionStatusTopicConfig { - private Integer pollingIntervalSec; - private Integer fetchTimeSec; - private String consumerGroup; - private String consumerId; + private Integer pollingIntervalSec; + private Integer fetchTimeSec; + private String consumerGroup; + private String consumerId; - public Integer getPollingIntervalSec() { - return pollingIntervalSec; - } + public Integer getPollingIntervalSec() { + return pollingIntervalSec; + } - public void setPollingIntervalSec(Integer pollingIntervalSec) { - this.pollingIntervalSec = pollingIntervalSec; - } + public void setPollingIntervalSec(Integer pollingIntervalSec) { + this.pollingIntervalSec = pollingIntervalSec; + } - public Integer getFetchTimeSec() { - return fetchTimeSec; - } + public Integer getFetchTimeSec() { + return fetchTimeSec; + } - public void setFetchTimeSec(Integer fetchTimeSec) { - this.fetchTimeSec = fetchTimeSec; - } + public void setFetchTimeSec(Integer fetchTimeSec) { + this.fetchTimeSec = fetchTimeSec; + } - public String getConsumerGroup() { - return consumerGroup; - } + public String getConsumerGroup() { + return consumerGroup; + } - public void setConsumerGroup(String consumerGroup) { - this.consumerGroup = consumerGroup; - } + public void setConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + } - public String getConsumerId() { - return consumerId; - } + public String getConsumerId() { + return consumerId; + } - public void setConsumerId(String consumerId) { - this.consumerId = consumerId; - } + public void setConsumerId(String consumerId) { + this.consumerId = consumerId; + } - @Override - public String toString() { - return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" - + fetchTimeSec + ", consumerGroup=" + consumerGroup + ", consumerId=" + consumerId + "]"; - } + @Override + public String toString() { + return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" + + fetchTimeSec + ", consumerGroup=" + consumerGroup + ", consumerId=" + consumerId + "]"; + } - } + } - public static class DistributionNotificationTopicConfig { + public static class DistributionNotificationTopicConfig { - private Integer maxWaitingAfterSendingSeconds; - private Integer maxThreadPoolSize; - private Integer minThreadPoolSize; + private Integer maxWaitingAfterSendingSeconds; + private Integer maxThreadPoolSize; + private Integer minThreadPoolSize; - public Integer getMaxWaitingAfterSendingSeconds() { - return maxWaitingAfterSendingSeconds; - } + public Integer getMaxWaitingAfterSendingSeconds() { + return maxWaitingAfterSendingSeconds; + } - public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) { - this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds; - } + public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) { + this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds; + } - public Integer getMaxThreadPoolSize() { - return maxThreadPoolSize; - } + public Integer getMaxThreadPoolSize() { + return maxThreadPoolSize; + } - public void setMaxThreadPoolSize(Integer maxThreadPoolSize) { - this.maxThreadPoolSize = maxThreadPoolSize; - } + public void setMaxThreadPoolSize(Integer maxThreadPoolSize) { + this.maxThreadPoolSize = maxThreadPoolSize; + } - public Integer getMinThreadPoolSize() { - return minThreadPoolSize; - } + public Integer getMinThreadPoolSize() { + return minThreadPoolSize; + } - public void setMinThreadPoolSize(Integer minThreadPoolSize) { - this.minThreadPoolSize = minThreadPoolSize; - } + public void setMinThreadPoolSize(Integer minThreadPoolSize) { + this.minThreadPoolSize = minThreadPoolSize; + } - @Override - public String toString() { - return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds - + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]"; - } + @Override + public String toString() { + return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds + + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]"; + } - } + } - public static class ComponentArtifactTypesConfig { + public static class ComponentArtifactTypesConfig { - private List<String> info; - private List<String> lifecycle; + private List<String> info; + private List<String> lifecycle; - public List<String> getInfo() { - return info; - } + public List<String> getInfo() { + return info; + } - public void setInfo(List<String> info) { - this.info = info; - } + public void setInfo(List<String> info) { + this.info = info; + } - public List<String> getLifecycle() { - return lifecycle; - } + public List<String> getLifecycle() { + return lifecycle; + } - public void setLifecycle(List<String> lifecycle) { - this.lifecycle = lifecycle; - } + public void setLifecycle(List<String> lifecycle) { + this.lifecycle = lifecycle; + } - @Override - public String toString() { - return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]"; - } + @Override + public String toString() { + return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]"; + } - } + } - public Integer getOpEnvRecoveryIntervalSec() { - return opEnvRecoveryIntervalSec; - } + public Integer getOpEnvRecoveryIntervalSec() { + return opEnvRecoveryIntervalSec; + } - public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) { - this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec; - } + public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) { + this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec; + } - public Integer getAllowedTimeBeforeStaleSec() { - return allowedTimeBeforeStaleSec; - } + public Integer getAllowedTimeBeforeStaleSec() { + return allowedTimeBeforeStaleSec; + } - public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) { - this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec; - } + public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) { + this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec; + } public ExternalServiceConfig getAaiConfig() { return aaiConfig; diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapConsumerConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapConsumerConfiguration.java index c99cbbaae3..926d21f395 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapConsumerConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapConsumerConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,284 +19,323 @@ */ package org.openecomp.sdc.be.config; - /** * Contains DMAAP Client configuration parameters */ public class DmaapConsumerConfiguration { - private boolean active; - private String hosts; - private String consumerGroup; - private String consumerId; - private Integer timeoutMs; - private Integer limit; - private Integer pollingInterval; - private String topic; - private Double latitude; - private Double longitude; - private String version; - private String serviceName; - private String environment; - private String partner; - private String routeOffer; - private String protocol; - private String contenttype; - private Boolean dme2TraceOn; - private String aftEnvironment; - private Integer aftDme2ConnectionTimeoutMs; - private Integer aftDme2RoundtripTimeoutMs; - private Integer aftDme2ReadTimeoutMs; - private String dme2preferredRouterFilePath; - private Credential credential; - private Integer timeLimitForNotificationHandleMs; - - public String getHosts() { - return hosts; - } - - public void setHosts(String hosts) { - this.hosts = hosts; - } - - public String getConsumerGroup() { - return consumerGroup; - } - - public void setConsumerGroup(String consumerGroup) { - this.consumerGroup = consumerGroup; - } - - public String getConsumerId() { - return consumerId; - } - - public void setConsumerId(String consumerId) { - this.consumerId = consumerId; - } - - public Integer getTimeoutMs() { - return timeoutMs; - } - - public void setTimeoutMs(Integer timeoutMs) { - this.timeoutMs = timeoutMs; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getPollingInterval() { - return pollingInterval; - } - - public void setPollingInterval(Integer pollingInterval) { - this.pollingInterval = pollingInterval; - } - - public String getTopic() { - return topic; - } - - public void setTopic(String topic) { - this.topic = topic; - } - - public Double getLatitude() { - return latitude; - } - - public void setLatitude(Double latitude) { - this.latitude = latitude; - } - - public Double getLongitude() { - return longitude; - } - - public void setLongitude(Double longitude) { - this.longitude = longitude; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } + private boolean active; + private String hosts; + private String consumerGroup; + private String consumerId; + private Integer timeoutMs; + private Integer limit; + private Integer pollingInterval; + private String topic; + private Double latitude; + private Double longitude; + private String version; + private String serviceName; + private String environment; + private String partner; + private String routeOffer; + private String protocol; + private String contenttype; + private Boolean dme2TraceOn; + private String aftEnvironment; + private Integer aftDme2ConnectionTimeoutMs; + private Integer aftDme2RoundtripTimeoutMs; + private Integer aftDme2ReadTimeoutMs; + private String dme2preferredRouterFilePath; + private Credential credential; + private Integer timeLimitForNotificationHandleMs; + private boolean aftDme2SslEnable; + private boolean aftDme2ClientIgnoreSslConfig; + private String aftDme2ClientKeystore; + private String aftDme2ClientKeystorePassword; + private String aftDme2ClientSslCertAlias; + + public String getHosts() { + return hosts; + } + + public void setHosts(String hosts) { + this.hosts = hosts; + } + + public String getConsumerGroup() { + return consumerGroup; + } + + public void setConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + } + + public String getConsumerId() { + return consumerId; + } + + public void setConsumerId(String consumerId) { + this.consumerId = consumerId; + } + + public Integer getTimeoutMs() { + return timeoutMs; + } + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(Integer pollingInterval) { + this.pollingInterval = pollingInterval; + } + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public String getEnvironment() { + return environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public String getPartner() { + return partner; + } + + public void setPartner(String partner) { + this.partner = partner; + } + + public String getRouteOffer() { + return routeOffer; + } + + public void setRouteOffer(String routeOffer) { + this.routeOffer = routeOffer; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getContenttype() { + return contenttype; + } + + public void setContenttype(String contenttype) { + this.contenttype = contenttype; + } + + public Boolean isDme2TraceOn() { + return dme2TraceOn; + } + + public Boolean getDme2TraceOn() { + return dme2TraceOn; + } + + public void setDme2TraceOn(Boolean dme2TraceOn) { + this.dme2TraceOn = dme2TraceOn; + } + + public String getAftEnvironment() { + return aftEnvironment; + } + + public void setAftEnvironment(String aftEnvironment) { + this.aftEnvironment = aftEnvironment; + } - public String getEnvironment() { - return environment; - } + public Integer getAftDme2ConnectionTimeoutMs() { + return aftDme2ConnectionTimeoutMs; + } - public void setEnvironment(String environment) { - this.environment = environment; - } + public void setAftDme2ConnectionTimeoutMs(Integer aftDme2ConnectionTimeoutMs) { + this.aftDme2ConnectionTimeoutMs = aftDme2ConnectionTimeoutMs; + } - public String getPartner() { - return partner; - } + public Integer getAftDme2RoundtripTimeoutMs() { + return aftDme2RoundtripTimeoutMs; + } - public void setPartner(String partner) { - this.partner = partner; - } + public void setAftDme2RoundtripTimeoutMs(Integer aftDme2RoundtripTimeoutMs) { + this.aftDme2RoundtripTimeoutMs = aftDme2RoundtripTimeoutMs; + } - public String getRouteOffer() { - return routeOffer; - } + public Integer getAftDme2ReadTimeoutMs() { + return aftDme2ReadTimeoutMs; + } - public void setRouteOffer(String routeOffer) { - this.routeOffer = routeOffer; - } + public void setAftDme2ReadTimeoutMs(Integer aftDme2ReadTimeoutMs) { + this.aftDme2ReadTimeoutMs = aftDme2ReadTimeoutMs; + } - public String getProtocol() { - return protocol; - } + public String getDme2preferredRouterFilePath() { + return dme2preferredRouterFilePath; + } - public void setProtocol(String protocol) { - this.protocol = protocol; - } + public void setDme2preferredRouterFilePath(String dme2preferredRouterFilePath) { + this.dme2preferredRouterFilePath = dme2preferredRouterFilePath; + } - public String getContenttype() { - return contenttype; - } + public Credential getCredential() { + return credential; + } - public void setContenttype(String contenttype) { - this.contenttype = contenttype; - } + public void setCredential(Credential credential) { + this.credential = credential; + } - public Boolean isDme2TraceOn() { - return dme2TraceOn; - } + public boolean isActive() { return active; } - public Boolean getDme2TraceOn() { - return dme2TraceOn; - } + public void setActive(boolean isActive) { this.active = isActive; } - public void setDme2TraceOn(Boolean dme2TraceOn) { - this.dme2TraceOn = dme2TraceOn; - } + /** + * Contains Dmaap Client credential parameters: username and password + */ + public static class Credential{ + + private String username; + private String password; + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + @Override + public String toString() { + return "Credential [username=" + username + ", password=" + password + "]"; + } + + } - public String getAftEnvironment() { - return aftEnvironment; - } + public Integer getTimeLimitForNotificationHandleMs() { + return timeLimitForNotificationHandleMs; + } - public void setAftEnvironment(String aftEnvironment) { - this.aftEnvironment = aftEnvironment; - } + public void setTimeLimitForNotificationHandleMs(Integer timeLimitForNotificationHandleMs) { + this.timeLimitForNotificationHandleMs = timeLimitForNotificationHandleMs; + } - public Integer getAftDme2ConnectionTimeoutMs() { - return aftDme2ConnectionTimeoutMs; + public boolean isAftDme2SslEnable() { + return aftDme2SslEnable; } - public void setAftDme2ConnectionTimeoutMs(Integer aftDme2ConnectionTimeoutMs) { - this.aftDme2ConnectionTimeoutMs = aftDme2ConnectionTimeoutMs; + public void setAftDme2SslEnable(boolean aftDme2SslEnable) { + this.aftDme2SslEnable = aftDme2SslEnable; } - public Integer getAftDme2RoundtripTimeoutMs() { - return aftDme2RoundtripTimeoutMs; + public boolean isAftDme2ClientIgnoreSslConfig() { + return aftDme2ClientIgnoreSslConfig; } - public void setAftDme2RoundtripTimeoutMs(Integer aftDme2RoundtripTimeoutMs) { - this.aftDme2RoundtripTimeoutMs = aftDme2RoundtripTimeoutMs; + public void setAftDme2ClientIgnoreSslConfig(boolean aftDme2ClientIgnoreSslConfig) { + this.aftDme2ClientIgnoreSslConfig = aftDme2ClientIgnoreSslConfig; } - public Integer getAftDme2ReadTimeoutMs() { - return aftDme2ReadTimeoutMs; + public String getAftDme2ClientKeystore() { + return aftDme2ClientKeystore; } - public void setAftDme2ReadTimeoutMs(Integer aftDme2ReadTimeoutMs) { - this.aftDme2ReadTimeoutMs = aftDme2ReadTimeoutMs; + public void setAftDme2ClientKeystore(String aftDme2ClientKeystore) { + this.aftDme2ClientKeystore = aftDme2ClientKeystore; } - public String getDme2preferredRouterFilePath() { - return dme2preferredRouterFilePath; - } - - public void setDme2preferredRouterFilePath(String dme2preferredRouterFilePath) { - this.dme2preferredRouterFilePath = dme2preferredRouterFilePath; - } - - public Credential getCredential() { - return credential; - } - - public void setCredential(Credential credential) { - this.credential = credential; - } - - public boolean isActive() { - return active; - } - - public void setActive(boolean isActive) { - this.active = isActive; - } - - /** - * Contains Dmaap Client credential parameters: username and password - */ - public static class Credential { - - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public String toString() { - return "Credential [username=" + username + ", password=" + password + "]"; - } - + public String getAftDme2ClientKeystorePassword() { + return aftDme2ClientKeystorePassword; } - @Override - public String toString() { - return "DmaapConsumerConfiguration [active=" + active + ", hosts=" + hosts + ", consumerGroup=" + consumerGroup + ", consumerId=" - + consumerId + ", timeoutMs=" + timeoutMs + ", limit=" + limit + ", pollingInterval=" + pollingInterval - + ", topic=" + topic + ", latitude=" + latitude + ", longitude=" + longitude + ", version=" + version - + ", serviceName=" + serviceName + ", environment=" + environment + ", partner=" + partner - + ", routeOffer=" + routeOffer + ", protocol=" + protocol + ", contenttype=" + contenttype - + ", dme2TraceOn=" + dme2TraceOn + ", aftEnvironment=" + aftEnvironment - + ", aftDme2ConnectionTimeoutMs=" + aftDme2ConnectionTimeoutMs + ", aftDme2RoundtripTimeoutMs=" - + aftDme2RoundtripTimeoutMs + ", aftDme2ReadTimeoutMs=" + aftDme2ReadTimeoutMs - + ", dme2preferredRouterFilePath=" + dme2preferredRouterFilePath - + ", timeLimitForNotificationHandleMs=" + timeLimitForNotificationHandleMs + ", credential=" + credential + "]"; + public void setAftDme2ClientKeystorePassword(String aftDme2ClientKeystorePassword) { + this.aftDme2ClientKeystorePassword = aftDme2ClientKeystorePassword; } - public Integer getTimeLimitForNotificationHandleMs() { - return timeLimitForNotificationHandleMs; + public String getAftDme2ClientSslCertAlias() { + return aftDme2ClientSslCertAlias; } - public void setTimeLimitForNotificationHandleMs(Integer timeLimitForNotificationHandleMs) { - this.timeLimitForNotificationHandleMs = timeLimitForNotificationHandleMs; + public void setAftDme2ClientSslCertAlias(String aftDme2ClientSslCertAlias) { + this.aftDme2ClientSslCertAlias = aftDme2ClientSslCertAlias; } + @Override + public String toString() { + return "DmaapConsumerConfiguration [active=" + active + ", hosts=" + hosts + ", consumerGroup=" + consumerGroup + + ", consumerId=" + consumerId + ", timeoutMs=" + timeoutMs + ", limit=" + limit + ", pollingInterval=" + + pollingInterval + ", topic=" + topic + ", latitude=" + latitude + ", longitude=" + longitude + + ", version=" + version + ", serviceName=" + serviceName + ", environment=" + environment + + ", partner=" + partner + ", routeOffer=" + routeOffer + ", protocol=" + protocol + ", contenttype=" + + contenttype + ", dme2TraceOn=" + dme2TraceOn + ", aftEnvironment=" + aftEnvironment + + ", aftDme2ConnectionTimeoutMs=" + aftDme2ConnectionTimeoutMs + ", aftDme2RoundtripTimeoutMs=" + + aftDme2RoundtripTimeoutMs + ", aftDme2ReadTimeoutMs=" + aftDme2ReadTimeoutMs + + ", dme2preferredRouterFilePath=" + dme2preferredRouterFilePath + ", credential=" + credential + + ", timeLimitForNotificationHandleMs=" + timeLimitForNotificationHandleMs + ", aftDme2SslEnable=" + + aftDme2SslEnable + ", aftDme2ClientIgnoreSslConfig=" + aftDme2ClientIgnoreSslConfig + + ", aftDme2ClientKeystore=" + aftDme2ClientKeystore + ", aftDme2ClientKeystorePassword=" + + aftDme2ClientKeystorePassword + ", aftDme2ClientSslCertAlias=" + aftDme2ClientSslCertAlias + "]"; + } + } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapProducerConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapProducerConfiguration.java new file mode 100644 index 0000000000..52d1def11f --- /dev/null +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmaapProducerConfiguration.java @@ -0,0 +1,325 @@ +package org.openecomp.sdc.be.config; +/** + * Contains DMAAP Client configuration parameters + */ +public class DmaapProducerConfiguration { + + private Boolean active; + private String hosts; + private String consumerGroup; + private String consumerId; + private Integer timeoutMs; + private Integer limit; + private Integer pollingInterval; + private String topic; + private Double latitude; + private Double longitude; + private String version; + private String serviceName; + private String environment; + private String partner; + private String routeOffer; + private String protocol; + private String contenttype; + private Boolean dme2TraceOn; + private String aftEnvironment; + private Integer aftDme2ConnectionTimeoutMs; + private Integer aftDme2RoundtripTimeoutMs; + private Integer aftDme2ReadTimeoutMs; + private String dme2preferredRouterFilePath; + private Credential credential; + private Integer timeLimitForNotificationHandleMs; + private boolean aftDme2SslEnable; + private boolean aftDme2ClientIgnoreSslConfig; + private String aftDme2ClientKeystore; + private String aftDme2ClientKeystorePassword; + private String aftDme2ClientSslCertAlias; + + + public Boolean getActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + public String getHosts() { + return hosts; + } + + public void setHosts(String hosts) { + this.hosts = hosts; + } + + public String getConsumerGroup() { + return consumerGroup; + } + + public void setConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + } + + public String getConsumerId() { + return consumerId; + } + + public void setConsumerId(String consumerId) { + this.consumerId = consumerId; + } + + public Integer getTimeoutMs() { + return timeoutMs; + } + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(Integer pollingInterval) { + this.pollingInterval = pollingInterval; + } + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public String getEnvironment() { + return environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public String getPartner() { + return partner; + } + + public void setPartner(String partner) { + this.partner = partner; + } + + public String getRouteOffer() { + return routeOffer; + } + + public void setRouteOffer(String routeOffer) { + this.routeOffer = routeOffer; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getContenttype() { + return contenttype; + } + + public void setContenttype(String contenttype) { + this.contenttype = contenttype; + } + + public Boolean isDme2TraceOn() { + return dme2TraceOn; + } + + public Boolean getDme2TraceOn() { + return dme2TraceOn; + } + + public void setDme2TraceOn(Boolean dme2TraceOn) { + this.dme2TraceOn = dme2TraceOn; + } + + public String getAftEnvironment() { + return aftEnvironment; + } + + public void setAftEnvironment(String aftEnvironment) { + this.aftEnvironment = aftEnvironment; + } + + public Integer getAftDme2ConnectionTimeoutMs() { + return aftDme2ConnectionTimeoutMs; + } + + public void setAftDme2ConnectionTimeoutMs(Integer aftDme2ConnectionTimeoutMs) { + this.aftDme2ConnectionTimeoutMs = aftDme2ConnectionTimeoutMs; + } + + public Integer getAftDme2RoundtripTimeoutMs() { + return aftDme2RoundtripTimeoutMs; + } + + public void setAftDme2RoundtripTimeoutMs(Integer aftDme2RoundtripTimeoutMs) { + this.aftDme2RoundtripTimeoutMs = aftDme2RoundtripTimeoutMs; + } + + public Integer getAftDme2ReadTimeoutMs() { + return aftDme2ReadTimeoutMs; + } + + public void setAftDme2ReadTimeoutMs(Integer aftDme2ReadTimeoutMs) { + this.aftDme2ReadTimeoutMs = aftDme2ReadTimeoutMs; + } + + public String getDme2preferredRouterFilePath() { + return dme2preferredRouterFilePath; + } + + public void setDme2preferredRouterFilePath(String dme2preferredRouterFilePath) { + this.dme2preferredRouterFilePath = dme2preferredRouterFilePath; + } + + public Credential getCredential() { + return credential; + } + + public void setCredential(Credential credential) { + this.credential = credential; + } + + /** + * Contains Dmaap Client credential parameters: username and password + */ + public static class Credential{ + + private String username; + private String password; + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + @Override + public String toString() { + return "Credential [username=" + username + ", password=" + password + "]"; + } + + } + public Integer getTimeLimitForNotificationHandleMs() { + return timeLimitForNotificationHandleMs; + } + + public void setTimeLimitForNotificationHandleMs(Integer timeLimitForNotificationHandleMs) { + this.timeLimitForNotificationHandleMs = timeLimitForNotificationHandleMs; + } + + public boolean isAftDme2SslEnable() { + return aftDme2SslEnable; + } + + public void setAftDme2SslEnable(boolean aftDme2SslEnable) { + this.aftDme2SslEnable = aftDme2SslEnable; + } + + public boolean isAftDme2ClientIgnoreSslConfig() { + return aftDme2ClientIgnoreSslConfig; + } + + public void setAftDme2ClientIgnoreSslConfig(boolean aftDme2ClientIgnoreSslConfig) { + this.aftDme2ClientIgnoreSslConfig = aftDme2ClientIgnoreSslConfig; + } + + public String getAftDme2ClientKeystore() { + return aftDme2ClientKeystore; + } + + public void setAftDme2ClientKeystore(String aftDme2ClientKeystore) { + this.aftDme2ClientKeystore = aftDme2ClientKeystore; + } + + public String getAftDme2ClientKeystorePassword() { + return aftDme2ClientKeystorePassword; + } + + public void setAftDme2ClientKeystorePassword(String aftDme2ClientKeystorePassword) { + this.aftDme2ClientKeystorePassword = aftDme2ClientKeystorePassword; + } + + public String getAftDme2ClientSslCertAlias() { + return aftDme2ClientSslCertAlias; + } + + public void setAftDme2ClientSslCertAlias(String aftDme2ClientSslCertAlias) { + this.aftDme2ClientSslCertAlias = aftDme2ClientSslCertAlias; + } + + @Override + public String toString() { + return "DmaapProducerConfiguration [hosts=" + hosts + ", consumerGroup=" + consumerGroup + ", consumerId=" + + consumerId + ", timeoutMs=" + timeoutMs + ", limit=" + limit + ", pollingInterval=" + pollingInterval + + ", topic=" + topic + ", latitude=" + latitude + ", longitude=" + longitude + ", version=" + version + + ", serviceName=" + serviceName + ", environment=" + environment + ", partner=" + partner + + ", routeOffer=" + routeOffer + ", protocol=" + protocol + ", contenttype=" + contenttype + + ", dme2TraceOn=" + dme2TraceOn + ", aftEnvironment=" + aftEnvironment + + ", aftDme2ConnectionTimeoutMs=" + aftDme2ConnectionTimeoutMs + ", aftDme2RoundtripTimeoutMs=" + + aftDme2RoundtripTimeoutMs + ", aftDme2ReadTimeoutMs=" + aftDme2ReadTimeoutMs + + ", dme2preferredRouterFilePath=" + dme2preferredRouterFilePath + + ", timeLimitForNotificationHandleMs=" + timeLimitForNotificationHandleMs+ ", credential=" + credential + + ", aftDme2SslEnable=" + aftDme2SslEnable + ", aftDme2ClientIgnoreSslConfig=" + aftDme2ClientIgnoreSslConfig + + ", aftDme2ClientKeystore=" + aftDme2ClientKeystore + ", aftDme2ClientSslCertAlias=" + aftDme2ClientSslCertAlias + "]"; + } + +} diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmeConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmeConfiguration.java index 4e553fdd8d..d876378421 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmeConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/DmeConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,27 +21,20 @@ package org.openecomp.sdc.be.config; public class DmeConfiguration { - private String dme2Search = "DME2SEARCH"; - private String dme2Resolve = "DME2RESOLVE"; + private String lookupUriFormat = "http://DME2RESOLVE/service=%s/version=1.0.0/envContext=%s/routeOffer=DEFAULT"; - public String getDme2Search() { - return dme2Search; + public String getLookupUriFormat() { + return lookupUriFormat; } - public void setDme2Search(String dme2Search) { - this.dme2Search = dme2Search; - } - - public String getDme2Resolve() { - return dme2Resolve; - } - - public void setDme2Resolve(String dme2Resolve) { - this.dme2Resolve = dme2Resolve; + public void setLookupUriFormat(String lookupUriFormat) { + this.lookupUriFormat = lookupUriFormat; } @Override public String toString() { - return "DmeConfiguration [dme2Search=" + dme2Search + ", dme2Resolve=" + dme2Resolve + "]"; + return "DmeConfiguration{" + + "lookupUriFormat='" + lookupUriFormat + '\'' + + '}'; } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorConfiguration.java index 3b7efbabf4..52ea02cfab 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,29 +26,29 @@ import java.util.Map; public class ErrorConfiguration extends BasicConfiguration { - private Map<String, ErrorInfo> errors; - - public Map<String, ErrorInfo> getErrors() { - return errors; - } - - public void setErrors(Map<String, ErrorInfo> errors) { - this.errors = errors; - } - - public ErrorInfo getErrorInfo(String key) { - ErrorInfo clone = null; - ErrorInfo other = errors.get(key); - if (other != null) { - clone = new ErrorInfo(); - clone.cloneData(other); - } - return clone; - } - - @Override - public String toString() { - return "ErrorConfiguration [errors=" + errors + "]"; - } + private Map<String, ErrorInfo> errors; + + public Map<String, ErrorInfo> getErrors() { + return errors; + } + + public void setErrors(Map<String, ErrorInfo> errors) { + this.errors = errors; + } + + public ErrorInfo getErrorInfo(String key) { + ErrorInfo clone = null; + ErrorInfo other = errors.get(key); + if (other != null) { + clone = new ErrorInfo(); + clone.cloneData(other); + } + return clone; + } + + @Override + public String toString() { + return "ErrorConfiguration [errors=" + errors + "]"; + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorInfo.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorInfo.java index 0846fc7083..ec9a61c81f 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorInfo.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/ErrorInfo.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,76 +24,76 @@ import org.openecomp.sdc.common.log.wrappers.Logger; public class ErrorInfo { - private Integer code; - private String message; - private String messageId; - private ErrorInfoType errorInfoType; - - private static final String SVC_PREFIX = "SVC"; - private static final String POL_PREFIX = "POL"; - - private static Logger log = Logger.getLogger(ErrorInfo.class.getName()); - - public ErrorInfo() { - this.errorInfoType = ErrorInfoType.OK; - } - - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getMessageId() { - return messageId; - } - - public void setMessageId(String messageId) { - // Determining the type of error - if (messageId == null) { - this.errorInfoType = ErrorInfoType.OK; - } else if (messageId.startsWith(SVC_PREFIX)) { - this.errorInfoType = ErrorInfoType.SERVICE_EXCEPTION; - } else if (messageId.startsWith(POL_PREFIX)) { - this.errorInfoType = ErrorInfoType.POLICY_EXCEPTION; - } else { - // unexpected - should it fail the startup? - BeEcompErrorManager.getInstance().logErrorConfigFileFormat("Error Info", - "Could not set error info type for message id " + messageId); - log.debug("Error: unexpected error message ID {}, should start with {} or {}", messageId, SVC_PREFIX, - POL_PREFIX); - } - this.messageId = messageId; - } - - public ErrorInfoType getErrorInfoType() { - return this.errorInfoType; - } - - public void cloneData(ErrorInfo other) { - this.code = other.getCode(); - this.message = other.getMessage(); - this.messageId = other.getMessageId(); - this.errorInfoType = other.errorInfoType; - } - - @Override - public String toString() { - return "ErrorInfo [code=" + code + ", messageId=" + messageId + ", message=" + message + "]"; - } - - public enum ErrorInfoType { - OK, POLICY_EXCEPTION, SERVICE_EXCEPTION - } + private Integer code; + private String message; + private String messageId; + private ErrorInfoType errorInfoType; + + private static final String SVC_PREFIX = "SVC"; + private static final String POL_PREFIX = "POL"; + + private static Logger log = Logger.getLogger(ErrorInfo.class.getName()); + + public ErrorInfo() { + this.errorInfoType = ErrorInfoType.OK; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + // Determining the type of error + if (messageId == null) { + this.errorInfoType = ErrorInfoType.OK; + } else if (messageId.startsWith(SVC_PREFIX)) { + this.errorInfoType = ErrorInfoType.SERVICE_EXCEPTION; + } else if (messageId.startsWith(POL_PREFIX)) { + this.errorInfoType = ErrorInfoType.POLICY_EXCEPTION; + } else { + // unexpected - should it fail the startup? + BeEcompErrorManager.getInstance().logErrorConfigFileFormat("Error Info", + "Could not set error info type for message id " + messageId); + log.debug("Error: unexpected error message ID {}, should start with {} or {}", messageId, SVC_PREFIX, + POL_PREFIX); + } + this.messageId = messageId; + } + + public ErrorInfoType getErrorInfoType() { + return this.errorInfoType; + } + + public void cloneData(ErrorInfo other) { + this.code = other.getCode(); + this.message = other.getMessage(); + this.messageId = other.getMessageId(); + this.errorInfoType = other.errorInfoType; + } + + @Override + public String toString() { + return "ErrorInfo [code=" + code + ", messageId=" + messageId + ", message=" + message + "]"; + } + + public enum ErrorInfoType { + OK, POLICY_EXCEPTION, SERVICE_EXCEPTION + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Neo4jErrorsConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Neo4jErrorsConfiguration.java index 7dc8dc8f26..02965242cf 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Neo4jErrorsConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Neo4jErrorsConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,23 +25,23 @@ import org.openecomp.sdc.common.api.BasicConfiguration; import java.util.Map; public class Neo4jErrorsConfiguration extends BasicConfiguration { - private Map<String, String> errors; + private Map<String, String> errors; - public Map<String, String> getErrors() { - return errors; - } + public Map<String, String> getErrors() { + return errors; + } - public void setErrors(Map<String, String> errors) { - this.errors = errors; - } + public void setErrors(Map<String, String> errors) { + this.errors = errors; + } - public String getErrorMessage(String key) { - return errors.get(key); - } + public String getErrorMessage(String key) { + return errors.get(key); + } - @Override - public String toString() { - return "Neo4jErrorsConfiguration [errors=" + errors + "]"; - } + @Override + public String toString() { + return "Neo4jErrorsConfiguration [errors=" + errors + "]"; + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfiguration.java index 88bab26d7c..72b53bac75 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfiguration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfiguration.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,33 +24,34 @@ import java.util.Map; /** * Currently for deployment artifacts HEAT validation only. - * + * * Other artifacts might require different fields validation Be sure to check it * before you re-use this class - * + * * @author paharoni + * */ public class DeploymentArtifactHeatConfiguration { - // All the rest of heat file is not needed for now... - private String heat_template_version; + // All the rest of heat file is not needed for now... + String heat_template_version; - private Map<String, Object> resources; + Map<String, Object> resources; - public String getHeat_template_version() { - return heat_template_version; - } + public String getHeat_template_version() { + return heat_template_version; + } - public void setHeat_template_version(String heat_template_version) { - this.heat_template_version = heat_template_version; - } + public void setHeat_template_version(String heat_template_version) { + this.heat_template_version = heat_template_version; + } - public Map<String, Object> getResources() { - return resources; - } + public Map<String, Object> getResources() { + return resources; + } - public void setResources(Map<String, Object> resources) { - this.resources = resources; - } + public void setResources(Map<String, Object> resources) { + this.resources = resources; + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/monitoring/BeMonitoringService.java b/common-app-api/src/main/java/org/openecomp/sdc/be/monitoring/BeMonitoringService.java index 0117b2be9e..c29574dd1b 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/monitoring/BeMonitoringService.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/monitoring/BeMonitoringService.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -46,64 +46,64 @@ import java.util.concurrent.TimeUnit; public class BeMonitoringService { - private static final String URL = "%s://%s:%s/sdc2/rest/monitoring"; - private static Logger monitoringLogger = Logger.getLogger("asdc.be.monitoring.service"); - private static Logger log = Logger.getLogger(BeMonitoringService.class.getName()); - private static Gson gson = new GsonBuilder().setPrettyPrinting().create(); + private static final String URL = "%s://%s:%s/sdc2/rest/monitoring"; + private static Logger monitoringLogger = Logger.getLogger("asdc.be.monitoring.service"); + private static Logger log = Logger.getLogger(BeMonitoringService.class.getName()); + private static Gson gson = new GsonBuilder().setPrettyPrinting().create(); - private class MonitoringScheduledTask implements Runnable { - @Override - public void run() { - monitoringLogger.trace("Executing BE Monitoring Task - Start"); - MonitoringEvent monitoringMetrics = MonitoringMetricsFetcher.getInstance().getMonitoringMetrics(); - processMonitoringEvent(monitoringMetrics); - monitoringLogger.trace("Executing BE Monitoring Task - Status = {}", monitoringMetrics.toString()); - } - } + private class MonitoringScheduledTask implements Runnable { + @Override + public void run() { + monitoringLogger.trace("Executing BE Monitoring Task - Start"); + MonitoringEvent monitoringMetrics = MonitoringMetricsFetcher.getInstance().getMonitoringMetrics(); + processMonitoringEvent(monitoringMetrics); + monitoringLogger.trace("Executing BE Monitoring Task - Status = {}", monitoringMetrics.toString()); + } + } - /** - * This executor will execute the Monitoring task. - */ - private ScheduledExecutorService monitoringExecutor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() { - @Override - public Thread newThread(Runnable r) { - return new Thread(r, "BE-Monitoring-Thread"); - } - }); - private ServletContext context; + /** + * This executor will execute the Monitoring task. + */ + ScheduledExecutorService monitoringExecutor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + return new Thread(r, "BE-Monitoring-Thread"); + } + }); + private ServletContext context; - public BeMonitoringService(ServletContext context) { - this.context = context; - } + public BeMonitoringService(ServletContext context) { + this.context = context; + } - public void start(int interval) { - Configuration config = ((ConfigurationManager) context.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)) - .getConfiguration(); - if (config.getSystemMonitoring().getEnabled()) { - log.info("BE monitoring service is enabled, interval is {} seconds", interval); - this.monitoringExecutor.scheduleAtFixedRate(new MonitoringScheduledTask(), 0, interval, TimeUnit.SECONDS); - } else { - log.info("BE monitoring service is disabled"); - } - } + public void start(int interval) { + Configuration config = ((ConfigurationManager) context.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)) + .getConfiguration(); + if (config.getSystemMonitoring().getEnabled()) { + log.info("BE monitoring service is enabled, interval is {} seconds", interval); + this.monitoringExecutor.scheduleAtFixedRate(new MonitoringScheduledTask(), 0, interval, TimeUnit.SECONDS); + } else { + log.info("BE monitoring service is disabled"); + } + } - private void processMonitoringEvent(MonitoringEvent monitoringMetrics) { - try { - Configuration config = ((ConfigurationManager) context.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)) - .getConfiguration(); - String redirectedUrl = String.format(URL, config.getBeProtocol(), config.getBeFqdn(), - config.getBeHttpPort()); + private void processMonitoringEvent(MonitoringEvent monitoringMetrics) { + try { + Configuration config = ((ConfigurationManager) context.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)) + .getConfiguration(); + String redirectedUrl = String.format(URL, config.getBeProtocol(), config.getBeFqdn(), + config.getBeHttpPort()); - final int timeout = 3000; - String monitoringMetricsJson = gson.toJson(monitoringMetrics); - HttpEntity myEntity = new StringEntity(monitoringMetricsJson, ContentType.APPLICATION_JSON); - HttpResponse<String> httpResponse = HttpRequest.post(redirectedUrl, myEntity, new HttpClientConfig(new Timeouts(timeout, timeout))); + final int timeout = 3000; + String monitoringMetricsJson = gson.toJson(monitoringMetrics); + HttpEntity myEntity = new StringEntity(monitoringMetricsJson, ContentType.APPLICATION_JSON); + HttpResponse<String> httpResponse = HttpRequest.post(redirectedUrl, myEntity, new HttpClientConfig(new Timeouts(timeout, timeout))); int beResponseStatus = httpResponse.getStatusCode(); if (beResponseStatus != HttpStatus.SC_OK) { - monitoringLogger.error(EcompLoggerErrorCode.UNKNOWN_ERROR, "", "", "Unexpected HTTP response from BE : {}", beResponseStatus); + monitoringLogger.error(EcompLoggerErrorCode.UNKNOWN_ERROR,"","","Unexpected HTTP response from BE : {}", beResponseStatus); } - } catch (Exception e) { - monitoringLogger.error(EcompLoggerErrorCode.UNKNOWN_ERROR, "", "", "Monitoring BE failed with exception ", e); - } - } + } catch (Exception e) { + monitoringLogger.error(EcompLoggerErrorCode.UNKNOWN_ERROR,"","","Monitoring BE failed with exception ", e); + } + } } |