aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Wonnell <kw5258@att.com>2017-08-29 22:39:17 -0500
committerMarcus Williams <marcus.williams@intel.com>2017-08-30 15:36:41 +0000
commitabe9420ac5220879d4790f9020c583cb037dd577 (patch)
tree178e8b7b0cdaa6317064add7e5e29299459188c5
parent8c9631e438b9491424df0f43d43445f098436834 (diff)
Initial add of APPC client libraries
Issue-ID: APPC-180 Change-Id: Ie0be2b518b90bb7f9996e9260c43fef75d1a5821 Signed-off-by: Skip Wonnell <kw5258@att.com>
-rw-r--r--appc-client/.gitignore11
-rw-r--r--appc-client/client-kit/.gitignore1
-rw-r--r--appc-client/client-kit/pom.xml54
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java37
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java43
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java49
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java50
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java901
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java42
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java44
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java44
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java44
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java61
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java60
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java108
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java51
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java120
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java85
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java85
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java109
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java94
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java143
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java102
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java59
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java128
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java117
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java83
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java75
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java89
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java106
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java72
-rw-r--r--appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java59
-rw-r--r--appc-client/client-kit/src/test/java/json2java/Json2JavaGeneratorTest.java171
-rw-r--r--appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java93
-rw-r--r--appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java140
-rw-r--r--appc-client/client-lib/.gitignore2
-rw-r--r--appc-client/client-lib/pom.xml63
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java85
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java76
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java45
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java314
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java70
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java43
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java28
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java36
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java68
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java33
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java47
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java69
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java36
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java85
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java50
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java107
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java65
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java98
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java82
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java77
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java40
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java157
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java56
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java125
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java39
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java40
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java61
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java38
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java82
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java38
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java44
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java79
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java98
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java30
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java38
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java102
-rw-r--r--appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java36
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java163
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java151
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java104
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java91
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java75
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java60
-rw-r--r--appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java70
-rw-r--r--appc-client/client-lib/src/test/resources/ueb.missing.properties30
-rw-r--r--appc-client/client-lib/src/test/resources/ueb.properties29
-rw-r--r--appc-client/client-simulator/.gitignore1
-rw-r--r--appc-client/client-simulator/pom.xml104
-rw-r--r--appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java33
-rw-r--r--appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java31
-rw-r--r--appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java272
-rw-r--r--appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java147
-rw-r--r--appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java99
-rw-r--r--appc-client/client-simulator/src/main/resources/assembly.xml51
-rw-r--r--appc-client/client-simulator/src/main/resources/assembly_zip.xml54
-rw-r--r--appc-client/client-simulator/src/main/resources/client-simulator.properties58
-rw-r--r--appc-client/client-simulator/src/main/resources/exceptions.txt1
-rw-r--r--appc-client/client-simulator/src/main/resources/logback.xml81
-rw-r--r--appc-client/client-simulator/src/main/resources/run.bat2
-rw-r--r--appc-client/client-simulator/src/test/java/run.java34
-rw-r--r--appc-client/code-generator/.gitignore1
-rw-r--r--appc-client/code-generator/pom.xml122
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java66
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java34
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java85
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java67
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java98
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java107
-rw-r--r--appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java71
-rw-r--r--appc-client/code-generator/src/main/resources/configuration/client-kit.properties34
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/common.ftl49
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/enum.ftl65
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/open-api-to-java.ftl41
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/pojo.ftl109
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/primitive-wrapper-pojo.ftl59
-rw-r--r--appc-client/code-generator/src/main/resources/templates/client-kit/service.ftl72
-rw-r--r--appc-client/code-generator/src/main/resources/templates/open-api/yang-to-open-api.ftl314
-rw-r--r--appc-client/pom.xml225
-rw-r--r--pom.xml1
163 files changed, 13841 insertions, 0 deletions
diff --git a/appc-client/.gitignore b/appc-client/.gitignore
new file mode 100644
index 000000000..0a7fe3c3c
--- /dev/null
+++ b/appc-client/.gitignore
@@ -0,0 +1,11 @@
+/target/
+/.idea/
+*.iml
+/logs/
+/debug-logs/
+.settings/
+.project
+*.swp
+.pydevproject
+.classpath
+client-lib/logs/EELF/application.log
diff --git a/appc-client/client-kit/.gitignore b/appc-client/client-kit/.gitignore
new file mode 100644
index 000000000..b83d22266
--- /dev/null
+++ b/appc-client/client-kit/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-client/client-kit/pom.xml b/appc-client/client-kit/pom.xml
new file mode 100644
index 000000000..ab3b1fa1f
--- /dev/null
+++ b/appc-client/client-kit/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-java-client</artifactId>
+ <groupId>org.openecomp.appc.client</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>client-kit</artifactId>
+
+
+ <properties>
+ <licenseDir>${project.parent.parent.basedir}</licenseDir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-parser-impl</artifactId>
+ <version>${yang.parser.impl.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java
new file mode 100644
index 000000000..001a3035e
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface RPC {
+ String name();
+ Class<?> outputType();
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java
new file mode 100644
index 000000000..ba6284ecd
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.api;
+
+import org.openecomp.appc.client.lcm.impl.business.AppcLifeCycleManagerServiceFactoryImpl;
+
+public class AppcClientServiceFactoryProvider {
+
+ private static AppcLifeCycleManagerServiceFactory appcLifeCycleManagerServiceFactory;
+
+ public static synchronized <T> T getFactory(Class<T> clazz) {
+ if (clazz.equals(AppcLifeCycleManagerServiceFactory.class)) {
+ if (appcLifeCycleManagerServiceFactory == null) {
+ appcLifeCycleManagerServiceFactory = new AppcLifeCycleManagerServiceFactoryImpl();
+ }
+ return (T) appcLifeCycleManagerServiceFactory;
+ } else {
+ throw new IllegalArgumentException(clazz.getName());
+ }
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java
new file mode 100644
index 000000000..7bf97907e
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.api;
+
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+
+import java.util.Properties;
+
+public interface AppcLifeCycleManagerServiceFactory {
+
+ /**
+ * Creates a new stateful LCM API
+ * @param context application context parameters
+ * @param properties configures the behaviour of the LCM
+ * @return a new stateful LCM API
+ * @throws AppcClientException in case of problem in instantiation
+ */
+ LifeCycleManagerStateful createLifeCycleManagerStateful(ApplicationContext context, Properties properties) throws AppcClientException;
+
+ /**
+ * performs a shutdown of LCM API.
+ * in case of graceful, will try and execute the remaining requests, otherwise, will force the shutdown right away
+ * @param isForceShutdown - boolean. If true to perform force shutdown, other to perform graceful shutdown.
+ */
+ void shutdownLifeCycleManager(boolean isForceShutdown);
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java
new file mode 100644
index 000000000..5829b0f92
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.api;
+
+/**
+ * Created by gital on 11/27/2016.
+ */
+public class ApplicationContext {
+
+ private String mechID;
+ private String applicationID;
+
+ public String getMechID() {
+ return mechID;
+ }
+
+ public void setMechID(String mechID) {
+ this.mechID = mechID;
+ }
+
+ public String getApplicationID() {
+ return applicationID;
+ }
+
+ public void setApplicationID(String applicationID) {
+ this.applicationID = applicationID;
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java
new file mode 100644
index 000000000..3a2aeb0dc
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java
@@ -0,0 +1,901 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/*
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.api;
+
+import org.openecomp.appc.client.lcm.model.AuditOutput;
+import org.openecomp.appc.client.lcm.model.AuditInput;
+import org.openecomp.appc.client.lcm.model.CheckLockOutput;
+import org.openecomp.appc.client.lcm.model.CheckLockInput;
+import org.openecomp.appc.client.lcm.model.ConfigBackupOutput;
+import org.openecomp.appc.client.lcm.model.ConfigBackupInput;
+import org.openecomp.appc.client.lcm.model.ConfigBackupDeleteOutput;
+import org.openecomp.appc.client.lcm.model.ConfigBackupDeleteInput;
+import org.openecomp.appc.client.lcm.model.ConfigExportOutput;
+import org.openecomp.appc.client.lcm.model.ConfigExportInput;
+import org.openecomp.appc.client.lcm.model.ConfigModifyOutput;
+import org.openecomp.appc.client.lcm.model.ConfigModifyInput;
+import org.openecomp.appc.client.lcm.model.ConfigRestoreOutput;
+import org.openecomp.appc.client.lcm.model.ConfigRestoreInput;
+import org.openecomp.appc.client.lcm.model.ConfigScaleoutOutput;
+import org.openecomp.appc.client.lcm.model.ConfigScaleoutInput;
+import org.openecomp.appc.client.lcm.model.ConfigureOutput;
+import org.openecomp.appc.client.lcm.model.ConfigureInput;
+import org.openecomp.appc.client.lcm.model.EvacuateOutput;
+import org.openecomp.appc.client.lcm.model.EvacuateInput;
+import org.openecomp.appc.client.lcm.model.HealthCheckOutput;
+import org.openecomp.appc.client.lcm.model.HealthCheckInput;
+import org.openecomp.appc.client.lcm.model.LiveUpgradeOutput;
+import org.openecomp.appc.client.lcm.model.LiveUpgradeInput;
+import org.openecomp.appc.client.lcm.model.LockOutput;
+import org.openecomp.appc.client.lcm.model.LockInput;
+import org.openecomp.appc.client.lcm.model.MigrateOutput;
+import org.openecomp.appc.client.lcm.model.MigrateInput;
+import org.openecomp.appc.client.lcm.model.RebuildOutput;
+import org.openecomp.appc.client.lcm.model.RebuildInput;
+import org.openecomp.appc.client.lcm.model.RestartOutput;
+import org.openecomp.appc.client.lcm.model.RestartInput;
+import org.openecomp.appc.client.lcm.model.RollbackOutput;
+import org.openecomp.appc.client.lcm.model.RollbackInput;
+import org.openecomp.appc.client.lcm.model.SnapshotOutput;
+import org.openecomp.appc.client.lcm.model.SnapshotInput;
+import org.openecomp.appc.client.lcm.model.SoftwareUploadOutput;
+import org.openecomp.appc.client.lcm.model.SoftwareUploadInput;
+import org.openecomp.appc.client.lcm.model.StartOutput;
+import org.openecomp.appc.client.lcm.model.StartInput;
+import org.openecomp.appc.client.lcm.model.StopOutput;
+import org.openecomp.appc.client.lcm.model.StopInput;
+import org.openecomp.appc.client.lcm.model.SyncOutput;
+import org.openecomp.appc.client.lcm.model.SyncInput;
+import org.openecomp.appc.client.lcm.model.TerminateOutput;
+import org.openecomp.appc.client.lcm.model.TerminateInput;
+import org.openecomp.appc.client.lcm.model.TestOutput;
+import org.openecomp.appc.client.lcm.model.TestInput;
+import org.openecomp.appc.client.lcm.model.UnlockOutput;
+import org.openecomp.appc.client.lcm.model.UnlockInput;
+import org.openecomp.appc.RPC;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+
+/**
+ * Defines the services and request/response requirements for the ECOMP APP-C
+ * component.
+ */
+@javax.annotation.Generated(value = {
+ "templates/client-kit/open-api-to-java.ftl" }, date = "2017-05-04T20:09:01.723+05:30", comments = "Auto-generated from Open API specification")
+public interface LifeCycleManagerStateful {
+
+ /**
+ * The Audit command compares the configuration of the VNF associated with the
+ * current request against the configuration that is stored in APPC's
+ * configuration store. A successful Audit means that the current VNF
+ * configuration matches the APPC stored configuration. A failed Audit indicates
+ * that the request configuration is different from the stored configuration.
+ * This command can be applied to any VNF type. The only restriction is that a
+ * particular VNF should be able to support the interface for Reading
+ * Configuration using existing adapters and use the following protocols: CLI,
+ * RestConf and XML. The Audit action does not require any payload parameters
+ *
+ * @param auditInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "audit", outputType = AuditOutput.class)
+ AuditOutput audit(AuditInput auditInput) throws AppcClientException;
+
+ /**
+ * The Audit command compares the configuration of the VNF associated with the
+ * current request against the configuration that is stored in APPC's
+ * configuration store. A successful Audit means that the current VNF
+ * configuration matches the APPC stored configuration. A failed Audit indicates
+ * that the request configuration is different from the stored configuration.
+ * This command can be applied to any VNF type. The only restriction is that a
+ * particular VNF should be able to support the interface for Reading
+ * Configuration using existing adapters and use the following protocols: CLI,
+ * RestConf and XML. The Audit action does not require any payload parameters
+ *
+ * @param auditInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "audit", outputType = AuditOutput.class)
+ void audit(AuditInput auditInput, ResponseHandler<AuditOutput> listener) throws AppcClientException;
+
+ /**
+ * The CheckLock command returns true if the specified VNF is locked, false if
+ * not. A CheckLock command is deemed successful if the processing completes
+ * without error, whether the VNF is locked or not. The command returns only a
+ * single response with a final status. The APPC also locks the target VNF
+ * during any command processing, so a VNF can have a locked status even if no
+ * Lock command has been explicitly called. The CheckLock command returns a
+ * specific response structure that extends the default LCM response. The
+ * CheckLock action does not require any payload parameters
+ *
+ * @param checkLockInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "check-lock", outputType = CheckLockOutput.class)
+ CheckLockOutput checkLock(CheckLockInput checkLockInput) throws AppcClientException;
+
+ /**
+ * The CheckLock command returns true if the specified VNF is locked, false if
+ * not. A CheckLock command is deemed successful if the processing completes
+ * without error, whether the VNF is locked or not. The command returns only a
+ * single response with a final status. The APPC also locks the target VNF
+ * during any command processing, so a VNF can have a locked status even if no
+ * Lock command has been explicitly called. The CheckLock command returns a
+ * specific response structure that extends the default LCM response. The
+ * CheckLock action does not require any payload parameters
+ *
+ * @param checkLockInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "check-lock", outputType = CheckLockOutput.class)
+ void checkLock(CheckLockInput checkLockInput, ResponseHandler<CheckLockOutput> listener) throws AppcClientException;
+
+ /**
+ * An operation to Backup configurations of a virtual network function (or VM)
+ *
+ * @param configBackupInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-backup", outputType = ConfigBackupOutput.class)
+ ConfigBackupOutput configBackup(ConfigBackupInput configBackupInput) throws AppcClientException;
+
+ /**
+ * An operation to Backup configurations of a virtual network function (or VM)
+ *
+ * @param configBackupInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-backup", outputType = ConfigBackupOutput.class)
+ void configBackup(ConfigBackupInput configBackupInput, ResponseHandler<ConfigBackupOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * An operation to Delete backup configurations of a virtual network function
+ * (or VM)
+ *
+ * @param configBackupDeleteInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-backup-delete", outputType = ConfigBackupDeleteOutput.class)
+ ConfigBackupDeleteOutput configBackupDelete(ConfigBackupDeleteInput configBackupDeleteInput)
+ throws AppcClientException;
+
+ /**
+ * An operation to Delete backup configurations of a virtual network function
+ * (or VM)
+ *
+ * @param configBackupDeleteInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-backup-delete", outputType = ConfigBackupDeleteOutput.class)
+ void configBackupDelete(ConfigBackupDeleteInput configBackupDeleteInput,
+ ResponseHandler<ConfigBackupDeleteOutput> listener) throws AppcClientException;
+
+ /**
+ * An operation to Export configurations of a virtual network function (or VM)
+ *
+ * @param configExportInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-export", outputType = ConfigExportOutput.class)
+ ConfigExportOutput configExport(ConfigExportInput configExportInput) throws AppcClientException;
+
+ /**
+ * An operation to Export configurations of a virtual network function (or VM)
+ *
+ * @param configExportInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-export", outputType = ConfigExportOutput.class)
+ void configExport(ConfigExportInput configExportInput, ResponseHandler<ConfigExportOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * Use the ModifyConfig command when a full configuration cycle is either not
+ * required or is considered too costly. The ModifyConfig LCM action affects
+ * only a subset of the total configuration data of a VNF. The set of
+ * configuration parameters to be affected is a subset of the total
+ * configuration data of the target VNF type. The payload block must contain the
+ * configuration parameters to be modified and their values. A successful modify
+ * returns a success response. A failed modify returns a failure response and
+ * the specific failure messages in the response payload block
+ *
+ * @param configModifyInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-modify", outputType = ConfigModifyOutput.class)
+ ConfigModifyOutput configModify(ConfigModifyInput configModifyInput) throws AppcClientException;
+
+ /**
+ * Use the ModifyConfig command when a full configuration cycle is either not
+ * required or is considered too costly. The ModifyConfig LCM action affects
+ * only a subset of the total configuration data of a VNF. The set of
+ * configuration parameters to be affected is a subset of the total
+ * configuration data of the target VNF type. The payload block must contain the
+ * configuration parameters to be modified and their values. A successful modify
+ * returns a success response. A failed modify returns a failure response and
+ * the specific failure messages in the response payload block
+ *
+ * @param configModifyInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-modify", outputType = ConfigModifyOutput.class)
+ void configModify(ConfigModifyInput configModifyInput, ResponseHandler<ConfigModifyOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * An operation to restore the configurations of a virtual network function (or
+ * VM)
+ *
+ * @param configRestoreInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-restore", outputType = ConfigRestoreOutput.class)
+ ConfigRestoreOutput configRestore(ConfigRestoreInput configRestoreInput) throws AppcClientException;
+
+ /**
+ * An operation to restore the configurations of a virtual network function (or
+ * VM)
+ *
+ * @param configRestoreInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-restore", outputType = ConfigRestoreOutput.class)
+ void configRestore(ConfigRestoreInput configRestoreInput, ResponseHandler<ConfigRestoreOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * An operation to scaleout the configurations of a virtual network function (or
+ * VM)
+ *
+ * @param configScaleoutInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-scaleout", outputType = ConfigScaleoutOutput.class)
+ ConfigScaleoutOutput configScaleout(ConfigScaleoutInput configScaleoutInput) throws AppcClientException;
+
+ /**
+ * An operation to scaleout the configurations of a virtual network function (or
+ * VM)
+ *
+ * @param configScaleoutInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "config-scaleout", outputType = ConfigScaleoutOutput.class)
+ void configScaleout(ConfigScaleoutInput configScaleoutInput, ResponseHandler<ConfigScaleoutOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * An operation to configure the configurations of a virtual network function
+ * (or VM)
+ *
+ * @param configureInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "configure", outputType = ConfigureOutput.class)
+ ConfigureOutput configure(ConfigureInput configureInput) throws AppcClientException;
+
+ /**
+ * An operation to configure the configurations of a virtual network function
+ * (or VM)
+ *
+ * @param configureInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "configure", outputType = ConfigureOutput.class)
+ void configure(ConfigureInput configureInput, ResponseHandler<ConfigureOutput> listener) throws AppcClientException;
+
+ /**
+ * An operation to evacuate a virtual network function (or VM)
+ *
+ * @param evacuateInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "evacuate", outputType = EvacuateOutput.class)
+ EvacuateOutput evacuate(EvacuateInput evacuateInput) throws AppcClientException;
+
+ /**
+ * An operation to evacuate a virtual network function (or VM)
+ *
+ * @param evacuateInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "evacuate", outputType = EvacuateOutput.class)
+ void evacuate(EvacuateInput evacuateInput, ResponseHandler<EvacuateOutput> listener) throws AppcClientException;
+
+ /**
+ * This command runs a VNF health check and returns the result. A health check
+ * is VNF-specific. For a complex VNF, APPC initiates further subordinate health
+ * checks
+ *
+ * @param healthCheckInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "health-check", outputType = HealthCheckOutput.class)
+ HealthCheckOutput healthCheck(HealthCheckInput healthCheckInput) throws AppcClientException;
+
+ /**
+ * This command runs a VNF health check and returns the result. A health check
+ * is VNF-specific. For a complex VNF, APPC initiates further subordinate health
+ * checks
+ *
+ * @param healthCheckInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "health-check", outputType = HealthCheckOutput.class)
+ void healthCheck(HealthCheckInput healthCheckInput, ResponseHandler<HealthCheckOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * The LiveUpgrade LCM action upgrades the target VNF to a new version without
+ * interrupting VNF operation. A successful upgrade returns a success status. A
+ * failed upgrade returns a failure code and the failure messages in the
+ * response payload block. The payload includes the IP of the location that
+ * hosts the new software version installer file and the new software version.
+ * Connections or operations that are active at the time of the LiveUpgrade
+ * action request will not be interrupted by the action and, therefore, the
+ * action may take a significant amount of time to run. A LiveUpgrade is defined
+ * as non-disruptive; it is the responsibility of the VNF to handle disruptions
+ * if they occur
+ *
+ * @param liveUpgradeInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "live-upgrade", outputType = LiveUpgradeOutput.class)
+ LiveUpgradeOutput liveUpgrade(LiveUpgradeInput liveUpgradeInput) throws AppcClientException;
+
+ /**
+ * The LiveUpgrade LCM action upgrades the target VNF to a new version without
+ * interrupting VNF operation. A successful upgrade returns a success status. A
+ * failed upgrade returns a failure code and the failure messages in the
+ * response payload block. The payload includes the IP of the location that
+ * hosts the new software version installer file and the new software version.
+ * Connections or operations that are active at the time of the LiveUpgrade
+ * action request will not be interrupted by the action and, therefore, the
+ * action may take a significant amount of time to run. A LiveUpgrade is defined
+ * as non-disruptive; it is the responsibility of the VNF to handle disruptions
+ * if they occur
+ *
+ * @param liveUpgradeInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "live-upgrade", outputType = LiveUpgradeOutput.class)
+ void liveUpgrade(LiveUpgradeInput liveUpgradeInput, ResponseHandler<LiveUpgradeOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * Use the Lock command to ensure exclusive access during a series of critical
+ * LCM commands. The Lock action will return a successful result if the VNF is
+ * not already locked or if it was locked with the same request-id, otherwise
+ * the action returns a response with a reject status code. When a VNF is
+ * locked, any subsequent sequential commands with same request-id will be
+ * accepted. Commands associated with other request-ids will be rejected. The
+ * Lock command returns only one final response with the status of the request
+ * processing. The APPC also locks the target VNF during any command processing.
+ * If a lock action is then requested on that VNF, it will be rejected because
+ * the VNF was already locked, even though no actual lock command was explicitly
+ * invoked
+ *
+ * @param lockInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "lock", outputType = LockOutput.class)
+ LockOutput lock(LockInput lockInput) throws AppcClientException;
+
+ /**
+ * Use the Lock command to ensure exclusive access during a series of critical
+ * LCM commands. The Lock action will return a successful result if the VNF is
+ * not already locked or if it was locked with the same request-id, otherwise
+ * the action returns a response with a reject status code. When a VNF is
+ * locked, any subsequent sequential commands with same request-id will be
+ * accepted. Commands associated with other request-ids will be rejected. The
+ * Lock command returns only one final response with the status of the request
+ * processing. The APPC also locks the target VNF during any command processing.
+ * If a lock action is then requested on that VNF, it will be rejected because
+ * the VNF was already locked, even though no actual lock command was explicitly
+ * invoked
+ *
+ * @param lockInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "lock", outputType = LockOutput.class)
+ void lock(LockInput lockInput, ResponseHandler<LockOutput> listener) throws AppcClientException;
+
+ /**
+ * Migrates a running target VFC from its current AIC host to another. A
+ * destination AIC node will be selected by relying on AIC internal rules to
+ * migrate. A successful Migrate action returns a success response and the new
+ * AIC node identity in the response payload block. A failed Migrate action
+ * returns a failure and the failure messages in the response payload block
+ *
+ * @param migrateInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "migrate", outputType = MigrateOutput.class)
+ MigrateOutput migrate(MigrateInput migrateInput) throws AppcClientException;
+
+ /**
+ * Migrates a running target VFC from its current AIC host to another. A
+ * destination AIC node will be selected by relying on AIC internal rules to
+ * migrate. A successful Migrate action returns a success response and the new
+ * AIC node identity in the response payload block. A failed Migrate action
+ * returns a failure and the failure messages in the response payload block
+ *
+ * @param migrateInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "migrate", outputType = MigrateOutput.class)
+ void migrate(MigrateInput migrateInput, ResponseHandler<MigrateOutput> listener) throws AppcClientException;
+
+ /**
+ * Recreates a target VFC instance to a known, stable state. A successful
+ * rebuild returns a success response and the rebuild details in the response
+ * payload block. A failed rebuild returns a failure and the failure messages in
+ * the response payload block
+ *
+ * @param rebuildInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "rebuild", outputType = RebuildOutput.class)
+ RebuildOutput rebuild(RebuildInput rebuildInput) throws AppcClientException;
+
+ /**
+ * Recreates a target VFC instance to a known, stable state. A successful
+ * rebuild returns a success response and the rebuild details in the response
+ * payload block. A failed rebuild returns a failure and the failure messages in
+ * the response payload block
+ *
+ * @param rebuildInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "rebuild", outputType = RebuildOutput.class)
+ void rebuild(RebuildInput rebuildInput, ResponseHandler<RebuildOutput> listener) throws AppcClientException;
+
+ /**
+ * An operation to restart a virtual network function (or VM)
+ *
+ * @param restartInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "restart", outputType = RestartOutput.class)
+ RestartOutput restart(RestartInput restartInput) throws AppcClientException;
+
+ /**
+ * An operation to restart a virtual network function (or VM)
+ *
+ * @param restartInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "restart", outputType = RestartOutput.class)
+ void restart(RestartInput restartInput, ResponseHandler<RestartOutput> listener) throws AppcClientException;
+
+ /**
+ * Sets a VNF to the previous version of the configuration without explicitly
+ * invoking the configuration set name. This command is used when the
+ * configuration was successful, but the health-check was not. A successful
+ * rollback returns a success status when the restart process has completed. A
+ * failed or a partially failed (for a complex VNF) rollback returns a failure
+ * and the failure messages in the response payload block. This command can be
+ * applied to any VNF type. The only restriction is that the particular VNF
+ * should be built based on the generic heap stack
+ *
+ * @param rollbackInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "rollback", outputType = RollbackOutput.class)
+ RollbackOutput rollback(RollbackInput rollbackInput) throws AppcClientException;
+
+ /**
+ * Sets a VNF to the previous version of the configuration without explicitly
+ * invoking the configuration set name. This command is used when the
+ * configuration was successful, but the health-check was not. A successful
+ * rollback returns a success status when the restart process has completed. A
+ * failed or a partially failed (for a complex VNF) rollback returns a failure
+ * and the failure messages in the response payload block. This command can be
+ * applied to any VNF type. The only restriction is that the particular VNF
+ * should be built based on the generic heap stack
+ *
+ * @param rollbackInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "rollback", outputType = RollbackOutput.class)
+ void rollback(RollbackInput rollbackInput, ResponseHandler<RollbackOutput> listener) throws AppcClientException;
+
+ /**
+ * Creates a snapshot of a VNF, or VM. The Snapshot command returns a customized
+ * response containing a reference to the newly created snapshot instance if the
+ * action is successful. This command can be applied to any VNF type. The only
+ * restriction is that the particular VNF should be built based on the generic
+ * heap stack
+ *
+ * @param snapshotInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "snapshot", outputType = SnapshotOutput.class)
+ SnapshotOutput snapshot(SnapshotInput snapshotInput) throws AppcClientException;
+
+ /**
+ * Creates a snapshot of a VNF, or VM. The Snapshot command returns a customized
+ * response containing a reference to the newly created snapshot instance if the
+ * action is successful. This command can be applied to any VNF type. The only
+ * restriction is that the particular VNF should be built based on the generic
+ * heap stack
+ *
+ * @param snapshotInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "snapshot", outputType = SnapshotOutput.class)
+ void snapshot(SnapshotInput snapshotInput, ResponseHandler<SnapshotOutput> listener) throws AppcClientException;
+
+ /**
+ * This LCM command uploads the file that contains a new software version to the
+ * target VNF
+ *
+ * @param softwareUploadInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "software-upload", outputType = SoftwareUploadOutput.class)
+ SoftwareUploadOutput softwareUpload(SoftwareUploadInput softwareUploadInput) throws AppcClientException;
+
+ /**
+ * This LCM command uploads the file that contains a new software version to the
+ * target VNF
+ *
+ * @param softwareUploadInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "software-upload", outputType = SoftwareUploadOutput.class)
+ void softwareUpload(SoftwareUploadInput softwareUploadInput, ResponseHandler<SoftwareUploadOutput> listener)
+ throws AppcClientException;
+
+ /**
+ * An operation to start a virtual network function (or VM)
+ *
+ * @param startInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "start", outputType = StartOutput.class)
+ StartOutput start(StartInput startInput) throws AppcClientException;
+
+ /**
+ * An operation to start a virtual network function (or VM)
+ *
+ * @param startInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "start", outputType = StartOutput.class)
+ void start(StartInput startInput, ResponseHandler<StartOutput> listener) throws AppcClientException;
+
+ /**
+ * Stop a target VNF or VNFC. A successful stop returns a success response. For
+ * a multi-component stop to be considered successful, all component stop
+ * actions must succeed. A failed stop returns a failure and the failure
+ * messages in the response payload block
+ *
+ * @param stopInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "stop", outputType = StopOutput.class)
+ StopOutput stop(StopInput stopInput) throws AppcClientException;
+
+ /**
+ * Stop a target VNF or VNFC. A successful stop returns a success response. For
+ * a multi-component stop to be considered successful, all component stop
+ * actions must succeed. A failed stop returns a failure and the failure
+ * messages in the response payload block
+ *
+ * @param stopInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "stop", outputType = StopOutput.class)
+ void stop(StopInput stopInput, ResponseHandler<StopOutput> listener) throws AppcClientException;
+
+ /**
+ * The Sync action updates the current configuration in the APPC store with the
+ * running configuration from the device. A successful Sync returns a success
+ * status. A failed Sync returns a failure response status and failure messages
+ * in the response payload block. This command can be applied to any VNF type.
+ * The only restriction is that a particular VNF should be able to support the
+ * interface for Reading Configuration using existing adapters and use the
+ * following protocols: CLI, RestConf and XML
+ *
+ * @param syncInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "sync", outputType = SyncOutput.class)
+ SyncOutput sync(SyncInput syncInput) throws AppcClientException;
+
+ /**
+ * The Sync action updates the current configuration in the APPC store with the
+ * running configuration from the device. A successful Sync returns a success
+ * status. A failed Sync returns a failure response status and failure messages
+ * in the response payload block. This command can be applied to any VNF type.
+ * The only restriction is that a particular VNF should be able to support the
+ * interface for Reading Configuration using existing adapters and use the
+ * following protocols: CLI, RestConf and XML
+ *
+ * @param syncInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "sync", outputType = SyncOutput.class)
+ void sync(SyncInput syncInput, ResponseHandler<SyncOutput> listener) throws AppcClientException;
+
+ /**
+ * Terminate a target VNF and release its resources (possibly gracefully).
+ * Specific scripts can be run before termination by placing them under the
+ * Terminate life cycle event. All configuration files related to the target VNF
+ * are deleted. The resources of a terminated VNF that are not managed by APPC,
+ * such as those handled by SDNC or other components, are not handled and remain
+ * the responsibility of their respective managing functions. A successful
+ * Terminate action returns a success response. For a multi-component terminate
+ * to be considered successful, all component Terminate actions must also
+ * succeed. A failed Terminate returns a failure status and the failure messages
+ * in the response payload block
+ *
+ * @param terminateInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "terminate", outputType = TerminateOutput.class)
+ TerminateOutput terminate(TerminateInput terminateInput) throws AppcClientException;
+
+ /**
+ * Terminate a target VNF and release its resources (possibly gracefully).
+ * Specific scripts can be run before termination by placing them under the
+ * Terminate life cycle event. All configuration files related to the target VNF
+ * are deleted. The resources of a terminated VNF that are not managed by APPC,
+ * such as those handled by SDNC or other components, are not handled and remain
+ * the responsibility of their respective managing functions. A successful
+ * Terminate action returns a success response. For a multi-component terminate
+ * to be considered successful, all component Terminate actions must also
+ * succeed. A failed Terminate returns a failure status and the failure messages
+ * in the response payload block
+ *
+ * @param terminateInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "terminate", outputType = TerminateOutput.class)
+ void terminate(TerminateInput terminateInput, ResponseHandler<TerminateOutput> listener) throws AppcClientException;
+
+ /**
+ * The Test LCM action checks a target VNF or VNFC for correct operation. The
+ * functionality of the Test LCM action involves should involve more than a
+ * HealthCheck , it should provide a means for launching a test transaction and
+ * determining if the transaction completed successfully or not. A transaction
+ * launcher microservice will have to be supplied by the VNF and called by APPC.
+ * A successful test returns a success and the results of the test in the
+ * payload block. A failed test returns a failure and specific failure messages
+ * in the payload block
+ *
+ * @param testInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "test", outputType = TestOutput.class)
+ TestOutput test(TestInput testInput) throws AppcClientException;
+
+ /**
+ * The Test LCM action checks a target VNF or VNFC for correct operation. The
+ * functionality of the Test LCM action involves should involve more than a
+ * HealthCheck , it should provide a means for launching a test transaction and
+ * determining if the transaction completed successfully or not. A transaction
+ * launcher microservice will have to be supplied by the VNF and called by APPC.
+ * A successful test returns a success and the results of the test in the
+ * payload block. A failed test returns a failure and specific failure messages
+ * in the payload block
+ *
+ * @param testInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "test", outputType = TestOutput.class)
+ void test(TestInput testInput, ResponseHandler<TestOutput> listener) throws AppcClientException;
+
+ /**
+ * Run the Unlock command to release the lock on a VNF and allow other clients
+ * to perform LCM commands on that VNF. The Unlock command will result in
+ * success if the VNF successfully unlocked or if it was already unlocked,
+ * otherwise commands will be rejected. The Unlock command will only return
+ * success if the VNF was locked with same request-id (on page 6). The Unlock
+ * command returns only one final response with the status of the request
+ * processing. The APPC also locks the target VNF during any command processing.
+ * If an Unlock action is then requested on that VNF with a different
+ * request-id, it will be rejected because the VNF is already locked for another
+ * process, even though no actual lock command was explicitly invoked
+ *
+ * @param unlockInput
+ * - RPC input object
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "unlock", outputType = UnlockOutput.class)
+ UnlockOutput unlock(UnlockInput unlockInput) throws AppcClientException;
+
+ /**
+ * Run the Unlock command to release the lock on a VNF and allow other clients
+ * to perform LCM commands on that VNF. The Unlock command will result in
+ * success if the VNF successfully unlocked or if it was already unlocked,
+ * otherwise commands will be rejected. The Unlock command will only return
+ * success if the VNF was locked with same request-id (on page 6). The Unlock
+ * command returns only one final response with the status of the request
+ * processing. The APPC also locks the target VNF during any command processing.
+ * If an Unlock action is then requested on that VNF with a different
+ * request-id, it will be rejected because the VNF is already locked for another
+ * process, even though no actual lock command was explicitly invoked
+ *
+ * @param unlockInput
+ * - RPC input object
+ * @param listener
+ * - callback implementation
+ * @throws AppcClientException
+ * - throw AppcClientException
+ */
+ @RPC(name = "unlock", outputType = UnlockOutput.class)
+ void unlock(UnlockInput unlockInput, ResponseHandler<UnlockOutput> listener) throws AppcClientException;
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java
new file mode 100644
index 000000000..f762dea2c
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.api;
+
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+
+public interface ResponseHandler<T> {
+
+ /**
+ * Handler to react when a response arrives
+ * @param response the response output object
+ */
+ void onResponse(T response);
+
+ /**
+ * Handler to react when an exception arrives instead of a response
+ * @param exception detailed with type of exception
+ */
+ void onException(AppcClientException exception);
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java
new file mode 100644
index 000000000..054dcc1ec
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.exceptions;
+
+public class AppcClientBusinessException extends AppcClientException {
+
+ public AppcClientBusinessException() {
+ super();
+ }
+
+ public AppcClientBusinessException(String message) {
+ super(message);
+ }
+
+ public AppcClientBusinessException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public AppcClientBusinessException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java
new file mode 100644
index 000000000..aad22ee38
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.exceptions;
+
+public class AppcClientException extends Exception {
+
+ public AppcClientException() {
+ super();
+ }
+
+ public AppcClientException(String message) {
+ super(message);
+ }
+
+ public AppcClientException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public AppcClientException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java
new file mode 100644
index 000000000..a92eb5562
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.exceptions;
+
+public class AppcClientInternalException extends AppcClientException {
+
+ public AppcClientInternalException() {
+ super();
+ }
+
+ public AppcClientInternalException(String message) {
+ super(message);
+ }
+
+ public AppcClientInternalException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public AppcClientInternalException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java
new file mode 100644
index 000000000..2cd671153
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory;
+import org.openecomp.appc.client.lcm.api.ApplicationContext;
+import org.openecomp.appc.client.lcm.api.LifeCycleManagerStateful;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+
+import java.lang.reflect.Proxy;
+import java.util.Properties;
+
+public class AppcLifeCycleManagerServiceFactoryImpl implements AppcLifeCycleManagerServiceFactory {
+
+ private LifeCycleManagerStateful lifeCycleManagerStateful;
+ private LCMRequestProcessor lcmRequestProcessor;
+
+ @Override
+ public synchronized LifeCycleManagerStateful createLifeCycleManagerStateful(ApplicationContext context, Properties properties) throws AppcClientException{
+ if (lifeCycleManagerStateful == null) {
+ lcmRequestProcessor = new LCMRequestProcessor(context, properties);
+ lifeCycleManagerStateful = (LifeCycleManagerStateful) Proxy.newProxyInstance(LifeCycleManagerStateful.class.getClassLoader(), new Class<?>[]{LifeCycleManagerStateful.class}, new RPCInvocator(lcmRequestProcessor));
+ }
+ else {
+ throw new IllegalStateException("already instansiated LifeCycleManagerStateful instance");
+ }
+ return lifeCycleManagerStateful;
+ }
+
+ @Override
+ public void shutdownLifeCycleManager(boolean isForceShutdown) {
+ if(lcmRequestProcessor != null){
+ lcmRequestProcessor.shutdown(isForceShutdown);
+ }
+ else{
+ throw new IllegalStateException("The life cycle manager library wasn't instantiated properly, therefore the shutdown event will not be handled");
+ }
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java
new file mode 100644
index 000000000..c01199e58
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.client.impl.core.CoreException;
+import org.openecomp.appc.client.impl.core.ICoreAsyncResponseHandler;
+import org.openecomp.appc.client.lcm.api.ResponseHandler;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+class CoreAsyncResponseHandlerImpl<T> extends CoreResponseHandler implements ICoreAsyncResponseHandler {
+
+ private final ResponseHandler<T> responseHandler;
+
+ CoreAsyncResponseHandlerImpl(ResponseHandler<T> responseHandler, Class<T> rpcOutput, ObjectMapper mapper) {
+ super(rpcOutput, mapper);
+ this.responseHandler = responseHandler;
+ }
+
+ public boolean onResponse(String message, String type) {
+ Boolean[] isFinal = new Boolean[1];
+ isFinal[0] = false;
+ try {
+ T responseObject = (T) super.getResponse(message, type, isFinal);
+ responseHandler.onResponse(responseObject);
+ return isFinal[0];
+ } catch (Exception e) {
+ this.onException(e);
+ isFinal[0] = true;
+ }
+ return isFinal[0];
+ }
+
+ public void onException(Exception e) {
+ AppcClientException ex = new AppcClientException(e);
+ responseHandler.onException(ex);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java
new file mode 100644
index 000000000..7a04251c8
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java
@@ -0,0 +1,108 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.client.lcm.exceptions.AppcClientInternalException;
+
+import org.openecomp.appc.client.lcm.model.Status;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+class CoreResponseHandler<T> {
+ private final Class<T> rpcOutput;
+ private final ObjectMapper mapper;
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(CoreResponseHandler.class);
+
+ CoreResponseHandler(Class<T> rpcOutput, ObjectMapper mapper) {
+ this.rpcOutput = rpcOutput;
+ this.mapper = mapper;
+ }
+
+ T getResponse(String message, String type, Boolean[] isFinal) throws AppcClientInternalException {
+ if (type.equals("error")) {
+ try {
+ String correlationId = getCorrelationID(message);
+ LOG.error("Received response with error on correlation id: " + correlationId);
+ } catch (IOException e) {
+ LOG.error("Received response with error and couldn't extract correlationID");
+ }
+ throw new AppcClientInternalException(message);
+ }
+ T responseObject = jsonToResponseObject(message);
+ int code = getStatusCode(responseObject);
+
+ int family = code / 100;
+
+ switch (family) {
+ case 1:
+ case 5:
+ // not final
+ break;
+ case 2:
+ case 3:
+ case 4:
+ isFinal[0] = true;
+ // final
+ break;
+ default: // Should never happen
+ throw new AppcClientInternalException(new IllegalStateException("Unsupported status code " + code + ". message: " + message));
+ }
+ return responseObject;
+
+ }
+
+ private T jsonToResponseObject(String message) throws AppcClientInternalException {
+ try {
+ JsonNode jsonOutput = mapper.readTree(message).get("output");
+ return rpcOutput.cast(mapper.treeToValue(jsonOutput, rpcOutput));
+ } catch (IOException e) {
+ throw new AppcClientInternalException("failed to read message: " + message, e);
+ }
+ }
+
+ private int getStatusCode(Object response) throws AppcClientInternalException {
+ try {
+ Method method = response.getClass().getMethod("getStatus");
+ Status status = (Status) method.invoke(response);
+ return status.getCode();
+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+ throw new AppcClientInternalException("failed to get status code from response: " + response, e);
+ }
+ }
+
+ private String getCorrelationID(String message) throws IOException {
+ JsonNode common = mapper.readTree(message).get("output").get("common-header");
+ String correlationId = common.get("request-id").asText() + "-" + common.get("sub-request-id").asText();
+ return correlationId;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java
new file mode 100644
index 000000000..34aae4723
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.client.impl.core.CoreException;
+import org.openecomp.appc.client.impl.core.ICoreSyncResponseHandler;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientInternalException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+class CoreSyncResponseHandlerImpl<T> extends CoreResponseHandler implements ICoreSyncResponseHandler {
+
+ CoreSyncResponseHandlerImpl(Class rpcOutput, ObjectMapper mapper) {
+ super(rpcOutput, mapper);
+ }
+
+ public <T> T onResponse(String message, String type) throws CoreException {
+ Boolean[] isFinal = new Boolean[1];
+ isFinal[0] = false;
+ T responseObject = null;
+ try {
+ responseObject = (T) super.getResponse(message, type, isFinal);
+ responseObject = (isFinal[0]) ? responseObject : null;
+ } catch (AppcClientInternalException e) {
+ throw new CoreException(e);
+ }
+
+ return responseObject;
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java
new file mode 100644
index 000000000..941e74dce
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java
@@ -0,0 +1,120 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.client.impl.core.*;
+import org.openecomp.appc.client.lcm.api.ApplicationContext;
+import org.openecomp.appc.client.lcm.api.ResponseHandler;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientBusinessException;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientInternalException;
+import org.openecomp.appc.client.lcm.model.CommonHeader;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Properties;
+import java.util.concurrent.TimeoutException;
+
+class LCMRequestProcessor {
+
+ private final IInvocationManager invocationManager;
+ private final ObjectMapper mapper;
+
+ LCMRequestProcessor(ApplicationContext context, Properties properties) throws AppcClientBusinessException {
+ try{
+ invocationManager = InvocationManagerFactory.getInstance();
+ invocationManager.init(properties);
+ mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ } catch (CoreException e) {
+ throw new AppcClientBusinessException(e);
+ }
+ }
+
+ <T> void processAsync(Object rpcInput, String rpcName, Class<T> rpcOutputType, ResponseHandler<T> handler) throws AppcClientInternalException {
+ try {
+ String correlationID = createCorrelationID(rpcInput);
+ String rpcStr = marshallRPCInput(rpcInput);
+ ICoreAsyncResponseHandler asyncResponseHandler = new CoreAsyncResponseHandlerImpl<T>(handler, rpcOutputType, mapper);
+ invocationManager.asyncRequest(rpcStr, asyncResponseHandler, correlationID, rpcName);
+ } catch (CoreException e) {
+ throw new AppcClientInternalException(e);
+ }
+ }
+
+ <T> T processSync(Object rpcInput, String rpcName, Class<T> rpcOutputType) throws AppcClientInternalException, AppcClientBusinessException {
+ T response = null;
+ try {
+ String correlationID = createCorrelationID(rpcInput);
+ String rpcStr = marshallRPCInput(rpcInput);
+ ICoreSyncResponseHandler syncResponseHandler = new CoreSyncResponseHandlerImpl<T>(rpcOutputType, mapper);
+ response = invocationManager.syncRequest(rpcStr, syncResponseHandler, correlationID, rpcName);
+ }catch (CoreException e){
+ if (e.getCause() instanceof AppcClientInternalException) {
+ throw (AppcClientInternalException) e.getCause();
+ }
+ else {
+ throw new AppcClientInternalException(e);
+ }
+ }catch (TimeoutException e){
+ throw new AppcClientBusinessException(e);
+ }
+ return response;
+ }
+
+ private CommonHeader getCommonHeader(Object rpcInput) throws AppcClientInternalException {
+ try {
+ Class<?> clazz = rpcInput.getClass();
+ Method method = clazz.getMethod("getCommonHeader");
+ return CommonHeader.class.cast(method.invoke(rpcInput));
+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+ throw new AppcClientInternalException("can't get commonHeader");
+ }
+ }
+
+ private String createCorrelationID(Object rpcInput) throws AppcClientInternalException {
+ CommonHeader commonHeader = getCommonHeader(rpcInput);
+ return commonHeader.getRequestId() + "-" + commonHeader.getSubRequestId();
+ }
+
+ private String marshallRPCInput(Object rpcInput) throws AppcClientInternalException {
+ try {
+ JsonNode body = mapper.valueToTree(rpcInput);
+ ObjectNode message = mapper.createObjectNode();
+ message.set("input", body);
+ return message.toString();
+ } catch (RuntimeException e) {
+ throw new AppcClientInternalException("can't marshall input", e);
+ }
+ }
+
+ void shutdown(boolean isForceShutdown){
+ invocationManager.shutdown(isForceShutdown);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java
new file mode 100644
index 000000000..97ff1c46f
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.lcm.impl.business;
+
+import org.openecomp.appc.RPC;
+import org.openecomp.appc.client.lcm.api.ResponseHandler;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientBusinessException;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientInternalException;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+class RPCInvocator implements InvocationHandler {
+
+ private final LCMRequestProcessor lcmRequestProcessor;
+
+ RPCInvocator(LCMRequestProcessor lcmRequestProcessor) {
+ this.lcmRequestProcessor = lcmRequestProcessor;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ if (isLCMRequest(method)) {
+ try {
+ return invokeImpl(method, args);
+ }
+ catch (AppcClientInternalException | AppcClientBusinessException e) {
+ throw new AppcClientException(e);
+ }
+ } else {
+ // Delegate non-RPC Object's methods (hashCode/equals/etc) to the proxy instance itself
+ return method.invoke(proxy, args);
+ }
+ }
+
+ private <T> T invokeImpl(Method method, Object[] args) throws AppcClientInternalException, AppcClientBusinessException {
+ Object rpcInput = args[0];
+ RPC annotation = method.getAnnotation(RPC.class);
+ String rpcName = annotation.name();
+ @SuppressWarnings("unchecked")
+ Class<T> rpcOutputType = (Class<T>) annotation.outputType();
+
+ T result = null;
+ if (isAsync(method)) {
+ @SuppressWarnings("unchecked")
+ ResponseHandler<T> handler = (ResponseHandler<T>) args[1];
+ lcmRequestProcessor.processAsync(rpcInput, rpcName, rpcOutputType, handler);
+ }
+ else {
+ result = lcmRequestProcessor.processSync(rpcInput, rpcName, rpcOutputType);
+ }
+ return result;
+ }
+
+ private boolean isLCMRequest(Method method) {
+ return method.isAnnotationPresent(RPC.class);
+ }
+
+ private boolean isAsync(Method method) {
+ return method.getReturnType().equals(Void.TYPE);
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java
new file mode 100644
index 000000000..3884428ff
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+/**
+* The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+*
+*/
+public enum Action {
+
+ Restart("Restart"),
+ Rebuild("Rebuild"),
+ Migrate("Migrate"),
+ Evacuate("Evacuate"),
+ Snapshot("Snapshot"),
+ Rollback("Rollback"),
+ Sync("Sync"),
+ Audit("Audit"),
+ Stop("Stop"),
+ Start("Start"),
+ Terminate("Terminate"),
+ SoftwareUpload("SoftwareUpload"),
+ HealthCheck("HealthCheck"),
+ LiveUpgrade("LiveUpgrade"),
+ Lock("Lock"),
+ Unlock("Unlock"),
+ Test("Test"),
+ CheckLock("CheckLock"),
+ Configure("Configure"),
+ ConfigModify("ConfigModify"),
+ ConfigScaleOut("ConfigScaleOut"),
+ ConfigRestore("ConfigRestore"),
+ ConfigBackup("ConfigBackup"),
+ ConfigBackupDelete("ConfigBackupDelete"),
+ ConfigExport("ConfigExport");
+
+ private String value;
+
+ Action(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static Action fromValue(String text) {
+ for (Action var : Action.values()) {
+ if (String.valueOf(var.value).equals(text)) {
+ return var;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java
new file mode 100644
index 000000000..54bd9a627
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java
@@ -0,0 +1,109 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.501+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ActionIdentifiers {
+
+ @JsonProperty("service-instance-id")
+ private String serviceInstanceId;
+
+ @JsonProperty("vnf-id")
+ private String vnfId;
+
+ @JsonProperty("vnfc-name")
+ private String vnfcName;
+
+ @JsonProperty("vserver-id")
+ private String vserverId;
+
+ /**
+ * identifies a specific service the command refers to. When multiple APP-C instances are used and applied to a subset of services, this will become significant . The field is mandatory when the vnf-id is empty
+ */
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ /**
+ * identifies a specific service the command refers to. When multiple APP-C instances are used and applied to a subset of services, this will become significant . The field is mandatory when the vnf-id is empty
+ */
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ /**
+ * identifies the VNF to which this action is to be applied(vnf-id uniquely identifies the service-instance referred to). Note that some actions are applied to multiple VNFs in the same service. When this is the case, vnf-id may be left out, but service-instance-id must appear. The field is mandatory when service-instance-id is empty
+ */
+ public String getVnfId() {
+ return vnfId;
+ }
+
+ /**
+ * identifies the VNF to which this action is to be applied(vnf-id uniquely identifies the service-instance referred to). Note that some actions are applied to multiple VNFs in the same service. When this is the case, vnf-id may be left out, but service-instance-id must appear. The field is mandatory when service-instance-id is empty
+ */
+ public void setVnfId(String vnfId) {
+ this.vnfId = vnfId;
+ }
+
+ /**
+ * identifies the VNFC to which this action is to be applied. Some actions apply only to a component within a VNF (e.g. RESTART is sometimes applied to on VM only). In such a case, the name of the VNFC is used to search for the component within the VNF
+ */
+ public String getVnfcName() {
+ return vnfcName;
+ }
+
+ /**
+ * identifies the VNFC to which this action is to be applied. Some actions apply only to a component within a VNF (e.g. RESTART is sometimes applied to on VM only). In such a case, the name of the VNFC is used to search for the component within the VNF
+ */
+ public void setVnfcName(String vnfcName) {
+ this.vnfcName = vnfcName;
+ }
+
+ /**
+ * identifies a specific VM within the given service/vnf to which this action is to be applied
+ */
+ public String getVserverId() {
+ return vserverId;
+ }
+
+ /**
+ * identifies a specific VM within the given service/vnf to which this action is to be applied
+ */
+ public void setVserverId(String vserverId) {
+ this.vserverId = vserverId;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java
new file mode 100644
index 000000000..b5f15e00f
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.512+05:30",
+ comments = "Auto-generated from Open API specification")
+public class AuditInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java
new file mode 100644
index 000000000..975c01b8f
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.517+05:30",
+ comments = "Auto-generated from Open API specification")
+public class AuditOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java
new file mode 100644
index 000000000..a0fdfee87
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.519+05:30",
+ comments = "Auto-generated from Open API specification")
+public class CheckLockInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java
new file mode 100644
index 000000000..b72ac0491
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.523+05:30",
+ comments = "Auto-generated from Open API specification")
+public class CheckLockOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ public enum Locked {
+ TRUE,
+ FALSE;
+ }
+
+ @JsonProperty("locked")
+ private Locked locked;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE
+ */
+ public Locked getLocked() {
+ return locked;
+ }
+
+ /**
+ * TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE
+ */
+ public void setLocked(Locked locked) {
+ this.locked = locked;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java
new file mode 100644
index 000000000..e71ad1294
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * A common header for all APP-C requests
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.49+05:30",
+ comments = "Auto-generated from Open API specification")
+public class CommonHeader {
+
+ @JsonProperty("timestamp")
+ private ZULU timestamp;
+
+ @JsonProperty("api-ver")
+ private String apiVer;
+
+ @JsonProperty("originator-id")
+ private String originatorId;
+
+ @JsonProperty("request-id")
+ private String requestId;
+
+ @JsonProperty("sub-request-id")
+ private String subRequestId;
+
+ @JsonProperty("flags")
+ private Flags flags;
+
+ /**
+ * Define a common definition of a time stamp (expressed as a formatted string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ
+ */
+ public ZULU getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * Define a common definition of a time stamp (expressed as a formatted string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ
+ */
+ public void setTimestamp(ZULU timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ /**
+ * api-ver is the API version identifier. A given release of APPC should support all previous versions of APPC API (correlate with general requirements)
+ */
+ public String getApiVer() {
+ return apiVer;
+ }
+
+ /**
+ * api-ver is the API version identifier. A given release of APPC should support all previous versions of APPC API (correlate with general requirements)
+ */
+ public void setApiVer(String apiVer) {
+ this.apiVer = apiVer;
+ }
+
+ /**
+ * originator-id an identifier of the calling system which can be used addressing purposes, i.e. returning asynchronous response to the proper destination over UEB (especially in case of multiple consumers of APP-C APIs)
+ */
+ public String getOriginatorId() {
+ return originatorId;
+ }
+
+ /**
+ * originator-id an identifier of the calling system which can be used addressing purposes, i.e. returning asynchronous response to the proper destination over UEB (especially in case of multiple consumers of APP-C APIs)
+ */
+ public void setOriginatorId(String originatorId) {
+ this.originatorId = originatorId;
+ }
+
+ /**
+ * UUID for the request ID. An OSS/BSS identifier for the request that caused the current action. Multiple API calls may be made with the same request-id The request-id shall be recorded throughout the operations on a single request
+ */
+ public String getRequestId() {
+ return requestId;
+ }
+
+ /**
+ * UUID for the request ID. An OSS/BSS identifier for the request that caused the current action. Multiple API calls may be made with the same request-id The request-id shall be recorded throughout the operations on a single request
+ */
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ /**
+ * Uniquely identifies a specific LCM action. It is persistent over the life-cycle of a single request
+ */
+ public String getSubRequestId() {
+ return subRequestId;
+ }
+
+ /**
+ * Uniquely identifies a specific LCM action. It is persistent over the life-cycle of a single request
+ */
+ public void setSubRequestId(String subRequestId) {
+ this.subRequestId = subRequestId;
+ }
+
+ /**
+ * Flags are generic flags that apply to any and all commands, all are optional
+ */
+ public Flags getFlags() {
+ return flags;
+ }
+
+ /**
+ * Flags are generic flags that apply to any and all commands, all are optional
+ */
+ public void setFlags(Flags flags) {
+ this.flags = flags;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java
new file mode 100644
index 000000000..96a87666d
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.533+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigBackupDeleteInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java
new file mode 100644
index 000000000..4edcfdb69
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.537+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigBackupDeleteOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java
new file mode 100644
index 000000000..8f6f64f39
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.526+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigBackupInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java
new file mode 100644
index 000000000..14f872192
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.529+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigBackupOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java
new file mode 100644
index 000000000..e42e2dfe2
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.541+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigExportInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java
new file mode 100644
index 000000000..25984aa1f
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.543+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigExportOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java
new file mode 100644
index 000000000..c4c16d602
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.559+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigModifyInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java
new file mode 100644
index 000000000..bc7e249da
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.563+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigModifyOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java
new file mode 100644
index 000000000..bfda83030
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.565+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigRestoreInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java
new file mode 100644
index 000000000..788c973a3
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.568+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigRestoreOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java
new file mode 100644
index 000000000..a81904472
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.571+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigScaleoutInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java
new file mode 100644
index 000000000..553d72644
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.574+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigScaleoutOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java
new file mode 100644
index 000000000..a1fe98964
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.577+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigureInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java
new file mode 100644
index 000000000..3de081468
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.585+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ConfigureOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java
new file mode 100644
index 000000000..b7908cdbd
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.587+05:30",
+ comments = "Auto-generated from Open API specification")
+public class EvacuateInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java
new file mode 100644
index 000000000..dd1dc0e03
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.59+05:30",
+ comments = "Auto-generated from Open API specification")
+public class EvacuateOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java
new file mode 100644
index 000000000..f0fa8f093
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java
@@ -0,0 +1,102 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Flags are generic flags that apply to any and all commands, all are optional
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.498+05:30",
+ comments = "Auto-generated from Open API specification")
+public class Flags {
+
+ public enum Mode {
+ EXCLUSIVE,
+ NORMAL;
+ }
+
+ @JsonProperty("mode")
+ private Mode mode;
+
+ public enum Force {
+ TRUE,
+ FALSE;
+ }
+
+ @JsonProperty("force")
+ private Force force;
+
+ @JsonProperty("ttl")
+ private int ttl;
+
+ /**
+ * EXCLUSIVE (accept no queued requests on this VNF while processing) or NORMAL (queue other requests until complete)
+ */
+ public Mode getMode() {
+ return mode;
+ }
+
+ /**
+ * EXCLUSIVE (accept no queued requests on this VNF while processing) or NORMAL (queue other requests until complete)
+ */
+ public void setMode(Mode mode) {
+ this.mode = mode;
+ }
+
+ /**
+ * TRUE/FALSE - Execute action even if target is in unstable (i.e. locked, transiting, etc.) state
+ */
+ public Force getForce() {
+ return force;
+ }
+
+ /**
+ * TRUE/FALSE - Execute action even if target is in unstable (i.e. locked, transiting, etc.) state
+ */
+ public void setForce(Force force) {
+ this.force = force;
+ }
+
+ /**
+ * The timeout value (expressed in seconds) for action execution, between action being received by APPC and action initiation
+ */
+ public int getTtl() {
+ return ttl;
+ }
+
+ /**
+ * The timeout value (expressed in seconds) for action execution, between action being received by APPC and action initiation
+ */
+ public void setTtl(int ttl) {
+ this.ttl = ttl;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java
new file mode 100644
index 000000000..2124d3cfe
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.593+05:30",
+ comments = "Auto-generated from Open API specification")
+public class HealthCheckInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java
new file mode 100644
index 000000000..6c2f5cc08
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.596+05:30",
+ comments = "Auto-generated from Open API specification")
+public class HealthCheckOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java
new file mode 100644
index 000000000..980bcae3e
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.602+05:30",
+ comments = "Auto-generated from Open API specification")
+public class LiveUpgradeInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java
new file mode 100644
index 000000000..3b40bde58
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.604+05:30",
+ comments = "Auto-generated from Open API specification")
+public class LiveUpgradeOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java
new file mode 100644
index 000000000..cb6bbe517
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.607+05:30",
+ comments = "Auto-generated from Open API specification")
+public class LockInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java
new file mode 100644
index 000000000..8c08002af
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.609+05:30",
+ comments = "Auto-generated from Open API specification")
+public class LockOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java
new file mode 100644
index 000000000..89504a950
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.612+05:30",
+ comments = "Auto-generated from Open API specification")
+public class MigrateInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java
new file mode 100644
index 000000000..38a439389
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.615+05:30",
+ comments = "Auto-generated from Open API specification")
+public class MigrateOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java
new file mode 100644
index 000000000..23a15ce4b
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.472+05:30",
+ comments = "Auto-generated from Open API specification")
+public class Payload {
+
+ private String value;
+
+ public Payload() {}
+
+ @JsonCreator
+ public Payload(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java
new file mode 100644
index 000000000..1041d515a
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.618+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RebuildInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java
new file mode 100644
index 000000000..48ade9328
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.621+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RebuildOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java
new file mode 100644
index 000000000..49a4a7ccb
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.623+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RestartInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java
new file mode 100644
index 000000000..69fc9def3
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.629+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RestartOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java
new file mode 100644
index 000000000..576954c99
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java
@@ -0,0 +1,128 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.653+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RollbackInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ @JsonProperty("identity-url")
+ private String identityUrl;
+
+ @JsonProperty("snapshot-id")
+ private String snapshotId;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+ public String getIdentityUrl() {
+ return identityUrl;
+ }
+
+ public void setIdentityUrl(String identityUrl) {
+ this.identityUrl = identityUrl;
+ }
+
+ public String getSnapshotId() {
+ return snapshotId;
+ }
+
+ public void setSnapshotId(String snapshotId) {
+ this.snapshotId = snapshotId;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java
new file mode 100644
index 000000000..ae8bbd068
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.656+05:30",
+ comments = "Auto-generated from Open API specification")
+public class RollbackOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java
new file mode 100644
index 000000000..fe13e9842
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.659+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SnapshotInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ @JsonProperty("identity-url")
+ private String identityUrl;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+ public String getIdentityUrl() {
+ return identityUrl;
+ }
+
+ public void setIdentityUrl(String identityUrl) {
+ this.identityUrl = identityUrl;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java
new file mode 100644
index 000000000..931f09db3
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.665+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SnapshotOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("snapshot-id")
+ private String snapshotId;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ public String getSnapshotId() {
+ return snapshotId;
+ }
+
+ public void setSnapshotId(String snapshotId) {
+ this.snapshotId = snapshotId;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java
new file mode 100644
index 000000000..286b351d2
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.668+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SoftwareUploadInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java
new file mode 100644
index 000000000..02bf80cdb
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.672+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SoftwareUploadOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java
new file mode 100644
index 000000000..a37228759
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-07-19T14:31:26.579+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StartApplicationInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java
new file mode 100644
index 000000000..7b3c193f4
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-07-19T14:31:26.58+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StartApplicationOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java
new file mode 100644
index 000000000..cfcf46384
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.675+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StartInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java
new file mode 100644
index 000000000..c3e58644d
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.679+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StartOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java
new file mode 100644
index 000000000..c70d8646c
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.507+05:30",
+ comments = "Auto-generated from Open API specification")
+public class Status {
+
+ @JsonProperty("code")
+ private int code;
+
+ @JsonProperty("message")
+ private String message;
+
+ /**
+ * Response code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Response code
+ */
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ /**
+ * Response message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Response message
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java
new file mode 100644
index 000000000..56e828216
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-07-19T14:31:26.586+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StopApplicationInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java
new file mode 100644
index 000000000..071276d36
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-07-19T14:31:26.588+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StopApplicationOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java
new file mode 100644
index 000000000..1cc7af4c3
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.689+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StopInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java
new file mode 100644
index 000000000..2fb0b7110
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.692+05:30",
+ comments = "Auto-generated from Open API specification")
+public class StopOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java
new file mode 100644
index 000000000..c9b861355
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.695+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SyncInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java
new file mode 100644
index 000000000..0fbe7e9f4
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.698+05:30",
+ comments = "Auto-generated from Open API specification")
+public class SyncOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java
new file mode 100644
index 000000000..44b0b8ef7
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.701+05:30",
+ comments = "Auto-generated from Open API specification")
+public class TerminateInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java
new file mode 100644
index 000000000..f3740c4ea
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.704+05:30",
+ comments = "Auto-generated from Open API specification")
+public class TerminateOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java
new file mode 100644
index 000000000..27507d9d1
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.706+05:30",
+ comments = "Auto-generated from Open API specification")
+public class TestInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java
new file mode 100644
index 000000000..5c2090183
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.708+05:30",
+ comments = "Auto-generated from Open API specification")
+public class TestOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java
new file mode 100644
index 000000000..e073c2dcf
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.711+05:30",
+ comments = "Auto-generated from Open API specification")
+public class UnlockInput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("action")
+ private Action action;
+
+ @JsonProperty("action-identifiers")
+ private ActionIdentifiers actionIdentifiers;
+
+ @JsonProperty("payload")
+ private Payload payload;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate
+ */
+ public void setAction(Action action) {
+ this.action = action;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public ActionIdentifiers getActionIdentifiers() {
+ return actionIdentifiers;
+ }
+
+ /**
+ * A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate
+ */
+ public void setActionIdentifiers(ActionIdentifiers actionIdentifiers) {
+ this.actionIdentifiers = actionIdentifiers;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public Payload getPayload() {
+ return payload;
+ }
+
+ /**
+ * The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value
+ */
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java
new file mode 100644
index 000000000..fb7cfeecb
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.716+05:30",
+ comments = "Auto-generated from Open API specification")
+public class UnlockOutput {
+
+ @JsonProperty("common-header")
+ private CommonHeader commonHeader;
+
+ @JsonProperty("status")
+ private Status status;
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public CommonHeader getCommonHeader() {
+ return commonHeader;
+ }
+
+ /**
+ * A common header for all APP-C requests
+ */
+ public void setCommonHeader(CommonHeader commonHeader) {
+ this.commonHeader = commonHeader;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+}
diff --git a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java
new file mode 100644
index 000000000..0517a906e
--- /dev/null
+++ b/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package org.openecomp.appc.client.lcm.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Define a common definition of a time stamp (expressed as a formatted string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ
+ */
+@javax.annotation.Generated(
+ value = {"templates/client-kit/open-api-to-java.ftl"},
+ date = "2017-05-04T20:09:01.441+05:30",
+ comments = "Auto-generated from Open API specification")
+public class ZULU {
+
+ private String value;
+
+ public ZULU() {}
+
+ @JsonCreator
+ public ZULU(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
diff --git a/appc-client/client-kit/src/test/java/json2java/Json2JavaGeneratorTest.java b/appc-client/client-kit/src/test/java/json2java/Json2JavaGeneratorTest.java
new file mode 100644
index 000000000..b5ded0283
--- /dev/null
+++ b/appc-client/client-kit/src/test/java/json2java/Json2JavaGeneratorTest.java
@@ -0,0 +1,171 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package json2java;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openecomp.appc.generator.JsonHelper;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.regex.Pattern;
+
+public class Json2JavaGeneratorTest {
+
+ private static JsonNode jsonNode = null;
+ private static final String MODEL_PACKAGE = "org.openecomp.appc.client.lcm.model";
+ private static final String GENERATED_LCM_API_CLASS = "org.openecomp.appc.client.lcm.api.LifeCycleManagerStateful";
+
+ //@Before
+ public void readIOfiles() throws IOException{
+ if(jsonNode == null){
+ jsonRead();
+ }
+
+ }
+
+ //@Test
+ public void testGeneratedJavaModel() {
+ Iterator<Map.Entry<String, JsonNode>> definitions = jsonNode.get("definitions").fields();
+ for (; definitions.hasNext(); ) {
+ Map.Entry<String, JsonNode> definitionEntry = definitions.next();
+ String definitionEntryKey = definitionEntry.getKey();
+ String className = MODEL_PACKAGE + "." + definitionEntryKey;
+ Class<?> generatedClass = null;
+ String errMsg = "the " + className + " was supposed to be generated, but not found";
+ try {
+ generatedClass = Class.forName(className);
+ Assert.assertNotNull(errMsg, generatedClass);
+ } catch (ClassNotFoundException e) {
+ Assert.fail(errMsg);
+ }
+
+ JsonNode properties = definitionEntry.getValue().get("properties");
+ if (generatedClass != null && properties != null && properties.fields() != null) {
+ Field[] declaredFields = generatedClass.getDeclaredFields();
+ Set<String> generatedFieldNames = new HashSet();
+ for(Field field : declaredFields){
+ generatedFieldNames.add(field.getName().toLowerCase());
+ }
+ Iterator<Map.Entry<String, JsonNode>> propertiesFields = properties.fields();
+ int totalExpectedFields = 0;
+ for (; propertiesFields.hasNext(); ) {
+ totalExpectedFields++;
+ Map.Entry<String, JsonNode> propertyEntry = propertiesFields.next();
+ String propertyEntryKey = propertyEntry.getKey();
+ String fieldNameFromJson = propertyEntryKey.replaceAll(Pattern.quote("-"),"").toLowerCase();
+ errMsg = "the field " + propertyEntryKey + " for " + className + " was supposed to be generated, but not found";
+ boolean contains = generatedFieldNames.contains(fieldNameFromJson);
+ Assert.assertTrue(errMsg, contains);
+ }
+ Assert.assertEquals("number of fields in "+className+" are not as expected!",totalExpectedFields,generatedFieldNames.size());
+ }
+ }
+ }
+
+ //@Test
+ public void testGeneratedJavaAPI() {
+ Map<String/*rpcOperation*/,Set<String> /*bodyInputParams*/> jsonBodyInputParams = new HashMap();
+ Map<String/*rpcOperation*/,Set<String> /*bodyOutputParams*/> jsonBodyOutputParams= new HashMap();
+ JsonHelper.populateRpcInputOutputSchemaRefFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams);
+ Assert.assertFalse(jsonBodyInputParams.isEmpty());
+ Assert.assertFalse(jsonBodyOutputParams.isEmpty());
+
+ //verify LifecycleManagementStatefulService was generated
+ Class<?> generatedClass = null;
+ String errMsg = "the " + GENERATED_LCM_API_CLASS + " was supposed to be generated, but not found";
+ try {
+ generatedClass = Class.forName(GENERATED_LCM_API_CLASS);
+ Assert.assertNotNull(errMsg, generatedClass);
+ } catch (ClassNotFoundException e) {
+ Assert.fail(errMsg);
+ }
+
+ //verify LifecycleManagementStatefulService was generated with methods
+ Method[] declaredMethods = generatedClass.getDeclaredMethods();
+ Assert.assertNotNull("no method was generated for "+GENERATED_LCM_API_CLASS,declaredMethods);
+
+ //verify correctness of input parameters and return type of each method
+ Set<String> generatedNonVoidMethods = new HashSet();
+ Set<String> generatedVoidMethods = new HashSet();
+ for(Method method : declaredMethods){
+ String returnType = method.getReturnType().getName();
+ Class<?>[] parameterTypes = method.getParameterTypes();
+ String methodName = method.getName().toLowerCase();
+ if(returnType.equals("void")){
+ generatedVoidMethods.add(methodName);
+ }else {
+ generatedNonVoidMethods.add(methodName);
+ //verify correctness of return type
+ String returnTypeSuffix = JsonHelper.getStringSuffix(returnType,".");
+ Set<String> jsonOutputParams = jsonBodyOutputParams.get(methodName);
+ Assert.assertNotNull(methodName+ " was not expected to return anything!",jsonOutputParams);
+ boolean contains = jsonOutputParams.contains(returnTypeSuffix);
+ Assert.assertTrue(methodName+ " was not expected to be with "+returnTypeSuffix+" return type!", contains);
+ }
+ //verify correctness of method input parameters
+ for (Class<?> parameterType :parameterTypes){
+ String parameterTypeSuffix = JsonHelper.getStringSuffix(parameterType.getName(), ".");
+ if(returnType.equals("void") && parameterTypeSuffix.equals("ResponseHandler")){
+ continue;
+ }
+ Set<String> jsonInputParams = jsonBodyInputParams.get(methodName);
+ Assert.assertNotNull(methodName+ " was not expected to be with any input parameter!",jsonInputParams);
+ boolean contains = jsonInputParams.contains(parameterTypeSuffix);
+ Assert.assertTrue(methodName+ " was not expected to be with "+parameterTypeSuffix+" parameter!", contains);
+ }
+
+ }
+
+ //verify total number of generated methods is same as expected
+ Assert.assertEquals("Total number of generated methods are not as expected!!",jsonBodyInputParams.size()*2,declaredMethods.length);
+ //verify all expected methods(void and non void) were generated
+ for(Map.Entry<String, Set<String>> rpcInputParams : jsonBodyInputParams.entrySet()){
+ errMsg = "none void method " + rpcInputParams.getKey() + "(case insensitive) for " + GENERATED_LCM_API_CLASS + " was supposed to be generated, but not found";
+ boolean contains = generatedNonVoidMethods.contains(rpcInputParams.getKey());
+ Assert.assertTrue(errMsg, contains);
+
+ errMsg = "void method " + rpcInputParams.getKey() + "(case insensitive) for " + GENERATED_LCM_API_CLASS + " was supposed to be generated, but not found";
+ contains = generatedVoidMethods.contains(rpcInputParams.getKey());
+ Assert.assertTrue(errMsg, contains);
+ }
+
+ }
+
+
+ private static void jsonRead ()throws IOException {
+ String jsonFilePath = System.getProperty("outputFile");
+ File file = new File(jsonFilePath);
+ ObjectMapper mapper = new ObjectMapper();
+ jsonNode = mapper.readTree(file);
+ }
+
+}
diff --git a/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java b/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java
new file mode 100644
index 000000000..6d9bf628f
--- /dev/null
+++ b/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.generator;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+public class JsonHelper {
+
+ private enum PopulateType{
+ PARAMETER,
+ SCHEMA_REF,
+ ;
+ }
+
+ public static void populateRpcInputOutputParamsFromJson(final JsonNode jsonNode, Map<String, Set<String>> jsonBodyInputParams, Map<String, Set<String>> jsonBodyOutputParams) {
+ populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.PARAMETER,false);
+ }
+ public static void populateRpcInputOutputSchemaRefFromJson(final JsonNode jsonNode, Map<String, Set<String>> jsonBodyInputParams, Map<String, Set<String>> jsonBodyOutputParams) {
+ populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.SCHEMA_REF,true);
+ }
+ public static void populateRpcInputOutputParamsFromJson(final JsonNode jsonNode, Map<String, Set<String>> jsonBodyInputParams, Map<String, Set<String>> jsonBodyOutputParams,PopulateType populateType,boolean normalizeRpcOperation) {
+ //get all yang2json Input and output Params and populate jsonBodyInputParams & jsonBodyOutputParams
+ for(Iterator<JsonNode> pathsElements = jsonNode.get("paths").elements(); pathsElements.hasNext(); ){
+ JsonNode pathNode = pathsElements.next();
+ String rpcOperation = pathNode.get("post").get("operationId").textValue();
+ String bodyInputSchemaRef = pathNode.get("post").get("parameters").get(0).get("schema").get("properties").get("input").get("$ref").textValue();
+ String bodyInputSchemaRefSuffix = JsonHelper.getStringSuffix(bodyInputSchemaRef,"/");
+ rpcOperation = normalizeRpcOperation ? rpcOperation.replaceAll(Pattern.quote("-"),"").toLowerCase() : rpcOperation;
+
+ String bodyOutputSchemaRef = pathNode.get("post").get("responses").get("200").get("schema").get("properties").get("output").get("$ref").textValue();
+ String bodyOutputSchemaRefSuffix = JsonHelper.getStringSuffix(bodyOutputSchemaRef,"/");
+
+ Set<String> inputParametersOrSchemaRef;
+ Set<String> outputParametersOrSchemaRef;
+ if(populateType == PopulateType.SCHEMA_REF){
+ inputParametersOrSchemaRef = new HashSet();
+ inputParametersOrSchemaRef.add(bodyInputSchemaRefSuffix);
+
+ outputParametersOrSchemaRef = new HashSet();
+ outputParametersOrSchemaRef.add(bodyOutputSchemaRefSuffix);
+ }else{
+ inputParametersOrSchemaRef = extractParams(jsonNode,bodyInputSchemaRefSuffix);
+ outputParametersOrSchemaRef = extractParams(jsonNode,bodyOutputSchemaRefSuffix);
+ }
+ jsonBodyInputParams.put(rpcOperation,inputParametersOrSchemaRef);
+ jsonBodyOutputParams.put(rpcOperation,outputParametersOrSchemaRef);
+ }
+ }
+
+ private static Set<String> extractParams(final JsonNode jsonNode,String schemaRefName) {
+ Iterator<Map.Entry<String, JsonNode>> fields = jsonNode.get("definitions").get(schemaRefName).get("properties").fields();
+ Set<String> params = new HashSet();
+ for( ;fields.hasNext(); ){
+ Map.Entry<String, JsonNode> fieldEntry = fields.next();
+ params.add(fieldEntry.getKey());
+ }
+ return params;
+ }
+
+ public static String getStringSuffix(String input, String afterString){
+ int indexOf = input.lastIndexOf(afterString);
+ String stringSuffix = (indexOf > -1) ? input.substring(indexOf+1) : input;
+ return stringSuffix;
+ }
+}
diff --git a/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java b/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java
new file mode 100644
index 000000000..2e8ef9577
--- /dev/null
+++ b/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.generator.yang2json;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Optional;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
+import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
+import org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver;
+import org.openecomp.appc.generator.JsonHelper;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+
+public class Yang2JsonGeneratorTest {
+
+ private static SchemaContext yangSchema = null;
+ private static JsonNode jsonNode = null;
+
+ public void readIOfiles() throws IOException{
+ if(yangSchema == null){
+ yangParse();
+ }
+ if(jsonNode == null){
+ jsonRead();
+ }
+
+ }
+
+ public void testJsonRpcNum(){
+
+ int rpcYangNum = yangSchema.getModules().iterator().next().getRpcs().size();
+ int rpcJsonNum = jsonNode.get("paths").size();
+ Assert.assertTrue(rpcYangNum == rpcJsonNum);
+ }
+
+ public void testJsonRpcsAndInOutParams(){
+
+ Map<String/*rpcOperation*/,Set<String> /*bodyInputParams*/> jsonBodyInputParams = new HashMap();
+ Map<String/*rpcOperation*/,Set<String> /*bodyOutputParams*/> jsonBodyOutputParams= new HashMap();
+ JsonHelper.populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams);
+
+ Set<RpcDefinition> rpcDefinitions = yangSchema.getModules().iterator().next().getRpcs();
+ for(RpcDefinition rpcDef : rpcDefinitions){
+ String rpcOperation = rpcDef.getQName().getLocalName();
+ //verify all yang rpc operations & all input yang params/groupings exist in yang2json
+ Assert.assertTrue(jsonBodyInputParams.containsKey(rpcOperation));
+ Collection<DataSchemaNode> inputChildNodes = rpcDef.getInput().getChildNodes();
+ if(inputChildNodes != null || !inputChildNodes.isEmpty()) {
+ Assert.assertTrue(rpcOperation+": yang and yang2json input params size is not equal!",jsonBodyInputParams.get(rpcOperation).size() == inputChildNodes.size());
+ Set<String> inputYangParams = getYangParams(inputChildNodes);
+ Assert.assertTrue(rpcOperation+": yang and yang2json input params are not same!",jsonBodyInputParams.get(rpcOperation).containsAll(inputYangParams));
+ }
+
+ //verify all yang rpc operations & all output yang params/groupings exist in yang2json
+ Assert.assertTrue(jsonBodyOutputParams.containsKey(rpcOperation));
+ Collection<DataSchemaNode> outputChildNodes = rpcDef.getOutput().getChildNodes();
+ if(outputChildNodes != null || !outputChildNodes.isEmpty()) {
+ Assert.assertTrue(rpcOperation+": yang and yang2json output params size is not equal!",jsonBodyOutputParams.get(rpcOperation).size()== outputChildNodes.size());
+ Set<String> outputYangParams = getYangParams(outputChildNodes);
+ Assert.assertTrue(rpcOperation+": yang and yang2json output params are not same!",jsonBodyOutputParams.get(rpcOperation).containsAll(outputYangParams));
+ }
+ }
+ }
+
+
+ private Set<String> getYangParams(Collection<DataSchemaNode> dataSchemaNodes) {
+ Set<String> yangParams = new HashSet();
+ for(DataSchemaNode child : dataSchemaNodes){
+ yangParams.add(child.getQName().getLocalName());
+ }
+ return yangParams;
+ }
+
+
+
+ private static void yangParse(){
+
+ try {
+ //sourceFileName
+ String yangFileName = System.getProperty("inputFile");
+ YangTextSchemaContextResolver yangContextResolver = null;
+ yangContextResolver = YangTextSchemaContextResolver.create("yang-context-resolver");
+ URL url = new File(yangFileName).toURI().toURL();
+ yangContextResolver.registerSource(url);
+ Optional<SchemaContext> yangSchemaContext = yangContextResolver.getSchemaContext();
+ yangSchema = yangSchemaContext.get();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ } catch (YangSyntaxErrorException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (SchemaSourceException e) {
+ e.printStackTrace();
+ }
+
+
+ }
+
+
+ private static void jsonRead ()throws IOException {
+ String jsonFilePath = System.getProperty("outputFile");
+ File file = new File(jsonFilePath);
+ ObjectMapper mapper = new ObjectMapper();
+ jsonNode = mapper.readTree(file);
+ }
+}
diff --git a/appc-client/client-lib/.gitignore b/appc-client/client-lib/.gitignore
new file mode 100644
index 000000000..1b08ea4e3
--- /dev/null
+++ b/appc-client/client-lib/.gitignore
@@ -0,0 +1,2 @@
+/target/
+client-lib/logs/EELF/application.log
diff --git a/appc-client/client-lib/pom.xml b/appc-client/client-lib/pom.xml
new file mode 100644
index 000000000..b51118a54
--- /dev/null
+++ b/appc-client/client-lib/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-java-client</artifactId>
+ <groupId>org.openecomp.appc.client</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>client-lib</artifactId>
+ <properties>
+ <licenseDir>${project.parent.parent.basedir}</licenseDir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.nsa</groupId>
+ <artifactId>cambriaClient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java
new file mode 100644
index 000000000..82d631965
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+/** Abstract request response handler class, responsible for common functionality of
+ * @{@link AsyncRequestResponseHandler} and @{@link SyncRequestResponseHandler}
+ */
+abstract class AbstractRequestResponseHandler implements RequestResponseHandler {
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(AbstractRequestResponseHandler.class);
+ ICoreResponseHandler businessCallback;
+ protected String corrID;
+ CoreManager coreManager;
+
+
+ AbstractRequestResponseHandler(String corrID,
+ ICoreResponseHandler businessCallback,
+ CoreManager coreManager)
+ {
+ this.businessCallback = businessCallback;
+ this.corrID = corrID;
+ this.coreManager = coreManager;
+ }
+
+ public synchronized void handleResponse(final MessageContext ctx, final String response) {
+ try {
+ coreManager.submitTask(ctx.getCorrelationID(), new Runnable() {
+ @Override
+ public void run() {
+ LOG.info("handling response of corrID <" + corrID + ">" + "response " + response);
+ if(coreManager.isExistHandler(corrID)) {
+ runTask(response, ctx.getType());
+ }
+
+ }
+ });
+ } catch (InterruptedException e) {
+ LOG.error("could not handle response <" + response + "> of corrID <" + corrID + ">", e);
+ }
+ }
+
+ /**
+ *
+ * @param response - Response
+ * @param type - Type of Response
+ */
+ abstract void runTask(String response, String type);
+
+ @Override
+ public void sendRequest(String request, String corrId, String rpcName) throws CoreException {
+ if(!coreManager.isShutdownInProgress()) {
+ coreManager.registerHandler(corrId, this);
+ coreManager.sendRequest(request, corrId, rpcName);
+ coreManager.startTimer(corrId);
+ }else{
+ throw new CoreException("Shutdown is in progress. Request will not be handled");
+ }
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java
new file mode 100644
index 000000000..86756e6b2
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.concurrent.TimeoutException;
+
+/** Handles async responses
+ */
+class AsyncRequestResponseHandler extends AbstractRequestResponseHandler {
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(AsyncRequestResponseHandler.class);
+
+ AsyncRequestResponseHandler(String corrID,
+ ICoreResponseHandler businessCallback,
+ CoreManager coreManager)
+ {
+ super(corrID, businessCallback, coreManager);
+ }
+
+ /**
+ * Calls API callback for sending response to consumer's listener. in case of complete response cleans timer and
+ * unregisters the handler.
+ * @param response - Response
+ * @param type - Type of Response
+ */
+ public void runTask(String response, String type) {
+ boolean finalTask = false;
+ try {
+ finalTask = ((ICoreAsyncResponseHandler) businessCallback).onResponse(response, type);
+ } catch (Exception e){
+ LOG.error("Error on API layer, for request with correlation-id " + corrID, e);
+ }
+ if (finalTask){
+ coreManager.cancelTimer(corrID);
+ coreManager.unregisterHandler(corrID);
+ }
+ else{
+ response = null;
+ type = null;
+ }
+ }
+
+ /**
+ * Calls to API layer for sending timeout exception.
+ */
+ @Override
+ public void onTimeOut() {
+ LOG.info("timeout for request with correlation-id " + corrID);
+ ((ICoreAsyncResponseHandler)businessCallback).onException(new TimeoutException("timeout for request with correlation-id " + corrID));
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java
new file mode 100644
index 000000000..009a1f42e
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+
+public class CoreException extends Exception {
+
+ public CoreException() {
+ super();
+ }
+
+ public CoreException(String message) {
+ super(message);
+ }
+
+ public CoreException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public CoreException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java
new file mode 100644
index 000000000..f299dc748
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java
@@ -0,0 +1,314 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import org.openecomp.appc.client.impl.protocol.*;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.Properties;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Consolidates all services(Registry, Timeout and Task Queue) for handling of requests/responses events.
+ */
+class CoreManager{
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(CoreManager.class);
+ private final ProtocolFactory protocolFactory;
+ protected AsyncProtocol protocol;
+ private final RetrieveMessageCallback protocolCallback = null;
+ private final CoreRegistry registry;
+ private final ITimerService timerService;
+ private final TaskQueueManager queueManager;
+ private String DEFAULT_TIMEOUT = "300000";
+ private final static String RESPONSE_TIMEOUT = "client.response.timeout";
+ private final static String GRACEFUL_SHUTDOWN_TIMEOUT = "client.graceful.shutdown.timeout";
+ private boolean isForceShutdown = false;
+ private AtomicBoolean isGracefulShutdown = new AtomicBoolean(false);
+ private long shutdownTimeout;
+
+ CoreManager(Properties prop) throws CoreException {
+ protocolFactory = ProtocolFactory.getInstance();
+ try {
+ initProtocol(prop);
+ }catch (ProtocolException e){
+ throw new CoreException(e);
+ }
+ registry = new CoreRegistry<RequestResponseHandler>(new EmptyRegistryCallbackImpl());
+ String timeoutProp = prop.getProperty(RESPONSE_TIMEOUT, DEFAULT_TIMEOUT);
+ long responseTimeout = Long.parseLong(timeoutProp);
+ String gracefulTimeout = prop.getProperty(GRACEFUL_SHUTDOWN_TIMEOUT, DEFAULT_TIMEOUT);
+ shutdownTimeout = Long.parseLong(gracefulTimeout);
+ timerService = new TimerServiceImpl(responseTimeout);
+ queueManager = new TaskQueueManager(prop);
+ listenShutdown();
+ }
+
+ /**
+ * initiates protocol layer services.
+ * @param prop - Properties
+ */
+ private void initProtocol(Properties prop) throws ProtocolException {
+ protocol = (AsyncProtocol) protocolFactory.getProtocolObject(ProtocolType.ASYNC);
+ protocol.init(prop, getProtocolCallback());
+ }
+
+ /**
+ * Creates protocol response callback
+ * @return - @{@link ProtocolResponseCallbackImpl}
+ */
+ RetrieveMessageCallback getProtocolCallback(){
+ return new ProtocolResponseCallbackImpl();
+ }
+
+ /**
+ * Registers a new handler in registry
+ * @param corrID - Correlation ID
+ * @param requestResponseHandler handler to be called when response arrives
+ */
+ void registerHandler(String corrID, RequestResponseHandler requestResponseHandler){
+ registry.register(corrID, requestResponseHandler);
+ }
+
+ /**
+ * Remove a handler from registry service by correlation ID.
+ * @param corrID - Correlation ID
+ * @return - @{@link RequestResponseHandler}
+ */
+ RequestResponseHandler unregisterHandler(String corrID){
+ return (RequestResponseHandler) registry.unregister(corrID);
+ }
+
+ /**
+ * Checks in registry service if a handler is existing.
+ * @param corrID - Correlation ID
+ * @return - boolean
+ */
+ boolean isExistHandler(String corrID) {
+ return registry.isExist(corrID);
+ }
+
+ /**
+ * Starts timer for timeout event when a request was send successfully.
+ * @param corrID - Correlation ID
+ */
+ void startTimer(String corrID){
+ timerService.add(corrID, new TimeoutHandlerImpl(corrID));
+ }
+
+ /**
+ * Cancels timer for fimeout event, in case when complete response was received
+ * @param corrID
+ */
+ void cancelTimer(String corrID){
+ timerService.cancel(corrID);
+ }
+
+ /**
+ * Submits a new task to Queue manager. it is using for both response and timeout tasks
+ * @param corrID - Correlation ID
+ * @param task - @{@link Runnable} task.
+ * @throws InterruptedException
+ */
+ void submitTask(String corrID, Runnable task) throws InterruptedException {
+ queueManager.submit(corrID, task);
+ }
+
+ /**
+ * Sends request to protocol.
+ * @param request - Request
+ * @param corrId - Correlation ID
+ * @param rpcName - RPC name
+ * @throws CoreException - @{@link CoreException}
+ */
+ void sendRequest(String request, String corrId, String rpcName) throws CoreException {
+ MessageContext ctx = getMessageContext(corrId, rpcName);
+ try {
+ protocol.sendRequest(request, ctx);
+ } catch (ProtocolException e) {
+ unregisterHandler(corrId);
+ throw new CoreException(e);
+ }
+ }
+
+ /**
+ * Creates @{@link MessageContext}
+ * @param correlationId - Correlation ID
+ * @param rpcName - RPC Name
+ * @return - @{@link MessageContext}
+ */
+ private MessageContext getMessageContext(String correlationId, String rpcName){
+ MessageContext msgCtx = new MessageContext();
+ msgCtx.setCorrelationID(correlationId);
+ msgCtx.setRpc(rpcName);
+ return msgCtx;
+ }
+
+ /**
+ * Implements response callback from protocol and filters responses by correlation ID.
+ * Only registered events(by correlation ID) will be handled.
+ */
+ private class ProtocolResponseCallbackImpl implements RetrieveMessageCallback {
+ @Override
+ public void onResponse(String response, MessageContext context) {
+ String corrID = context.getCorrelationID();
+ if (corrID != null) {
+ RequestResponseHandler messageHandler = (RequestResponseHandler) registry.get(corrID);
+ if (messageHandler != null) {
+ LOG.info("On response callback corrID <" + corrID + "> handler " + messageHandler + " response " + response);
+ messageHandler.handleResponse(context, response);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * listens to @{@link Runtime} shutdown event
+ */
+ private void listenShutdown() {
+ Runtime.getRuntime().addShutdownHook(new Thread(){
+ public void run(){
+ gracefulShutdown();
+ }
+ });
+ }
+
+ /**
+ * Implements shutdown for client library.
+ * @param isForceShutdown - true force shutdown, false graceful shutdown
+ */
+ void shutdown(boolean isForceShutdown){
+ if(isForceShutdown){
+ forceShutdown();
+ }else{
+ gracefulShutdown();
+ }
+ }
+
+ /**
+ * Graceful shutdown. in case of all requests already were handled, calls to force shutdown. another goes to force
+ * shutdown only when either all request will be handled or graceful shutdown will be time out.
+ */
+ synchronized void gracefulShutdown(){
+ isGracefulShutdown.set(true);
+ if(registry.isEmpty()){
+ forceShutdown();
+ }
+ else{
+ try {
+ LOG.info("Core manager::graceful shutdown is starting... this <" + this + ">");
+ wait(shutdownTimeout);
+ LOG.info("Core manager::graceful shutdown is continue... this <" + this + ">");
+ forceShutdown();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ /**
+ * Closes Protocol, stops Queue Manager and shutdowns Time Service.
+ */
+ private void forceShutdown(){
+ isForceShutdown = true;
+ try {
+ LOG.info("Starting shutdown process.");
+ protocol.shutdown();
+ queueManager.stopQueueManager();
+ timerService.shutdown();
+ } catch (InterruptedException e) {
+ LOG.info("Client library shutdown in progress ", e);
+ }
+ }
+
+ /**
+ *
+ * @return - true when shutdown is in process
+ */
+ boolean isShutdownInProgress(){
+ return isForceShutdown || isGracefulShutdown.get();
+ }
+
+ /**
+ * Timeout handler implementation.
+ * This handler is responsible to assign a task for handling of timeout events.
+ *
+ */
+ private class TimeoutHandlerImpl implements ITimeoutHandler {
+
+ private final String corrID;
+
+ TimeoutHandlerImpl(String corrID) {
+ this.corrID = corrID;
+ }
+
+ /**
+ * When a timeout event is occurring, the new Timeout task will be assigned into a queue,
+ * this queue is shared between both timeout and handlers which belong to same correlation ID.
+ */
+ @Override
+ public void onTimeout() {
+ try {
+ submitTask(corrID, new Runnable() {
+ @Override
+ public void run() {
+ RequestResponseHandler requestResponseHandler = unregisterHandler(corrID);
+ if (requestResponseHandler != null) {
+ requestResponseHandler.onTimeOut();
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ LOG.warn("could not submit timeout task for correlation ID <" + corrID + "> ", e);
+ }
+ }
+ }
+
+
+ /**
+ * Wakes Up graceful shutdown.
+ */
+ class EmptyRegistryCallbackImpl implements CoreRegistry.EmptyRegistryCallback {
+ @Override
+ public synchronized void emptyCallback() {
+ LOG.info("Registry is empty, wake up the shutdown!, isGraceful flag <" + isGracefulShutdown + ">");
+ if(isGracefulShutdown.get()){
+ wakeUpShutdown();
+ }
+ }
+ }
+
+ /**
+ * wakes up waiting shutdown.
+ */
+ private synchronized void wakeUpShutdown(){
+ notifyAll();
+ }
+
+}
+
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java
new file mode 100644
index 000000000..8d5d0b729
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/** client lib Registry
+ */
+class CoreRegistry<T>{
+ private Map<String, T> registry =
+ new ConcurrentHashMap<String, T>();
+
+ final private EmptyRegistryCallback emptyRegistryCallback;
+
+
+ CoreRegistry(EmptyRegistryCallback emptyRegistryCallback){
+ this.emptyRegistryCallback = emptyRegistryCallback;
+ }
+
+ void register(String key, T obj) {
+ registry.put(key, obj);
+ }
+
+ <T> T unregister(String key) {
+ T item = (T) registry.remove(key);
+ if(registry.isEmpty()) {
+ emptyRegistryCallback.emptyCallback();
+ }
+ return item;
+ }
+
+ <T> T get(String key){
+ return (T) registry.get(key);
+ }
+
+ synchronized boolean isExist(String key) {
+ return registry.containsKey(key);
+ }
+
+ boolean isEmpty(){
+ return registry.isEmpty();
+ }
+
+ public interface EmptyRegistryCallback{
+ void emptyCallback();
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java
new file mode 100644
index 000000000..23fce28dc
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+public interface ICoreAsyncResponseHandler extends ICoreResponseHandler{
+
+ /**
+ * Core response to incoming message
+ * @param message response accepted from protocol
+ * @param type type of response
+ * @return true if message is final, false otherwise
+ */
+ boolean onResponse(String message, String type);
+
+ /**
+ * Core reaction to an event of exception
+ * @param e the exception which have been thrown
+ */
+ void onException(Exception e);
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java
new file mode 100644
index 000000000..4f0cb8a8c
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+public interface ICoreResponseHandler {
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java
new file mode 100644
index 000000000..332986733
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+public interface ICoreSyncResponseHandler extends ICoreResponseHandler{
+
+ /**
+ * Core response to incoming message, should return completed message only
+ * @param message response accepted from protocol
+ * @param type type of response
+ * @return true if message is final, false otherwise
+ */
+ <T> T onResponse(String message, String type) throws CoreException;
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java
new file mode 100644
index 000000000..831263aad
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import java.util.Properties;
+import java.util.concurrent.TimeoutException;
+
+/**
+ */
+public interface IInvocationManager {
+
+ /**
+ * initializes the manager
+ * @param prop properties to read from
+ * @throws CoreException thrown if madatory fields are not set right
+ */
+ void init(Properties prop) throws CoreException;
+
+ /**
+ * handles the flow of an async request
+ * @param request the request body
+ * @param listener business response handler
+ * @param correlationId unique id of the request
+ * @param rpcName rpc call name
+ * @throws CoreException thrown if the request failed to be sent
+ */
+ void asyncRequest(String request, ICoreAsyncResponseHandler listener, String correlationId, String rpcName) throws CoreException;
+
+ /**
+ * handles to flow of a sync request
+ * @param request the request body
+ * @param callback business response handler
+ * @param correlationId unique id of the request
+ * @param rpcName rpc call name
+ * @return the output object to be returned
+ * @throws CoreException thrown if the request failed to be sent
+ * @throws TimeoutException thrown if timeout has exceeded
+ */
+ <T> T syncRequest(String request, ICoreSyncResponseHandler callback, String correlationId, String rpcName) throws CoreException, TimeoutException;
+
+ /**
+ * shuts the invocation manager down.
+ * @param isForceShutdown if true, shutdown will be forced, otherwise it will be gracefully
+ */
+ void shutdown(boolean isForceShutdown);
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java
new file mode 100644
index 000000000..e2ec1d6cc
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+interface ITimeoutHandler {
+
+ /**
+ * handles timeout event
+ */
+ void onTimeout();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java
new file mode 100644
index 000000000..c5a4145f9
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+interface ITimerService {
+
+ /**
+ * add a new timeout handler to a request
+ * @param correlationID the id of the request
+ * @param handler to be called once "timeout' time has arrived
+ */
+ void add(String correlationID, ITimeoutHandler handler);
+
+ /**
+ * cancel the timeout handler of a request
+ * @param correlationID the id of the request
+ */
+ void cancel(String correlationID);
+
+
+ /**
+ * shuts the timer service down immediately
+ */
+ void shutdown();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java
new file mode 100644
index 000000000..0582244ff
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import java.util.Properties;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * layer for passing requests from API to Core
+ */
+class InvocationManager implements IInvocationManager{
+
+ protected CoreManager coreManager = null;
+
+ InvocationManager(){
+ }
+
+ public void init(Properties properties) throws CoreException {
+ coreManager = new CoreManager(properties);
+ }
+
+ /**
+ *
+ * @param request
+ * @param businessCallback
+ * @param correlationId
+ * @param rpcName
+ * @throws CoreException
+ */
+ public void asyncRequest(String request, ICoreAsyncResponseHandler businessCallback, String correlationId, String rpcName) throws CoreException {
+ AsyncRequestResponseHandler requestResponseHandler = new AsyncRequestResponseHandler(correlationId, businessCallback, coreManager);
+ requestResponseHandler.sendRequest(request, correlationId, rpcName);
+ }
+
+ public <T> T syncRequest(String request, ICoreSyncResponseHandler businessCallback, String correlationId, String rpcName ) throws CoreException, TimeoutException {
+ SyncRequestResponseHandler requestResponseHandler = new SyncRequestResponseHandler(correlationId, businessCallback, coreManager);
+ requestResponseHandler.sendRequest(request, correlationId, rpcName);
+ T responseObject = (T) requestResponseHandler.getResponse();
+ return responseObject;
+ }
+
+ @Override
+ public void shutdown(boolean isForceShutdown) {
+ coreManager.shutdown(isForceShutdown);
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java
new file mode 100644
index 000000000..32b3ff22f
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+public abstract class InvocationManagerFactory {
+ private static IInvocationManager invocationManager = null;
+
+ public static synchronized IInvocationManager getInstance(){
+ if(invocationManager == null){
+ invocationManager = new InvocationManager();
+ }
+ return invocationManager;
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java
new file mode 100644
index 000000000..abd644cea
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+/** Helper class for wrapping request/response information.
+ */
+public class MessageContext {
+
+ /**
+ * valid values of type are response/error
+ */
+ private String type;
+
+ /**
+ * RPC name
+ */
+ private String rpc;
+
+ /**
+ * correlation ID
+ */
+ private String correlationID;
+
+ /**
+ * partitioner for message bus usage
+ */
+ private String partitioner;
+
+
+ public String getRpc() {
+ return rpc;
+ }
+
+ public void setRpc(String rpc) {
+ this.rpc = rpc;
+ }
+
+ public String getCorrelationID() {
+ return correlationID;
+ }
+
+ public void setCorrelationID(String correlationID) {
+ this.correlationID = correlationID;
+ }
+
+ public String getPartiton() {
+ return partitioner;
+ }
+
+ public void setPartiton(String partitioner) {
+ this.partitioner = partitioner;
+ }
+
+ public void setType(String type){
+ this.type = type;
+ }
+
+ public String getType(){
+ return type;
+ }
+
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java
new file mode 100644
index 000000000..7264e35f8
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+interface RequestResponseHandler {
+
+ /**
+ * sends request, registers handler of response and start timer.
+ * @param request - Request
+ * @param corrId - correlation ID
+ * @param rpcName - RPC name
+ * @throws CoreException - @{@link CoreException}
+ */
+ void sendRequest(String request, String corrId, String rpcName) throws CoreException;
+
+ /**
+ * submits a handler task to task queue @{@link TaskQueue}, this task will be performed only if this handler is
+ * still existing in core registry @{@link CoreRegistry}, others timeout was occurred .
+ * @param ctx - Message Context @{@link MessageContext}
+ * @param response - Response from backend
+ */
+ void handleResponse(MessageContext ctx, String response);
+
+ /**
+ * handles timeout event
+ */
+ void onTimeOut();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java
new file mode 100644
index 000000000..e7a65766e
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.concurrent.TimeoutException;
+
+/** Handles sync requests
+ */
+class SyncRequestResponseHandler<T> extends AbstractRequestResponseHandler {
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(SyncRequestResponseHandler.class);
+ private T responseObject = null;
+ private CoreException coreException = null;
+ private TimeoutException timeoutException = null;
+
+ SyncRequestResponseHandler(String corrID,
+ ICoreResponseHandler callback,
+ CoreManager coreManager){
+ super(corrID, callback, coreManager);
+ }
+
+ /**
+ * Calls API callback for getting response object. in case of complete response notifies consumer
+ * thread for receiving response
+ * @param response - Response
+ * @param type - Type of Response
+ */
+ synchronized void runTask(String response, String type) {
+ try {
+ responseObject = ((ICoreSyncResponseHandler) businessCallback).onResponse(response, type);
+ } catch (CoreException e) {
+ coreException = e;
+ }
+ if(responseObject != null || coreException != null) {
+ notify();
+ }
+ }
+
+
+ /**
+ * Returns response. goes sleep until coming either timeout event or complete response
+ */
+ public synchronized <T> T getResponse() throws CoreException, TimeoutException {
+ try{
+ if(!isResponseReceived()){
+ wait();
+ }
+ if (coreException != null) {
+ throw coreException;
+ }
+ if ( timeoutException != null) {
+ throw timeoutException;
+ }
+
+ } catch (InterruptedException e) {
+ throw new CoreException(e);
+ } finally{
+ coreManager.unregisterHandler(corrID);
+ coreManager.cancelTimer(corrID);
+ }
+ return (T) responseObject;
+ }
+
+ /**
+ * indicates if a response received
+ * @return
+ */
+ private boolean isResponseReceived() {
+ return responseObject != null;
+ }
+
+ @Override
+ public synchronized void onTimeOut() {
+ LOG.error("sync response handler on timeout correlation ID <" + corrID + ">.");
+ timeoutException = new TimeoutException("timeout for request with correlation-id " + corrID);
+ notify();
+ }
+
+
+
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java
new file mode 100644
index 000000000..e75d33f91
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+/** Responsible to ensure synchronous handling of responses and timouts.
+ */
+class TaskQueue implements Runnable{
+
+ private final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(TaskQueue.class);
+
+ private boolean isShutdown;
+
+ synchronized void addTask(Runnable task) throws InterruptedException {
+ queue.put(task);
+ }
+
+ public void run() {
+ Runnable task;
+ while(!Thread.currentThread().isInterrupted() && !isShutdown){
+ try {
+ task = queue.take();
+ task.run();
+ } catch (InterruptedException e) {
+ LOG.error("could not take task from queue", e);
+ } catch (RuntimeException e) {
+ LOG.error("could not run task", e);
+ }
+ LOG.info("THR# <" + Thread.currentThread().getId() + "> shutdown indicator " + isShutdown);
+ }
+ LOG.info("THR# <" + Thread.currentThread().getId() + "> in shutdown process.");
+ }
+
+ void stopQueue(){
+ isShutdown = true;
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java
new file mode 100644
index 000000000..1d1fc1533
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/** Creates a task queue pool that reuses a fixed number of threads.
+ * Assigns one thread for each queue.
+ */
+class TaskQueueManager {
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(TaskQueueManager.class);
+ private ExecutorService executorService;
+ private final static String DEFAULT_POOL_SIZE = "10";
+ private final static String CLIENT_POOL_SIZE = "client.pool.size";
+ private TaskQueue[] queues;
+ private int poolInt;
+
+ TaskQueueManager(Properties properties){
+ String size = properties.getProperty(CLIENT_POOL_SIZE, DEFAULT_POOL_SIZE);
+ poolInt = Integer.parseInt(size);
+ this.executorService = Executors.newFixedThreadPool(poolInt);
+ initTaskQueues();
+ }
+
+ private void initTaskQueues(){
+ queues = new TaskQueue[poolInt];
+ for(int i=0; i<poolInt; i++){
+ queues[i] = new TaskQueue();
+ this.executorService.submit(queues[i]);
+ }
+ }
+
+ void submit(String corrID, Runnable task) throws InterruptedException {
+ TaskQueue queue = getTaskQueue(corrID);
+ queue.addTask(task);
+ }
+
+ /**
+ * ensures synchronous handling all responses and timeout belongs to same correlation ID
+ * @param corrID
+ * @return - @{@link TaskQueue}
+ */
+ private TaskQueue getTaskQueue(String corrID){
+ int index = Math.abs(corrID.hashCode()) % poolInt;
+ return queues[index];
+ }
+
+ /**
+ * goes over queues for stopping threads
+ * @throws InterruptedException
+ */
+ void stopQueueManager() throws InterruptedException {
+ for(int i=0; i<poolInt; i++){
+ queues[i].stopQueue();
+ queues[i].addTask(new Runnable() {
+ @Override
+ public void run() {
+ /**
+ * wake up the queue for stopping thread
+ */
+ }
+ });
+ }
+ List<Runnable> listTask = executorService.shutdownNow();
+ if (!executorService.awaitTermination(6, TimeUnit.SECONDS))
+ System.err.println("Pool did not terminate");
+ LOG.info("the amount of tasks that never commenced execution " + listTask.size());
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java
new file mode 100644
index 000000000..10f664c65
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.List;
+import java.util.concurrent.*;
+
+class TimerServiceImpl implements ITimerService {
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(TimerServiceImpl.class);
+ private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
+ private final ConcurrentHashMap<String, Future> timeOutEvents = new ConcurrentHashMap<>();
+ private final long responseTimeout;
+
+ TimerServiceImpl(long responseTimeout) {
+ this.responseTimeout = responseTimeout;
+ }
+
+ @Override
+ public synchronized void cancel(String correlationID) {
+ Future timeOutEvent = timeOutEvents.remove(correlationID);
+ if (timeOutEvent != null){
+ timeOutEvent.cancel(true);
+ }
+ }
+
+ @Override
+ public synchronized void add(String correlationID, ITimeoutHandler handler) {
+ Future timeOutEvent = scheduler.schedule(new HandleTimeout(correlationID, handler), responseTimeout, TimeUnit.MILLISECONDS);
+ timeOutEvents.put(correlationID, timeOutEvent);
+ }
+
+ @Override
+ public void shutdown() {
+ List<Runnable> listTask = scheduler.shutdownNow();
+ LOG.info("the amount of tasks that never commenced execution " + listTask.size());
+ }
+
+ private class HandleTimeout implements Runnable {
+
+ String correlationID;
+ ITimeoutHandler handler;
+
+ HandleTimeout(String correlationID, ITimeoutHandler handler) {
+ this.correlationID = correlationID;
+ this.handler = handler;
+ }
+
+ @Override
+ public void run(){
+ System.out.println("Timeout event of request " + correlationID);
+ handler.onTimeout();
+ timeOutEvents.remove(correlationID);
+ }
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java
new file mode 100644
index 000000000..1415514ac
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.IOException;
+
+class APPCMessageReaderWriter implements MessageReader, MessageWriter {
+
+ private final ObjectMapper mapper;
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(APPCMessageReaderWriter.class);
+
+ APPCMessageReaderWriter() {
+ mapper = new ObjectMapper();
+ }
+
+ public String read(String payload, MessageContext context) throws ProtocolException {
+ try {
+ ProtocolMessage protocolMessage = mapper.readValue(payload, ProtocolMessage.class);
+ context.setType(protocolMessage.getType());
+ context.setRpc(protocolMessage.getRpcName());
+ context.setCorrelationID(protocolMessage.getCorrelationID());
+ context.setPartiton(protocolMessage.getPartition());
+ String body = protocolMessage.getBody().toString();
+ LOG.debug("Received body : <" + body + ">");
+ return body;
+ } catch (IOException e) {
+ throw new ProtocolException(e);
+ }
+
+ }
+
+ public String write(String payload, MessageContext context) throws ProtocolException {
+ try {
+ ProtocolMessage protocolMessage = new ProtocolMessage();
+ protocolMessage.setVersion("2.0");
+ protocolMessage.setType(context.getType());
+ protocolMessage.setRpcName(context.getRpc());
+ protocolMessage.setCorrelationID(context.getCorrelationID());
+ protocolMessage.setPartition(context.getPartiton());
+ JsonNode body = mapper.readTree(payload);
+ protocolMessage.setBody(body);
+ String message = mapper.writeValueAsString(protocolMessage);
+ return message;
+ } catch (IOException e) {
+ throw new ProtocolException(e);
+ }
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java
new file mode 100644
index 000000000..6d42d7cf4
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+
+public interface AsyncProtocol extends Protocol {
+
+ /**
+ * sends a string message to underlying message bus/java API
+ * @param payload - meesage body
+ * @param context - message headers
+ * @throws ProtocolException
+ */
+ void sendRequest(String payload, MessageContext context) throws ProtocolException;
+
+ void shutdown();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java
new file mode 100644
index 000000000..a20c2a0cb
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+class AsyncProtocolImpl implements AsyncProtocol {
+
+ /**
+ * message bus listener thread handler
+ */
+ private Future listenerHandler;
+ /**
+ * called when messages are fetched - called for a single message
+ */
+ private RetrieveMessageCallback callback;
+ /**
+ * message bus client used to send/fetch
+ */
+ private MessagingService messageService;
+ /**
+ * Message reader used to extract body and context from reponse message
+ */
+ private MessageReader messageReader;
+ /**
+ * Message writer used to construct meesage from body and context
+ */
+ private MessageWriter messageWriter;
+
+ /**
+ * shutdown indicator
+ */
+ private boolean isShutdown = false;
+
+ /**
+ * executor service for listener usage
+ */
+ private ExecutorService executorService = Executors.newSingleThreadExecutor();
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(AsyncProtocolImpl.class);
+
+
+ AsyncProtocolImpl() {
+
+ messageService = new UEBMessagingService();
+ messageReader = new APPCMessageReaderWriter();
+ messageWriter = (MessageWriter) messageReader;
+ }
+
+ public void init(Properties props, RetrieveMessageCallback callback) throws ProtocolException {
+
+ if (callback == null) {
+ throw new ProtocolException("Callback param should not be null!");
+ }
+ this.callback = callback;
+
+ try {
+ messageService.init(props);
+ //get message bus listener thread
+ //start the thread after initializing services
+ listenerHandler = executorService.submit(new Listener());
+ } catch (GeneralSecurityException | IllegalAccessException | NoSuchFieldException | IOException e) {
+ throw new ProtocolException(e);
+ }
+ }
+
+ public void sendRequest(String payload, MessageContext context) throws ProtocolException {
+
+ //get message to be sent to appc from payload and context
+ String message = messageWriter.write(payload, context);
+ try {
+ messageService.send(context.getPartiton(), message);
+ LOG.debug("Successfully send message: " + message);
+ } catch (IOException e) {
+ throw new ProtocolException(e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ isShutdown = true;
+ messageService.close();
+ LOG.warn("The protocol layer in shutdown stage.");
+ executorService.shutdownNow();
+ }
+
+ public class Listener implements Runnable {
+
+
+ public void run() {
+
+ while (!isShutdown) {
+ List<String> messages = new ArrayList<>();
+ try {
+ messages = messageService.fetch();
+ LOG.debug("Successfully fetched " + messages.size() + " messages");
+ } catch (IOException e) {
+ LOG.error("Fetching " + messages.size() + " messages failed");
+ }
+ for (String message : messages) {
+
+ MessageContext context = new MessageContext();
+ String payload = null;
+
+ try {
+ //get payload and context from message to be sent to core layer
+ payload = messageReader.read(message, context);
+ LOG.debug("Got body: " + payload);
+ //call core layer response handler
+ if(!isShutdown) {
+ callback.onResponse(payload, context);
+ }else{
+ LOG.warn("Shutdown in progress, response will not receive. Correlation ID <" +
+ context.getCorrelationID() + "> response ", message);
+ }
+ } catch (ProtocolException e) {
+ LOG.error("Failed to read message from UEB. message is: " + message);
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java
new file mode 100644
index 000000000..ec9606c19
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import java.io.IOException;
+import java.util.List;
+
+interface Consumer {
+
+ /**
+ * Gets a batch of messages from the topic. Defaults to 1000 messages with 15s wait for messages if empty.
+ *
+ * @return A list of strings representing the messages pulled from the topic.
+ * @throws IOException
+ */
+ List<String> fetch() throws IOException;
+
+ /**
+ * Gets a batch of messages from the topic.
+ *
+ * @param limit The amount of messages to fetch
+ * @return A list of strings representing the messages pulled from the topic.
+ * @throws IOException
+ */
+ List<String> fetch(int limit) throws IOException;
+
+ /**
+ * Send dummy fetch request to register client to be able to fetch messages
+ * @throws IOException
+ */
+ void registerForRead() throws IOException;
+
+ void close();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java
new file mode 100644
index 000000000..99d884e98
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import com.att.nsa.cambria.client.CambriaClientBuilders.ConsumerBuilder;
+import com.att.nsa.cambria.client.CambriaConsumer;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.MalformedURLException;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+class ConsumerImpl implements Consumer {
+
+ private static final int DEFAULT_LIMIT = 1000;
+
+ private Collection<String> hosts;
+ private String topic;
+ private String group;
+ private String groupId;
+ private int timeout;
+
+ private String authKey;
+ private String authSecret;
+
+ private CambriaConsumer consumer = null;
+
+ /**
+ * constructor
+ * @param urls
+ * @param topicName
+ * @param consumerName
+ * @param consumerId
+ * @param timeout
+ */
+ public ConsumerImpl(Collection<String> urls, String topicName, String consumerName, String consumerId, Integer timeout, String apiKey, String apiSecret) throws MalformedURLException, GeneralSecurityException, NoSuchFieldException, IllegalAccessException {
+ this.hosts = urls;
+ this.topic = topicName;
+ this.group = consumerName;
+ this.groupId = consumerId;
+ this.authKey = apiKey;
+ this.authSecret = apiSecret;
+ this.timeout = timeout;
+ consumer = getConsumer();
+ }
+
+
+ public List<String> fetch() throws IOException {
+
+ return fetch(DEFAULT_LIMIT);
+ }
+
+ public List<String> fetch(int limit) throws IOException {
+
+ List<String> out = new ArrayList<String>();
+ try {
+ for(String msg : consumer.fetch(timeout,limit)){
+ out.add(msg);
+ }
+ } catch (IOException e) {
+ throw e;
+ }
+ return out;
+ }
+
+ public void registerForRead() throws IOException {
+
+ int waitForRegisteration = 1; //return from fetch after 1ms, no need to read any messages
+ consumer.fetch(waitForRegisteration, 1);
+ }
+
+ /**
+ * init cambria consumer
+ * @return CambriaConsumer
+ */
+ private CambriaConsumer getConsumer() throws MalformedURLException, GeneralSecurityException, NoSuchFieldException, IllegalAccessException {
+
+ ConsumerBuilder builder = new ConsumerBuilder();
+
+ builder.usingHosts(hosts).onTopic(topic).knownAs(group, groupId);
+ builder.withSocketTimeout(timeout + 5000).waitAtServer(timeout);
+ builder.receivingAtMost(DEFAULT_LIMIT);
+
+ // Add credentials if provided
+ if (authKey != null && authSecret != null) {
+
+ Field apiKeyField = ConsumerBuilder.class.getDeclaredField("fApiKey");
+ apiKeyField.setAccessible(true);
+ apiKeyField.set(builder, "");
+ builder.authenticatedBy(authKey, authSecret);
+ }
+
+ return builder.build();
+ }
+
+ @Override
+ public void close() {
+ consumer.close();
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java
new file mode 100644
index 000000000..682220a2d
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+
+public interface MessageReader {
+
+ /**
+ * reads payload, fills the context out of payload headers, and returns the body of the payload
+ * @param payload incoming message
+ * @param context context to fill
+ * @return body of the payload
+ * @throws ProtocolException
+ */
+ String read(String payload, MessageContext context) throws ProtocolException;
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java
new file mode 100644
index 000000000..a19fd3fb4
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public interface MessageWriter {
+
+ /**
+ * builds a message out of context and payload
+ * @param payload body of the message
+ * @param context headers of the message
+ * @return the message to write/send
+ * @throws ProtocolException
+ */
+ String write(String payload, MessageContext context) throws ProtocolException;
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java
new file mode 100644
index 000000000..791e1224b
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.List;
+import java.util.Properties;
+
+interface MessagingService {
+
+ /**
+ * initialize consumer/publisher
+ * @param props
+ */
+ void init(Properties props) throws IOException, GeneralSecurityException, NoSuchFieldException, IllegalAccessException;
+
+ /**
+ * sends a string as is
+ * @param partition
+ * @param body
+ */
+ void send(String partition, String body) throws IOException;
+
+ /**
+ * retrieve messages from bus - timeout extracted from props or see impl
+ * @return
+ */
+ List<String> fetch() throws IOException;
+
+ /**
+ * retrieve messages from bus - timeout extracted from props or see impl
+ * @param limit
+ * @return
+ */
+ List<String> fetch(int limit) throws IOException;
+
+ void close();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java
new file mode 100644
index 000000000..2f2490a54
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import java.io.IOException;
+
+interface Producer {
+
+ /**
+ * send a message to a partition via ueb
+ * @param data
+ */
+ void post(String Partition, String data) throws IOException;
+
+ void close();
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java
new file mode 100644
index 000000000..1455fd922
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import com.att.nsa.cambria.client.CambriaBatchingPublisher;
+import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.security.GeneralSecurityException;
+import java.util.Collection;
+
+class ProducerImpl implements Producer {
+
+ private Collection<String> hosts;
+ private String topic;
+ private CambriaBatchingPublisher producer;
+
+ private String authKey;
+ private String authSecret;
+
+ public ProducerImpl(Collection<String> urls, String topicName, String apiKey, String apiSecret) throws MalformedURLException, GeneralSecurityException {
+
+ topic = topicName;
+ hosts = urls;
+ authKey = apiKey;
+ authSecret = apiSecret;
+ producer = getProducer();
+ }
+
+ public void post(String partition, String data) throws IOException {
+
+ producer.send(partition, data);
+ }
+
+ /**
+ * get cambria producer
+ * @return
+ */
+ private CambriaBatchingPublisher getProducer() throws MalformedURLException, GeneralSecurityException {
+
+ PublisherBuilder builder = new PublisherBuilder().usingHosts(hosts);
+
+ // Add credentials if provided
+ if (authKey != null && authSecret != null) {
+ builder.authenticatedBy(authKey, authSecret);
+ }
+
+ CambriaBatchingPublisher client = null;
+
+ client = builder.onTopic(topic).build();
+
+ return client;
+ }
+
+ @Override
+ public void close() {
+ producer.close();
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java
new file mode 100644
index 000000000..19e7d6024
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import java.util.Properties;
+
+public interface Protocol {
+
+ /**
+ * init protocol properties and callback
+ * @param props
+ * @param callback
+ * @throws ProtocolException
+ */
+ void init(Properties props, RetrieveMessageCallback callback) throws ProtocolException;
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java
new file mode 100644
index 000000000..87e1318ee
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+public class ProtocolException extends Exception {
+
+ public ProtocolException() {
+ super();
+ }
+
+ public ProtocolException(String message) {
+ super(message);
+ }
+
+ public ProtocolException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ProtocolException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java
new file mode 100644
index 000000000..f9364e192
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java
@@ -0,0 +1,79 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ProtocolFactory {
+
+ private static ProtocolFactory instance;
+ private Map<ProtocolType,Protocol> protocols;
+
+ /**
+ * Singleton factory
+ */
+ private ProtocolFactory(){
+
+ protocols = new HashMap<ProtocolType, Protocol>();
+ }
+
+ /**
+ * get factory instance
+ * @return factory instance
+ */
+ public static synchronized ProtocolFactory getInstance(){
+
+ if (instance == null) {
+ instance = new ProtocolFactory();
+ }
+ return instance;
+ }
+
+ /**
+ * returns instantiated protocol object
+ * @param type of protocol object
+ * @return protocol object
+ */
+ public Protocol getProtocolObject(ProtocolType type) throws ProtocolException {
+
+ Protocol protocol = protocols.get(type);
+ synchronized (this) {
+ if (protocol == null) {
+ switch (type) {
+ case SYNC:
+ throw new ProtocolException("Protocol SYNC is not implemented");
+ case ASYNC:
+ protocol = new AsyncProtocolImpl();
+ protocols.put(type, protocol);
+ break;
+ default:
+ throw new ProtocolException("Protocol type not found");
+ }
+ }
+ }
+ return protocol;
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java
new file mode 100644
index 000000000..161a590a0
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+
+class ProtocolMessage {
+
+ private String version;
+ private String type;
+ private String rpcName;
+ private String correlationID; // correlation-id
+ private String partition; // cambria.partition
+ private JsonNode body;
+
+ @JsonProperty
+ String getVersion() {
+ return version;
+ }
+
+ @JsonProperty
+ void setVersion(String version) {
+ this.version = version;
+ }
+
+ @JsonProperty
+ String getType() {
+ return type;
+ }
+
+ @JsonProperty
+ void setType(String type) {
+ this.type = type;
+ }
+
+ @JsonProperty("rpc-name")
+ String getRpcName() {
+ return rpcName;
+ }
+
+ @JsonProperty("rpc-name")
+ void setRpcName(String rpcName) {
+ this.rpcName = rpcName;
+ }
+
+ @JsonProperty("correlation-id")
+ String getCorrelationID() {
+ return correlationID;
+ }
+
+ @JsonProperty("correlation-id")
+ void setCorrelationID(String correlationID) {
+ this.correlationID = correlationID;
+ }
+
+ @JsonProperty("cambria.partition")
+ String getPartition() {
+ return partition;
+ }
+
+ @JsonProperty("cambria.partition")
+ void setPartition(String partition) {
+ this.partition = partition;
+ }
+
+ @JsonProperty
+ JsonNode getBody() {
+ return body;
+ }
+
+ @JsonProperty
+ void setBody(JsonNode body) {
+ this.body = body;
+ }
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java
new file mode 100644
index 000000000..133fbf8ad
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+public enum ProtocolType {
+
+ SYNC, ASYNC;
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java
new file mode 100644
index 000000000..46105553a
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+
+public interface RetrieveMessageCallback {
+
+ /**
+ * called when response received
+ * @param payload
+ * @param context
+ */
+ void onResponse(String payload, MessageContext context);
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java
new file mode 100644
index 000000000..22563f68a
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java
@@ -0,0 +1,102 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.*;
+
+class UEBMessagingService implements MessagingService {
+
+ private Consumer consumer;
+ private Producer producer;
+
+ private final String DEFAULT_READ_TIMEOUT_MS = "60000";
+ private final String DEFAULT_READ_LIMIT = "1000";
+
+ private int readLimit;
+
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(UEBMessagingService.class);
+
+ @SuppressWarnings("Since15")
+ public void init(Properties props) throws IOException, GeneralSecurityException, NoSuchFieldException, IllegalAccessException {
+
+ if (props != null) {
+ String readTopic = props.getProperty(UEBPropertiesKeys.TOPIC_READ);
+ String writeTopic = props.getProperty(UEBPropertiesKeys.TOPIC_WRITE);
+ String apiKey = props.getProperty(UEBPropertiesKeys.AUTH_USER);
+ String apiSecret = props.getProperty(UEBPropertiesKeys.AUTH_SECRET);
+ String readTimeoutString = props.getProperty(UEBPropertiesKeys.TOPIC_READ_TIMEOUT, DEFAULT_READ_TIMEOUT_MS);
+ Integer readTimeout = Integer.parseInt(readTimeoutString);
+ String readLimitString = props.getProperty(UEBPropertiesKeys.READ_LIMIT, DEFAULT_READ_LIMIT);
+ readLimit = Integer.parseInt(readLimitString);
+ //get hosts pool
+ Collection<String> pool = new HashSet<String>();
+ String hostNames = props.getProperty(UEBPropertiesKeys.HOSTS);
+ if (hostNames != null && !hostNames.isEmpty()) {
+ for (String name : hostNames.split(",")) {
+ pool.add(name);
+ }
+ }
+
+ //generate consumer id and group - same value for both
+ String consumerName = UUID.randomUUID().toString();
+ String consumerID = consumerName;
+
+ //create consumer and producer
+ consumer = new ConsumerImpl(pool, readTopic, consumerName, consumerID, readTimeout, apiKey, apiSecret);
+ producer = new ProducerImpl(pool, writeTopic, apiKey, apiSecret);
+
+ //initial consumer registration
+ try {
+ consumer.registerForRead();
+ }catch(Exception e){
+ LOG.error("Message consumer failed to register client "+consumerID);
+ }
+ }
+ }
+
+ public void send(String partition, String body) throws IOException {
+ producer.post(partition, body);
+ }
+
+ public List<String> fetch() throws IOException {
+ return consumer.fetch(readLimit);
+ }
+
+ public List<String> fetch(int limit) throws IOException {
+ return consumer.fetch(limit);
+ }
+
+ @Override
+ public void close() {
+ consumer.close();
+ producer.close();
+ }
+
+}
diff --git a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java
new file mode 100644
index 000000000..8bbcaf404
--- /dev/null
+++ b/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+class UEBPropertiesKeys {
+
+ static final String TOPIC_READ = "topic.read";
+ static final String TOPIC_READ_TIMEOUT = "topic.read.timeout";
+ static final String READ_LIMIT = "topic.read.limit";
+ static final String TOPIC_WRITE = "topic.write";
+ static final String AUTH_USER = "client.key";
+ static final String AUTH_SECRET = "client.secret";
+ static final String HOSTS = "poolMembers";
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java
new file mode 100644
index 000000000..d1720f03b
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java
@@ -0,0 +1,163 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import org.openecomp.appc.client.impl.core.AsyncRequestResponseHandler;
+import org.openecomp.appc.client.impl.core.CoreException;
+import org.openecomp.appc.client.impl.core.CoreManager;
+import org.openecomp.appc.client.impl.core.ICoreAsyncResponseHandler;
+import org.openecomp.appc.client.impl.core.MessageContext;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocol;
+import org.openecomp.appc.client.impl.protocol.ProtocolException;
+import org.openecomp.appc.client.impl.protocol.RetrieveMessageCallback;
+import org.junit.Before;
+
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import static org.mockito.Mockito.mock;
+
+public class ResponseManagerTest {
+
+ private final ExecutorService executorService = Executors.newFixedThreadPool(10);
+ ICoreAsyncResponseHandler listener1 = new ListenerImpl();
+ ICoreAsyncResponseHandler listener2 = new SleeepListenerImpl();
+ ICoreAsyncResponseHandler listener3 = new ListenerImpl();
+ CoreManager coreManager = null;
+
+ public void initialize() throws CoreException {
+ Properties prop = new Properties();
+ prop.setProperty("client.pool.size", "10");
+ prop.setProperty("client.response.timeout", "7000");
+ coreManager = new ResponseManagerTest.CoreManagerTest(prop);
+ }
+
+ void asyncRequest(String request, ICoreAsyncResponseHandler businessCallback, String correlationId, String rpcName) throws CoreException {
+ AsyncRequestResponseHandler requestResponseHandler = new AsyncRequestResponseHandler(correlationId, businessCallback, coreManager);
+ requestResponseHandler.sendRequest(request, correlationId, rpcName);
+ }
+
+ public void simpleResponseTest() throws Exception {
+ System.out.println("simpleResponseTest");
+ asyncRequest("request 1", listener1,"vasia1", "test");
+ MessageContext msgCtx = new MessageContext();
+ msgCtx.setCorrelationID("vasia1");
+ msgCtx.setType("response");
+ coreManager.getProtocolCallback().onResponse("vasia1 response",msgCtx);
+ coreManager.getProtocolCallback().onResponse("vasia2 response",msgCtx);
+ Thread.sleep(10);
+ }
+
+ public void twoResponseTest() throws Exception {
+ System.out.println("twoResponseTest");
+ asyncRequest("twoResponseTest request 1", listener2,"vasia2", "test");
+ MessageContext msgCtx = new MessageContext();
+ msgCtx.setCorrelationID("vasia2");
+ msgCtx.setType("response");
+ coreManager.getProtocolCallback().onResponse("second of vasia2",msgCtx);
+ Thread.sleep(100);
+ asyncRequest("twoResponseTest request 2", listener1,"vasia1", "test");
+ MessageContext msgCtx2 = new MessageContext();
+ msgCtx2.setCorrelationID("vasia1");
+ msgCtx2.setType("response");
+ coreManager.getProtocolCallback().onResponse("first of vasia1",msgCtx2);
+ Thread.sleep(150);
+ }
+
+ public void threeResponseTest() throws Exception {
+ System.out.println("treeResponseTest");
+ asyncRequest("threeResponseTest request 2", listener1,"vasia4", "test");
+ asyncRequest("threeResponseTest request 1", listener2,"vasia2", "test");
+ MessageContext msgCtx2 = new MessageContext();
+ msgCtx2.setCorrelationID("vasia2");
+ msgCtx2.setType("response");
+ coreManager.getProtocolCallback().onResponse("second of vasia2",msgCtx2);
+
+ asyncRequest("threeResponseTest request 2", listener1,"vasia1", "test");
+ MessageContext msgCtx1 = new MessageContext();
+ msgCtx1.setCorrelationID("vasia1");
+ msgCtx1.setType("response");
+ coreManager.getProtocolCallback().onResponse("vasia1",msgCtx1);
+
+ asyncRequest("threeResponseTest request 3", listener3,"vasia3", "test");
+ MessageContext msgCtx3 = new MessageContext();
+ msgCtx3.setCorrelationID("vasia3");
+ msgCtx3.setType("response");
+ coreManager.getProtocolCallback().onResponse("three1",msgCtx3);
+
+ coreManager.getProtocolCallback().onResponse("three2", msgCtx3);
+
+ coreManager.getProtocolCallback().onResponse("first1", msgCtx1);
+ Thread.sleep(250);
+
+ coreManager.getProtocolCallback().onResponse("first2", msgCtx1);
+ Thread.sleep(10000);
+ }
+
+ private class ListenerImpl implements ICoreAsyncResponseHandler{
+
+ public boolean onResponse(String message, String type) {
+ System.out.println("callback " + message);
+ return message != null;
+ }
+
+ @Override
+ public void onException(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private class SleeepListenerImpl implements ICoreAsyncResponseHandler{
+
+ public boolean onResponse(String message, String type) {
+ try {
+ Thread.sleep(150);
+ System.out.println("sleep callback " + message);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return message != null;
+ }
+
+ @Override
+ public void onException(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ class CoreManagerTest extends CoreManager{
+ CoreManagerTest(Properties properties) throws CoreException {
+ super(properties);
+ protocol = mock(AsyncProtocol.class);
+ }
+ protected void sendRequest2Protocol(String request, String corrId, String rpcName) throws CoreException {
+ }
+
+ protected void initProtocol(Properties properties, RetrieveMessageCallback protocolCallback) throws ProtocolException {
+
+ }
+ }
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java
new file mode 100644
index 000000000..4b4bce578
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java
@@ -0,0 +1,151 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.core;
+
+import org.openecomp.appc.client.impl.core.CoreException;
+import org.openecomp.appc.client.impl.core.CoreManager;
+import org.openecomp.appc.client.impl.core.ICoreSyncResponseHandler;
+import org.openecomp.appc.client.impl.core.MessageContext;
+import org.openecomp.appc.client.impl.core.SyncRequestResponseHandler;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocol;
+import org.openecomp.appc.client.impl.protocol.ProtocolException;
+import org.openecomp.appc.client.impl.protocol.RetrieveMessageCallback;
+import org.junit.Assert;
+import org.junit.Before;
+
+import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeoutException;
+
+import static org.mockito.Mockito.mock;
+
+public class SyncFlowTest {
+ CoreManager coreManager = null;
+
+ public void initialize() throws CoreException {
+ Properties prop = new Properties();
+ prop.setProperty("client.pool.size", "10");
+ prop.setProperty("client.response.timeout", "7000");
+ coreManager = new CoreManagerTest(prop);
+ }
+
+ <T> T syncRequest(String request, ICoreSyncResponseHandler businessCallback, String correlationId, String rpcName ) throws CoreException, TimeoutException {
+ SyncRequestResponseHandler requestResponseHandler = new SyncRequestResponseHandler(correlationId, businessCallback, coreManager);
+ requestResponseHandler.sendRequest(request, correlationId, rpcName);
+ T responseObject = (T) requestResponseHandler.getResponse();
+ return responseObject;
+ }
+
+ public void blockRequestTest(){
+ ICoreSyncResponseHandler handler = new ICoreSyncResponseHandlerImpl1();
+ try {
+ syncRequest("request 1", handler, "vasia1", "test");
+ }catch (Throwable e){
+ e.printStackTrace();
+ Assert.assertTrue(e != null);
+ }
+
+ }
+
+ public <T> void blockRequestSucceedTest() throws InterruptedException {
+ ExecutorService executorService = Executors.newFixedThreadPool(2);
+ final ICoreSyncResponseHandler handler = new ICoreSyncResponseHandlerImpl1();
+ try {
+ executorService.submit(new Runnable() {
+ public void run() {
+ System.out.println("Send request");
+ T response;
+ try {
+ response = syncRequest("request 1", handler, "vasia1", "test");
+ System.out.println("=======" + response.toString());
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }catch (Throwable e){
+ Assert.assertTrue((RuntimeException)e != null);
+ }
+ Thread.sleep(2000);
+ executorService.submit(new Runnable() {
+ public void run() {
+ MessageContext ctx = new MessageContext();
+ ctx.setCorrelationID("vasia1");
+ ctx.setType("response");
+ try {
+ System.out.println("Send response 1");
+ coreManager.getProtocolCallback().onResponse("response for request 1", ctx);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ Thread.sleep(2000);
+ executorService.submit(new Runnable() {
+ public void run() {
+ MessageContext ctx = new MessageContext();
+ ctx.setCorrelationID("vasia1");
+ ctx.setType("response");
+ try {
+ System.out.println("Send response 2");
+ coreManager.getProtocolCallback().onResponse("response for request 1 final", ctx);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ Thread.sleep(1000);
+
+ }
+
+ class ICoreSyncResponseHandlerImpl1 implements ICoreSyncResponseHandler{
+
+
+ public <T> T onResponse(String message, String type) {
+ System.out.println("Received message = " + message) ;
+ if(message.contains("final")){
+ return (T) new String(message);
+ }
+ return null;
+ }
+ }
+
+ class CoreManagerTest extends CoreManager{
+ CoreManagerTest(Properties properties) throws CoreException {
+ super(properties);
+ protocol = mock(AsyncProtocol.class);
+ }
+ protected void sendRequest2Protocol(String request, String corrId, String rpcName) throws CoreException {
+ }
+
+ protected void initProtocol(Properties properties, RetrieveMessageCallback protocolCallback) throws ProtocolException{
+
+ }
+ }
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java
new file mode 100644
index 000000000..91f615720
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import org.openecomp.appc.client.impl.protocol.APPCMessageReaderWriter;
+import org.openecomp.appc.client.impl.protocol.ProtocolException;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.StringWriter;
+
+public class APPCMessageReaderWriterTest {
+
+ private APPCMessageReaderWriter messageReaderWriter;
+ private ObjectMapper mapper;
+
+ private static final String VERSION = "2.0";
+ private static final String TYPE = "typeTest";
+ private static final String CORRELATION_ID = "correlationIdTest";
+ private static final String PARTITION = "partitionTest";
+ private static final String RPC = "rpcTest";
+ private static final String PAYLOAD = "{\"key1\":\"val1\",\"key2\":\"val2\",\"key3\":{\"key3.1\":\"val3.1\"}}";
+
+ @Before
+ public void init() throws IOException {
+ mapper = new ObjectMapper();
+ messageReaderWriter = new APPCMessageReaderWriter();
+ }
+
+ @Test
+ public void writeTest() throws IOException, ProtocolException {
+ MessageContext context = new MessageContext();
+ context.setType(TYPE);
+ context.setCorrelationID(CORRELATION_ID);
+ context.setPartiton(PARTITION);
+ context.setRpc(RPC);
+ String payload = PAYLOAD;
+ String message = messageReaderWriter.write(payload, context);
+
+ JsonNode messageJson = mapper.readTree(message);
+ Assert.assertEquals(VERSION, messageJson.get("version").asText());
+ Assert.assertEquals(context.getType(), messageJson.get("type").asText());
+ Assert.assertEquals(context.getCorrelationID(), messageJson.get("correlation-id").asText());
+ Assert.assertEquals(context.getPartiton(), messageJson.get("cambria.partition").asText());
+ Assert.assertEquals(context.getRpc(), messageJson.get("rpc-name").asText());
+ Assert.assertEquals(payload, messageJson.get("body").toString());
+ }
+
+ @Test
+ public void readTest() throws IOException, ProtocolException {
+ ObjectNode node = mapper.createObjectNode();
+ node.put("version", VERSION);
+ node.put("type", TYPE);
+ node.put("correlation-id", CORRELATION_ID);
+ node.put("cambria.partition", PARTITION);
+ node.put("rpc-name", RPC);
+ JsonNode payload = mapper.valueToTree(PAYLOAD);
+ node.set("body", payload);
+ String message = node.toString();
+
+ MessageContext returnContext = new MessageContext();
+ String returnPayload = messageReaderWriter.read(message, returnContext);
+
+ Assert.assertEquals(TYPE, returnContext.getType());
+ Assert.assertEquals(CORRELATION_ID, returnContext.getCorrelationID());
+ Assert.assertEquals(PARTITION, returnContext.getPartiton());
+ Assert.assertEquals(RPC, returnContext.getRpc());
+ Assert.assertEquals(payload.toString(), returnPayload);
+ }
+
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java
new file mode 100644
index 000000000..046f5a814
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocol;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocolImpl;
+import org.openecomp.appc.client.impl.protocol.ProtocolException;
+import org.openecomp.appc.client.impl.protocol.RetrieveMessageCallback;
+import org.openecomp.appc.client.impl.protocol.UEBPropertiesKeys;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class TestAsyncProtocolImpl {
+
+ private static AsyncProtocol protocol;
+ private static AtomicBoolean gotResponse;
+ private static Properties props;
+
+ private static class TestCallback implements RetrieveMessageCallback{
+
+ public void onResponse(String payload, MessageContext context) {
+ Assert.assertNotEquals(null, payload);
+ Assert.assertNotEquals(null, context);
+ protocol = null;
+ gotResponse.set(true);
+ }
+ }
+
+ @BeforeClass
+ public static void setUp() throws IOException, ProtocolException {
+
+ gotResponse = new AtomicBoolean(false);
+
+ props = new Properties();
+ String propFileName = "ueb.properties";
+
+ InputStream input = TestAsyncProtocolImpl.class.getClassLoader().getResourceAsStream(propFileName);
+
+ props.load(input);
+
+ protocol = new AsyncProtocolImpl();
+ protocol.init(props, new TestCallback());
+ }
+
+ public void testSendRequest() throws ProtocolException {
+
+ MessageContext context = new MessageContext();
+ context.setType("Test");
+
+ protocol.sendRequest("{\"Test\":\"\"}", context);
+
+ try {
+ Long timeToSleep = Long.parseLong((String)props.get(UEBPropertiesKeys.TOPIC_READ_TIMEOUT))*2;
+ Thread.sleep(timeToSleep);
+ } catch (InterruptedException e) {
+ Assert.assertFalse(e.getMessage(), false);
+ }
+ if (gotResponse.get() == false) {
+ Assert.assertFalse("Message was not read !", true);
+ }
+ }
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java
new file mode 100644
index 000000000..9611a7900
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.openecomp.appc.client.impl.core.MessageContext;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocol;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocolImpl;
+import org.openecomp.appc.client.impl.protocol.RetrieveMessageCallback;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class TestAsyncProtocolImplMissingProps {
+
+ private static AsyncProtocol protocol;
+
+ private static class TestCallback implements RetrieveMessageCallback {
+
+ public void onResponse(String payload, MessageContext context) {
+ Assert.assertFalse("bad Callback !",false);
+ }
+ }
+
+ @Test
+ /**
+ * protocol should throw illegal argument exception due to null properties
+ */
+ public void testSetUpMissingProps() {
+
+ Properties props = new Properties();
+ String propFileName = "ueb.missing.properties";
+
+ InputStream input = TestAsyncProtocolImplMissingProps.class.getClassLoader().getResourceAsStream(propFileName);
+
+ try {
+ props.load(input);
+ } catch (IOException e) {
+ Assert.assertFalse(e.getMessage(),false);
+ }
+
+ protocol = new AsyncProtocolImpl();
+ try {
+ protocol.init(props, new TestCallback());
+ } catch (IllegalArgumentException e) {
+ Assert.assertTrue(true);
+ } catch (Exception e) {
+ Assert.assertFalse(e.getMessage(),false);
+ }
+ }
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java
new file mode 100644
index 000000000..e537037f7
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocol;
+import org.openecomp.appc.client.impl.protocol.AsyncProtocolImpl;
+import org.openecomp.appc.client.impl.protocol.ProtocolException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class TestAsyncProtocolImplNullCallback {
+
+ private static AsyncProtocol protocol;
+
+ public void testSetUpNoCallback() throws IOException {
+
+ Properties props = new Properties();
+ String propFileName = "ueb.properties";
+
+ InputStream input = TestAsyncProtocolImpl.class.getClassLoader().getResourceAsStream(propFileName);
+
+ props.load(input);
+
+ protocol = new AsyncProtocolImpl();
+
+ try {
+ protocol.init(props, null);
+ } catch (ProtocolException e) {
+ Assert.assertTrue(true);
+ } catch (Exception e){
+ Assert.assertFalse(e.getMessage(),false);
+ }
+ }
+}
diff --git a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java
new file mode 100644
index 000000000..109065ab4
--- /dev/null
+++ b/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.client.impl.protocol;
+
+import org.junit.*;
+import org.junit.runners.MethodSorters;
+import org.openecomp.appc.client.impl.protocol.MessagingService;
+import org.openecomp.appc.client.impl.protocol.UEBMessagingService;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.GeneralSecurityException;
+import java.util.List;
+import java.util.Properties;
+
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestUEBMessagingService {
+
+ private static MessagingService ueb;
+
+ public static void setUp() throws IOException, GeneralSecurityException, NoSuchFieldException, IllegalAccessException {
+
+ Properties props = new Properties();
+ String propFileName = "ueb.properties";
+
+ InputStream input = TestUEBMessagingService.class.getClassLoader().getResourceAsStream(propFileName);
+
+ props.load(input);
+
+ ueb = new UEBMessagingService();
+ ueb.init(props);
+ }
+
+ public void test1Send() throws IOException {
+ System.out.println("Here");
+
+ String message = "Test Message Service";
+ ueb.send(null,message);
+ }
+
+ public void test2Fetch() throws IOException {
+
+ System.out.println("Here2");
+ List<String> messages = ueb.fetch(1);
+ Assert.assertEquals(1,messages.size());
+ }
+
+}
diff --git a/appc-client/client-lib/src/test/resources/ueb.missing.properties b/appc-client/client-lib/src/test/resources/ueb.missing.properties
new file mode 100644
index 000000000..54ba58284
--- /dev/null
+++ b/appc-client/client-lib/src/test/resources/ueb.missing.properties
@@ -0,0 +1,30 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : APPC
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
+# 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.
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# ============LICENSE_END=========================================================
+###
+
+topic.read=APPC-UNIT-TEST
+topic.read.timeout=60000
+topic.write=APPC-UNIT-TEST
+client.name=APPC-CLIENT
+client.id=0
+
diff --git a/appc-client/client-lib/src/test/resources/ueb.properties b/appc-client/client-lib/src/test/resources/ueb.properties
new file mode 100644
index 000000000..026d5f4e8
--- /dev/null
+++ b/appc-client/client-lib/src/test/resources/ueb.properties
@@ -0,0 +1,29 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : APPC
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
+# 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.
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# ============LICENSE_END=========================================================
+###
+
+poolMembers=10.147.29.67:3904
+topic.read=APPC-TEST1
+topic.read.timeout=2500
+topic.write=APPC-TEST1
+
diff --git a/appc-client/client-simulator/.gitignore b/appc-client/client-simulator/.gitignore
new file mode 100644
index 000000000..b83d22266
--- /dev/null
+++ b/appc-client/client-simulator/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-client/client-simulator/pom.xml b/appc-client/client-simulator/pom.xml
new file mode 100644
index 000000000..59be1263f
--- /dev/null
+++ b/appc-client/client-simulator/pom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-java-client</artifactId>
+ <groupId>org.openecomp.appc.client</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>client-simulator</artifactId>
+
+ <properties>
+ <licenseDir>${project.parent.parent.basedir}</licenseDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <id>make-assembly</id> <!-- this is used for inheritance merges -->
+ <phase>package</phase> <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.openecomp.appc.simulator.client.main.ClientRunner</mainClass>
+ </manifest>
+ </archive>
+ <descriptors>
+ <descriptor>src/main/resources/assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>client</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>true</attach>
+ <descriptors>
+ <descriptor>src/main/resources/assembly_zip.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>posix</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java
new file mode 100644
index 000000000..225f6bba9
--- /dev/null
+++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.simulator.client;
+
+import java.io.File;
+import java.io.IOException;
+
+public interface RequestHandler {
+ void proceedFile(File source, File log) throws IOException, ClassNotFoundException, NoSuchMethodException;
+ void shutdown(boolean isForceShutdown);
+}
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java
new file mode 100644
index 000000000..459804aaa
--- /dev/null
+++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.simulator.client;
+
+import java.io.File;
+
+public interface ResponseHandler {
+ void validateResponse(File output);
+}
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java
new file mode 100644
index 000000000..de1a2055b
--- /dev/null
+++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java
@@ -0,0 +1,272 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.simulator.client.impl;
+
+import org.openecomp.appc.client.lcm.api.*;
+import org.openecomp.appc.client.lcm.exceptions.*;
+import org.openecomp.appc.simulator.client.RequestHandler;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.*;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Properties;
+
+public class JsonRequestHandler implements RequestHandler {
+
+ private enum modeT {
+ SYNCH,
+ ASYNCH
+ }
+
+ public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+ private String rpcName = null;
+ private String inputClassName = null;
+ private String actionName = null;
+ private String methodName = null;
+ String packageName = null;
+ private LifeCycleManagerStateful service = null;
+ private Properties properties;
+ HashMap<String, String> exceptRpcMap = null;
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(JsonRequestHandler.class);
+ private AppcLifeCycleManagerServiceFactory appcLifeCycleManagerServiceFactory = null;
+
+
+ public JsonRequestHandler(Properties prop) throws AppcClientException {
+ properties = prop;
+ packageName = properties.getProperty("ctx.model.package") + ".";
+ try {
+ service = createService();
+ } catch (AppcClientException e) {
+ e.printStackTrace();
+ }
+ exceptRpcMap = prepareExceptionsMap();
+ }
+
+ private HashMap<String,String> prepareExceptionsMap() {
+ exceptRpcMap = new HashMap<String, String>();
+
+ String line;
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new FileReader(properties.getProperty("client.rpc.exceptions.map.file")));
+ } catch (FileNotFoundException e) {
+ return exceptRpcMap;
+ }
+
+ try {
+ while ((line = reader.readLine()) != null)
+ {
+ String[] parts = line.split(":", 2);
+ if (parts.length >= 2)
+ {
+ String key = parts[0];
+ String value = parts[1];
+ exceptRpcMap.put(key, value);
+ } else {
+ System.out.println("ignoring line: " + line);
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ try {
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return exceptRpcMap;
+ }
+
+ @Override
+ public void proceedFile(File source, File log) throws IOException {
+ final JsonNode inputNode = OBJECT_MAPPER.readTree(source);
+
+ try {
+ // proceed with inputNode and get some xxxInput object, depends on action
+ prepareNames(inputNode);
+
+ Object input = prepareObject(inputNode);
+
+ JsonResponseHandler response = new JsonResponseHandler();
+ response.setFile(source.getPath().toString());
+ switch (isSyncMode(inputNode)) {
+ case SYNCH: {
+ LOG.debug("Received input request will be processed in synchronously mode");
+ Method rpc = LifeCycleManagerStateful.class.getDeclaredMethod(methodName, input.getClass());
+ response.onResponse(rpc.invoke(service, input));
+ break;
+ }
+ case ASYNCH: {
+ LOG.debug("Received input request will be processed in asynchronously mode");
+ Method rpc = LifeCycleManagerStateful.class.getDeclaredMethod(methodName, input.getClass(), ResponseHandler.class);
+ rpc.invoke(service, input, response);
+ break;
+ }
+ default: {
+ throw new RuntimeException("Unrecognized request mode");
+ }
+ }
+ }
+ catch(Exception ex){
+ //ex.printStackTrace();
+ }
+
+ LOG.debug("Action <" + actionName + "> from input file <" + source.getPath().toString() + "> processed");
+ }
+
+ private modeT isSyncMode(JsonNode inputNode) {
+ // The following solution is for testing purposes only
+ // the sync/async decision logic may change upon request
+ try {
+ int mode = Integer.parseInt(inputNode.findValue("input").findValue("common-header").findValue("sub-request-id").asText());
+ if ((mode % 2) == 0) {
+ return modeT.SYNCH;
+ }
+ }catch (Throwable ex) {
+ //use ASYNC as default, if value is not integer.
+ }
+ return modeT.ASYNCH;
+ }
+
+ private LifeCycleManagerStateful createService() throws AppcClientException {
+ appcLifeCycleManagerServiceFactory = AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class);
+ return appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(new ApplicationContext(), properties);
+ }
+
+ public void shutdown(boolean isForceShutdown){
+ appcLifeCycleManagerServiceFactory.shutdownLifeCycleManager(isForceShutdown);
+ }
+
+ public Object prepareObject(JsonNode input) {
+ try {
+ Class cls = Class.forName(inputClassName);
+ try {
+ // since payload is not mandatory field and not all actions contains payload
+ // so we have to check that during input parsing
+ alignPayload(input);
+ } catch (NoSuchFieldException e) {
+ LOG.debug("In " + actionName + " no payload defined");
+ }
+
+ return OBJECT_MAPPER.treeToValue(input.get("input"), cls);
+ }
+ catch(Exception ex){
+ //ex.printStackTrace();
+ }
+ return null;
+ }
+
+ private void prepareNames(JsonNode input) throws NoSuchFieldException {
+ JsonNode inputNode = input.findValue("input");
+ actionName = inputNode.findValue("action").asText();
+ if (actionName.isEmpty()) {
+ throw new NoSuchFieldException("Input doesn't contains field <action>");
+ }
+
+ rpcName = prepareRpcFromAction(actionName);
+ inputClassName = packageName + actionName + "Input";
+ methodName = prepareMethodName(rpcName);
+ }
+
+ private void alignPayload(JsonNode input) throws NoSuchFieldException {
+ JsonNode inputNode = input.findValue("input");
+ JsonNode payload = inputNode.findValue("payload");
+ if (payload == null || payload.asText().isEmpty() || payload.toString().isEmpty())
+ throw new NoSuchFieldException("Input doesn't contains field <payload>");
+
+ String payloadData = payload.asText();
+ if (payloadData.isEmpty())
+ payloadData = payload.toString();
+ ((ObjectNode)inputNode).put("payload", payloadData);
+ }
+
+ private String prepareRpcFromAction(String action) {
+ String rpc = checkExceptionalRpcList(action);
+ if (rpc!= null && !rpc.isEmpty()) {
+ return rpc; // we found exceptional rpc, so no need to format it
+ }
+
+ rpc = "";
+ boolean makeItLowerCase = true;
+ for(int i = 0; i < action.length(); i++)
+ {
+ if(makeItLowerCase) // first character will make lower case
+ {
+ rpc+=Character.toLowerCase(action.charAt(i));
+ makeItLowerCase = false;
+ }
+ else if((i+1 < action.length()) && Character.isUpperCase(action.charAt(i+1)))
+ {
+ rpc+=action.charAt(i) + "-";
+ makeItLowerCase = true;
+ }
+ else
+ {
+ rpc+=action.charAt(i);
+ makeItLowerCase = false;
+ }
+ }
+ return rpc;
+ }
+
+ private String checkExceptionalRpcList(String action) {
+ if (exceptRpcMap.isEmpty()) {
+ return null;
+ }
+ return exceptRpcMap.get(action);
+ }
+
+ private String prepareMethodName(String inputRpcName) {
+ boolean makeItUpperCase = false;
+ String method = "";
+
+ for(int i = 0; i < inputRpcName.length(); i++) //to check the characters of string..
+ {
+ if(Character.isLowerCase(inputRpcName.charAt(i)) && makeItUpperCase) // skip first character if it lower case
+ {
+ method+=Character.toUpperCase(inputRpcName.charAt(i));
+ makeItUpperCase = false;
+ }
+ else if(inputRpcName.charAt(i) == '-')
+ {
+ makeItUpperCase = true;
+ }
+ else
+ {
+ method+=inputRpcName.charAt(i);
+ makeItUpperCase = false;
+ }
+ }
+ return method;
+ }
+
+}
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java
new file mode 100644
index 000000000..aef034f53
--- /dev/null
+++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java
@@ -0,0 +1,147 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.simulator.client.impl;
+
+import org.openecomp.appc.client.lcm.api.ResponseHandler;
+import org.openecomp.appc.client.lcm.exceptions.AppcClientException;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.FileWriter;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class JsonResponseHandler implements ResponseHandler<Object> {
+
+ public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+ private final EELFLogger LOG = EELFManager.getInstance().getLogger(JsonResponseHandler.class);
+
+ private String fileName = "default";
+ private static final int ACCEPT_FAMILY = 1;
+ private static final int SUCCESS_FAMILY = 4;
+ private static final int INTERMEDIATE_MESSAGES =5;
+
+ private AtomicInteger messageCount =new AtomicInteger(1);
+
+ public void setFile(String name) {
+ fileName = name;
+ }
+
+ @Override
+ public void onResponse(Object response) {
+
+ String output = null;
+ try {
+ output = OBJECT_MAPPER.writeValueAsString(response);
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+ LOG.debug("Received response : " + output);
+
+ int errorCode = 0;
+ boolean isFinal = true;
+ try {
+ JsonNode code = OBJECT_MAPPER.readTree(output).findValue("status").findValue("code");
+ if (code == null)
+ {
+ LOG.error("Status code doesn't exist. Malformed response : " + output);
+ flushToErrorFile(output, isFinal);
+ return;
+ }
+ errorCode = code.asInt();
+ errorCode = errorCode / 100;
+ switch (errorCode) {
+ case ACCEPT_FAMILY:
+ isFinal = false; // for ACCEPT that it is not a final response
+ break;
+ case INTERMEDIATE_MESSAGES:
+ isFinal = false; // for 5xx series messages are not a final response
+ break;
+ default:
+ break;
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+
+ switch (errorCode) {
+ case ACCEPT_FAMILY: {
+ try {
+ System.out.println("== THR#" + Thread.currentThread().getId() + " Got ACCEPT on ReqID <" +
+ OBJECT_MAPPER.readTree(output).findValue("common-header").findValue("request-id").asText() + ">");
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ // no need to report ACCEPT into output file
+ break;
+ }
+ case SUCCESS_FAMILY:
+ flushToOutputFile(output, isFinal);
+ break;
+ case INTERMEDIATE_MESSAGES:
+ flushToMessageFile(output, isFinal);
+ break;
+ default:
+ flushToErrorFile(output, isFinal);
+ }
+ }
+
+ @Override
+ public void onException(AppcClientException exception) {
+ flushToErrorFile("exception: " + exception, true);
+ }
+
+ private void flushToOutputFile(String output, boolean isFinal) {
+ this.flushToFile(output, ".output", isFinal);
+ }
+ private void flushToMessageFile(String output, boolean isFinal) {
+ this.flushToFile(output, ".message" + messageCount.getAndIncrement(), isFinal);
+
+ }
+
+ private void flushToErrorFile(String output, boolean isFinal) {
+ this.flushToFile(output, ".error", isFinal);
+ }
+
+ private void flushToFile(String output, String suffix, boolean isFinal) {
+ try (FileWriter fileWriter = new FileWriter(fileName + suffix);){
+ LOG.info("Output file : " + fileName + suffix);
+
+ fileWriter.write(output);
+ fileWriter.flush();
+ if (isFinal){
+ fileWriter.close();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ System.out.println("== THR#" +Thread.currentThread().getId()+ " Output file : " + fileName + suffix);
+ }
+}
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java
new file mode 100644
index 000000000..d28927302
--- /dev/null
+++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.simulator.client.main;
+
+import org.apache.commons.io.filefilter.WildcardFileFilter;
+import org.openecomp.appc.simulator.client.RequestHandler;
+import org.openecomp.appc.simulator.client.impl.JsonRequestHandler;
+
+import java.io.*;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+public class ClientRunner {
+ public static void main(String ... args) throws Exception {
+ String folder = args[0];
+ if (folder == null) {
+ folder = System.getProperty("user.dir");
+ }
+ System.out.println("== THR#" +Thread.currentThread().getId()+ " Reading files under the folder : " + folder);
+
+ String inputType = args[1];
+ if (inputType != null && !inputType.matches("JSON")) {
+ throw new RuntimeException("### ERROR ### - Unsupported file type <" + inputType + "> was provided");
+ }
+
+ Properties properties = getProperties(folder);
+ RequestHandler reqHandler = new JsonRequestHandler(properties);
+ List<File> sources = getJsonFiles(folder);
+ File log = new File(folder + "/output.txt");
+ int filesNum = 0;
+ for (File source: sources) {
+ reqHandler.proceedFile(source, log);
+ System.out.println("== THR#" +Thread.currentThread().getId()+ " File <" + source.getName() + "> processed.");
+ ++filesNum;
+ }
+ System.out.println("DONE with " + filesNum + " files under the folder : " + folder);
+ Thread.sleep(30);
+ System.out.println("Shutdown ...");
+ reqHandler.shutdown(Boolean.parseBoolean(properties.getProperty("client.force.shutdown")));
+// System.exit(0);
+ }
+
+ private static Properties getProperties(String folder) {
+ Properties prop = new Properties();
+
+ InputStream conf = null;
+ try {
+ conf = new FileInputStream(folder + "client-simulator.properties");
+ } catch (FileNotFoundException e) {
+
+ }
+ if (conf != null) {
+ try {
+ prop.load(conf);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ } else {
+ try {
+ prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("client-simulator.properties"));
+ } catch (Exception e) {
+ throw new RuntimeException("### ERROR ### - Could not load properties to test");
+ }
+ }
+ return prop;
+ }
+
+ private static List<File> getJsonFiles(String folder) throws FileNotFoundException {
+ Path dir = Paths.get(folder);
+ FileFilter fileFilter = new WildcardFileFilter("*.json");
+ return new ArrayList<File>(Arrays.asList(dir.toFile().listFiles(fileFilter)));
+ }
+}
diff --git a/appc-client/client-simulator/src/main/resources/assembly.xml b/appc-client/client-simulator/src/main/resources/assembly.xml
new file mode 100644
index 000000000..69e500f27
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/assembly.xml
@@ -0,0 +1,51 @@
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+ <!-- TODO: a jarjar format would be better -->
+ <id>jar-with-dependencies</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <!--<outputDirectory>/</outputDirectory>-->
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>true</unpack>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/resources</directory>
+ <includes>
+ <include>*.properties</include>
+ </includes>
+ <outputDirectory>resources</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
diff --git a/appc-client/client-simulator/src/main/resources/assembly_zip.xml b/appc-client/client-simulator/src/main/resources/assembly_zip.xml
new file mode 100644
index 000000000..2a5202fb0
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/assembly_zip.xml
@@ -0,0 +1,54 @@
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>client</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <outputDirectory>.</outputDirectory>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ </excludes>
+ <lineEnding>unix</lineEnding>
+ </fileSet>
+ <fileSet>
+ <directory>${project.build.directory}</directory>
+ <outputDirectory>.</outputDirectory>
+ <includes>
+ <include>*-jar-with-dependencies.jar</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
+
diff --git a/appc-client/client-simulator/src/main/resources/client-simulator.properties b/appc-client/client-simulator/src/main/resources/client-simulator.properties
new file mode 100644
index 000000000..242b34f93
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/client-simulator.properties
@@ -0,0 +1,58 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : APPC
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
+# 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.
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# ============LICENSE_END=========================================================
+###
+
+#
+# Default Properties - Configured for client simulator
+#
+#--------------------------------------------------------------------------------------------
+ctx.model.package=org.openecomp.appc.client.lcm.model
+
+client.pool.size=10
+client.rpc.exceptions.map.file=C:\\test\\test1\\exceptions.txt
+
+#------------------
+# UEB configuration
+#------------------
+#topic.read=client.test.2
+#topic.read.timeout=10
+#topic.write=client.test.1
+#poolMembers=uebsb91sfdc.it.att.com:3904
+#client.key=1
+#client.secret=1
+#client.name=ClientTest1
+client.name.id=0
+client.response.timeout=60000
+#true - force shutdown
+client.force.shutdown=false
+client.graceful.shutdown.timeout=60000
+
+#topic.read=Topic102-Write
+#topic.read.timeout=60000
+#topic.write=Topic102-Read
+#poolMembers=10.147.100.36:3904
+
+topic.read=Topic106-Write
+topic.read.timeout=20000
+topic.write=Topic106-Read
+poolMembers=10.147.29.67:3904
diff --git a/appc-client/client-simulator/src/main/resources/exceptions.txt b/appc-client/client-simulator/src/main/resources/exceptions.txt
new file mode 100644
index 000000000..54d433017
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/exceptions.txt
@@ -0,0 +1 @@
+ConfigScaleOut:config-scaleout
diff --git a/appc-client/client-simulator/src/main/resources/logback.xml b/appc-client/client-simulator/src/main/resources/logback.xml
new file mode 100644
index 000000000..934c2bc69
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/logback.xml
@@ -0,0 +1,81 @@
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+
+ <configuration scan="true">
+
+ <property name="componentName" value="APPC-Client"/>
+ <property name="debugDir" value="logs" />
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <encoder>
+ <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} %X{akkaSource} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>logs/client-debug.log</file>
+
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>logs/client-debug.%d.log.zip</fileNamePattern>
+ <maxHistory>1</maxHistory>
+ </rollingPolicy>
+
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>10MB</maxFileSize>
+ </triggeringPolicy>
+
+ <encoder>
+ <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{35} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="ERROR_FILE" />
+ </appender>
+
+
+ <root level="debug">
+ <appender-ref ref="DEBUG_FILE" />
+ </root>
+
+ <!--<logger name="ch.qos.logback" level="error" additivity="false">-->
+ <!--<appender-ref ref="asyncEELFServer" />-->
+ <!--</logger>-->
+
+ <!--<logger name="ch.qos.logback" level="error" additivity="false">-->
+ <!--<appender-ref ref="asyncEELFPerformance" />-->
+ <!--</logger>-->
+
+ <!--<logger name="ch.qos.logback" level="error" additivity="false">-->
+ <!--<appender-ref ref="asyncEELFPolicy" />-->
+ <!--</logger>-->
+
+</configuration>
+
diff --git a/appc-client/client-simulator/src/main/resources/run.bat b/appc-client/client-simulator/src/main/resources/run.bat
new file mode 100644
index 000000000..0fb66f4cc
--- /dev/null
+++ b/appc-client/client-simulator/src/main/resources/run.bat
@@ -0,0 +1,2 @@
+java -jar client-simulator-1.4.07-SNAPSHOT-jar-with-dependencies.jar C:\test\1\ JSON
+pause
diff --git a/appc-client/client-simulator/src/test/java/run.java b/appc-client/client-simulator/src/test/java/run.java
new file mode 100644
index 000000000..62f12acbb
--- /dev/null
+++ b/appc-client/client-simulator/src/test/java/run.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.openecomp.appc.simulator.client.main.ClientRunner;
+
+public class run {
+ public static void main(String ... args) throws Exception, IOException, RuntimeException, FileNotFoundException {
+ ClientRunner.main(args);
+ }
+}
diff --git a/appc-client/code-generator/.gitignore b/appc-client/code-generator/.gitignore
new file mode 100644
index 000000000..b83d22266
--- /dev/null
+++ b/appc-client/code-generator/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/appc-client/code-generator/pom.xml b/appc-client/code-generator/pom.xml
new file mode 100644
index 000000000..92bc109ec
--- /dev/null
+++ b/appc-client/code-generator/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-java-client</artifactId>
+ <groupId>org.openecomp.appc.client</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>code-generator</artifactId>
+ <name>code-generator</name>
+ <description>APPC client code generator</description>
+ <packaging>maven-plugin</packaging>
+
+ <properties>
+ <licenseDir>${project.parent.parent.basedir}</licenseDir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>${maven.plugin.plugin.version}</version>
+ <configuration>
+ <goalPrefix>code-generator</goalPrefix>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ <execution>
+ <id>help-descriptor</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-parser-impl</artifactId>
+ <version>${yang.parser.impl.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-core-api</artifactId>
+ <version>${sal.core.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-model-api</artifactId>
+ <version>${yang.parser.impl.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>${freemarker.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>${maven.plugin.annotations.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.plugin.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>${maven.core.version}</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java
new file mode 100644
index 000000000..61516a72d
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.api;
+
+import org.openecomp.appc.tools.generator.impl.ModelGenerator;
+
+public class CLI {
+ public static void main(String... args) throws Exception {
+ String sourceFile = args[0];
+ if(sourceFile == null)
+ throw new IllegalArgumentException("Source file is missing. Please add argument 'client <source file> <destination file> <model template>'");
+
+ String destinationFile = args[1];
+ if(destinationFile == null)
+ throw new IllegalArgumentException("Destination file name is missing. Please add argument 'client "
+ + sourceFile
+ + "<destination> <model template> <builder> <conf file>'");
+
+ String templateFile = args[2];
+ if(templateFile == null)
+ throw new IllegalArgumentException("template file name is missing. Please add argument 'client "
+ + sourceFile
+ + destinationFile
+ + " <model template> <builder> <conf file>'");
+
+ String builderName = args[3];
+ if(builderName == null)
+ throw new IllegalArgumentException("builder FQDN is missing. Please add argument 'client "
+ + sourceFile
+ + destinationFile
+ + templateFile
+ + " <builder> <conf file>'");
+ String contextConfName = args[4];
+ if(contextConfName == null)
+ throw new IllegalArgumentException("context conf file is missing. Please add argument 'client "
+ + sourceFile
+ + destinationFile
+ + templateFile
+ + builderName
+ + " <conf file>'");
+ ModelGenerator generator = new ModelGenerator();
+ generator.execute(sourceFile, destinationFile, templateFile, builderName, contextConfName);
+ }
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java
new file mode 100644
index 000000000..7e0bbe15a
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.api;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Map;
+
+public interface ContextBuilder {
+
+ Map<String, Object> buildContext(String sourceFile, String contextConf) throws IOException;
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java
new file mode 100644
index 000000000..f031dd666
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java
@@ -0,0 +1,85 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.api;
+
+import org.openecomp.appc.tools.generator.impl.ModelGenerator;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+
+@Mojo(
+ name = "generate",
+ defaultPhase = LifecyclePhase.GENERATE_SOURCES
+)
+public class MavenPlugin extends AbstractMojo {
+
+ @Parameter(property = "templateName", required = true)
+ private String templateName;
+
+ @Parameter(property = "sourceFileName")
+ private String sourceFileName;
+
+ @Parameter(property = "outputFileName")
+ private String outputFileName;
+
+ @Parameter(property = "contextBuilderClassName", required = true)
+ private String contextBuilderClassName;
+
+ @Parameter(property = "contextConfigFileName")
+ private String contextConfigFileName;
+
+ @Parameter (property = "project")
+ private MavenProject project;
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ ModelGenerator generator = new ModelGenerator();
+ try {
+ trace("\t === Called MavenPlugin on builder <" + contextBuilderClassName +">\n");
+ generator.execute(sourceFileName,outputFileName,templateName,contextBuilderClassName,contextConfigFileName);
+ String workDirectory = getWorkDirectory(outputFileName);
+ project.addCompileSourceRoot(workDirectory);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new MojoExecutionException(e.getMessage());
+ }
+ }
+
+ private String getWorkDirectory(String outputFileName) throws IOException {
+ String workDirPath = Paths.get(outputFileName.toString()).getParent().toString();
+ return workDirPath;
+ }
+
+ private void trace(String message) {
+ getLog().info(message);
+ }
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java
new file mode 100644
index 000000000..6a3d13bf5
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.extensions;
+
+import org.openecomp.appc.tools.generator.api.ContextBuilder;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+public class JsonContextBuilderImpl implements ContextBuilder {
+
+ @Override
+ public Map<String, Object> buildContext(String sourceFile, String contextConf) throws IOException {
+ //read json file
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode model = mapper.readTree(new File(sourceFile));
+
+ //get context config file
+ Properties properties = new Properties();
+ ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+ InputStream inputStream = classloader.getResourceAsStream(contextConf);
+ properties.load(inputStream);
+
+ //get context related properties
+ ObjectNode metadata = mapper.createObjectNode();
+ for (String key : properties.stringPropertyNames()) {
+ if (key.startsWith("ctx")) {
+ metadata.put(key.replaceFirst("ctx.", ""), properties.getProperty(key));
+ }
+ }
+
+ //create context and populate it
+ Map<String, Object> map = new HashMap<>();
+ map.put("model", model);
+ map.put("metadata", metadata);
+ return map;
+ }
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java
new file mode 100644
index 000000000..32846166e
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.extensions;
+
+import org.openecomp.appc.tools.generator.api.ContextBuilder;
+import com.google.common.base.Optional;
+
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
+import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
+import org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.ModuleEffectiveStatementImpl;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
+public class YangContextBuilderImpl implements ContextBuilder {
+
+ @Override
+ public Map<String, Object> buildContext(String sourceFile, String contextConf) throws FileNotFoundException {
+ InputStream source = new FileInputStream(sourceFile);
+ if (source == null) {
+ throw new FileNotFoundException("YANG file <" + sourceFile + ">not found");
+ }
+
+ YangTextSchemaContextResolver yangContextResolver = YangTextSchemaContextResolver
+ .create("yang-context-resolver");
+ try {
+ yangContextResolver.registerSource(new URL("file:///" + sourceFile));
+ } catch (SchemaSourceException | IOException | YangSyntaxErrorException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ Optional<SchemaContext> sc = yangContextResolver.getSchemaContext();
+
+ Map<String, Object> map = new HashMap<>();
+ if (sc.isPresent()) {
+
+ Set<Module> modules = sc.get().getModules();
+ for (Module module : modules) {
+ ModuleEffectiveStatementImpl impl = (ModuleEffectiveStatementImpl) module;
+ map.put("module", module);
+ }
+
+ }
+
+ return map;
+ }
+
+ // @Override
+ // public Map<String, Object> buildContext(String sourceFile, String
+ // contextConf) throws FileNotFoundException {
+ // InputStream source = new FileInputStream(sourceFile);
+ // if (source == null) {
+ // throw new FileNotFoundException("YANG file <" + sourceFile + ">not found");
+ // }
+ //
+ // SchemaContext mSchema = parse(Collections.singletonList(source));
+ //
+ // Map<String, Object> map = new HashMap<>();
+ // map.put("module", mSchema.getModules().iterator().next());
+ // return map;
+ // }
+ //
+ // private SchemaContext parse(List<InputStream> sources) {
+ // YangParserImpl parser = new YangParserImpl();
+ // Set<Module> modules = parser.parseYangModelsFromStreams(sources);
+ // return parser.resolveSchemaContext(modules);
+ // }
+
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java
new file mode 100644
index 000000000..15498c83d
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.impl;
+
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+class CodeGenWriter extends Writer {
+
+ private FileWriter fileWriter;
+ private boolean delimiterBeginFound;
+ private Path basePath;
+ private String outPath;
+ private boolean deleteFile;
+ private static final String DELIMITER = "__";
+ private Pattern pattern;
+
+
+ CodeGenWriter(String destination) throws IOException {
+ super(destination);
+ fileWriter = new FileWriter(destination);
+ basePath = Paths.get(destination);
+ delimiterBeginFound = false;
+ outPath = "";
+ deleteFile = false;
+ pattern = Pattern.compile(DELIMITER);
+ }
+
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ String bufferStr = new String(cbuf).substring(off, off + len);
+ Matcher matcher = pattern.matcher(bufferStr);
+
+ boolean isMatch = matcher.find();
+ if (!isMatch) {
+ if (!delimiterBeginFound) {
+ fileWriter.write(cbuf, off, len);
+ }
+ else {
+ outPath += bufferStr;
+ }
+ }
+ else {
+ if (!delimiterBeginFound) {
+ delimiterBeginFound = true;
+ }
+ else {
+ deleteFile = true;
+ Path fileName = getNewFileName();
+ Files.createDirectories(fileName.getParent());
+ openNewFileWriter(fileName.toString());
+ delimiterBeginFound = false;
+ outPath = "";
+ }
+ }
+ }
+
+ @Override
+ public void flush() throws IOException {
+ fileWriter.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ fileWriter.close();
+ if (deleteFile) {
+ Files.deleteIfExists(basePath);
+ }
+ }
+
+ private Path getNewFileName() {
+ String newRelativePath = this.outPath.replace(".", File.separator);
+ return Paths.get(basePath.getParent().toString(), newRelativePath + ".java");
+ }
+
+ private void openNewFileWriter(String fileName) throws IOException {
+ flush();
+ close();
+ fileWriter = new FileWriter(fileName);
+ }
+}
diff --git a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java
new file mode 100644
index 000000000..bdaa3a29d
--- /dev/null
+++ b/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java
@@ -0,0 +1,71 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.tools.generator.impl;
+
+import org.openecomp.appc.tools.generator.api.ContextBuilder;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Map;
+
+public class ModelGenerator {
+
+ public void execute(String sourceFile, String destinationFile, String templateFile, String builderName, String contextConfName) throws IOException, ReflectiveOperationException {
+
+ ContextBuilder contextBuilder = (ContextBuilder) Class.forName(builderName).newInstance();
+ Map<String, Object> context = contextBuilder.buildContext(sourceFile, contextConfName);
+
+ Path destinationPath = Paths.get(destinationFile);
+ if (!Files.isDirectory(destinationPath))
+ Files.createDirectories(destinationPath.getParent());
+ else {
+ Files.createDirectories(destinationPath);
+ }
+
+ this.generate(context, templateFile, destinationFile);
+ System.out.println("\tFile <" + destinationFile + "> prepared successfully");
+ }
+
+ private void generate(Map<String, Object> context, String templateFile, String destinationFile) throws ReflectiveOperationException {
+ try {
+ Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);
+ cfg.setClassForTemplateLoading(ModelGenerator.class, "/");
+ Template template = cfg.getTemplate(templateFile);
+
+ Writer out = new CodeGenWriter(destinationFile);
+ template.process(context, out);
+ out.close();
+ } catch (IOException | TemplateException e) {
+ throw new RuntimeException("Failed to generate file from template <" + templateFile + ">", e);
+ }
+ }
+
+}
diff --git a/appc-client/code-generator/src/main/resources/configuration/client-kit.properties b/appc-client/code-generator/src/main/resources/configuration/client-kit.properties
new file mode 100644
index 000000000..047915e44
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/configuration/client-kit.properties
@@ -0,0 +1,34 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : APPC
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Copyright (C) 2017 Amdocs
+# =============================================================================
+# 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.
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+# ============LICENSE_END=========================================================
+###
+
+#
+# Default Properties - Configured for code generator
+#
+#--------------------------------------------------------------------------------------------
+ctx.model.package=org.openecomp.appc.client.lcm.model
+ctx.api.package=org.openecomp.appc.client.lcm.api
+ctx.utils.package=org.openecomp.appc.client.lcm.utils
+ctx.exceptions.package=org.openecomp.appc.client.lcm.exceptions
+ctx.interface.classname=LifeCycleManagerStateful
+
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/common.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/common.ftl
new file mode 100644
index 000000000..ca72829d1
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/common.ftl
@@ -0,0 +1,49 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+<#global template = .main_template_name>
+<#function toJavaName text>
+ <#assign names = text?split("-")>
+ <#assign returnValue = "">
+ <#list names as name>
+ <#assign returnValue = returnValue + name?cap_first>
+ </#list>
+ <#return returnValue?uncap_first>
+</#function>
+<#function toJavaType type>
+ <#switch type>
+ <#case "string">
+ <#return "String">
+ <#case "integer">
+ <#return "int">
+ <#default>
+ <#return type>
+ </#switch>
+</#function>
+<#macro generated>
+@javax.annotation.Generated(
+ value = {"${template}"},
+ date = "${.now?string.iso}",
+ comments = "Auto-generated from Open API specification")
+</#macro>
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/enum.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/enum.ftl
new file mode 100644
index 000000000..2ca633b3f
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/enum.ftl
@@ -0,0 +1,65 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package ${meta.model\.package};
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+<#if pojo.description??>
+/**
+* ${pojo.description}
+*
+*/
+</#if>
+public enum ${objectName} {
+
+<#list pojo.enum as enum>
+ ${enum}("${enum}")<#if enum?has_next>,<#else>;</#if>
+</#list>
+
+ private String value;
+
+ ${objectName}(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ${objectName} fromValue(String text) {
+ for (${objectName} var : ${objectName}.values()) {
+ if (String.valueOf(var.value).equals(text)) {
+ return var;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/open-api-to-java.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/open-api-to-java.ftl
new file mode 100644
index 000000000..b9a222132
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/open-api-to-java.ftl
@@ -0,0 +1,41 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+<#include "common.ftl">
+<#assign model = model?eval>
+<#assign meta = metadata?eval>
+<#list model.definitions?keys as objectName>
+ <#assign pojo = model.definitions[objectName]>
+__${meta.model\.package}.${objectName}__
+ <#if model.definitions[objectName].enum??>
+ <#include "enum.ftl">
+ <#elseif model.definitions[objectName].properties??>
+ <#include "pojo.ftl">
+ <#else>
+ <#include "primitive-wrapper-pojo.ftl">
+ </#if>
+</#list>
+<#assign service = model.paths>
+__${meta.api\.package}.${meta.interface\.classname}__
+<#include "service.ftl">
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/pojo.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/pojo.ftl
new file mode 100644
index 000000000..1be2d1173
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/pojo.ftl
@@ -0,0 +1,109 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package ${meta.model\.package};
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+<#if pojo.description??>
+/**
+ * ${pojo.description}
+ */
+</#if>
+<@generated/>
+public class ${objectName} {
+
+<#assign properties = pojo.properties>
+<#list properties?keys as member>
+ <#if properties[member]?is_hash>
+ <#assign varName = toJavaName(member)>
+ <#if properties[member].type??>
+ <#assign property = properties[member]>
+ <#else>
+ <#assign ref = properties[member].$ref?keep_after_last("/")>
+ <#assign property = model.definitions[ref]>
+ </#if>
+ <#if properties[member].enum??>
+ <#assign varType = property.type?cap_first>
+ public enum ${varName?cap_first} {
+ <#list property.enum as enum>
+ ${enum}<#if enum?has_next>,<#else>;</#if>
+ </#list>
+ }
+
+ @JsonProperty("${member}")
+ private ${varName?cap_first} ${varName};
+ <#else>
+ <#if properties[member].$ref??>
+ <#assign varType = toJavaType(ref)>
+ <#else>
+ <#assign varType = toJavaType(property.type)>
+ </#if>
+ @JsonProperty("${member}")
+ private ${varType} ${varName};
+ </#if>
+ </#if>
+
+</#list>
+<#list properties?keys as member>
+ <#if properties[member]?is_hash>
+ <#if properties[member].type??>
+ <#assign property = properties[member]>
+ <#elseif properties[member].$ref??>
+ <#assign ref = properties[member].$ref?keep_after_last("/")>
+ <#assign property = model.definitions[ref]>
+ </#if>
+ <#if properties[member].$ref??>
+ <#assign varType = ref>
+ <#else>
+ <#assign varType = toJavaType(property.type)>
+ </#if>
+ <#if property.enum??>
+ <#assign varType = toJavaName(member)?cap_first>
+ </#if>
+ <#assign varName = toJavaName(member)>
+ <#if property.description??>
+ /**
+ * ${property.description}
+ */
+ </#if>
+ public ${varType} get${varName?cap_first}() {
+ return ${varName};
+ }
+
+ <#if property.description??>
+ /**
+ * ${property.description}
+ */
+ </#if>
+ public void set${toJavaName(member)?cap_first}(${varType} ${varName}) {
+ this.${varName} = ${varName};
+ }
+
+ </#if>
+</#list>
+}
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/primitive-wrapper-pojo.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/primitive-wrapper-pojo.ftl
new file mode 100644
index 000000000..fd2b2c995
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/primitive-wrapper-pojo.ftl
@@ -0,0 +1,59 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+/**
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package ${meta.model\.package};
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+<#if pojo.description??>
+/**
+ * ${pojo.description}
+ */
+</#if>
+<@generated/>
+public class ${objectName} {
+<#assign varType = toJavaType(pojo.type)>
+
+ private ${varType} value;
+
+ public ${objectName}() {}
+
+ @JsonCreator
+ public ${objectName}(${varType} value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public ${varType} getValue() {
+ return value;
+ }
+
+ public void setValue(${varType} value) {
+ this.value = value;
+ }
+}
diff --git a/appc-client/code-generator/src/main/resources/templates/client-kit/service.ftl b/appc-client/code-generator/src/main/resources/templates/client-kit/service.ftl
new file mode 100644
index 000000000..a3a87bdf6
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/client-kit/service.ftl
@@ -0,0 +1,72 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+/*
+ * NOTE: This file is auto-generated and should not be changed manually.
+ */
+package ${meta.api\.package};
+
+<#list service?keys as action>
+ <#assign outputType = service[action].post.responses["200"].schema.properties.output.$ref?keep_after_last("/")>
+ <#assign inputType = service[action].post.parameters[0].schema.properties.input.$ref?keep_after_last("/")>
+import ${meta.model\.package}.${outputType};
+import ${meta.model\.package}.${inputType};
+</#list>
+import ${meta.exceptions\.package}.AppcClientException;
+import ${meta.utils\.package}.RPC;
+
+<#if model.info.description??>
+/**
+* ${model.info.description}
+*/
+</#if>
+<@generated/>
+public interface ${meta.interface\.classname} {
+
+<#list service?keys as action>
+ <#assign returnType = service[action].post.responses["200"].schema.properties.output.$ref?keep_after_last("/")>
+ <#assign rpcName = service[action].post.operationId>
+ <#assign methodName = toJavaName(rpcName)>
+ <#assign methodInputType = service[action].post.parameters[0].schema.properties.input.$ref?keep_after_last("/")>
+ <#assign methodInputName = methodInputType?uncap_first>
+ <#assign description = service[action].post.description>
+ /**
+ * ${description}
+ *
+ * @param ${methodInputName} - RPC input object
+ */
+ @RPC(name="${rpcName}", outputType=${returnType}.class)
+ ${returnType} ${methodName}(${methodInputType} ${methodInputName}) throws AppcClientException;
+
+ /**
+ * ${description}
+ *
+ * @param ${methodInputName} - RPC input object
+ * @return listener - callback implementation
+ */
+ @RPC(name="${rpcName}", outputType=${returnType}.class)
+ void ${methodName}(${methodInputType} ${methodInputName}, ResponseHandler<${returnType}> listener) throws AppcClientException;
+
+</#list>
+}
diff --git a/appc-client/code-generator/src/main/resources/templates/open-api/yang-to-open-api.ftl b/appc-client/code-generator/src/main/resources/templates/open-api/yang-to-open-api.ftl
new file mode 100644
index 000000000..685efcb02
--- /dev/null
+++ b/appc-client/code-generator/src/main/resources/templates/open-api/yang-to-open-api.ftl
@@ -0,0 +1,314 @@
+<#--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+-->
+
+<#global _ = " ">
+<#global __ = _ + _>
+<#global ___ = __ + _>
+<#global ____ = ___ + _>
+<#global _____ = ____ + _>
+<#global ______ = _____ + _>
+<#global _______ = ______ + _>
+<#global ________ = _______ + _>
+<#global _________ = ________ + _>
+<#global __________ = _________ + _>
+<#--
+=================================================================
+ Function definitions
+=================================================================
+-->
+<#function toCamelNotation text>
+ <#local temp = text?upper_case>
+ <#-- Preserve abbreviations (e.g. UUID) - only replace hyphens with underscores, if any -->
+ <#if text == temp>
+ <#return temp?replace("-", "_ ")>
+ <#else>
+ <#return text?replace("-", " ")?capitalize?replace(" ", "")>
+ </#if>
+</#function>
+<#function toRpcInput rpcName>
+ <#return toCamelNotation(rpcName) + "Input">
+</#function>
+<#function toRpcOutput rpcName>
+ <#return toCamelNotation(rpcName) + "Output">
+</#function>
+<#function toJsonType type>
+ <#if type == "string" || type == "enumeration">
+ <#return "string">
+ <#elseif type == "uint16" || type == "uint32">
+ <#return "integer">
+ <#elseif type == "boolean">
+ <#return "boolean">
+ <#else>
+ <#stop "UNSUPPORTED TYPE - ${type}">
+ </#if>
+</#function>
+<#function encode text>
+ <#local temp = text?replace('(\r|\n)+', '', 'r')?replace('( )+', ' ', 'rm')>
+ <#return temp>
+</#function>
+<#--
+ Similar to Java's Class.isAssignableFrom(Class)
+-->
+<#function isAssignableFrom class typeName>
+ <#list class.interfaces as interfaceClass>
+ <#if interfaceClass.name == typeName || isAssignableFrom(interfaceClass, typeName)>
+ <#return true>
+ </#if>
+ </#list>
+ <#return false>
+</#function>
+<#function isContainerNode node>
+ <#return isAssignableFrom(node.class, "org.opendaylight.yangtools.yang.model.api.DataNodeContainer")>
+</#function>
+<#function isLeafNode node>
+ <#return isAssignableFrom(node.class, "org.opendaylight.yangtools.yang.model.api.LeafSchemaNode")>
+</#function>
+<#function isEnumType type>
+ <#return isAssignableFrom(type.class, "org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition")>
+</#function>
+<#function isStringType type>
+ <#return isAssignableFrom(type.class, "org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition")>
+</#function>
+<#function isExtendedType type>
+ <#if type.baseType??>
+ <#return true>
+ </#if>
+ <#return false>
+</#function>
+<#function isGlobalTypeDef obj>
+ <#list module.typeDefinitions as typeDef>
+ <#if typeDef.QName.localName == obj.type.QName.localName>
+ <#return true>
+ </#if>
+ </#list>
+ <#return false>
+</#function>
+<#function getMandatoryProperties obj>
+ <#local result = {}>
+ <#list obj.childNodes as property>
+ <#if property.constraints.mandatory>
+ <#local result = result + {property.QName.localName : ""}>
+ </#if>
+ </#list>
+ <#return result>
+</#function>
+<#function gatherModuleTypes module>
+ <#local result = {}>
+ <#list module.rpcs as rpc>
+ <#local result = gatherNestedTypes(rpc.input, result)>
+ <#local result = gatherNestedTypes(rpc.output, result)>
+ </#list>
+ <#return result>
+</#function>
+<#function gatherNestedTypes container result>
+ <#list container.childNodes as property>
+ <#if isContainerNode(property)>
+ <#local name = property.QName.localName>
+ <#if !result[name]??>
+ <#local result = result + {name : property}>
+ <#local result = gatherNestedTypes(property, result)>
+ </#if>
+ </#if>
+ </#list>
+ <#return result>
+</#function>
+<#--
+=================================================================
+ Macro definitions
+=================================================================
+-->
+<#--
+ Macro to generate description property, if any.
+-->
+<#macro description obj indent = "">
+<#if obj.description??>
+${indent},
+${indent}"description" : "${encode(obj.description)}"<#else>${indent}</#if>
+</#macro>
+<#--
+ Macro to generate enum of valid values
+-->
+<#macro enum yangType indent = "">
+<#if isEnumType(yangType)>
+${indent},
+${indent}"enum" : [
+${indent}${_}<#list yangType.values as enum>"${enum.name}"<#if enum?has_next>, </#if></#list>
+${indent}]
+</#if>
+</#macro>
+<#--
+ Macro to print out schema constraints (min/max/pattern/etc.) if any. Used for custom types defined either globaly via 'typedef'
+ statement or locally (in-line withing a leaf node definition).
+ -->
+<#macro constraints yangType indent = "">
+<#if yangType.patternConstraints?size != 0>
+${indent},
+${indent}"pattern" : "${yangType.patternConstraints?first.regularExpression?replace('\\\\', '\\\\\\\\', 'r')}"
+</#if>
+<#if yangType.lengthConstraints?size != 0>
+${indent},
+${indent}"minLength" : ${yangType.lengthConstraints?first.min},
+${indent}"maxLength" : ${yangType.lengthConstraints?first.max}
+</#if>
+<@enum yangType = yangType.baseType indent = indent />
+</#macro>
+<#--
+ Macro to generate a property within an outer object
+ -->
+<#macro property name prop indent = "">
+${indent}"${name}": {
+<#if isContainerNode(prop)>
+${indent}${_}"$ref" : "#/definitions/${toCamelNotation(prop.QName.localName)}"
+<#elseif isExtendedType(prop.type) && isGlobalTypeDef(prop)>
+${indent}${_}"$ref" : "#/definitions/${toCamelNotation(prop.type.QName.localName)}"
+<#elseif isExtendedType(prop.type)>
+${indent}${_}"type" : "${toJsonType(prop.type.QName.localName)}"
+<@description obj = prop indent = indent + _ />
+<@constraints yangType = prop.type indent = indent + _ />
+<#else><#-- leaf node -->
+${indent}${_}"type" : "${toJsonType(prop.type.QName.localName)}"
+<@description obj = prop indent = indent + _ />
+<@enum yangType = prop.type indent = indent + _ />
+</#if>
+${indent}}</#macro>
+<#--
+ Macro generates declaration of a container node modeled in YANG schema
+-->
+<#macro container name node indent = "">
+${indent}"${name}" : {
+${indent}${_}"type" : "object"
+<@description obj = node indent = indent + _ />
+${indent}${_},
+${indent}${_}"properties" : {
+<#list node.childNodes as child>
+<@property name = child.QName.localName prop = child indent = indent + __ /><#if child?has_next>,</#if>
+</#list>
+${indent}${_}}<#-- end of properties -->
+<#local mandatoryProperties = getMandatoryProperties(node)>
+<#if mandatoryProperties?size != 0>
+,
+${indent}${_}"required" : [<#list mandatoryProperties?keys as p>"${p}"<#if p?has_next> ,</#if></#list>]
+</#if>
+${indent}}<#-- end of container -->
+</#macro>
+<#--
+ Macro generates declaration of JSON object for a custom type defined in YANG schema via 'typedef' statement.
+-->
+<#macro typedef name yangType indent = "">
+${indent}"${name}" : {
+<#local jsonType = toJsonType(yangType.baseType.QName.localName)>
+${indent}${_}"type" : "${jsonType}"
+<@description obj = yangType indent = indent + _ />
+<@constraints yangType = yangType indent = indent + _ />
+${indent}}<#-- end of container -->
+</#macro>
+<#--
+=================================================================
+ Content body
+=================================================================
+-->
+<#assign moduleName = module.name>
+{
+${_}"swagger": "2.0",
+${_}"info": {
+${__}"version": "${module.QNameModule.formattedRevision}"
+<@description obj = module indent = __ />,
+${__}"contact": {
+${_____}"name" : "${module.contact}"
+${__}},
+${__}"title": "${moduleName}"
+${_}},
+${_}"basePath": "/restconf",
+${_}"tags": [{"name": "${moduleName}"}],
+${_}"schemes": [ "https", "http" ],
+${_}"paths": {
+<#list module.rpcs as rpc>
+<#assign rpcName = rpc.QName.localName>
+${__}"/operations/${moduleName}:${rpcName}": {
+${___}"post": {
+${____}"tags": ["${moduleName}"],
+${____}"summary": ""
+<@description obj = rpc indent = ____ />,
+${____}"operationId": "${rpcName}",
+${____}"consumes": ["application/json"],
+${____}"produces": ["application/json"],
+${____}"parameters": [{
+${_____}"in": "body",
+${_____}"name": "input",
+${_____}"required": true,
+${_____}"schema": {
+${______}"type" : "object",
+${______}"properties" : {
+${_______}"input" : {
+${________}"$ref": "#/definitions/${toRpcInput(rpcName)}"
+${_______}}
+${______}}
+${_____}}
+${____}}],
+${____}"responses": {
+${_____}"200": {
+${______}"description": "Successful operation",
+${______}"schema": {
+${_______}"type" : "object",
+${_______}"properties" : {
+${________}"output" : {
+${_________}"$ref": "#/definitions/${toRpcOutput(rpcName)}"
+${________}}
+${_______}}
+${______}}
+${_____}},
+${_____}"401": {"description" : "Unauthorized"},
+${_____}"500": {"description" : "Internal server error"}
+${____}}
+${___}}
+${__}}<#if rpc?has_next>,</#if>
+</#list>
+${_}},
+${_}"definitions": {
+<#--
+ Definition per custom type defined via 'typedef'
+-->
+<#list module.typeDefinitions as typeDef>
+<@typedef name = toCamelNotation(typeDef.QName.localName) yangType = typeDef indent = __ />
+<#if typeDef?has_next>${__},</#if>
+</#list>
+<#--
+ Definition per container explicitly defined in YANG schema
+-->
+<#assign definitions = gatherModuleTypes(module)>
+<#if module.typeDefinitions?size != 0 && definitions?size != 0>${__},</#if>
+<#list definitions?keys as definition>
+<@container name = toCamelNotation(definition) node = definitions[definition] indent = __ /><#if definition?has_next>${__},</#if>
+</#list>
+<#if definitions?size != 0 && module.rpcs?size != 0>${__},</#if>
+<#--
+ Definition per PRC input/output parameter block implicitly defined in YANG schema
+-->
+<#list module.rpcs as rpc>
+<#assign rpcName = rpc.QName.localName>
+<@container name = toRpcInput(rpcName) node = rpc.input indent = __ />${__},
+<@container name = toRpcOutput(rpcName) node = rpc.output indent = __ /><#if rpc?has_next>${__},</#if>
+</#list>
+${_}}<#-- end of "definitions" -->
+} <#-- end of file -->
diff --git a/appc-client/pom.xml b/appc-client/pom.xml
new file mode 100644
index 000000000..871fc3def
--- /dev/null
+++ b/appc-client/pom.xml
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ ONAP : APPC
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Copyright (C) 2017 Amdocs
+ =============================================================================
+ 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.
+
+ ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ ============LICENSE_END=========================================================
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>appc-java-client</artifactId>
+ <groupId>org.openecomp.appc.client</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+
+ <name>appc-java-client</name>
+ <description>APPC Java Client</description>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>client-lib</module>
+ <module>client-kit</module>
+ <module>client-simulator</module>
+ <module>code-generator</module>
+ </modules>
+
+ <properties>
+ <licenseDir>${project.parent.basedir}</licenseDir>
+ <build.helper.maven.plugin.version>1.7</build.helper.maven.plugin.version>
+ <build-helper-maven-plugin-version>3.0.0</build-helper-maven-plugin-version>
+ <bundle.plugin.version>2.5.0</bundle.plugin.version>
+ <cambria.client.version>0.0.1</cambria.client.version>
+ <eelf.core.version>1.0.0</eelf.core.version>
+ <eelf.version>0.0.4</eelf.version>
+ <freemarker.version>2.3.23</freemarker.version>
+ <jackson.version>2.8.5</jackson.version>
+ <java.version>1.8</java.version>
+ <junit.version>4.12</junit.version>
+ <maven.compiler.plugin.version>3.6.0</maven.compiler.plugin.version>
+ <maven.core.version>3.3.9</maven.core.version>
+ <maven.install.plugin.version>2.5.2</maven.install.plugin.version>
+ <maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
+ <maven.plugin.annotations.version>3.5</maven.plugin.annotations.version>
+ <maven.plugin.api.version>3.3.9</maven.plugin.api.version>
+ <maven.plugin.plugin.version>3.3</maven.plugin.plugin.version>
+ <maven.release.plugin.version>2.5.2</maven.release.plugin.version>
+ <maven.scm.provers.jgit.version>1.9.5</maven.scm.provers.jgit.version>
+ <maven.surefire.plugin.version>2.10</maven.surefire.plugin.version>
+ <mockito-core.version>1.9.5</mockito-core.version>
+ <odl.mdsal.yang.binding.version>0.9.1-Boron-SR1</odl.mdsal.yang.binding.version>
+ <odl.sal.binding.version>1.4.1-Boron-SR1</odl.sal.binding.version>
+ <odl.version>0.5.1-Boron-SR1</odl.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.scm.id>git-server</project.scm.id>
+ <sal.core.api.version>1.4.2-Boron-SR2</sal.core.api.version>
+ <sdnctl.dblib.version>1.1.0</sdnctl.dblib.version>
+ <sdnctl.sli.version>1.1.0</sdnctl.sli.version>
+ <yang.maven.plugin.version>1.0.1-Boron-SR1</yang.maven.plugin.version>
+ <yang.parser.impl.version>1.0.3-Boron-SR3</yang.parser.impl.version>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ <version>${odl.mdsal.yang.binding.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${bundle.plugin.version}</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>${yang.maven.plugin.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven.compiler.plugin.version}</version>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>${maven.release.plugin.version}</version>
+ <configuration>
+ <goals>-s ${mvn.settings} deploy</goals>
+ <providerImplementations>
+ <git>jgit</git>
+ </providerImplementations>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-jgit</artifactId>
+ <version>${maven.scm.provers.jgit.version></version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${maven.javadoc.plugin.version}</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <phase>install</phase>
+ <goals>
+ <goal>aggregate-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <phase>install</phase>
+ <goals>
+ <goal>aggregate-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <version>${sdnctl.sli.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>dblib-provider</artifactId>
+ <version>${sdnctl.dblib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ <version>${odl.sal.binding.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.nsa</groupId>
+ <artifactId>cambriaClient</artifactId>
+ <version>${cambria.client.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockito-core.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+</project>
diff --git a/pom.xml b/pom.xml
index 5348062f7..2b6abfdaf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -608,6 +608,7 @@
<module>appc-outbound</module>
<module>appc-inbound</module>
<module>appc-sequence-generator</module>
+ <module>appc-client</module>
</modules>
</profile>
<profile>