From 781b1a6df324419c846c84ea983c18fc8362bfd3 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Wed, 13 Dec 2017 11:19:06 -0800 Subject: Third part of onap rename This part of the commit changes the folder structure on all other folders of appc. Change-Id: I8acfa11cdfcdcd36be0e137245d1dd7324f1abd3 Signed-off-by: Patrick Brady Issue-ID: APPC-13 --- .../src/main/java/org/onap/appc/RPC.java | 37 + .../lcm/api/AppcClientServiceFactoryProvider.java | 43 + .../api/AppcLifeCycleManagerServiceFactory.java | 49 ++ .../appc/client/lcm/api/ApplicationContext.java | 50 ++ .../client/lcm/api/LifeCycleManagerStateful.java | 901 +++++++++++++++++++++ .../onap/appc/client/lcm/api/ResponseHandler.java | 42 + .../exceptions/AppcClientBusinessException.java | 44 + .../client/lcm/exceptions/AppcClientException.java | 44 + .../exceptions/AppcClientInternalException.java | 44 + .../AppcLifeCycleManagerServiceFactoryImpl.java | 61 ++ .../business/CoreAsyncResponseHandlerImpl.java | 60 ++ .../lcm/impl/business/CoreResponseHandler.java | 108 +++ .../impl/business/CoreSyncResponseHandlerImpl.java | 51 ++ .../lcm/impl/business/LCMRequestProcessor.java | 120 +++ .../client/lcm/impl/business/RPCInvocator.java | 85 ++ .../org/onap/appc/client/lcm/model/Action.java | 85 ++ .../appc/client/lcm/model/ActionIdentifiers.java | 109 +++ .../org/onap/appc/client/lcm/model/AuditInput.java | 106 +++ .../onap/appc/client/lcm/model/AuditOutput.java | 89 ++ .../onap/appc/client/lcm/model/CheckLockInput.java | 89 ++ .../appc/client/lcm/model/CheckLockOutput.java | 94 +++ .../onap/appc/client/lcm/model/CommonHeader.java | 143 ++++ .../client/lcm/model/ConfigBackupDeleteInput.java | 89 ++ .../client/lcm/model/ConfigBackupDeleteOutput.java | 89 ++ .../appc/client/lcm/model/ConfigBackupInput.java | 106 +++ .../appc/client/lcm/model/ConfigBackupOutput.java | 89 ++ .../appc/client/lcm/model/ConfigExportInput.java | 89 ++ .../appc/client/lcm/model/ConfigExportOutput.java | 72 ++ .../appc/client/lcm/model/ConfigModifyInput.java | 106 +++ .../appc/client/lcm/model/ConfigModifyOutput.java | 89 ++ .../appc/client/lcm/model/ConfigRestoreInput.java | 106 +++ .../appc/client/lcm/model/ConfigRestoreOutput.java | 89 ++ .../appc/client/lcm/model/ConfigScaleoutInput.java | 106 +++ .../client/lcm/model/ConfigScaleoutOutput.java | 89 ++ .../onap/appc/client/lcm/model/ConfigureInput.java | 106 +++ .../appc/client/lcm/model/ConfigureOutput.java | 89 ++ .../onap/appc/client/lcm/model/EvacuateInput.java | 106 +++ .../onap/appc/client/lcm/model/EvacuateOutput.java | 72 ++ .../java/org/onap/appc/client/lcm/model/Flags.java | 102 +++ .../appc/client/lcm/model/HealthCheckInput.java | 106 +++ .../appc/client/lcm/model/HealthCheckOutput.java | 72 ++ .../appc/client/lcm/model/LiveUpgradeInput.java | 106 +++ .../appc/client/lcm/model/LiveUpgradeOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/LockInput.java | 106 +++ .../org/onap/appc/client/lcm/model/LockOutput.java | 72 ++ .../onap/appc/client/lcm/model/MigrateInput.java | 106 +++ .../onap/appc/client/lcm/model/MigrateOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/Payload.java | 59 ++ .../onap/appc/client/lcm/model/RebuildInput.java | 106 +++ .../onap/appc/client/lcm/model/RebuildOutput.java | 72 ++ .../onap/appc/client/lcm/model/RestartInput.java | 106 +++ .../onap/appc/client/lcm/model/RestartOutput.java | 72 ++ .../onap/appc/client/lcm/model/RollbackInput.java | 128 +++ .../onap/appc/client/lcm/model/RollbackOutput.java | 72 ++ .../onap/appc/client/lcm/model/SnapshotInput.java | 117 +++ .../onap/appc/client/lcm/model/SnapshotOutput.java | 83 ++ .../appc/client/lcm/model/SoftwareUploadInput.java | 106 +++ .../client/lcm/model/SoftwareUploadOutput.java | 72 ++ .../client/lcm/model/StartApplicationInput.java | 106 +++ .../client/lcm/model/StartApplicationOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/StartInput.java | 106 +++ .../onap/appc/client/lcm/model/StartOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/Status.java | 75 ++ .../client/lcm/model/StopApplicationInput.java | 106 +++ .../client/lcm/model/StopApplicationOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/StopInput.java | 106 +++ .../org/onap/appc/client/lcm/model/StopOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/SyncInput.java | 106 +++ .../org/onap/appc/client/lcm/model/SyncOutput.java | 89 ++ .../onap/appc/client/lcm/model/TerminateInput.java | 106 +++ .../appc/client/lcm/model/TerminateOutput.java | 72 ++ .../org/onap/appc/client/lcm/model/TestInput.java | 106 +++ .../org/onap/appc/client/lcm/model/TestOutput.java | 72 ++ .../onap/appc/client/lcm/model/UnlockInput.java | 106 +++ .../onap/appc/client/lcm/model/UnlockOutput.java | 72 ++ .../java/org/onap/appc/client/lcm/model/ZULU.java | 59 ++ .../src/main/java/org/openecomp/appc/RPC.java | 37 - .../lcm/api/AppcClientServiceFactoryProvider.java | 43 - .../api/AppcLifeCycleManagerServiceFactory.java | 49 -- .../appc/client/lcm/api/ApplicationContext.java | 50 -- .../client/lcm/api/LifeCycleManagerStateful.java | 901 --------------------- .../appc/client/lcm/api/ResponseHandler.java | 42 - .../exceptions/AppcClientBusinessException.java | 44 - .../client/lcm/exceptions/AppcClientException.java | 44 - .../exceptions/AppcClientInternalException.java | 44 - .../AppcLifeCycleManagerServiceFactoryImpl.java | 61 -- .../business/CoreAsyncResponseHandlerImpl.java | 60 -- .../lcm/impl/business/CoreResponseHandler.java | 108 --- .../impl/business/CoreSyncResponseHandlerImpl.java | 51 -- .../lcm/impl/business/LCMRequestProcessor.java | 120 --- .../client/lcm/impl/business/RPCInvocator.java | 85 -- .../openecomp/appc/client/lcm/model/Action.java | 85 -- .../appc/client/lcm/model/ActionIdentifiers.java | 109 --- .../appc/client/lcm/model/AuditInput.java | 106 --- .../appc/client/lcm/model/AuditOutput.java | 89 -- .../appc/client/lcm/model/CheckLockInput.java | 89 -- .../appc/client/lcm/model/CheckLockOutput.java | 94 --- .../appc/client/lcm/model/CommonHeader.java | 143 ---- .../client/lcm/model/ConfigBackupDeleteInput.java | 89 -- .../client/lcm/model/ConfigBackupDeleteOutput.java | 89 -- .../appc/client/lcm/model/ConfigBackupInput.java | 106 --- .../appc/client/lcm/model/ConfigBackupOutput.java | 89 -- .../appc/client/lcm/model/ConfigExportInput.java | 89 -- .../appc/client/lcm/model/ConfigExportOutput.java | 72 -- .../appc/client/lcm/model/ConfigModifyInput.java | 106 --- .../appc/client/lcm/model/ConfigModifyOutput.java | 89 -- .../appc/client/lcm/model/ConfigRestoreInput.java | 106 --- .../appc/client/lcm/model/ConfigRestoreOutput.java | 89 -- .../appc/client/lcm/model/ConfigScaleoutInput.java | 106 --- .../client/lcm/model/ConfigScaleoutOutput.java | 89 -- .../appc/client/lcm/model/ConfigureInput.java | 106 --- .../appc/client/lcm/model/ConfigureOutput.java | 89 -- .../appc/client/lcm/model/EvacuateInput.java | 106 --- .../appc/client/lcm/model/EvacuateOutput.java | 72 -- .../org/openecomp/appc/client/lcm/model/Flags.java | 102 --- .../appc/client/lcm/model/HealthCheckInput.java | 106 --- .../appc/client/lcm/model/HealthCheckOutput.java | 72 -- .../appc/client/lcm/model/LiveUpgradeInput.java | 106 --- .../appc/client/lcm/model/LiveUpgradeOutput.java | 72 -- .../openecomp/appc/client/lcm/model/LockInput.java | 106 --- .../appc/client/lcm/model/LockOutput.java | 72 -- .../appc/client/lcm/model/MigrateInput.java | 106 --- .../appc/client/lcm/model/MigrateOutput.java | 72 -- .../openecomp/appc/client/lcm/model/Payload.java | 59 -- .../appc/client/lcm/model/RebuildInput.java | 106 --- .../appc/client/lcm/model/RebuildOutput.java | 72 -- .../appc/client/lcm/model/RestartInput.java | 106 --- .../appc/client/lcm/model/RestartOutput.java | 72 -- .../appc/client/lcm/model/RollbackInput.java | 128 --- .../appc/client/lcm/model/RollbackOutput.java | 72 -- .../appc/client/lcm/model/SnapshotInput.java | 117 --- .../appc/client/lcm/model/SnapshotOutput.java | 83 -- .../appc/client/lcm/model/SoftwareUploadInput.java | 106 --- .../client/lcm/model/SoftwareUploadOutput.java | 72 -- .../client/lcm/model/StartApplicationInput.java | 106 --- .../client/lcm/model/StartApplicationOutput.java | 72 -- .../appc/client/lcm/model/StartInput.java | 106 --- .../appc/client/lcm/model/StartOutput.java | 72 -- .../openecomp/appc/client/lcm/model/Status.java | 75 -- .../client/lcm/model/StopApplicationInput.java | 106 --- .../client/lcm/model/StopApplicationOutput.java | 72 -- .../openecomp/appc/client/lcm/model/StopInput.java | 106 --- .../appc/client/lcm/model/StopOutput.java | 72 -- .../openecomp/appc/client/lcm/model/SyncInput.java | 106 --- .../appc/client/lcm/model/SyncOutput.java | 89 -- .../appc/client/lcm/model/TerminateInput.java | 106 --- .../appc/client/lcm/model/TerminateOutput.java | 72 -- .../openecomp/appc/client/lcm/model/TestInput.java | 106 --- .../appc/client/lcm/model/TestOutput.java | 72 -- .../appc/client/lcm/model/UnlockInput.java | 106 --- .../appc/client/lcm/model/UnlockOutput.java | 72 -- .../org/openecomp/appc/client/lcm/model/ZULU.java | 59 -- ...TestAppcLifeCycleManagerServiceFactoryImpl.java | 60 ++ .../onap/appc/client/lcm/model/TestModelPOJO.java | 144 ++++ .../java/org/onap/appc/generator/JsonHelper.java | 93 +++ .../yang2json/Yang2JsonGeneratorTest.java | 140 ++++ ...TestAppcLifeCycleManagerServiceFactoryImpl.java | 60 -- .../appc/client/lcm/model/TestModelPOJO.java | 144 ---- .../org/openecomp/appc/generator/JsonHelper.java | 93 --- .../yang2json/Yang2JsonGeneratorTest.java | 140 ---- .../impl/core/AbstractRequestResponseHandler.java | 85 ++ .../impl/core/AsyncRequestResponseHandler.java | 76 ++ .../onap/appc/client/impl/core/CoreException.java | 45 + .../onap/appc/client/impl/core/CoreManager.java | 314 +++++++ .../onap/appc/client/impl/core/CoreRegistry.java | 70 ++ .../impl/core/ICoreAsyncResponseHandler.java | 43 + .../client/impl/core/ICoreResponseHandler.java | 28 + .../client/impl/core/ICoreSyncResponseHandler.java | 36 + .../appc/client/impl/core/IInvocationManager.java | 68 ++ .../appc/client/impl/core/ITimeoutHandler.java | 33 + .../onap/appc/client/impl/core/ITimerService.java | 47 ++ .../appc/client/impl/core/InvocationManager.java | 69 ++ .../client/impl/core/InvocationManagerFactory.java | 36 + .../onap/appc/client/impl/core/MessageContext.java | 85 ++ .../client/impl/core/RequestResponseHandler.java | 50 ++ .../impl/core/SyncRequestResponseHandler.java | 107 +++ .../org/onap/appc/client/impl/core/TaskQueue.java | 65 ++ .../appc/client/impl/core/TaskQueueManager.java | 98 +++ .../appc/client/impl/core/TimerServiceImpl.java | 82 ++ .../impl/protocol/APPCMessageReaderWriter.java | 77 ++ .../appc/client/impl/protocol/AsyncProtocol.java | 40 + .../client/impl/protocol/AsyncProtocolImpl.java | 157 ++++ .../onap/appc/client/impl/protocol/Consumer.java | 56 ++ .../appc/client/impl/protocol/ConsumerImpl.java | 125 +++ .../appc/client/impl/protocol/MessageReader.java | 39 + .../appc/client/impl/protocol/MessageWriter.java | 40 + .../client/impl/protocol/MessagingService.java | 61 ++ .../onap/appc/client/impl/protocol/Producer.java | 38 + .../appc/client/impl/protocol/ProducerImpl.java | 82 ++ .../onap/appc/client/impl/protocol/Protocol.java | 38 + .../client/impl/protocol/ProtocolException.java | 44 + .../appc/client/impl/protocol/ProtocolFactory.java | 79 ++ .../appc/client/impl/protocol/ProtocolMessage.java | 98 +++ .../appc/client/impl/protocol/ProtocolType.java | 30 + .../impl/protocol/RetrieveMessageCallback.java | 38 + .../client/impl/protocol/UEBMessagingService.java | 102 +++ .../client/impl/protocol/UEBPropertiesKeys.java | 36 + .../impl/core/AbstractRequestResponseHandler.java | 85 -- .../impl/core/AsyncRequestResponseHandler.java | 76 -- .../appc/client/impl/core/CoreException.java | 45 - .../appc/client/impl/core/CoreManager.java | 314 ------- .../appc/client/impl/core/CoreRegistry.java | 70 -- .../impl/core/ICoreAsyncResponseHandler.java | 43 - .../client/impl/core/ICoreResponseHandler.java | 28 - .../client/impl/core/ICoreSyncResponseHandler.java | 36 - .../appc/client/impl/core/IInvocationManager.java | 68 -- .../appc/client/impl/core/ITimeoutHandler.java | 33 - .../appc/client/impl/core/ITimerService.java | 47 -- .../appc/client/impl/core/InvocationManager.java | 69 -- .../client/impl/core/InvocationManagerFactory.java | 36 - .../appc/client/impl/core/MessageContext.java | 85 -- .../client/impl/core/RequestResponseHandler.java | 50 -- .../impl/core/SyncRequestResponseHandler.java | 107 --- .../openecomp/appc/client/impl/core/TaskQueue.java | 65 -- .../appc/client/impl/core/TaskQueueManager.java | 98 --- .../appc/client/impl/core/TimerServiceImpl.java | 82 -- .../impl/protocol/APPCMessageReaderWriter.java | 77 -- .../appc/client/impl/protocol/AsyncProtocol.java | 40 - .../client/impl/protocol/AsyncProtocolImpl.java | 157 ---- .../appc/client/impl/protocol/Consumer.java | 56 -- .../appc/client/impl/protocol/ConsumerImpl.java | 125 --- .../appc/client/impl/protocol/MessageReader.java | 39 - .../appc/client/impl/protocol/MessageWriter.java | 40 - .../client/impl/protocol/MessagingService.java | 61 -- .../appc/client/impl/protocol/Producer.java | 38 - .../appc/client/impl/protocol/ProducerImpl.java | 82 -- .../appc/client/impl/protocol/Protocol.java | 38 - .../client/impl/protocol/ProtocolException.java | 44 - .../appc/client/impl/protocol/ProtocolFactory.java | 79 -- .../appc/client/impl/protocol/ProtocolMessage.java | 98 --- .../appc/client/impl/protocol/ProtocolType.java | 30 - .../impl/protocol/RetrieveMessageCallback.java | 38 - .../client/impl/protocol/UEBMessagingService.java | 102 --- .../client/impl/protocol/UEBPropertiesKeys.java | 36 - .../appc/client/impl/core/ResponseManagerTest.java | 163 ++++ .../onap/appc/client/impl/core/SyncFlowTest.java | 151 ++++ .../impl/protocol/APPCMessageReaderWriterTest.java | 104 +++ .../impl/protocol/TestAsyncProtocolImpl.java | 91 +++ .../TestAsyncProtocolImplMissingProps.java | 75 ++ .../TestAsyncProtocolImplNullCallback.java | 60 ++ .../impl/protocol/TestUEBMessagingService.java | 70 ++ .../appc/client/impl/core/ResponseManagerTest.java | 163 ---- .../appc/client/impl/core/SyncFlowTest.java | 151 ---- .../impl/protocol/APPCMessageReaderWriterTest.java | 104 --- .../impl/protocol/TestAsyncProtocolImpl.java | 91 --- .../TestAsyncProtocolImplMissingProps.java | 75 -- .../TestAsyncProtocolImplNullCallback.java | 60 -- .../impl/protocol/TestUEBMessagingService.java | 70 -- .../onap/appc/simulator/client/RequestHandler.java | 33 + .../appc/simulator/client/ResponseHandler.java | 31 + .../simulator/client/impl/JsonRequestHandler.java | 275 +++++++ .../simulator/client/impl/JsonResponseHandler.java | 147 ++++ .../appc/simulator/client/main/ClientRunner.java | 100 +++ .../appc/simulator/client/RequestHandler.java | 33 - .../appc/simulator/client/ResponseHandler.java | 31 - .../simulator/client/impl/JsonRequestHandler.java | 275 ------- .../simulator/client/impl/JsonResponseHandler.java | 147 ---- .../appc/simulator/client/main/ClientRunner.java | 100 --- .../client/impl/TestJsonRequestHandler.java | 53 ++ .../client/impl/TestJsonResponseHandler.java | 46 ++ .../simulator/client/main/TestClientRunner.java | 102 +++ .../client/impl/TestJsonRequestHandler.java | 53 -- .../client/impl/TestJsonResponseHandler.java | 46 -- .../simulator/client/main/TestClientRunner.java | 102 --- .../org/onap/appc/tools/generator/api/CLI.java | 66 ++ .../appc/tools/generator/api/ContextBuilder.java | 34 + .../onap/appc/tools/generator/api/MavenPlugin.java | 85 ++ .../extensions/JsonContextBuilderImpl.java | 67 ++ .../extensions/YangContextBuilderImpl.java | 97 +++ .../appc/tools/generator/impl/CodeGenWriter.java | 107 +++ .../appc/tools/generator/impl/ModelGenerator.java | 71 ++ .../openecomp/appc/tools/generator/api/CLI.java | 66 -- .../appc/tools/generator/api/ContextBuilder.java | 34 - .../appc/tools/generator/api/MavenPlugin.java | 85 -- .../extensions/JsonContextBuilderImpl.java | 67 -- .../extensions/YangContextBuilderImpl.java | 97 --- .../appc/tools/generator/impl/CodeGenWriter.java | 107 --- .../appc/tools/generator/impl/ModelGenerator.java | 71 -- .../org/onap/appc/tools/generator/api/CLITest.java | 57 ++ .../tools/generator/impl/CodeGenWriterTest.java | 22 + .../appc/tools/generator/api/CLITest.java | 57 -- .../tools/generator/impl/CodeGenWriterTest.java | 22 - 282 files changed, 12489 insertions(+), 12489 deletions(-) create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/RPC.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/AppcClientServiceFactoryProvider.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/ApplicationContext.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/LifeCycleManagerStateful.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/ResponseHandler.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientBusinessException.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientException.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientInternalException.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreResponseHandler.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/LCMRequestProcessor.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/RPCInvocator.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Action.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ActionIdentifiers.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/AuditInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/AuditOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CheckLockInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CheckLockOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CommonHeader.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupDeleteInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupDeleteOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigExportInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigExportOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigModifyInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigModifyOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigRestoreInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigRestoreOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigScaleoutInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigScaleoutOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigureInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigureOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/EvacuateInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/EvacuateOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Flags.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/HealthCheckInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/HealthCheckOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LiveUpgradeInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LiveUpgradeOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LockInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LockOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/MigrateInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/MigrateOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Payload.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RebuildInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RebuildOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RestartInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RestartOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RollbackInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RollbackOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SnapshotInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SnapshotOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SoftwareUploadInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SoftwareUploadOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartApplicationInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartApplicationOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Status.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopApplicationInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopApplicationOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SyncInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SyncOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TerminateInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TerminateOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TestInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TestOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/UnlockInput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/UnlockOutput.java create mode 100644 appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ZULU.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java delete mode 100644 appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java create mode 100644 appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java create mode 100644 appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/model/TestModelPOJO.java create mode 100644 appc-client/client-kit/src/test/java/org/onap/appc/generator/JsonHelper.java create mode 100644 appc-client/client-kit/src/test/java/org/onap/appc/generator/yang2json/Yang2JsonGeneratorTest.java delete mode 100644 appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java delete mode 100644 appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/model/TestModelPOJO.java delete mode 100644 appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java delete mode 100644 appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/AbstractRequestResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/AsyncRequestResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreException.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreManager.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreRegistry.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreAsyncResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreSyncResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/IInvocationManager.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ITimeoutHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ITimerService.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/InvocationManager.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/InvocationManagerFactory.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/MessageContext.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/RequestResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/SyncRequestResponseHandler.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TaskQueue.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TaskQueueManager.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TimerServiceImpl.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/APPCMessageReaderWriter.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/AsyncProtocol.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/AsyncProtocolImpl.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Consumer.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ConsumerImpl.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessageReader.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessageWriter.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessagingService.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Producer.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProducerImpl.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Protocol.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolException.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolFactory.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolMessage.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolType.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/RetrieveMessageCallback.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/UEBMessagingService.java create mode 100644 appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/UEBPropertiesKeys.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java delete mode 100644 appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/core/ResponseManagerTest.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/core/SyncFlowTest.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/APPCMessageReaderWriterTest.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImpl.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java create mode 100644 appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestUEBMessagingService.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java delete mode 100644 appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java create mode 100644 appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/RequestHandler.java create mode 100644 appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/ResponseHandler.java create mode 100644 appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/impl/JsonRequestHandler.java create mode 100644 appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/impl/JsonResponseHandler.java create mode 100644 appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java delete mode 100644 appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java delete mode 100644 appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java delete mode 100644 appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java delete mode 100644 appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java delete mode 100644 appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java create mode 100644 appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonRequestHandler.java create mode 100644 appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonResponseHandler.java create mode 100644 appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/main/TestClientRunner.java delete mode 100644 appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonRequestHandler.java delete mode 100644 appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonResponseHandler.java delete mode 100644 appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/main/TestClientRunner.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/CLI.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/ContextBuilder.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/MavenPlugin.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/JsonContextBuilderImpl.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/YangContextBuilderImpl.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/impl/CodeGenWriter.java create mode 100644 appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/impl/ModelGenerator.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java delete mode 100644 appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java create mode 100644 appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java create mode 100644 appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java delete mode 100644 appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java delete mode 100644 appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java (limited to 'appc-client') diff --git a/appc-client/client-kit/src/main/java/org/onap/appc/RPC.java b/appc-client/client-kit/src/main/java/org/onap/appc/RPC.java new file mode 100644 index 000000000..2b2c5220a --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/api/AppcClientServiceFactoryProvider.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/AppcClientServiceFactoryProvider.java new file mode 100644 index 000000000..0ae23f19a --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.api; + +import org.onap.appc.client.lcm.impl.business.AppcLifeCycleManagerServiceFactoryImpl; + +public class AppcClientServiceFactoryProvider { + + private static AppcLifeCycleManagerServiceFactory appcLifeCycleManagerServiceFactory; + + public static synchronized T getFactory(Class 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/onap/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java new file mode 100644 index 000000000..c0d2daa01 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.api; + +import org.onap.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/onap/appc/client/lcm/api/ApplicationContext.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/ApplicationContext.java new file mode 100644 index 000000000..b0877ef55 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/api/LifeCycleManagerStateful.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/LifeCycleManagerStateful.java new file mode 100644 index 000000000..5600f137f --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.api; + +import org.onap.appc.client.lcm.model.AuditOutput; +import org.onap.appc.client.lcm.model.AuditInput; +import org.onap.appc.client.lcm.model.CheckLockOutput; +import org.onap.appc.client.lcm.model.CheckLockInput; +import org.onap.appc.client.lcm.model.ConfigBackupOutput; +import org.onap.appc.client.lcm.model.ConfigBackupInput; +import org.onap.appc.client.lcm.model.ConfigBackupDeleteOutput; +import org.onap.appc.client.lcm.model.ConfigBackupDeleteInput; +import org.onap.appc.client.lcm.model.ConfigExportOutput; +import org.onap.appc.client.lcm.model.ConfigExportInput; +import org.onap.appc.client.lcm.model.ConfigModifyOutput; +import org.onap.appc.client.lcm.model.ConfigModifyInput; +import org.onap.appc.client.lcm.model.ConfigRestoreOutput; +import org.onap.appc.client.lcm.model.ConfigRestoreInput; +import org.onap.appc.client.lcm.model.ConfigScaleoutOutput; +import org.onap.appc.client.lcm.model.ConfigScaleoutInput; +import org.onap.appc.client.lcm.model.ConfigureOutput; +import org.onap.appc.client.lcm.model.ConfigureInput; +import org.onap.appc.client.lcm.model.EvacuateOutput; +import org.onap.appc.client.lcm.model.EvacuateInput; +import org.onap.appc.client.lcm.model.HealthCheckOutput; +import org.onap.appc.client.lcm.model.HealthCheckInput; +import org.onap.appc.client.lcm.model.LiveUpgradeOutput; +import org.onap.appc.client.lcm.model.LiveUpgradeInput; +import org.onap.appc.client.lcm.model.LockOutput; +import org.onap.appc.client.lcm.model.LockInput; +import org.onap.appc.client.lcm.model.MigrateOutput; +import org.onap.appc.client.lcm.model.MigrateInput; +import org.onap.appc.client.lcm.model.RebuildOutput; +import org.onap.appc.client.lcm.model.RebuildInput; +import org.onap.appc.client.lcm.model.RestartOutput; +import org.onap.appc.client.lcm.model.RestartInput; +import org.onap.appc.client.lcm.model.RollbackOutput; +import org.onap.appc.client.lcm.model.RollbackInput; +import org.onap.appc.client.lcm.model.SnapshotOutput; +import org.onap.appc.client.lcm.model.SnapshotInput; +import org.onap.appc.client.lcm.model.SoftwareUploadOutput; +import org.onap.appc.client.lcm.model.SoftwareUploadInput; +import org.onap.appc.client.lcm.model.StartOutput; +import org.onap.appc.client.lcm.model.StartInput; +import org.onap.appc.client.lcm.model.StopOutput; +import org.onap.appc.client.lcm.model.StopInput; +import org.onap.appc.client.lcm.model.SyncOutput; +import org.onap.appc.client.lcm.model.SyncInput; +import org.onap.appc.client.lcm.model.TerminateOutput; +import org.onap.appc.client.lcm.model.TerminateInput; +import org.onap.appc.client.lcm.model.TestOutput; +import org.onap.appc.client.lcm.model.TestInput; +import org.onap.appc.client.lcm.model.UnlockOutput; +import org.onap.appc.client.lcm.model.UnlockInput; +import org.onap.appc.RPC; +import org.onap.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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 listener) throws AppcClientException; + +} diff --git a/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/ResponseHandler.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/api/ResponseHandler.java new file mode 100644 index 000000000..68459925f --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.api; + +import org.onap.appc.client.lcm.exceptions.AppcClientException; + +public interface ResponseHandler { + + /** + * 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/onap/appc/client/lcm/exceptions/AppcClientBusinessException.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientBusinessException.java new file mode 100644 index 000000000..7d91f39e5 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/exceptions/AppcClientException.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientException.java new file mode 100644 index 000000000..c72f6150e --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/exceptions/AppcClientInternalException.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/exceptions/AppcClientInternalException.java new file mode 100644 index 000000000..9b6dfed7b --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java new file mode 100644 index 000000000..b8ab36bbe --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; +import org.onap.appc.client.lcm.api.ApplicationContext; +import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; +import org.onap.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/onap/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java new file mode 100644 index 000000000..96e21d8f8 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.client.impl.core.CoreException; +import org.onap.appc.client.impl.core.ICoreAsyncResponseHandler; +import org.onap.appc.client.lcm.api.ResponseHandler; +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import com.fasterxml.jackson.databind.ObjectMapper; + +class CoreAsyncResponseHandlerImpl extends CoreResponseHandler implements ICoreAsyncResponseHandler { + + private final ResponseHandler responseHandler; + + CoreAsyncResponseHandlerImpl(ResponseHandler responseHandler, Class 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/onap/appc/client/lcm/impl/business/CoreResponseHandler.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreResponseHandler.java new file mode 100644 index 000000000..3d4786862 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; + +import org.onap.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 { + private final Class rpcOutput; + private final ObjectMapper mapper; + + private final EELFLogger LOG = EELFManager.getInstance().getLogger(CoreResponseHandler.class); + + CoreResponseHandler(Class 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/onap/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java new file mode 100644 index 000000000..66da8fbe2 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.client.impl.core.CoreException; +import org.onap.appc.client.impl.core.ICoreSyncResponseHandler; +import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; +import com.fasterxml.jackson.databind.ObjectMapper; + +class CoreSyncResponseHandlerImpl extends CoreResponseHandler implements ICoreSyncResponseHandler { + + CoreSyncResponseHandlerImpl(Class rpcOutput, ObjectMapper mapper) { + super(rpcOutput, mapper); + } + + public 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/onap/appc/client/lcm/impl/business/LCMRequestProcessor.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/LCMRequestProcessor.java new file mode 100644 index 000000000..b718c1ac9 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.client.impl.core.*; +import org.onap.appc.client.lcm.api.ApplicationContext; +import org.onap.appc.client.lcm.api.ResponseHandler; +import org.onap.appc.client.lcm.exceptions.AppcClientBusinessException; +import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; +import org.onap.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); + } + } + + void processAsync(Object rpcInput, String rpcName, Class rpcOutputType, ResponseHandler handler) throws AppcClientInternalException { + try { + String correlationID = createCorrelationID(rpcInput); + String rpcStr = marshallRPCInput(rpcInput); + ICoreAsyncResponseHandler asyncResponseHandler = new CoreAsyncResponseHandlerImpl(handler, rpcOutputType, mapper); + invocationManager.asyncRequest(rpcStr, asyncResponseHandler, correlationID, rpcName); + } catch (CoreException e) { + throw new AppcClientInternalException(e); + } + } + + T processSync(Object rpcInput, String rpcName, Class rpcOutputType) throws AppcClientInternalException, AppcClientBusinessException { + T response = null; + try { + String correlationID = createCorrelationID(rpcInput); + String rpcStr = marshallRPCInput(rpcInput); + ICoreSyncResponseHandler syncResponseHandler = new CoreSyncResponseHandlerImpl(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/onap/appc/client/lcm/impl/business/RPCInvocator.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/impl/business/RPCInvocator.java new file mode 100644 index 000000000..525700d62 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.appc.client.lcm.impl.business; + +import org.onap.appc.RPC; +import org.onap.appc.client.lcm.api.ResponseHandler; +import org.onap.appc.client.lcm.exceptions.AppcClientBusinessException; +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import org.onap.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 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 rpcOutputType = (Class) annotation.outputType(); + + T result = null; + if (isAsync(method)) { + @SuppressWarnings("unchecked") + ResponseHandler handler = (ResponseHandler) 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/onap/appc/client/lcm/model/Action.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Action.java new file mode 100644 index 000000000..d43a61c92 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ActionIdentifiers.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ActionIdentifiers.java new file mode 100644 index 000000000..bff2c44cb --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/AuditInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/AuditInput.java new file mode 100644 index 000000000..2301913a9 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/AuditOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/AuditOutput.java new file mode 100644 index 000000000..00f4244ba --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/CheckLockInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CheckLockInput.java new file mode 100644 index 000000000..840aad615 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/CheckLockOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CheckLockOutput.java new file mode 100644 index 000000000..2bfdea0fe --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/CommonHeader.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/CommonHeader.java new file mode 100644 index 000000000..43320d333 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigBackupDeleteInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupDeleteInput.java new file mode 100644 index 000000000..c5f14b6ae --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigBackupDeleteOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupDeleteOutput.java new file mode 100644 index 000000000..730240276 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigBackupInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupInput.java new file mode 100644 index 000000000..26f799cb4 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigBackupOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigBackupOutput.java new file mode 100644 index 000000000..1768ea74d --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigExportInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigExportInput.java new file mode 100644 index 000000000..5c2d98d19 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigExportOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigExportOutput.java new file mode 100644 index 000000000..bbfe27af1 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigModifyInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigModifyInput.java new file mode 100644 index 000000000..c1a9e6be6 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigModifyOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigModifyOutput.java new file mode 100644 index 000000000..356299d77 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigRestoreInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigRestoreInput.java new file mode 100644 index 000000000..ec26bae34 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigRestoreOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigRestoreOutput.java new file mode 100644 index 000000000..0646d670b --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigScaleoutInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigScaleoutInput.java new file mode 100644 index 000000000..14c62689a --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigScaleoutOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigScaleoutOutput.java new file mode 100644 index 000000000..fb3f1973a --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigureInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigureInput.java new file mode 100644 index 000000000..b56d692b8 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ConfigureOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ConfigureOutput.java new file mode 100644 index 000000000..fcf32bf2d --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/EvacuateInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/EvacuateInput.java new file mode 100644 index 000000000..85c36e8a4 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/EvacuateOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/EvacuateOutput.java new file mode 100644 index 000000000..2c73a5b84 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/Flags.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Flags.java new file mode 100644 index 000000000..01d2652dd --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/HealthCheckInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/HealthCheckInput.java new file mode 100644 index 000000000..7bd3207cb --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/HealthCheckOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/HealthCheckOutput.java new file mode 100644 index 000000000..41a907c71 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/LiveUpgradeInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LiveUpgradeInput.java new file mode 100644 index 000000000..82a971bc7 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/LiveUpgradeOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LiveUpgradeOutput.java new file mode 100644 index 000000000..809adcd8f --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/LockInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LockInput.java new file mode 100644 index 000000000..f6f68d2c6 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/LockOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/LockOutput.java new file mode 100644 index 000000000..0f77bced6 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/MigrateInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/MigrateInput.java new file mode 100644 index 000000000..5877aab07 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/MigrateOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/MigrateOutput.java new file mode 100644 index 000000000..4d804db9a --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/Payload.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Payload.java new file mode 100644 index 000000000..56ce6c529 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RebuildInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RebuildInput.java new file mode 100644 index 000000000..ecd199dee --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RebuildOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RebuildOutput.java new file mode 100644 index 000000000..0816c5b87 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RestartInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RestartInput.java new file mode 100644 index 000000000..4df2184c4 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RestartOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RestartOutput.java new file mode 100644 index 000000000..8c44631dd --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RollbackInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RollbackInput.java new file mode 100644 index 000000000..db688c0ec --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/RollbackOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/RollbackOutput.java new file mode 100644 index 000000000..21aa1f08f --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SnapshotInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SnapshotInput.java new file mode 100644 index 000000000..b3492c2dd --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SnapshotOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SnapshotOutput.java new file mode 100644 index 000000000..9036b2607 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SoftwareUploadInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SoftwareUploadInput.java new file mode 100644 index 000000000..270121a96 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SoftwareUploadOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SoftwareUploadOutput.java new file mode 100644 index 000000000..8e32dd3a2 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StartApplicationInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartApplicationInput.java new file mode 100644 index 000000000..dca0bc47b --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StartApplicationOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartApplicationOutput.java new file mode 100644 index 000000000..061f2476e --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StartInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartInput.java new file mode 100644 index 000000000..3e0829b52 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StartOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StartOutput.java new file mode 100644 index 000000000..1efcae95d --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/Status.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/Status.java new file mode 100644 index 000000000..85f64c790 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StopApplicationInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopApplicationInput.java new file mode 100644 index 000000000..dc9bf4840 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StopApplicationOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopApplicationOutput.java new file mode 100644 index 000000000..d0193a16d --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StopInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopInput.java new file mode 100644 index 000000000..f5477405e --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/StopOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/StopOutput.java new file mode 100644 index 000000000..9160a98f7 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SyncInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SyncInput.java new file mode 100644 index 000000000..2928c76a2 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/SyncOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/SyncOutput.java new file mode 100644 index 000000000..82347d295 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/TerminateInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TerminateInput.java new file mode 100644 index 000000000..de45dddda --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/TerminateOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TerminateOutput.java new file mode 100644 index 000000000..1a78f0e3f --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/TestInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TestInput.java new file mode 100644 index 000000000..33dab668e --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/TestOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/TestOutput.java new file mode 100644 index 000000000..283a92d7e --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/UnlockInput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/UnlockInput.java new file mode 100644 index 000000000..b03c683b7 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/UnlockOutput.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/UnlockOutput.java new file mode 100644 index 000000000..9830c8f87 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/onap/appc/client/lcm/model/ZULU.java b/appc-client/client-kit/src/main/java/org/onap/appc/client/lcm/model/ZULU.java new file mode 100644 index 000000000..416b56a20 --- /dev/null +++ b/appc-client/client-kit/src/main/java/org/onap/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.onap.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/main/java/org/openecomp/appc/RPC.java b/appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java deleted file mode 100644 index 2b2c5220a..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/RPC.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 0ae23f19a..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcClientServiceFactoryProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.api; - -import org.onap.appc.client.lcm.impl.business.AppcLifeCycleManagerServiceFactoryImpl; - -public class AppcClientServiceFactoryProvider { - - private static AppcLifeCycleManagerServiceFactory appcLifeCycleManagerServiceFactory; - - public static synchronized T getFactory(Class 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 deleted file mode 100644 index c0d2daa01..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/AppcLifeCycleManagerServiceFactory.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.api; - -import org.onap.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 deleted file mode 100644 index b0877ef55..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ApplicationContext.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 5600f137f..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/LifeCycleManagerStateful.java +++ /dev/null @@ -1,901 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.api; - -import org.onap.appc.client.lcm.model.AuditOutput; -import org.onap.appc.client.lcm.model.AuditInput; -import org.onap.appc.client.lcm.model.CheckLockOutput; -import org.onap.appc.client.lcm.model.CheckLockInput; -import org.onap.appc.client.lcm.model.ConfigBackupOutput; -import org.onap.appc.client.lcm.model.ConfigBackupInput; -import org.onap.appc.client.lcm.model.ConfigBackupDeleteOutput; -import org.onap.appc.client.lcm.model.ConfigBackupDeleteInput; -import org.onap.appc.client.lcm.model.ConfigExportOutput; -import org.onap.appc.client.lcm.model.ConfigExportInput; -import org.onap.appc.client.lcm.model.ConfigModifyOutput; -import org.onap.appc.client.lcm.model.ConfigModifyInput; -import org.onap.appc.client.lcm.model.ConfigRestoreOutput; -import org.onap.appc.client.lcm.model.ConfigRestoreInput; -import org.onap.appc.client.lcm.model.ConfigScaleoutOutput; -import org.onap.appc.client.lcm.model.ConfigScaleoutInput; -import org.onap.appc.client.lcm.model.ConfigureOutput; -import org.onap.appc.client.lcm.model.ConfigureInput; -import org.onap.appc.client.lcm.model.EvacuateOutput; -import org.onap.appc.client.lcm.model.EvacuateInput; -import org.onap.appc.client.lcm.model.HealthCheckOutput; -import org.onap.appc.client.lcm.model.HealthCheckInput; -import org.onap.appc.client.lcm.model.LiveUpgradeOutput; -import org.onap.appc.client.lcm.model.LiveUpgradeInput; -import org.onap.appc.client.lcm.model.LockOutput; -import org.onap.appc.client.lcm.model.LockInput; -import org.onap.appc.client.lcm.model.MigrateOutput; -import org.onap.appc.client.lcm.model.MigrateInput; -import org.onap.appc.client.lcm.model.RebuildOutput; -import org.onap.appc.client.lcm.model.RebuildInput; -import org.onap.appc.client.lcm.model.RestartOutput; -import org.onap.appc.client.lcm.model.RestartInput; -import org.onap.appc.client.lcm.model.RollbackOutput; -import org.onap.appc.client.lcm.model.RollbackInput; -import org.onap.appc.client.lcm.model.SnapshotOutput; -import org.onap.appc.client.lcm.model.SnapshotInput; -import org.onap.appc.client.lcm.model.SoftwareUploadOutput; -import org.onap.appc.client.lcm.model.SoftwareUploadInput; -import org.onap.appc.client.lcm.model.StartOutput; -import org.onap.appc.client.lcm.model.StartInput; -import org.onap.appc.client.lcm.model.StopOutput; -import org.onap.appc.client.lcm.model.StopInput; -import org.onap.appc.client.lcm.model.SyncOutput; -import org.onap.appc.client.lcm.model.SyncInput; -import org.onap.appc.client.lcm.model.TerminateOutput; -import org.onap.appc.client.lcm.model.TerminateInput; -import org.onap.appc.client.lcm.model.TestOutput; -import org.onap.appc.client.lcm.model.TestInput; -import org.onap.appc.client.lcm.model.UnlockOutput; -import org.onap.appc.client.lcm.model.UnlockInput; -import org.onap.appc.RPC; -import org.onap.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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 deleted file mode 100644 index 68459925f..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/api/ResponseHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.api; - -import org.onap.appc.client.lcm.exceptions.AppcClientException; - -public interface ResponseHandler { - - /** - * 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 deleted file mode 100644 index 7d91f39e5..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientBusinessException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index c72f6150e..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 9b6dfed7b..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/exceptions/AppcClientInternalException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index b8ab36bbe..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/AppcLifeCycleManagerServiceFactoryImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; -import org.onap.appc.client.lcm.api.ApplicationContext; -import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; -import org.onap.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 deleted file mode 100644 index 96e21d8f8..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreAsyncResponseHandlerImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.client.impl.core.CoreException; -import org.onap.appc.client.impl.core.ICoreAsyncResponseHandler; -import org.onap.appc.client.lcm.api.ResponseHandler; -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import com.fasterxml.jackson.databind.ObjectMapper; - -class CoreAsyncResponseHandlerImpl extends CoreResponseHandler implements ICoreAsyncResponseHandler { - - private final ResponseHandler responseHandler; - - CoreAsyncResponseHandlerImpl(ResponseHandler responseHandler, Class 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 deleted file mode 100644 index 3d4786862..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreResponseHandler.java +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; - -import org.onap.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 { - private final Class rpcOutput; - private final ObjectMapper mapper; - - private final EELFLogger LOG = EELFManager.getInstance().getLogger(CoreResponseHandler.class); - - CoreResponseHandler(Class 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 deleted file mode 100644 index 66da8fbe2..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/CoreSyncResponseHandlerImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.client.impl.core.CoreException; -import org.onap.appc.client.impl.core.ICoreSyncResponseHandler; -import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; -import com.fasterxml.jackson.databind.ObjectMapper; - -class CoreSyncResponseHandlerImpl extends CoreResponseHandler implements ICoreSyncResponseHandler { - - CoreSyncResponseHandlerImpl(Class rpcOutput, ObjectMapper mapper) { - super(rpcOutput, mapper); - } - - public 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 deleted file mode 100644 index b718c1ac9..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/LCMRequestProcessor.java +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.client.impl.core.*; -import org.onap.appc.client.lcm.api.ApplicationContext; -import org.onap.appc.client.lcm.api.ResponseHandler; -import org.onap.appc.client.lcm.exceptions.AppcClientBusinessException; -import org.onap.appc.client.lcm.exceptions.AppcClientInternalException; -import org.onap.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); - } - } - - void processAsync(Object rpcInput, String rpcName, Class rpcOutputType, ResponseHandler handler) throws AppcClientInternalException { - try { - String correlationID = createCorrelationID(rpcInput); - String rpcStr = marshallRPCInput(rpcInput); - ICoreAsyncResponseHandler asyncResponseHandler = new CoreAsyncResponseHandlerImpl(handler, rpcOutputType, mapper); - invocationManager.asyncRequest(rpcStr, asyncResponseHandler, correlationID, rpcName); - } catch (CoreException e) { - throw new AppcClientInternalException(e); - } - } - - T processSync(Object rpcInput, String rpcName, Class rpcOutputType) throws AppcClientInternalException, AppcClientBusinessException { - T response = null; - try { - String correlationID = createCorrelationID(rpcInput); - String rpcStr = marshallRPCInput(rpcInput); - ICoreSyncResponseHandler syncResponseHandler = new CoreSyncResponseHandlerImpl(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 deleted file mode 100644 index 525700d62..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/impl/business/RPCInvocator.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.onap.appc.client.lcm.impl.business; - -import org.onap.appc.RPC; -import org.onap.appc.client.lcm.api.ResponseHandler; -import org.onap.appc.client.lcm.exceptions.AppcClientBusinessException; -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import org.onap.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 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 rpcOutputType = (Class) annotation.outputType(); - - T result = null; - if (isAsync(method)) { - @SuppressWarnings("unchecked") - ResponseHandler handler = (ResponseHandler) 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 deleted file mode 100644 index d43a61c92..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Action.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index bff2c44cb..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ActionIdentifiers.java +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 2301913a9..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 00f4244ba..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/AuditOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 840aad615..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockInput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 2bfdea0fe..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CheckLockOutput.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 43320d333..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/CommonHeader.java +++ /dev/null @@ -1,143 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index c5f14b6ae..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteInput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 730240276..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupDeleteOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 26f799cb4..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 1768ea74d..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigBackupOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 5c2d98d19..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportInput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index bbfe27af1..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigExportOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index c1a9e6be6..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 356299d77..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigModifyOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index ec26bae34..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 0646d670b..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigRestoreOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 14c62689a..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index fb3f1973a..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigScaleoutOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index b56d692b8..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index fcf32bf2d..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ConfigureOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 85c36e8a4..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 2c73a5b84..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/EvacuateOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 01d2652dd..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Flags.java +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 7bd3207cb..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 41a907c71..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/HealthCheckOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 82a971bc7..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 809adcd8f..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LiveUpgradeOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index f6f68d2c6..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 0f77bced6..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/LockOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 5877aab07..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 4d804db9a..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/MigrateOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 56ce6c529..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Payload.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index ecd199dee..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 0816c5b87..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RebuildOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 4df2184c4..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 8c44631dd..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RestartOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index db688c0ec..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackInput.java +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 21aa1f08f..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/RollbackOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index b3492c2dd..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotInput.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 9036b2607..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SnapshotOutput.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 270121a96..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 8e32dd3a2..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SoftwareUploadOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index dca0bc47b..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 061f2476e..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartApplicationOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 3e0829b52..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 1efcae95d..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StartOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 85f64c790..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/Status.java +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index dc9bf4840..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index d0193a16d..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopApplicationOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index f5477405e..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 9160a98f7..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/StopOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 2928c76a2..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 82347d295..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/SyncOutput.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index de45dddda..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 1a78f0e3f..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TerminateOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 33dab668e..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 283a92d7e..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/TestOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index b03c683b7..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockInput.java +++ /dev/null @@ -1,106 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 9830c8f87..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/UnlockOutput.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 416b56a20..000000000 --- a/appc-client/client-kit/src/main/java/org/openecomp/appc/client/lcm/model/ZULU.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============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.onap.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/org/onap/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java b/appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java new file mode 100644 index 000000000..6b24b0a83 --- /dev/null +++ b/appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java @@ -0,0 +1,60 @@ +package org.onap.appc.client.lcm.impl.business; + + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.onap.appc.client.lcm.api.ApplicationContext; +import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import org.onap.appc.client.lcm.impl.business.LCMRequestProcessor; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +public class TestAppcLifeCycleManagerServiceFactoryImpl { + + AppcLifeCycleManagerServiceFactoryImpl appcLifeCycleManagerServiceFactory=new AppcLifeCycleManagerServiceFactoryImpl(); + + @Ignore + public void testCreateLifeCycleManagerStateful() throws AppcClientException{ + LifeCycleManagerStateful lifeCycleManagerStateful; + ApplicationContext applicationContext=new ApplicationContext(); + applicationContext.setApplicationID("AppID"); + applicationContext.setMechID("mechId"); + String folder="src/test/resources/data"; + Properties properties =getProperties(folder); + lifeCycleManagerStateful=appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(applicationContext,properties); + + Assert.assertNotNull(lifeCycleManagerStateful); + + } + + public 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; + } +} diff --git a/appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/model/TestModelPOJO.java b/appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/model/TestModelPOJO.java new file mode 100644 index 000000000..9cb3b9f56 --- /dev/null +++ b/appc-client/client-kit/src/test/java/org/onap/appc/client/lcm/model/TestModelPOJO.java @@ -0,0 +1,144 @@ +package org.onap.appc.client.lcm.model; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +public class TestModelPOJO { + static List pojoClassName; + static List fields; + static{ + pojoClassName = new ArrayList<>(); + pojoClassName.add(AuditInput.class); + pojoClassName.add(AuditOutput.class); + pojoClassName.add(CheckLockInput.class); + pojoClassName.add(CheckLockOutput.class); + pojoClassName.add(ConfigBackupDeleteInput.class); + pojoClassName.add(ConfigBackupDeleteOutput.class); + pojoClassName.add(ConfigBackupInput.class); + pojoClassName.add(ConfigBackupOutput.class); + pojoClassName.add(ConfigExportInput.class); + pojoClassName.add(ConfigExportOutput.class); + pojoClassName.add(ConfigModifyInput.class); + pojoClassName.add(ConfigModifyOutput.class); + pojoClassName.add(ConfigRestoreInput.class); + pojoClassName.add(ConfigRestoreOutput.class); + pojoClassName.add(ConfigScaleoutInput.class); + pojoClassName.add(ConfigScaleoutOutput.class); + pojoClassName.add(ConfigureInput.class); + pojoClassName.add(ConfigureOutput.class); + pojoClassName.add(EvacuateInput.class); + pojoClassName.add(EvacuateOutput.class); + pojoClassName.add(HealthCheckInput.class); + pojoClassName.add(HealthCheckOutput.class); + pojoClassName.add(LiveUpgradeInput.class); + pojoClassName.add(LiveUpgradeOutput.class); + pojoClassName.add(LockInput.class); + pojoClassName.add(LockOutput.class); + pojoClassName.add(MigrateInput.class); + pojoClassName.add(MigrateOutput.class); + pojoClassName.add(RebuildInput.class); + pojoClassName.add(RebuildOutput.class); + pojoClassName.add(HealthCheckInput.class); + pojoClassName.add(RollbackInput.class); + pojoClassName.add(RollbackOutput.class); + pojoClassName.add(RestartInput.class); + pojoClassName.add(RestartOutput.class); + pojoClassName.add(SnapshotInput.class); + pojoClassName.add(SnapshotOutput.class); + pojoClassName.add(SoftwareUploadInput.class); + pojoClassName.add(SoftwareUploadOutput.class); + pojoClassName.add(StartApplicationInput.class); + pojoClassName.add(StartApplicationOutput.class); + pojoClassName.add(StartInput.class); + pojoClassName.add(StartOutput.class); + pojoClassName.add(StopApplicationInput.class); + pojoClassName.add(StopApplicationOutput.class); + pojoClassName.add(StopInput.class); + pojoClassName.add(SyncInput.class); + pojoClassName.add(SyncOutput.class); + pojoClassName.add(TerminateInput.class); + pojoClassName.add(TerminateOutput.class); + pojoClassName.add(TestInput.class); + pojoClassName.add(TestOutput.class); + pojoClassName.add(UnlockInput.class); + pojoClassName.add(UnlockOutput.class); + + fields = new ArrayList<>(); + fields.add("CommonHeader"); + fields.add("Action"); + fields.add("Payload"); + fields.add("Status"); + } + @Test + public void testModel() throws Exception{ + for(String field: fields){ + for(Class c: pojoClassName){ + Object instance = c.newInstance(); + Field[] fields = c.getDeclaredFields(); + for(Field f: fields){ + if(f.getType() == getClassForString(field)){ + Method m = c.getDeclaredMethod("set"+field,getClassForString(field)); + Object argument = createArgument(field); + m.invoke(instance,argument); + + Method getter = c.getDeclaredMethod("get"+field); + Object getValue = getter.invoke(instance); + Assert.assertEquals("POJO test failed for class:"+c.getCanonicalName()+" for method:"+m.getName(),argument, getValue); + } + } + } + } + } + + private Object createArgument(String field){ + if(field.equals("CommonHeader")){ + return createHeader(); + } + else if(field.equals("Action")){ + return createAction(); + }else if(field.equals("Payload")){ + return createPayload(); + }else if(field.equals("Status")){ + return createStatus(); + } + + throw new IllegalArgumentException(); + } + + private Action createAction(){ + return Action.Restart; + } + private Payload createPayload(){ + return new Payload(); + } + private CommonHeader createHeader(){ + CommonHeader header = new CommonHeader(); + header.setApiVer("apiver"); + header.setOriginatorId("originator"); + return header; + } + private Status createStatus() { + return new Status(); + } + + private Class getClassForString(String field){ + + if(field.equals("CommonHeader")){ + return CommonHeader.class; + }else if(field.equals("Action")){ + return Action.class; + }else if(field.equals("ActionIdentifiers")){ + return ActionIdentifiers.class; + }else if(field.equals("Payload")){ + return Payload.class; + }else if(field.equals("Status")){ + return Status.class; + } + throw new IllegalArgumentException(); + } +} diff --git a/appc-client/client-kit/src/test/java/org/onap/appc/generator/JsonHelper.java b/appc-client/client-kit/src/test/java/org/onap/appc/generator/JsonHelper.java new file mode 100644 index 000000000..e75a44e65 --- /dev/null +++ b/appc-client/client-kit/src/test/java/org/onap/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.onap.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> jsonBodyInputParams, Map> jsonBodyOutputParams) { + populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.PARAMETER,false); + } + public static void populateRpcInputOutputSchemaRefFromJson(final JsonNode jsonNode, Map> jsonBodyInputParams, Map> jsonBodyOutputParams) { + populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.SCHEMA_REF,true); + } + public static void populateRpcInputOutputParamsFromJson(final JsonNode jsonNode, Map> jsonBodyInputParams, Map> jsonBodyOutputParams,PopulateType populateType,boolean normalizeRpcOperation) { + //get all yang2json Input and output Params and populate jsonBodyInputParams & jsonBodyOutputParams + for(Iterator 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 inputParametersOrSchemaRef; + Set 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 extractParams(final JsonNode jsonNode,String schemaRefName) { + Iterator> fields = jsonNode.get("definitions").get(schemaRefName).get("properties").fields(); + Set params = new HashSet(); + for( ;fields.hasNext(); ){ + Map.Entry 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/onap/appc/generator/yang2json/Yang2JsonGeneratorTest.java b/appc-client/client-kit/src/test/java/org/onap/appc/generator/yang2json/Yang2JsonGeneratorTest.java new file mode 100644 index 000000000..ff3a4ccb6 --- /dev/null +++ b/appc-client/client-kit/src/test/java/org/onap/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.onap.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.onap.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 /*bodyInputParams*/> jsonBodyInputParams = new HashMap(); + Map /*bodyOutputParams*/> jsonBodyOutputParams= new HashMap(); + JsonHelper.populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams); + + Set 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 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 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 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 outputYangParams = getYangParams(outputChildNodes); + Assert.assertTrue(rpcOperation+": yang and yang2json output params are not same!",jsonBodyOutputParams.get(rpcOperation).containsAll(outputYangParams)); + } + } + } + + + private Set getYangParams(Collection dataSchemaNodes) { + Set 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 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-kit/src/test/java/org/openecomp/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java b/appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java deleted file mode 100644 index 6b24b0a83..000000000 --- a/appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/impl/business/TestAppcLifeCycleManagerServiceFactoryImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.onap.appc.client.lcm.impl.business; - - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.onap.appc.client.lcm.api.ApplicationContext; -import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import org.onap.appc.client.lcm.impl.business.LCMRequestProcessor; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public class TestAppcLifeCycleManagerServiceFactoryImpl { - - AppcLifeCycleManagerServiceFactoryImpl appcLifeCycleManagerServiceFactory=new AppcLifeCycleManagerServiceFactoryImpl(); - - @Ignore - public void testCreateLifeCycleManagerStateful() throws AppcClientException{ - LifeCycleManagerStateful lifeCycleManagerStateful; - ApplicationContext applicationContext=new ApplicationContext(); - applicationContext.setApplicationID("AppID"); - applicationContext.setMechID("mechId"); - String folder="src/test/resources/data"; - Properties properties =getProperties(folder); - lifeCycleManagerStateful=appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(applicationContext,properties); - - Assert.assertNotNull(lifeCycleManagerStateful); - - } - - public 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; - } -} diff --git a/appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/model/TestModelPOJO.java b/appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/model/TestModelPOJO.java deleted file mode 100644 index 9cb3b9f56..000000000 --- a/appc-client/client-kit/src/test/java/org/openecomp/appc/client/lcm/model/TestModelPOJO.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.onap.appc.client.lcm.model; - -import org.junit.Assert; -import org.junit.Test; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -public class TestModelPOJO { - static List pojoClassName; - static List fields; - static{ - pojoClassName = new ArrayList<>(); - pojoClassName.add(AuditInput.class); - pojoClassName.add(AuditOutput.class); - pojoClassName.add(CheckLockInput.class); - pojoClassName.add(CheckLockOutput.class); - pojoClassName.add(ConfigBackupDeleteInput.class); - pojoClassName.add(ConfigBackupDeleteOutput.class); - pojoClassName.add(ConfigBackupInput.class); - pojoClassName.add(ConfigBackupOutput.class); - pojoClassName.add(ConfigExportInput.class); - pojoClassName.add(ConfigExportOutput.class); - pojoClassName.add(ConfigModifyInput.class); - pojoClassName.add(ConfigModifyOutput.class); - pojoClassName.add(ConfigRestoreInput.class); - pojoClassName.add(ConfigRestoreOutput.class); - pojoClassName.add(ConfigScaleoutInput.class); - pojoClassName.add(ConfigScaleoutOutput.class); - pojoClassName.add(ConfigureInput.class); - pojoClassName.add(ConfigureOutput.class); - pojoClassName.add(EvacuateInput.class); - pojoClassName.add(EvacuateOutput.class); - pojoClassName.add(HealthCheckInput.class); - pojoClassName.add(HealthCheckOutput.class); - pojoClassName.add(LiveUpgradeInput.class); - pojoClassName.add(LiveUpgradeOutput.class); - pojoClassName.add(LockInput.class); - pojoClassName.add(LockOutput.class); - pojoClassName.add(MigrateInput.class); - pojoClassName.add(MigrateOutput.class); - pojoClassName.add(RebuildInput.class); - pojoClassName.add(RebuildOutput.class); - pojoClassName.add(HealthCheckInput.class); - pojoClassName.add(RollbackInput.class); - pojoClassName.add(RollbackOutput.class); - pojoClassName.add(RestartInput.class); - pojoClassName.add(RestartOutput.class); - pojoClassName.add(SnapshotInput.class); - pojoClassName.add(SnapshotOutput.class); - pojoClassName.add(SoftwareUploadInput.class); - pojoClassName.add(SoftwareUploadOutput.class); - pojoClassName.add(StartApplicationInput.class); - pojoClassName.add(StartApplicationOutput.class); - pojoClassName.add(StartInput.class); - pojoClassName.add(StartOutput.class); - pojoClassName.add(StopApplicationInput.class); - pojoClassName.add(StopApplicationOutput.class); - pojoClassName.add(StopInput.class); - pojoClassName.add(SyncInput.class); - pojoClassName.add(SyncOutput.class); - pojoClassName.add(TerminateInput.class); - pojoClassName.add(TerminateOutput.class); - pojoClassName.add(TestInput.class); - pojoClassName.add(TestOutput.class); - pojoClassName.add(UnlockInput.class); - pojoClassName.add(UnlockOutput.class); - - fields = new ArrayList<>(); - fields.add("CommonHeader"); - fields.add("Action"); - fields.add("Payload"); - fields.add("Status"); - } - @Test - public void testModel() throws Exception{ - for(String field: fields){ - for(Class c: pojoClassName){ - Object instance = c.newInstance(); - Field[] fields = c.getDeclaredFields(); - for(Field f: fields){ - if(f.getType() == getClassForString(field)){ - Method m = c.getDeclaredMethod("set"+field,getClassForString(field)); - Object argument = createArgument(field); - m.invoke(instance,argument); - - Method getter = c.getDeclaredMethod("get"+field); - Object getValue = getter.invoke(instance); - Assert.assertEquals("POJO test failed for class:"+c.getCanonicalName()+" for method:"+m.getName(),argument, getValue); - } - } - } - } - } - - private Object createArgument(String field){ - if(field.equals("CommonHeader")){ - return createHeader(); - } - else if(field.equals("Action")){ - return createAction(); - }else if(field.equals("Payload")){ - return createPayload(); - }else if(field.equals("Status")){ - return createStatus(); - } - - throw new IllegalArgumentException(); - } - - private Action createAction(){ - return Action.Restart; - } - private Payload createPayload(){ - return new Payload(); - } - private CommonHeader createHeader(){ - CommonHeader header = new CommonHeader(); - header.setApiVer("apiver"); - header.setOriginatorId("originator"); - return header; - } - private Status createStatus() { - return new Status(); - } - - private Class getClassForString(String field){ - - if(field.equals("CommonHeader")){ - return CommonHeader.class; - }else if(field.equals("Action")){ - return Action.class; - }else if(field.equals("ActionIdentifiers")){ - return ActionIdentifiers.class; - }else if(field.equals("Payload")){ - return Payload.class; - }else if(field.equals("Status")){ - return Status.class; - } - throw new IllegalArgumentException(); - } -} 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 deleted file mode 100644 index e75a44e65..000000000 --- a/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/JsonHelper.java +++ /dev/null @@ -1,93 +0,0 @@ -/*- - * ============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.onap.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> jsonBodyInputParams, Map> jsonBodyOutputParams) { - populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.PARAMETER,false); - } - public static void populateRpcInputOutputSchemaRefFromJson(final JsonNode jsonNode, Map> jsonBodyInputParams, Map> jsonBodyOutputParams) { - populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams,PopulateType.SCHEMA_REF,true); - } - public static void populateRpcInputOutputParamsFromJson(final JsonNode jsonNode, Map> jsonBodyInputParams, Map> jsonBodyOutputParams,PopulateType populateType,boolean normalizeRpcOperation) { - //get all yang2json Input and output Params and populate jsonBodyInputParams & jsonBodyOutputParams - for(Iterator 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 inputParametersOrSchemaRef; - Set 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 extractParams(final JsonNode jsonNode,String schemaRefName) { - Iterator> fields = jsonNode.get("definitions").get(schemaRefName).get("properties").fields(); - Set params = new HashSet(); - for( ;fields.hasNext(); ){ - Map.Entry 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 deleted file mode 100644 index ff3a4ccb6..000000000 --- a/appc-client/client-kit/src/test/java/org/openecomp/appc/generator/yang2json/Yang2JsonGeneratorTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/*- - * ============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.onap.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.onap.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 /*bodyInputParams*/> jsonBodyInputParams = new HashMap(); - Map /*bodyOutputParams*/> jsonBodyOutputParams= new HashMap(); - JsonHelper.populateRpcInputOutputParamsFromJson(jsonNode,jsonBodyInputParams, jsonBodyOutputParams); - - Set 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 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 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 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 outputYangParams = getYangParams(outputChildNodes); - Assert.assertTrue(rpcOperation+": yang and yang2json output params are not same!",jsonBodyOutputParams.get(rpcOperation).containsAll(outputYangParams)); - } - } - } - - - private Set getYangParams(Collection dataSchemaNodes) { - Set 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 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/src/main/java/org/onap/appc/client/impl/core/AbstractRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/AbstractRequestResponseHandler.java new file mode 100644 index 000000000..c5d6120f0 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/AsyncRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/AsyncRequestResponseHandler.java new file mode 100644 index 000000000..1bcf0af99 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/CoreException.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreException.java new file mode 100644 index 000000000..a2bf6e250 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/CoreManager.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreManager.java new file mode 100644 index 000000000..c1c23890e --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.core; + +import org.onap.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(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/onap/appc/client/impl/core/CoreRegistry.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/CoreRegistry.java new file mode 100644 index 000000000..e0a0c5b34 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.core; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** client lib Registry + */ +class CoreRegistry{ + private Map registry = + new ConcurrentHashMap(); + + final private EmptyRegistryCallback emptyRegistryCallback; + + + CoreRegistry(EmptyRegistryCallback emptyRegistryCallback){ + this.emptyRegistryCallback = emptyRegistryCallback; + } + + void register(String key, T obj) { + registry.put(key, obj); + } + + T unregister(String key) { + T item = (T) registry.remove(key); + if(registry.isEmpty()) { + emptyRegistryCallback.emptyCallback(); + } + return item; + } + + 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/onap/appc/client/impl/core/ICoreAsyncResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreAsyncResponseHandler.java new file mode 100644 index 000000000..862d56dc3 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/ICoreResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreResponseHandler.java new file mode 100644 index 000000000..555640dfd --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.core; + +public interface ICoreResponseHandler { +} diff --git a/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreSyncResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ICoreSyncResponseHandler.java new file mode 100644 index 000000000..996d3d8d2 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 onResponse(String message, String type) throws CoreException; +} diff --git a/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/IInvocationManager.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/IInvocationManager.java new file mode 100644 index 000000000..93cf20b3f --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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/onap/appc/client/impl/core/ITimeoutHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ITimeoutHandler.java new file mode 100644 index 000000000..0f3b81a6f --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.core; + +interface ITimeoutHandler { + + /** + * handles timeout event + */ + void onTimeout(); +} diff --git a/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ITimerService.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/ITimerService.java new file mode 100644 index 000000000..96b06033f --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/InvocationManager.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/InvocationManager.java new file mode 100644 index 000000000..8179da107 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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/onap/appc/client/impl/core/InvocationManagerFactory.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/InvocationManagerFactory.java new file mode 100644 index 000000000..c9face762 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/MessageContext.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/MessageContext.java new file mode 100644 index 000000000..6fab66bb3 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/RequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/RequestResponseHandler.java new file mode 100644 index 000000000..8e05a2974 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/core/SyncRequestResponseHandler.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/SyncRequestResponseHandler.java new file mode 100644 index 000000000..90b0a9926 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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 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/onap/appc/client/impl/core/TaskQueue.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TaskQueue.java new file mode 100644 index 000000000..4ceeb3f08 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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/onap/appc/client/impl/core/TaskQueueManager.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TaskQueueManager.java new file mode 100644 index 000000000..b87349411 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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/onap/appc/client/impl/core/TimerServiceImpl.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/core/TimerServiceImpl.java new file mode 100644 index 000000000..fa2d0804d --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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 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/onap/appc/client/impl/protocol/APPCMessageReaderWriter.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/APPCMessageReaderWriter.java new file mode 100644 index 000000000..a76f0a90b --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.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/onap/appc/client/impl/protocol/AsyncProtocol.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/AsyncProtocol.java new file mode 100644 index 000000000..94d2d6b85 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.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/onap/appc/client/impl/protocol/AsyncProtocolImpl.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/AsyncProtocolImpl.java new file mode 100644 index 000000000..82626d802 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.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 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/onap/appc/client/impl/protocol/Consumer.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Consumer.java new file mode 100644 index 000000000..4765a58ef --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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 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/onap/appc/client/impl/protocol/ConsumerImpl.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ConsumerImpl.java new file mode 100644 index 000000000..913f80f44 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 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 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 fetch() throws IOException { + + return fetch(DEFAULT_LIMIT); + } + + public List fetch(int limit) throws IOException { + + List out = new ArrayList(); + 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/onap/appc/client/impl/protocol/MessageReader.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessageReader.java new file mode 100644 index 000000000..19688d696 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.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/onap/appc/client/impl/protocol/MessageWriter.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessageWriter.java new file mode 100644 index 000000000..0849bc4a4 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.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/onap/appc/client/impl/protocol/MessagingService.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/MessagingService.java new file mode 100644 index 000000000..029378931 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 fetch() throws IOException; + + /** + * retrieve messages from bus - timeout extracted from props or see impl + * @param limit + * @return + */ + List fetch(int limit) throws IOException; + + void close(); +} diff --git a/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Producer.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Producer.java new file mode 100644 index 000000000..f290e8a89 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/protocol/ProducerImpl.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProducerImpl.java new file mode 100644 index 000000000..7729db98d --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 hosts; + private String topic; + private CambriaBatchingPublisher producer; + + private String authKey; + private String authSecret; + + public ProducerImpl(Collection 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/onap/appc/client/impl/protocol/Protocol.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/Protocol.java new file mode 100644 index 000000000..eaa21d857 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/protocol/ProtocolException.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolException.java new file mode 100644 index 000000000..eb0537b80 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/protocol/ProtocolFactory.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolFactory.java new file mode 100644 index 000000000..98e7d669b --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +import java.util.HashMap; +import java.util.Map; + +public class ProtocolFactory { + + private static ProtocolFactory instance; + private Map protocols; + + /** + * Singleton factory + */ + private ProtocolFactory(){ + + protocols = new HashMap(); + } + + /** + * 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/onap/appc/client/impl/protocol/ProtocolMessage.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolMessage.java new file mode 100644 index 000000000..c02ea5607 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/onap/appc/client/impl/protocol/ProtocolType.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/ProtocolType.java new file mode 100644 index 000000000..cc2eca447 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + +public enum ProtocolType { + + SYNC, ASYNC; +} diff --git a/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/RetrieveMessageCallback.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/RetrieveMessageCallback.java new file mode 100644 index 000000000..8fc486bb8 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.appc.client.impl.protocol; + + +import org.onap.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/onap/appc/client/impl/protocol/UEBMessagingService.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/UEBMessagingService.java new file mode 100644 index 000000000..df51861b8 --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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 pool = new HashSet(); + 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 fetch() throws IOException { + return consumer.fetch(readLimit); + } + + public List 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/onap/appc/client/impl/protocol/UEBPropertiesKeys.java b/appc-client/client-lib/src/main/java/org/onap/appc/client/impl/protocol/UEBPropertiesKeys.java new file mode 100644 index 000000000..5c1916f2b --- /dev/null +++ b/appc-client/client-lib/src/main/java/org/onap/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.onap.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/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 deleted file mode 100644 index c5d6120f0..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AbstractRequestResponseHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 1bcf0af99..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/AsyncRequestResponseHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index a2bf6e250..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreException.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index c1c23890e..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreManager.java +++ /dev/null @@ -1,314 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.core; - -import org.onap.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(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 deleted file mode 100644 index e0a0c5b34..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/CoreRegistry.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.core; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** client lib Registry - */ -class CoreRegistry{ - private Map registry = - new ConcurrentHashMap(); - - final private EmptyRegistryCallback emptyRegistryCallback; - - - CoreRegistry(EmptyRegistryCallback emptyRegistryCallback){ - this.emptyRegistryCallback = emptyRegistryCallback; - } - - void register(String key, T obj) { - registry.put(key, obj); - } - - T unregister(String key) { - T item = (T) registry.remove(key); - if(registry.isEmpty()) { - emptyRegistryCallback.emptyCallback(); - } - return item; - } - - 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 deleted file mode 100644 index 862d56dc3..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreAsyncResponseHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 555640dfd..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreResponseHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 996d3d8d2..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ICoreSyncResponseHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============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.onap.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 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 deleted file mode 100644 index 93cf20b3f..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/IInvocationManager.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============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.onap.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 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 deleted file mode 100644 index 0f3b81a6f..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimeoutHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 96b06033f..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/ITimerService.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 8179da107..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManager.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============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.onap.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 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 deleted file mode 100644 index c9face762..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/InvocationManagerFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 6fab66bb3..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/MessageContext.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 8e05a2974..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/RequestResponseHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 90b0a9926..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/SyncRequestResponseHandler.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============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.onap.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 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 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 deleted file mode 100644 index 4ceeb3f08..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueue.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============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.onap.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 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 deleted file mode 100644 index b87349411..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TaskQueueManager.java +++ /dev/null @@ -1,98 +0,0 @@ -/*- - * ============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.onap.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 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 deleted file mode 100644 index fa2d0804d..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/core/TimerServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============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.onap.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 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 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 deleted file mode 100644 index a76f0a90b..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriter.java +++ /dev/null @@ -1,77 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.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 deleted file mode 100644 index 94d2d6b85..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocol.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.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 deleted file mode 100644 index 82626d802..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/AsyncProtocolImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.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 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 deleted file mode 100644 index 4765a58ef..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Consumer.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============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.onap.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 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 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 deleted file mode 100644 index 913f80f44..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ConsumerImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/*- - * ============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.onap.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 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 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 fetch() throws IOException { - - return fetch(DEFAULT_LIMIT); - } - - public List fetch(int limit) throws IOException { - - List out = new ArrayList(); - 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 deleted file mode 100644 index 19688d696..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageReader.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.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 deleted file mode 100644 index 0849bc4a4..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessageWriter.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.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 deleted file mode 100644 index 029378931..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/MessagingService.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============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.onap.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 fetch() throws IOException; - - /** - * retrieve messages from bus - timeout extracted from props or see impl - * @param limit - * @return - */ - List 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 deleted file mode 100644 index f290e8a89..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Producer.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 7729db98d..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProducerImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============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.onap.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 hosts; - private String topic; - private CambriaBatchingPublisher producer; - - private String authKey; - private String authSecret; - - public ProducerImpl(Collection 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 deleted file mode 100644 index eaa21d857..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/Protocol.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index eb0537b80..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 98e7d669b..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolFactory.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import java.util.HashMap; -import java.util.Map; - -public class ProtocolFactory { - - private static ProtocolFactory instance; - private Map protocols; - - /** - * Singleton factory - */ - private ProtocolFactory(){ - - protocols = new HashMap(); - } - - /** - * 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 deleted file mode 100644 index c02ea5607..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolMessage.java +++ /dev/null @@ -1,98 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index cc2eca447..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/ProtocolType.java +++ /dev/null @@ -1,30 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 8fc486bb8..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/RetrieveMessageCallback.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - - -import org.onap.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 deleted file mode 100644 index df51861b8..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBMessagingService.java +++ /dev/null @@ -1,102 +0,0 @@ -/*- - * ============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.onap.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 pool = new HashSet(); - 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 fetch() throws IOException { - return consumer.fetch(readLimit); - } - - public List 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 deleted file mode 100644 index 5c1916f2b..000000000 --- a/appc-client/client-lib/src/main/java/org/openecomp/appc/client/impl/protocol/UEBPropertiesKeys.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============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.onap.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/onap/appc/client/impl/core/ResponseManagerTest.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/core/ResponseManagerTest.java new file mode 100644 index 000000000..cc157e5c4 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.core; + +import org.onap.appc.client.impl.core.AsyncRequestResponseHandler; +import org.onap.appc.client.impl.core.CoreException; +import org.onap.appc.client.impl.core.CoreManager; +import org.onap.appc.client.impl.core.ICoreAsyncResponseHandler; +import org.onap.appc.client.impl.core.MessageContext; +import org.onap.appc.client.impl.protocol.AsyncProtocol; +import org.onap.appc.client.impl.protocol.ProtocolException; +import org.onap.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/onap/appc/client/impl/core/SyncFlowTest.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/core/SyncFlowTest.java new file mode 100644 index 000000000..2e69369b9 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.core; + +import org.onap.appc.client.impl.core.CoreException; +import org.onap.appc.client.impl.core.CoreManager; +import org.onap.appc.client.impl.core.ICoreSyncResponseHandler; +import org.onap.appc.client.impl.core.MessageContext; +import org.onap.appc.client.impl.core.SyncRequestResponseHandler; +import org.onap.appc.client.impl.protocol.AsyncProtocol; +import org.onap.appc.client.impl.protocol.ProtocolException; +import org.onap.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 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 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 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/onap/appc/client/impl/protocol/APPCMessageReaderWriterTest.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/APPCMessageReaderWriterTest.java new file mode 100644 index 000000000..1d41a52f8 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.appc.client.impl.core.MessageContext; +import org.onap.appc.client.impl.protocol.APPCMessageReaderWriter; +import org.onap.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/onap/appc/client/impl/protocol/TestAsyncProtocolImpl.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImpl.java new file mode 100644 index 000000000..ceba10b58 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.appc.client.impl.core.MessageContext; +import org.onap.appc.client.impl.protocol.AsyncProtocol; +import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; +import org.onap.appc.client.impl.protocol.ProtocolException; +import org.onap.appc.client.impl.protocol.RetrieveMessageCallback; +import org.onap.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/onap/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java new file mode 100644 index 000000000..267282abd --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.onap.appc.client.impl.core.MessageContext; +import org.onap.appc.client.impl.protocol.AsyncProtocol; +import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; +import org.onap.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/onap/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java new file mode 100644 index 000000000..22954cd75 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.appc.client.impl.protocol.AsyncProtocol; +import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; +import org.onap.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/onap/appc/client/impl/protocol/TestUEBMessagingService.java b/appc-client/client-lib/src/test/java/org/onap/appc/client/impl/protocol/TestUEBMessagingService.java new file mode 100644 index 000000000..de192ab12 --- /dev/null +++ b/appc-client/client-lib/src/test/java/org/onap/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.onap.appc.client.impl.protocol; + +import org.junit.*; +import org.junit.runners.MethodSorters; +import org.onap.appc.client.impl.protocol.MessagingService; +import org.onap.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 messages = ueb.fetch(1); + Assert.assertEquals(1,messages.size()); + } + +} 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 deleted file mode 100644 index cc157e5c4..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/ResponseManagerTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.core; - -import org.onap.appc.client.impl.core.AsyncRequestResponseHandler; -import org.onap.appc.client.impl.core.CoreException; -import org.onap.appc.client.impl.core.CoreManager; -import org.onap.appc.client.impl.core.ICoreAsyncResponseHandler; -import org.onap.appc.client.impl.core.MessageContext; -import org.onap.appc.client.impl.protocol.AsyncProtocol; -import org.onap.appc.client.impl.protocol.ProtocolException; -import org.onap.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 deleted file mode 100644 index 2e69369b9..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/core/SyncFlowTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.core; - -import org.onap.appc.client.impl.core.CoreException; -import org.onap.appc.client.impl.core.CoreManager; -import org.onap.appc.client.impl.core.ICoreSyncResponseHandler; -import org.onap.appc.client.impl.core.MessageContext; -import org.onap.appc.client.impl.core.SyncRequestResponseHandler; -import org.onap.appc.client.impl.protocol.AsyncProtocol; -import org.onap.appc.client.impl.protocol.ProtocolException; -import org.onap.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 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 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 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 deleted file mode 100644 index 1d41a52f8..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/APPCMessageReaderWriterTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.appc.client.impl.core.MessageContext; -import org.onap.appc.client.impl.protocol.APPCMessageReaderWriter; -import org.onap.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 deleted file mode 100644 index ceba10b58..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.appc.client.impl.core.MessageContext; -import org.onap.appc.client.impl.protocol.AsyncProtocol; -import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; -import org.onap.appc.client.impl.protocol.ProtocolException; -import org.onap.appc.client.impl.protocol.RetrieveMessageCallback; -import org.onap.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 deleted file mode 100644 index 267282abd..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplMissingProps.java +++ /dev/null @@ -1,75 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.onap.appc.client.impl.core.MessageContext; -import org.onap.appc.client.impl.protocol.AsyncProtocol; -import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; -import org.onap.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 deleted file mode 100644 index 22954cd75..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestAsyncProtocolImplNullCallback.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.junit.Assert; -import org.junit.Test; -import org.onap.appc.client.impl.protocol.AsyncProtocol; -import org.onap.appc.client.impl.protocol.AsyncProtocolImpl; -import org.onap.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 deleted file mode 100644 index de192ab12..000000000 --- a/appc-client/client-lib/src/test/java/org/openecomp/appc/client/impl/protocol/TestUEBMessagingService.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============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.onap.appc.client.impl.protocol; - -import org.junit.*; -import org.junit.runners.MethodSorters; -import org.onap.appc.client.impl.protocol.MessagingService; -import org.onap.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 messages = ueb.fetch(1); - Assert.assertEquals(1,messages.size()); - } - -} diff --git a/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/RequestHandler.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/RequestHandler.java new file mode 100644 index 000000000..293b72f89 --- /dev/null +++ b/appc-client/client-simulator/src/main/java/org/onap/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.onap.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/onap/appc/simulator/client/ResponseHandler.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/ResponseHandler.java new file mode 100644 index 000000000..5a24028e8 --- /dev/null +++ b/appc-client/client-simulator/src/main/java/org/onap/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.onap.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/onap/appc/simulator/client/impl/JsonRequestHandler.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/impl/JsonRequestHandler.java new file mode 100644 index 000000000..243136d0e --- /dev/null +++ b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/impl/JsonRequestHandler.java @@ -0,0 +1,275 @@ +/*- + * ============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.onap.appc.simulator.client.impl; + +import org.onap.appc.client.lcm.api.AppcClientServiceFactoryProvider; +import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; +import org.onap.appc.client.lcm.api.ApplicationContext; +import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; +import org.onap.appc.client.lcm.api.ResponseHandler; + +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import org.onap.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.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +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 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(); + } + + public JsonRequestHandler(){ + + } + + private HashMap prepareExceptionsMap() { + exceptRpcMap = new HashMap<>(); + + try (BufferedReader reader = new BufferedReader( + new FileReader(properties.getProperty( + "client.rpc.exceptions.map.file")))) { + String line; + 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 (FileNotFoundException e) { + return exceptRpcMap; + } 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 (Exception 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 "); + } + + 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 "); + + 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/onap/appc/simulator/client/impl/JsonResponseHandler.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/impl/JsonResponseHandler.java new file mode 100644 index 000000000..c19abb2fb --- /dev/null +++ b/appc-client/client-simulator/src/main/java/org/onap/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.onap.appc.simulator.client.impl; + +import org.onap.appc.client.lcm.api.ResponseHandler; +import org.onap.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 { + + 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/onap/appc/simulator/client/main/ClientRunner.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java new file mode 100644 index 000000000..c8da17e79 --- /dev/null +++ b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java @@ -0,0 +1,100 @@ +/*- + * ============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.onap.appc.simulator.client.main; + +import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.onap.appc.simulator.client.RequestHandler; +import org.onap.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 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 getJsonFiles(String folder) throws FileNotFoundException { + Path dir = Paths.get(folder); + FileFilter fileFilter = new WildcardFileFilter("*.json"); + return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); + } +} 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 deleted file mode 100644 index 293b72f89..000000000 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/RequestHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 5a24028e8..000000000 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/ResponseHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 243136d0e..000000000 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java +++ /dev/null @@ -1,275 +0,0 @@ -/*- - * ============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.onap.appc.simulator.client.impl; - -import org.onap.appc.client.lcm.api.AppcClientServiceFactoryProvider; -import org.onap.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; -import org.onap.appc.client.lcm.api.ApplicationContext; -import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; -import org.onap.appc.client.lcm.api.ResponseHandler; - -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import org.onap.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.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -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 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(); - } - - public JsonRequestHandler(){ - - } - - private HashMap prepareExceptionsMap() { - exceptRpcMap = new HashMap<>(); - - try (BufferedReader reader = new BufferedReader( - new FileReader(properties.getProperty( - "client.rpc.exceptions.map.file")))) { - String line; - 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 (FileNotFoundException e) { - return exceptRpcMap; - } 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 (Exception 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 "); - } - - 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 "); - - 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 deleted file mode 100644 index c19abb2fb..000000000 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============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.onap.appc.simulator.client.impl; - -import org.onap.appc.client.lcm.api.ResponseHandler; -import org.onap.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 { - - 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 deleted file mode 100644 index c8da17e79..000000000 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java +++ /dev/null @@ -1,100 +0,0 @@ -/*- - * ============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.onap.appc.simulator.client.main; - -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.onap.appc.simulator.client.RequestHandler; -import org.onap.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 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 getJsonFiles(String folder) throws FileNotFoundException { - Path dir = Paths.get(folder); - FileFilter fileFilter = new WildcardFileFilter("*.json"); - return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); - } -} diff --git a/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonRequestHandler.java b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonRequestHandler.java new file mode 100644 index 000000000..ba3696f26 --- /dev/null +++ b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonRequestHandler.java @@ -0,0 +1,53 @@ +package org.onap.appc.simulator.client.impl; + +import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Matchers; +import org.mockito.Mockito; +import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import java.io.*; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({LifeCycleManagerStateful.class}) + +public class TestJsonRequestHandler { + + JsonResponseHandler jsonResponseHandler=new JsonResponseHandler(); + @Before + public void init(){ + jsonResponseHandler= Mockito.mock(JsonResponseHandler.class); + } + + + @Test + public void testProceedFiles() throws AppcClientException,java.io.IOException{ + String folder="src/test/resources/data"; + List sources = getJsonFiles(folder); + File source=sources.get(0); + File log = new File(folder + "/output.txt"); + JsonRequestHandler requestHandler = new JsonRequestHandler(); + Mockito.doNothing().when(jsonResponseHandler).onResponse(Matchers.anyBoolean()); + requestHandler.proceedFile(source,log); + + Assert.assertNotNull(log); + + } + + private static List getJsonFiles(String folder) throws FileNotFoundException { + Path dir = Paths.get(folder); + FileFilter fileFilter = new WildcardFileFilter("*.json"); + return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); + } + + +} \ No newline at end of file diff --git a/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonResponseHandler.java b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonResponseHandler.java new file mode 100644 index 000000000..59ffe1b31 --- /dev/null +++ b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/impl/TestJsonResponseHandler.java @@ -0,0 +1,46 @@ +package org.onap.appc.simulator.client.impl; + +import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.junit.Assert; +import org.junit.Ignore; +import java.io.*; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + +public class TestJsonResponseHandler { + String folder="/data/output/error.json"; + JsonResponseHandler responseHandler=new JsonResponseHandler(); + + @Ignore + public void testOnResponse() throws URISyntaxException, IOException{ + responseHandler.onResponse(getNode()); + List files=getJsonFiles(folder); + Assert.assertNotNull(files); + + } + + private String readData(String inputFile) throws URISyntaxException, IOException { + File file = new File(this.getClass().getResource(inputFile).toURI()); + + byte[] bFile = new byte[(int) file.length()]; + FileInputStream fileInputStream = new FileInputStream(file); + fileInputStream.read(bFile); + fileInputStream.close(); + return new String(bFile); + } + + private String getNode() throws java.io.IOException{ + String jsonSring="{\"status\": {\"code\": \"200\"}}"; + return jsonSring; +} + public List getJsonFiles(String folder) throws FileNotFoundException { + Path dir = Paths.get(folder); + FileFilter fileFilter = new WildcardFileFilter("*.error"); + return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); + } +} diff --git a/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/main/TestClientRunner.java b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/main/TestClientRunner.java new file mode 100644 index 000000000..db648f957 --- /dev/null +++ b/appc-client/client-simulator/src/test/java/org/onap/appc/simulator/client/main/TestClientRunner.java @@ -0,0 +1,102 @@ +package org.onap.appc.simulator.client.main; + +import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Matchers; +import org.mockito.Mockito; +import org.onap.appc.client.lcm.exceptions.AppcClientException; +import org.onap.appc.simulator.client.impl.JsonRequestHandler; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +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; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({JsonRequestHandler.class,ClientRunner.class}) + +public class TestClientRunner { + + JsonRequestHandler jsonRequestHandler; + private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + + @Before + public void init() throws AppcClientException{ + System.setOut(new PrintStream(outContent)); + jsonRequestHandler= Mockito.mock(JsonRequestHandler.class); + + } + + @After + public void cleanUpStreams() { + System.setOut(null); + } + + @Test + public void testMain() throws java.io.IOException,java.lang.Exception{ + String []arguments=new String[]{"src/test/resources/data","JSON"}; + PowerMockito.whenNew(JsonRequestHandler.class).withArguments(Mockito.anyObject()).thenReturn(jsonRequestHandler); + Mockito.doNothing().when(jsonRequestHandler).proceedFile(Matchers.anyObject(), Matchers.anyObject()); + + ClientRunner.main(arguments); + String expectedOutput=outContent.toString(); + Assert.assertEquals(expectedOutput,outContent.toString()); + } + + @Test + public void testGetPrperties(){ + String folder="src/test/resources/data"; + Properties properties=new Properties(); + properties=getProperties(folder); + Assert.assertNotNull(properties); + } + + @Test + public void testGetJsonFIles() throws FileNotFoundException{ + String folder="src/test/resources/data"; + List sources = getJsonFiles(folder); + Assert.assertNotNull(sources); + } + + 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 getJsonFiles(String folder) throws FileNotFoundException { + Path dir = Paths.get(folder); + FileFilter fileFilter = new WildcardFileFilter("*.json"); + return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); + } + +} diff --git a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonRequestHandler.java b/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonRequestHandler.java deleted file mode 100644 index ba3696f26..000000000 --- a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonRequestHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.onap.appc.simulator.client.impl; - -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Matchers; -import org.mockito.Mockito; -import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import java.io.*; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({LifeCycleManagerStateful.class}) - -public class TestJsonRequestHandler { - - JsonResponseHandler jsonResponseHandler=new JsonResponseHandler(); - @Before - public void init(){ - jsonResponseHandler= Mockito.mock(JsonResponseHandler.class); - } - - - @Test - public void testProceedFiles() throws AppcClientException,java.io.IOException{ - String folder="src/test/resources/data"; - List sources = getJsonFiles(folder); - File source=sources.get(0); - File log = new File(folder + "/output.txt"); - JsonRequestHandler requestHandler = new JsonRequestHandler(); - Mockito.doNothing().when(jsonResponseHandler).onResponse(Matchers.anyBoolean()); - requestHandler.proceedFile(source,log); - - Assert.assertNotNull(log); - - } - - private static List getJsonFiles(String folder) throws FileNotFoundException { - Path dir = Paths.get(folder); - FileFilter fileFilter = new WildcardFileFilter("*.json"); - return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); - } - - -} \ No newline at end of file diff --git a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonResponseHandler.java b/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonResponseHandler.java deleted file mode 100644 index 59ffe1b31..000000000 --- a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/impl/TestJsonResponseHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.onap.appc.simulator.client.impl; - -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.junit.Assert; -import org.junit.Ignore; -import java.io.*; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - - -public class TestJsonResponseHandler { - String folder="/data/output/error.json"; - JsonResponseHandler responseHandler=new JsonResponseHandler(); - - @Ignore - public void testOnResponse() throws URISyntaxException, IOException{ - responseHandler.onResponse(getNode()); - List files=getJsonFiles(folder); - Assert.assertNotNull(files); - - } - - private String readData(String inputFile) throws URISyntaxException, IOException { - File file = new File(this.getClass().getResource(inputFile).toURI()); - - byte[] bFile = new byte[(int) file.length()]; - FileInputStream fileInputStream = new FileInputStream(file); - fileInputStream.read(bFile); - fileInputStream.close(); - return new String(bFile); - } - - private String getNode() throws java.io.IOException{ - String jsonSring="{\"status\": {\"code\": \"200\"}}"; - return jsonSring; -} - public List getJsonFiles(String folder) throws FileNotFoundException { - Path dir = Paths.get(folder); - FileFilter fileFilter = new WildcardFileFilter("*.error"); - return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); - } -} diff --git a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/main/TestClientRunner.java b/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/main/TestClientRunner.java deleted file mode 100644 index db648f957..000000000 --- a/appc-client/client-simulator/src/test/java/org/openecomp/appc/simulator/client/main/TestClientRunner.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.onap.appc.simulator.client.main; - -import org.apache.commons.io.filefilter.WildcardFileFilter; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Matchers; -import org.mockito.Mockito; -import org.onap.appc.client.lcm.exceptions.AppcClientException; -import org.onap.appc.simulator.client.impl.JsonRequestHandler; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -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; - -@RunWith(PowerMockRunner.class) -@PrepareForTest({JsonRequestHandler.class,ClientRunner.class}) - -public class TestClientRunner { - - JsonRequestHandler jsonRequestHandler; - private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); - - @Before - public void init() throws AppcClientException{ - System.setOut(new PrintStream(outContent)); - jsonRequestHandler= Mockito.mock(JsonRequestHandler.class); - - } - - @After - public void cleanUpStreams() { - System.setOut(null); - } - - @Test - public void testMain() throws java.io.IOException,java.lang.Exception{ - String []arguments=new String[]{"src/test/resources/data","JSON"}; - PowerMockito.whenNew(JsonRequestHandler.class).withArguments(Mockito.anyObject()).thenReturn(jsonRequestHandler); - Mockito.doNothing().when(jsonRequestHandler).proceedFile(Matchers.anyObject(), Matchers.anyObject()); - - ClientRunner.main(arguments); - String expectedOutput=outContent.toString(); - Assert.assertEquals(expectedOutput,outContent.toString()); - } - - @Test - public void testGetPrperties(){ - String folder="src/test/resources/data"; - Properties properties=new Properties(); - properties=getProperties(folder); - Assert.assertNotNull(properties); - } - - @Test - public void testGetJsonFIles() throws FileNotFoundException{ - String folder="src/test/resources/data"; - List sources = getJsonFiles(folder); - Assert.assertNotNull(sources); - } - - 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 getJsonFiles(String folder) throws FileNotFoundException { - Path dir = Paths.get(folder); - FileFilter fileFilter = new WildcardFileFilter("*.json"); - return new ArrayList(Arrays.asList(dir.toFile().listFiles(fileFilter))); - } - -} diff --git a/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/CLI.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/CLI.java new file mode 100644 index 000000000..e28b3706a --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.appc.tools.generator.api; + +import org.onap.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 '"); + + String destinationFile = args[1]; + if(destinationFile == null) + throw new IllegalArgumentException("Destination file name is missing. Please add argument 'client " + + sourceFile + + " '"); + + String templateFile = args[2]; + if(templateFile == null) + throw new IllegalArgumentException("template file name is missing. Please add argument 'client " + + sourceFile + + " "+destinationFile + + " '"); + + String builderName = args[3]; + if(builderName == null) + throw new IllegalArgumentException("builder FQDN is missing. Please add argument 'client " + + sourceFile + + " "+destinationFile + + " "+templateFile + + " '"); + String contextConfName = args[4]; + if(contextConfName == null) + throw new IllegalArgumentException("context conf file is missing. Please add argument 'client " + + sourceFile + + " "+destinationFile + + " "+templateFile + + " "+builderName + + " '"); + ModelGenerator generator = new ModelGenerator(); + generator.execute(sourceFile, destinationFile, templateFile, builderName, contextConfName); + } +} diff --git a/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/ContextBuilder.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/ContextBuilder.java new file mode 100644 index 000000000..a1826f270 --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.appc.tools.generator.api; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Map; + +public interface ContextBuilder { + + Map buildContext(String sourceFile, String contextConf) throws IOException; +} diff --git a/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/MavenPlugin.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/api/MavenPlugin.java new file mode 100644 index 000000000..9e160eed2 --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.appc.tools.generator.api; + +import org.onap.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/onap/appc/tools/generator/extensions/JsonContextBuilderImpl.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/JsonContextBuilderImpl.java new file mode 100644 index 000000000..6c408dd1d --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.appc.tools.generator.extensions; + +import org.onap.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 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 map = new HashMap<>(); + map.put("model", model); + map.put("metadata", metadata); + return map; + } +} diff --git a/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/YangContextBuilderImpl.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/YangContextBuilderImpl.java new file mode 100644 index 000000000..67055c757 --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/extensions/YangContextBuilderImpl.java @@ -0,0 +1,97 @@ +/*- + * ============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.onap.appc.tools.generator.extensions; + +import org.onap.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.Map; +import java.util.HashMap; +import java.util.Set; + +public class YangContextBuilderImpl implements ContextBuilder { + + @Override + public Map buildContext(String sourceFile, String contextConf) throws FileNotFoundException { + try ( InputStream source = new FileInputStream(sourceFile) ) {} + catch ( IOException ex) { + throw new FileNotFoundException("YANG file <" + sourceFile + ">not found"); + } + + Optional sc = null; + try ( YangTextSchemaContextResolver yangContextResolver = + YangTextSchemaContextResolver.create("yang-context-resolver")) { + yangContextResolver.registerSource(new URL("file:///" + sourceFile)); + sc = yangContextResolver.getSchemaContext(); + } catch (SchemaSourceException | IOException | YangSyntaxErrorException e) { + e.printStackTrace(); + } + + Map map = new HashMap<>(); + if ( null != sc && sc.isPresent()) { + Set modules = sc.get().getModules(); + for (Module module : modules) { + ModuleEffectiveStatementImpl impl = (ModuleEffectiveStatementImpl) module; + map.put("module", module); + } + } + + return map; + } + + // @Override + // public Map 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 map = new HashMap<>(); + // map.put("module", mSchema.getModules().iterator().next()); + // return map; + // } + // + // private SchemaContext parse(List sources) { + // YangParserImpl parser = new YangParserImpl(); + // Set modules = parser.parseYangModelsFromStreams(sources); + // return parser.resolveSchemaContext(modules); + // } + +} diff --git a/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/impl/CodeGenWriter.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/impl/CodeGenWriter.java new file mode 100644 index 000000000..347c24c06 --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.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/onap/appc/tools/generator/impl/ModelGenerator.java b/appc-client/code-generator/src/main/java/org/onap/appc/tools/generator/impl/ModelGenerator.java new file mode 100644 index 000000000..2275fdac7 --- /dev/null +++ b/appc-client/code-generator/src/main/java/org/onap/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.onap.appc.tools.generator.impl; + +import org.onap.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 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 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/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 deleted file mode 100644 index e28b3706a..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/CLI.java +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.api; - -import org.onap.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 '"); - - String destinationFile = args[1]; - if(destinationFile == null) - throw new IllegalArgumentException("Destination file name is missing. Please add argument 'client " - + sourceFile - + " '"); - - String templateFile = args[2]; - if(templateFile == null) - throw new IllegalArgumentException("template file name is missing. Please add argument 'client " - + sourceFile - + " "+destinationFile - + " '"); - - String builderName = args[3]; - if(builderName == null) - throw new IllegalArgumentException("builder FQDN is missing. Please add argument 'client " - + sourceFile - + " "+destinationFile - + " "+templateFile - + " '"); - String contextConfName = args[4]; - if(contextConfName == null) - throw new IllegalArgumentException("context conf file is missing. Please add argument 'client " - + sourceFile - + " "+destinationFile - + " "+templateFile - + " "+builderName - + " '"); - 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 deleted file mode 100644 index a1826f270..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/ContextBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.api; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Map; - -public interface ContextBuilder { - - Map 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 deleted file mode 100644 index 9e160eed2..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/api/MavenPlugin.java +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.api; - -import org.onap.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 deleted file mode 100644 index 6c408dd1d..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/JsonContextBuilderImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.extensions; - -import org.onap.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 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 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 deleted file mode 100644 index 67055c757..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/extensions/YangContextBuilderImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.extensions; - -import org.onap.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.Map; -import java.util.HashMap; -import java.util.Set; - -public class YangContextBuilderImpl implements ContextBuilder { - - @Override - public Map buildContext(String sourceFile, String contextConf) throws FileNotFoundException { - try ( InputStream source = new FileInputStream(sourceFile) ) {} - catch ( IOException ex) { - throw new FileNotFoundException("YANG file <" + sourceFile + ">not found"); - } - - Optional sc = null; - try ( YangTextSchemaContextResolver yangContextResolver = - YangTextSchemaContextResolver.create("yang-context-resolver")) { - yangContextResolver.registerSource(new URL("file:///" + sourceFile)); - sc = yangContextResolver.getSchemaContext(); - } catch (SchemaSourceException | IOException | YangSyntaxErrorException e) { - e.printStackTrace(); - } - - Map map = new HashMap<>(); - if ( null != sc && sc.isPresent()) { - Set modules = sc.get().getModules(); - for (Module module : modules) { - ModuleEffectiveStatementImpl impl = (ModuleEffectiveStatementImpl) module; - map.put("module", module); - } - } - - return map; - } - - // @Override - // public Map 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 map = new HashMap<>(); - // map.put("module", mSchema.getModules().iterator().next()); - // return map; - // } - // - // private SchemaContext parse(List sources) { - // YangParserImpl parser = new YangParserImpl(); - // Set 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 deleted file mode 100644 index 347c24c06..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/CodeGenWriter.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============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.onap.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 deleted file mode 100644 index 2275fdac7..000000000 --- a/appc-client/code-generator/src/main/java/org/openecomp/appc/tools/generator/impl/ModelGenerator.java +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * ============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.onap.appc.tools.generator.impl; - -import org.onap.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 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 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/test/java/org/onap/appc/tools/generator/api/CLITest.java b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java new file mode 100644 index 000000000..4cd6bb5f5 --- /dev/null +++ b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/api/CLITest.java @@ -0,0 +1,57 @@ +package org.onap.appc.tools.generator.api; + +import org.junit.Assert; +import org.junit.Test; + +public class CLITest { + @Test + public void missingSourceFileTest() { + CLI cli = new CLI(); + try { + String[] input = new String[1]; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("Source file is missing. Please add argument 'client '",e.getMessage()); + } + } + @Test + public void missingDestinationFileTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("Destination file name is missing. Please add argument 'client sourceFilePath '",e.getMessage()); + } + } + @Test + public void missingTemplateFileTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("template file name is missing. Please add argument 'client sourceFilePath destinationPath '",e.getMessage()); + } + } + @Test + public void missingBuilderNameTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath","templateFileName",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals("builder FQDN is missing. Please add argument 'client sourceFilePath destinationPath templateFileName '",e.getMessage()); + } + } + @Test + public void missingContextConfFileNameTest() { + CLI cli = new CLI(); + try { + String[] input = {"sourceFilePath","destinationPath","templateFileName","builderFQDN",null}; + cli.main(input); + } catch (Exception e) { + Assert.assertEquals(e.getMessage(),"context conf file is missing. Please add argument 'client sourceFilePath destinationPath templateFileName builderFQDN '"); + } + } +} diff --git a/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java new file mode 100644 index 000000000..e0669b836 --- /dev/null +++ b/appc-client/code-generator/src/test/java/org/onap/appc/tools/generator/impl/CodeGenWriterTest.java @@ -0,0 +1,22 @@ +package org.onap.appc.tools.generator.impl; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + + +public class CodeGenWriterTest { + @Test + public void writeTest() throws IOException { + CodeGenWriter codeGenWriter = new CodeGenWriter("destination"); + char[] cbuf = {'t','e','s','t'}; + int off = 1; + int len = 3; + codeGenWriter.write(cbuf,off,len); + codeGenWriter.flush(); + codeGenWriter.close(); + Assert.assertNotNull(codeGenWriter); + } + +} diff --git a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java b/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java deleted file mode 100644 index 4cd6bb5f5..000000000 --- a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/api/CLITest.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.onap.appc.tools.generator.api; - -import org.junit.Assert; -import org.junit.Test; - -public class CLITest { - @Test - public void missingSourceFileTest() { - CLI cli = new CLI(); - try { - String[] input = new String[1]; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("Source file is missing. Please add argument 'client '",e.getMessage()); - } - } - @Test - public void missingDestinationFileTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("Destination file name is missing. Please add argument 'client sourceFilePath '",e.getMessage()); - } - } - @Test - public void missingTemplateFileTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("template file name is missing. Please add argument 'client sourceFilePath destinationPath '",e.getMessage()); - } - } - @Test - public void missingBuilderNameTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath","templateFileName",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals("builder FQDN is missing. Please add argument 'client sourceFilePath destinationPath templateFileName '",e.getMessage()); - } - } - @Test - public void missingContextConfFileNameTest() { - CLI cli = new CLI(); - try { - String[] input = {"sourceFilePath","destinationPath","templateFileName","builderFQDN",null}; - cli.main(input); - } catch (Exception e) { - Assert.assertEquals(e.getMessage(),"context conf file is missing. Please add argument 'client sourceFilePath destinationPath templateFileName builderFQDN '"); - } - } -} diff --git a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java b/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java deleted file mode 100644 index e0669b836..000000000 --- a/appc-client/code-generator/src/test/java/org/openecomp/appc/tools/generator/impl/CodeGenWriterTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.onap.appc.tools.generator.impl; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; - - -public class CodeGenWriterTest { - @Test - public void writeTest() throws IOException { - CodeGenWriter codeGenWriter = new CodeGenWriter("destination"); - char[] cbuf = {'t','e','s','t'}; - int off = 1; - int len = 3; - codeGenWriter.write(cbuf,off,len); - codeGenWriter.flush(); - codeGenWriter.close(); - Assert.assertNotNull(codeGenWriter); - } - -} -- cgit 1.2.3-korg