summaryrefslogtreecommitdiffstats
path: root/feature-eelf/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-02-19 16:56:06 -0500
committerJim Hahn <jrh3@att.com>2018-02-20 09:59:15 -0500
commita45f8909871dc1ddb75845f067a602951afc8d11 (patch)
treefa72aff7ceede971d4e6922f62a503a8ee8924d5 /feature-eelf/src
parent1708e9a45cb88571613c10b68d392811b2b3f0f4 (diff)
Sonar fixes to drools-pdp
Fixed most of the instances of the following sonar issues: Moved array designator Used diamond operator Changed System.out/err to use a logger Changed several Thread.sleep() in test code to a single sleep() Useless assignments Replaced comparison with "" to string.isEmpty() Merged if's Replaced ArrayList with List in method returns Reordered type modifiers Reordered constructor methods Defined constants for literals, or replaced them with method calls Removed "throws Xxx" for subclasses of RuntimeException Combined identical "catch" blocks Re-interrupted the current thread after catching an InterruptedException Removed tests against the literal "false" Fix indentation of new makeTopicOperError() method. Fix exception variable name in new methods, logNoUebEncoder() and logNoDmaapEncoder(). Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94 Issue-ID: POLICY-336 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-eelf/src')
-rw-r--r--feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java b/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
index e48bd2fa..aac456e2 100644
--- a/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
+++ b/feature-eelf/src/main/java/org/onap/policy/drools/eelf/EelfFeature.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* feature-eelf
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ import org.onap.policy.drools.system.PolicyEngine;
public class EelfFeature implements PolicyEngineFeatureAPI {
@Override
- final public boolean beforeBoot(PolicyEngine engine, String cliArgs[]) {
+ public final boolean beforeBoot(PolicyEngine engine, String[] cliArgs) {
String logback = System.getProperty(Main.LOGBACK_CONFIGURATION_FILE_SYSTEM_PROPERTY,
Main.LOGBACK_CONFIGURATION_FILE_DEFAULT);
@@ -53,17 +53,18 @@ public class EelfFeature implements PolicyEngineFeatureAPI {
Logger logger = FlexLogger.getLogger(this.getClass(), true);
if (logger.isInfoEnabled()) {
- logger.info("eelf-feature: Property " + Main.LOGBACK_CONFIGURATION_FILE_SYSTEM_PROPERTY + "=" +
- System.getProperty(Main.LOGBACK_CONFIGURATION_FILE_SYSTEM_PROPERTY));
- logger.info("eelf-feature: Property " + Configuration.PROPERTY_LOGGING_FILE_PATH + "=" +
- System.getProperty(Configuration.PROPERTY_LOGGING_FILE_PATH));
- logger.info("eelf-feature: Property " + Configuration.PROPERTY_LOGGING_FILE_NAME + "=" +
- System.getProperty(Configuration.PROPERTY_LOGGING_FILE_NAME));
+ logProperty(logger, Main.LOGBACK_CONFIGURATION_FILE_SYSTEM_PROPERTY);
+ logProperty(logger, Configuration.PROPERTY_LOGGING_FILE_PATH);
+ logProperty(logger, Configuration.PROPERTY_LOGGING_FILE_NAME);
}
return false;
}
+ private void logProperty(Logger logger, String propnm) {
+ logger.info("eelf-feature: Property " + propnm + "=" + System.getProperty(propnm));
+ }
+
@Override
public int getSequenceNumber() {
return 0;
Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# ================================================================================ 
# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. 
# ================================================================================ 
# Licensed under the Apache License, Version 2.0 (the "License"); 
# you may not use this file except in compliance with the License. 
# You may obtain a copy of the License at 
#  
#      http://www.apache.org/licenses/LICENSE-2.0 
#  
# Unless required by applicable law or agreed to in writing, software 
# distributed under the License is distributed on an "AS IS" BASIS, 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
# See the License for the specific language governing permissions and 
# limitations under the License. 
# ============LICENSE_END=========================================================

tosca_definitions_version: cloudify_dsl_1_3

imports:
    - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
    - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.13/k8splugin_types.yaml
    - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml

inputs:
    topic00_name:
        type: string
        default: "topic00"
    topic01_name:
        type: string
        default: "topic01"
    location:
        type: string
        default: "san-francisco"

node_templates:

    topic00:
        type: ccsdk.nodes.Topic
        properties:
            topic_name: { get_input: topic00_name }

    topic01:
        type: ccsdk.nodes.Topic
        properties:
            topic_name: { get_input: topic01_name }

    web_server:
        type: dcae.nodes.ContainerizedServiceComponentUsingDmaap

        properties:
            service_component_type: 'nginx-web'
            image: nginx
            docker_config:
                healthcheck:
                    type: "http"
                    endpoint: "/"
            streams_publishes:
              - name: topic00
                location: { get_input: location }
                client_role: org.onap.dcae.pnfPublisher
                type: message_router
            streams_subscribes:
              - name: topic01
                location: { get_input: location }
                client_role: org.onap.dcae.pnfSubscriber
                type: message_router

        relationships:
            - type: ccsdk.relationships.publish_events
              target: topic00
            - type: ccsdk.relationships.subscribe_to_events
              target: topic01

        interfaces:
          cloudify.interfaces.lifecycle:
            start:
              inputs:
                ports:
                  - '80:0'
outputs:

    topic00_data:
        description: "Topic 00 data on client00"
        value: { get_attribute: [web_server, topic00]}

    topic01_data:
        description: "Topic 01 data on client00"
        value: { get_attribute: [web_server, topic01]}