Tabnine Logo
SnapshotInfo.processEvent
Code IndexAdd Tabnine to your IDE (free)

How to use
processEvent
method
in
org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo

Best Java code snippets using org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo.processEvent (Showing top 10 results out of 315)

origin: apache/cloudstack

protected Void deleteSnapshotCallback(AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult> callback, DeleteSnapshotContext<CommandResult> context) {
  CommandResult result = callback.getResult();
  AsyncCallFuture<SnapshotResult> future = context.future;
  SnapshotInfo snapshot = context.snapshot;
  SnapshotResult res = null;
  try {
    if (result.isFailed()) {
      s_logger.debug("delete snapshot failed" + result.getResult());
      snapshot.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);
      res = new SnapshotResult(context.snapshot, null);
      res.setResult(result.getResult());
    } else {
      snapshot.processEvent(ObjectInDataStoreStateMachine.Event.OperationSuccessed);
      res = new SnapshotResult(context.snapshot, null);
    }
  } catch (Exception e) {
    s_logger.debug("Failed to in deleteSnapshotCallback", e);
    res.setResult(e.toString());
  }
  future.complete(res);
  return null;
}
origin: apache/cloudstack

snapshot.processEvent(Event.DestroyRequested);
snapshot.processEvent(Event.OperationSuccessed);
deleted = true;
if (!resultIsSet) {
origin: apache/cloudstack

protected Void syncSnapshotCallBack(AsyncCallbackDispatcher<SnapshotServiceImpl, CopyCommandResult> callback,
    CopySnapshotContext<CommandResult> context) {
  CopyCommandResult result = callback.getResult();
  SnapshotInfo destSnapshot = context.destSnapshot;
  SnapshotResult res = new SnapshotResult(destSnapshot, null);
  AsyncCallFuture<SnapshotResult> future = context.future;
  try {
    if (result.isFailed()) {
      res.setResult(result.getResult());
      // no change to existing snapshot_store_ref, will try to re-sync later if other call triggers this sync operation
    } else {
      // this will update install path properly, next time it will not sync anymore.
      destSnapshot.processEvent(Event.OperationSuccessed, result.getAnswer());
    }
    future.complete(res);
  } catch (Exception e) {
    s_logger.debug("Failed to process sync snapshot callback", e);
    res.setResult(e.toString());
    future.complete(res);
  }
  return null;
}
origin: apache/cloudstack

try {
  if (createSnapshotPayload.getAsyncBackup()) {
    destSnapshot.processEvent(Event.OperationFailed);
    throw new SnapshotBackupException("Failed in creating backup of snapshot with ID "+srcSnapshot.getId());
  } else {
    destSnapshot.processEvent(Event.OperationFailed);
destSnapshot.processEvent(Event.OperationSuccessed, copyCmdAnswer);
srcSnapshot.processEvent(Snapshot.Event.OperationSucceeded);
snapResult = new SnapshotResult(_snapshotFactory.getSnapshot(destSnapshot.getId(), destSnapshot.getDataStore()), copyCmdAnswer);
origin: apache/cloudstack

@Override
public boolean deleteSnapshot(SnapshotInfo snapInfo) {
  snapInfo.processEvent(ObjectInDataStoreStateMachine.Event.DestroyRequested);
  AsyncCallFuture<SnapshotResult> future = new AsyncCallFuture<SnapshotResult>();
  DeleteSnapshotContext<CommandResult> context = new DeleteSnapshotContext<CommandResult>(null, snapInfo, future);
  AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult> caller = AsyncCallbackDispatcher.create(this);
  caller.setCallback(caller.getTarget().deleteSnapshotCallback(null, null)).setContext(context);
  DataStore store = snapInfo.getDataStore();
  store.getDriver().deleteAsync(store, snapInfo, caller);
  SnapshotResult result = null;
  try {
    result = future.get();
    if (result.isFailed()) {
      throw new CloudRuntimeException(result.getResult());
    }
    return true;
  } catch (InterruptedException e) {
    s_logger.debug("delete snapshot is failed: " + e.toString());
  } catch (ExecutionException e) {
    s_logger.debug("delete snapshot is failed: " + e.toString());
  }
  return false;
}
origin: apache/cloudstack

snapshotOnImageStore.processEvent(Event.CreateOnlyRequested);
CopySnapshotContext<CommandResult> context = new CopySnapshotContext<CommandResult>(null, snapshot, snapshotOnImageStore, future);
AsyncCallbackDispatcher<SnapshotServiceImpl, CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
origin: apache/cloudstack

snapshotInfo.processEvent(Event.CopyingRequested);
    snapshotInfo.processEvent(Event.OperationSuccessed);
    snapshotInfo.processEvent(Event.OperationFailed);
origin: apache/cloudstack

snapshotInfo.processEvent(Event.CopyingRequested);
      snapshotInfo.processEvent(Event.OperationSuccessed);
      snapshotInfo.processEvent(Event.OperationFailed);
origin: apache/cloudstack

snapshot.processEvent(Event.OperationFailed);
origin: apache/cloudstack

snapshotOnImageStore.processEvent(Event.CreateOnlyRequested);
snapshotOnImageStore.processEvent(Event.OperationSuccessed, createSnapshotAnswer);
SnapshotObject snapObj = (SnapshotObject)snapshot;
try {
org.apache.cloudstack.engine.subsystem.api.storageSnapshotInfoprocessEvent

Popular methods of SnapshotInfo

  • getId
  • getBaseVolume
  • getDataStore
  • getHypervisorType
  • getName
  • getTO
  • getVolumeId
  • getAccountId
  • getDataCenterId
  • getParent
  • getSize
  • getUuid
  • getSize,
  • getUuid,
  • addPayload,
  • getChild,
  • getFullBackup,
  • getLocationType,
  • getPath,
  • getPayload,
  • delete

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now