X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-provider%2Fappc-provider-bundle%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fprovider%2FAppcProviderLcm.java;fp=appc-provider%2Fappc-provider-bundle%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fprovider%2FAppcProviderLcm.java;h=cd5576b0f8df16080c5ca6e53253aea479399084;hb=13c0353d0f637ec88ca4cdbeb64c4de3917e6a2b;hp=ff11951272f9a6e2585b125834b62aa9967a7d79;hpb=356dba9fb407b1df3fe89a4c8f082a09aa564d36;p=appc.git diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java index ff1195127..cd5576b0f 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP : APPC * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs * ================================================================================ @@ -28,7 +28,6 @@ package org.onap.appc.provider; import java.text.ParseException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; import org.onap.appc.Constants; import org.onap.appc.configuration.Configuration; import org.onap.appc.configuration.ConfigurationFactory; @@ -61,6 +60,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, AppcProviderLcmService { @@ -140,7 +140,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#rebuild(RebuildInput) */ @Override - public Future> rebuild(RebuildInput input) { + public ListenableFuture> rebuild(RebuildInput input) { logger.debug("Input received : " + input.toString()); RebuildOutputBuilder outputBuilder = new RebuildOutputBuilder(); @@ -180,7 +180,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#restart(RestartInput) */ @Override - public Future> restart(RestartInput input) { + public ListenableFuture> restart(RestartInput input) { logger.debug("Input received : " + input.toString()); RestartOutputBuilder outputBuilder = new RestartOutputBuilder(); @@ -219,7 +219,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#startApplication(StartApplicationInput) */ @Override - public Future> startApplication(StartApplicationInput input) { + public ListenableFuture> startApplication(StartApplicationInput input) { logger.debug("Input received : " + input.toString()); StartApplicationOutputBuilder outputBuilder = new StartApplicationOutputBuilder(); @@ -258,7 +258,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#migrate(MigrateInput) */ @Override - public Future> migrate(MigrateInput input) { + public ListenableFuture> migrate(MigrateInput input) { logger.debug("Input received : " + input.toString()); MigrateOutputBuilder outputBuilder = new MigrateOutputBuilder(); @@ -297,7 +297,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#evacuate(EvacuateInput) */ @Override - public Future> evacuate(EvacuateInput input) { + public ListenableFuture> evacuate(EvacuateInput input) { logger.debug("Input received : " + input.toString()); EvacuateOutputBuilder outputBuilder = new EvacuateOutputBuilder(); @@ -336,7 +336,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#snapshot(SnapshotInput) */ @Override - public Future> snapshot(SnapshotInput input) { + public ListenableFuture> snapshot(SnapshotInput input) { logger.debug("Input received : " + input.toString()); SnapshotOutputBuilder outputBuilder = new SnapshotOutputBuilder(); @@ -370,7 +370,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> rollback(RollbackInput input) { + public ListenableFuture> rollback(RollbackInput input) { logger.debug("Input received : " + input.toString()); RollbackOutputBuilder outputBuilder = new RollbackOutputBuilder(); @@ -405,7 +405,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> sync(SyncInput input) { + public ListenableFuture> sync(SyncInput input) { logger.debug("Input received : " + input.toString()); SyncOutputBuilder outputBuilder = new SyncOutputBuilder(); String action = Action.Sync.toString(); @@ -437,7 +437,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> query(QueryInput input) { + public ListenableFuture> query(QueryInput input) { logger.debug(String.format("LCM query received input: %s", input.toString())); QueryOutputBuilder outputBuilder = new QueryService().process(input); RpcResult result = @@ -446,7 +446,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> reboot(RebootInput input) { + public ListenableFuture> reboot(RebootInput input) { logger.debug(String.format("LCM reboot received input: %s", input.toString())); RebootOutputBuilder outputBuilder = new RebootService().reboot(input); RpcResult result = @@ -455,7 +455,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> attachVolume(AttachVolumeInput input) { + public ListenableFuture> attachVolume(AttachVolumeInput input) { logger.debug(String.format("LCM attachVolume received input: %s", input.toString())); AttachVolumeOutputBuilder outputBuilder = new VolumeService(true).attachVolume(input); RpcResult result = @@ -464,7 +464,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> detachVolume(DetachVolumeInput input) { + public ListenableFuture> detachVolume(DetachVolumeInput input) { logger.debug(String.format("LCM detachVolume received input: %s", input.toString())); DetachVolumeOutputBuilder outputBuilder = new VolumeService(false).detachVolume(input); RpcResult result = @@ -473,7 +473,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> quiesceTraffic(QuiesceTrafficInput input) { + public ListenableFuture> quiesceTraffic(QuiesceTrafficInput input) { logger.debug(String.format("LCM quiesce received input: %s", input.toString())); QuiesceTrafficOutputBuilder outputBuilder = new QuiesceTrafficService().process(input); RpcResult result = @@ -482,7 +482,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> resumeTraffic(ResumeTrafficInput input) { + public ListenableFuture> resumeTraffic(ResumeTrafficInput input) { logger.debug(String.format("LCM resume received input: %s", input.toString())); ResumeTrafficOutputBuilder outputBuilder = new ResumeTrafficService().process(input); RpcResult result = @@ -491,7 +491,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> distributeTraffic(DistributeTrafficInput input) { + public ListenableFuture> distributeTraffic(DistributeTrafficInput input) { logger.debug(String.format("LCM DistributeTraffic, received input: %s", input.toString())); DistributeTrafficOutputBuilder outputBuilder = new DistributeTrafficService().process(input); RpcResult result = @@ -500,7 +500,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> upgradePreCheck(UpgradePreCheckInput input) { + public ListenableFuture> upgradePreCheck(UpgradePreCheckInput input) { logger.debug(String.format("LCM upgradeprecheck received input: %s", input.toString())); UpgradePreCheckOutputBuilder outputBuilder = new UpgradeService("upgradePre").upgradePreCheck(input); RpcResult result = @@ -509,7 +509,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> upgradeSoftware(UpgradeSoftwareInput input) { + public ListenableFuture> upgradeSoftware(UpgradeSoftwareInput input) { logger.debug(String.format("LCM upgradesoftware received input: %s", input.toString())); UpgradeSoftwareOutputBuilder outputBuilder = new UpgradeService("upgradeSoft").upgradeSoftware(input); RpcResult result = @@ -518,7 +518,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> upgradePostCheck(UpgradePostCheckInput input) { + public ListenableFuture> upgradePostCheck(UpgradePostCheckInput input) { logger.debug(String.format("LCM upgradepostcheck received input: %s", input.toString())); UpgradePostCheckOutputBuilder outputBuilder = new UpgradeService("upgradePost").upgradePostCheck(input); RpcResult result = @@ -527,7 +527,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> upgradeBackup(UpgradeBackupInput input) { + public ListenableFuture> upgradeBackup(UpgradeBackupInput input) { logger.debug(String.format("LCM backup received input: %s", input.toString())); UpgradeBackupOutputBuilder outputBuilder = new UpgradeService("upgradeBackup").upgradeBackup(input); RpcResult result = @@ -536,7 +536,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> upgradeBackout(UpgradeBackoutInput input) { + public ListenableFuture> upgradeBackout(UpgradeBackoutInput input) { logger.debug(String.format("LCM backout received input: %s", input.toString())); UpgradeBackoutOutputBuilder outputBuilder = new UpgradeService("upgradeBackout").upgradeBackout(input); RpcResult result = @@ -545,7 +545,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> terminate(TerminateInput input) { + public ListenableFuture> terminate(TerminateInput input) { logger.debug("Input received : " + input.toString()); TerminateOutputBuilder outputBuilder = new TerminateOutputBuilder(); Action myAction = Action.Terminate; @@ -580,7 +580,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> configure(ConfigureInput input) { + public ListenableFuture> configure(ConfigureInput input) { logger.debug("Input received : " + input.toString()); ConfigureOutputBuilder outputBuilder = new ConfigureOutputBuilder(); Action myAction = Action.Configure; @@ -613,7 +613,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> actionStatus(ActionStatusInput input) { + public ListenableFuture> actionStatus(ActionStatusInput input) { logger.debug(String.format("Input received : %s", input.toString())); ActionStatusOutputBuilder outputBuilder = (new ActionStatusService()).queryStatus(input); RpcResult result = @@ -622,7 +622,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> configModify(ConfigModifyInput input) { + public ListenableFuture> configModify(ConfigModifyInput input) { logger.debug("Input received : " + input.toString()); ConfigModifyOutputBuilder outputBuilder = new ConfigModifyOutputBuilder(); Action myAction = Action.ConfigModify; @@ -655,7 +655,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> configScaleOut(ConfigScaleOutInput input) { + public ListenableFuture> configScaleOut(ConfigScaleOutInput input) { logger.debug("Input received : " + input.toString()); ConfigScaleOutOutputBuilder outputBuilder = new ConfigScaleOutService().process(input); RpcResult result = RpcResultBuilder. status(true).withResult(outputBuilder.build()).build(); @@ -663,7 +663,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> configRestore(ConfigRestoreInput input) { + public ListenableFuture> configRestore(ConfigRestoreInput input) { logger.debug("Input received : " + input.toString()); ConfigRestoreOutputBuilder outputBuilder = new ConfigRestoreOutputBuilder(); Action myAction = Action.ConfigRestore; @@ -696,7 +696,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> test(TestInput input) { + public ListenableFuture> test(TestInput input) { logger.debug("Input received : " + input.toString()); TestOutputBuilder outputBuilder = new TestOutputBuilder(); Action myAction = Action.Test; @@ -730,7 +730,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> stop(StopInput input) { + public ListenableFuture> stop(StopInput input) { logger.debug("Input received : " + input.toString()); StopOutputBuilder outputBuilder = new StopOutputBuilder(); Action myAction = Action.Stop; @@ -768,7 +768,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @see org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.AppcProviderLcmService#start(StartInput) */ @Override - public Future> start(StartInput input) { + public ListenableFuture> start(StartInput input) { logger.debug("Input received : " + input.toString()); StartOutputBuilder outputBuilder = new StartOutputBuilder(); @@ -803,7 +803,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> audit(AuditInput input) { + public ListenableFuture> audit(AuditInput input) { logger.debug("Input received : " + input.toString()); AuditOutputBuilder outputBuilder = new AuditOutputBuilder(); Action myAction = Action.Audit; @@ -836,7 +836,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> softwareUpload(SoftwareUploadInput input) { + public ListenableFuture> softwareUpload(SoftwareUploadInput input) { logger.debug("Input received : " + input.toString()); SoftwareUploadOutputBuilder outputBuilder = new SoftwareUploadOutputBuilder(); Action myAction = Action.SoftwareUpload; @@ -869,7 +869,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> healthCheck(HealthCheckInput input) { + public ListenableFuture> healthCheck(HealthCheckInput input) { logger.debug("Input received : " + input.toString()); HealthCheckOutputBuilder outputBuilder = new HealthCheckOutputBuilder(); Action myAction = Action.HealthCheck; @@ -902,7 +902,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> liveUpgrade(LiveUpgradeInput input) { + public ListenableFuture> liveUpgrade(LiveUpgradeInput input) { logger.debug("Input received : " + input.toString()); LiveUpgradeOutputBuilder outputBuilder = new LiveUpgradeOutputBuilder(); Action myAction = Action.LiveUpgrade; @@ -936,7 +936,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> lock(LockInput input) { + public ListenableFuture> lock(LockInput input) { logger.debug("Input received : " + input.toString()); LockOutputBuilder outputBuilder = new LockOutputBuilder(); Action myAction = Action.Lock; @@ -970,7 +970,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> unlock(UnlockInput input) { + public ListenableFuture> unlock(UnlockInput input) { logger.debug("Input received : " + input.toString()); UnlockOutputBuilder outputBuilder = new UnlockOutputBuilder(); Action myAction = Action.Unlock; @@ -1003,7 +1003,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> checkLock(CheckLockInput input) { + public ListenableFuture> checkLock(CheckLockInput input) { logger.debug("Input received : " + input.toString()); CheckLockOutputBuilder outputBuilder = new CheckLockOutputBuilder(); Action myAction = Action.CheckLock; @@ -1044,7 +1044,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } @Override - public Future> configBackup(ConfigBackupInput input) { + public ListenableFuture> configBackup(ConfigBackupInput input) { logger.debug("Input received : " + input.toString()); ConfigBackupOutputBuilder outputBuilder = new ConfigBackupOutputBuilder(); Action myAction = Action.ConfigBackup; @@ -1078,7 +1078,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> configBackupDelete(ConfigBackupDeleteInput input) { + public ListenableFuture> configBackupDelete(ConfigBackupDeleteInput input) { logger.debug("Input received : " + input.toString()); ConfigBackupDeleteOutputBuilder outputBuilder = new ConfigBackupDeleteOutputBuilder(); Action myAction = Action.ConfigBackupDelete; @@ -1112,7 +1112,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, @Override - public Future> configExport(ConfigExportInput input) { + public ListenableFuture> configExport(ConfigExportInput input) { logger.debug("Input received : " + input.toString()); ConfigExportOutputBuilder outputBuilder = new ConfigExportOutputBuilder(); Action myAction = Action.ConfigExport; @@ -1145,7 +1145,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, } - public Future> stopApplication(StopApplicationInput input) { + public ListenableFuture> stopApplication(StopApplicationInput input) { logger.debug("Input received : " + input.toString()); StopApplicationOutputBuilder outputBuilder = new StopApplicationOutputBuilder(); Action myAction = Action.StopApplication;