diff options
Diffstat (limited to 'appc-outbound/appc-network-inventory-client/provider/src/main/java')
-rw-r--r-- | appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/aai/interfaceImpl/AaiInterfaceRulesHandler.java | 2 | ||||
-rw-r--r-- | appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/InstarClientActivator.java | 17 | ||||
-rw-r--r-- | appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java | 8 | ||||
-rw-r--r-- | appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/interfaces/RuleHandlerInterface.java (renamed from appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaces/RuleHandlerInterface.java) | 9 | ||||
-rw-r--r-- | appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/node/SourceSystemNode.java (renamed from appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/node/InstarClientNode.java) | 28 |
5 files changed, 37 insertions, 27 deletions
diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/aai/interfaceImpl/AaiInterfaceRulesHandler.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/aai/interfaceImpl/AaiInterfaceRulesHandler.java index 37a40f7c4..f82404303 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/aai/interfaceImpl/AaiInterfaceRulesHandler.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/aai/interfaceImpl/AaiInterfaceRulesHandler.java @@ -33,7 +33,7 @@ import org.onap.appc.aai.data.AaiVmInfo; import org.onap.appc.aai.data.AaiVnfInfo; import org.onap.appc.aai.data.AaiVnfcInfo; import org.onap.appc.aai.utils.AaiClientConstant; -import org.onap.appc.instar.interfaces.RuleHandlerInterface; +import org.onap.appc.system.interfaces.RuleHandlerInterface; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.sdnc.config.params.data.Parameter; import org.onap.sdnc.config.params.data.ResponseKey; diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/InstarClientActivator.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/InstarClientActivator.java index a703f816b..137ef9ee5 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/InstarClientActivator.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/InstarClientActivator.java @@ -9,15 +9,15 @@ * 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========================================================= */ @@ -27,7 +27,8 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import java.util.LinkedList; import java.util.List; -import org.onap.appc.instar.node.InstarClientNode; + +import org.onap.appc.system.node.SourceSystemNode; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; @@ -40,10 +41,10 @@ public class InstarClientActivator implements BundleActivator { @Override public void start(BundleContext ctx) throws Exception { - InstarClientNode instarClientNode = new InstarClientNode(); - log.info("Registering service " + instarClientNode.getClass().getName()); - registrations.add(ctx.registerService(instarClientNode.getClass().getName(), instarClientNode, null)); - log.info("Registering service sccessful for " + instarClientNode.getClass().getName()); + SourceSystemNode sourceSystemNode = new SourceSystemNode(); + log.info("Registering service " + sourceSystemNode.getClass().getName()); + registrations.add(ctx.registerService(sourceSystemNode.getClass().getName(), sourceSystemNode, null)); + log.info("Registering service sccessful for " + sourceSystemNode.getClass().getName()); } @Override diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java index f5f4924d6..88ab4c137 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaceImpl/InterfaceIpAddressImpl.java @@ -9,15 +9,15 @@ * 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========================================================= */ @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; import org.onap.appc.instar.interfaces.ResponseHandlerInterface; import org.onap.appc.instar.interfaces.RestClientInterface; -import org.onap.appc.instar.interfaces.RuleHandlerInterface; +import org.onap.appc.system.interfaces.RuleHandlerInterface; import org.onap.appc.instar.utils.InstarClientConstant; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.sdnc.config.params.data.Parameter; diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaces/RuleHandlerInterface.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/interfaces/RuleHandlerInterface.java index f86d25272..2f4580701 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/interfaces/RuleHandlerInterface.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/interfaces/RuleHandlerInterface.java @@ -9,21 +9,22 @@ * 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========================================================= */ -package org.onap.appc.instar.interfaces; +package org.onap.appc.system.interfaces; import java.io.IOException; + import org.onap.appc.instar.interfaceImpl.InstarResponseException; @FunctionalInterface diff --git a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/node/InstarClientNode.java b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/node/SourceSystemNode.java index 4087e2ad2..32a65df59 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/instar/node/InstarClientNode.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/main/java/org/onap/appc/system/node/SourceSystemNode.java @@ -4,26 +4,28 @@ * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Copyright (C) 2017 Amdocs + * Copyright (C) 2017 Amdocs * ================================================================================ * Modifications Copyright (C) 2018 Ericsson - * ============================================================================= + * ================================================================================ + * * 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========================================================= */ -package org.onap.appc.instar.node; + +package org.onap.appc.system.node; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -37,16 +39,16 @@ import org.onap.appc.aai.utils.AaiClientConstant; import org.onap.appc.instar.interfaceImpl.InstarRestClientImpl; import org.onap.appc.instar.interfaceImpl.InterfaceIpAddressImpl; import org.onap.appc.instar.interfaces.RestClientInterface; -import org.onap.appc.instar.interfaces.RuleHandlerInterface; +import org.onap.appc.system.interfaces.RuleHandlerInterface; import org.onap.appc.instar.utils.InstarClientConstant; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.sdnc.config.params.data.Parameter; -public class InstarClientNode implements SvcLogicJavaPlugin { +public class SourceSystemNode implements SvcLogicJavaPlugin { - private static final EELFLogger log = EELFManager.getInstance().getLogger(InstarClientNode.class); + private static final EELFLogger log = EELFManager.getInstance().getLogger(SourceSystemNode.class); public void getInstarInfo(Map<String, String> inParams, SvcLogicContext ctx) @@ -67,7 +69,7 @@ public class InstarClientNode implements SvcLogicJavaPlugin { RuleHandlerInterface handler; log.info("Processing rule Type : " + params.getRuleType()); if (params.getRuleType().equals(InstarClientConstant.INTERFACE_IP_ADDRESS)) { - handler = createHandler(params, ctx); + handler = createHandler(params, ctx); } else { throw new SvcLogicException("No Rule Defined to process :" + params.getRuleType()); } @@ -92,10 +94,12 @@ public class InstarClientNode implements SvcLogicJavaPlugin { private static String[] getKeys(String keyString) { log.error("Received Key String as :" + keyString); + String key = keyString .replace("[", "") .replace("]", "") .replace("\"", ""); + if (key.contains(",")) { return key.split(","); } else { @@ -112,10 +116,12 @@ public class InstarClientNode implements SvcLogicJavaPlugin { input.putAll(inParams); RestClientInterface rcINterface = createRestClientInterface(input); String response = rcINterface.sendRequest(inParams.get("operationName")); + responsePrefix = StringUtils.isNotBlank(responsePrefix) ? responsePrefix + "." : ""; ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_SUCCESS); ctx.setAttribute(responsePrefix + InstarClientConstant.INSTAR_KEY_VALUES, response); + } catch (Exception e) { ctx.setAttribute(responsePrefix + InstarClientConstant.OUTPUT_PARAM_STATUS, InstarClientConstant.OUTPUT_STATUS_FAILURE); @@ -157,6 +163,7 @@ public class InstarClientNode implements SvcLogicJavaPlugin { } } + protected RuleHandlerInterface createHandler(Parameter params, SvcLogicContext ctx) { return new InterfaceIpAddressImpl(params, ctx); } @@ -164,4 +171,5 @@ public class InstarClientNode implements SvcLogicJavaPlugin { protected RestClientInterface createRestClientInterface(Map<String, String> input) { return new InstarRestClientImpl(input); } + } |