/* (non-Javadoc)
@see org.duracloud.snapshot.service.RestoreManager#restartRestore(java.lang.String)
975180
@Override
    @Transactional
    public Restoration restartRestore(String restoreId) throws SnapshotException {
        Restoration restoration = this.jobManager.stopRestore(restoreId);
        restoration.setEndDate(null);
        restoration.setStatus(RestoreStatus.RETRIEVING_FROM_STORAGE);
        restoration = restoreRepo.save(restoration);
        eventLog.logRestoreUpdate(restoration);
        return this.restoreCompleted(restoration);
    }
1157941
@Override
    @Transactional
    public void finalizeRestores() {
        log.debug("Running finalize restores...");
        List<Restoration> completedRestores =
            restoreRepo.findByStatus(RestoreStatus.RESTORATION_COMPLETE);

        for (Restoration restoration : completedRestores) {
            Date expirationDate = restoration.getExpirationDate();
            if (expirationDate.before(new Date())) { // Only continue if expired
                DuracloudEndPointConfig destination = restoration.getDestination();
                ContentStore store =
                    storeClientHelper.create(destination,
                                             bridgeConfig.getDuracloudUsername(),
                                             bridgeConfig.getDuracloudPassword());
                try {
                    String spaceId = destination.getSpaceId();
                    Iterator<String> it = store.getSpaceContents(spaceId);
                    if (!it.hasNext()) { // if space is empty
                        // Call DuraCloud to remove space
                        log.info("Deleting expired restoration space: " + spaceId +
                                 " at host: " + destination.getHost());
                        store.deleteSpace(spaceId);

                        // Update restore status
                        validateAndSet(restoration,
                                       RestoreStatus.RESTORATION_EXPIRED,
                                       "Restoration expired");
                        restoration = save(restoration);
                        log.info("Transition of restore " +
                                 restoration.getRestorationId() +
                                 " to expired state completed successfully");

                        // Add history event
                        String history =
                            "[{'" + RESTORE_ACTION_TITLE + "':'" + RESTORE_ACTION_EXPIRED + "'}," +
                            "{'" + RESTORE_ID_TITLE + "':'" + restoration.getRestorationId() + "'}]";
                        snapshotManager.updateHistory(restoration.getSnapshot(), history);
                    }
                } catch (Exception e) {
                    log.error("Failed to transition restore " +
                              restoration.getRestorationId() +
                              " to expired state due to: " + e.getMessage());
                }
            }
        }
    }
876586
void enterRestore() {
        createZKDirectory(VoltZK.restore);
        createZKDirectory(VoltZK.restore_barrier);
        createZKDirectory(VoltZK.restore_barrier2);

        try {
            m_generatedRestoreBarrier2 = m_zk.create(VoltZK.restore_barrier2 + "/counter", null,
                        Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
        } catch (Exception e) {
            VoltDB.crashGlobalVoltDB("Failed to create Zookeeper node: " + e.getMessage(),
                                     false, e);
        }
    }
1132340
@Override
    public void run() {
        if (m_restoreAgent != null) {
            // start restore process
            m_restoreAgent.restore();
        }
        else {
            onSnapshotRestoreCompletion();
            onReplayCompletion(Long.MIN_VALUE, m_iv2InitiatorStartingTxnIds);
        }

        // Start the rejoin coordinator
        if (m_joinCoordinator != null) {
            try {
                m_statusTracker.set(NodeState.REJOINING);
                if (!m_joinCoordinator.startJoin(m_catalogContext.database)) {
                    VoltDB.crashLocalVoltDB("Failed to join the cluster", true, null);
                }
            } catch (Exception e) {
                VoltDB.crashLocalVoltDB("Failed to join the cluster", true, e);
            }
        }

        m_isRunning = true;
    }
1062803
public void resumeZooKeeper() throws Exception {
        val zk = new ZooKeeperServiceRunner(this.zkPort, this.secureZK, this.tLSKeyStore, this.tLSKeyStorePasswordPath, this.tlsTrustStore);
        if (this.zkServer.compareAndSet(null, zk)) {
            // Initialize ZK runner (since nobody else did it for us).
            zk.initialize();
            log.info("ZooKeeper initialized.");
        } else {
            zk.close();
        }

        // Start or resume ZK.
        this.zkServer.get().start();
        log.info("ZooKeeper resumed.");
    }
128589
private static void initialize(final boolean _restart)
        throws CacheReloadException
    {
        if (InfinispanCache.get().exists(IndexDefinition.UUIDCACHE)) {
            if (_restart) {
                InfinispanCache.get().<UUID, IndexDefinition>getCache(IndexDefinition.UUIDCACHE).clear();
            }
        } else {
            InfinispanCache.get().<UUID, Type>getCache(IndexDefinition.UUIDCACHE).addListener(new CacheLogListener(
                            IndexDefinition.LOG));
        }
    }
254623
public void restart(Destination dst) throws KNXTimeoutException,
		KNXLinkClosedException
	{
		final byte[] send = DataUnitBuilder.createCompactAPDU(RESTART, null);
		if (dst.isConnectionOriented())
			tl.connect(dst);
		else
			logger.error("doing restart in connectionless mode, " + dst.toString());
		tl.sendData(dst.getAddress(), priority, send);
		// force a reconnect at later time
		tl.disconnect(dst);
	}
308576
@Override
    public void restart() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "restart", "SRTInputStream31: Start re-read of data");
        }
        this.isClosed = false;
        super.restart();
    }
1154442
public void start() throws Exception
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED));

        //Try to restore data from backup before zookeeper will be started
        backupManager.restoreAll();

        activityQueue.start();
        configManager.start();
        monitorRunningInstance.start();
        cleanupManager.start();
        backupManager.start();
        autoInstanceManagement.start();
        if ( servoMonitoring != null )
        {
            servoMonitoring.start();
        }

        configManager.addConfigListener
        (
            new ConfigListener()
            {
                @Override
                public void configUpdated()
                {
                    try
                    {
                        resetLocalConnection();
                    }
                    catch ( IOException e )
                    {
                        log.add(ActivityLog.Type.ERROR, "Resetting connection", e);
                    }
                }
            }
        );
    }
995849
@Override
    public Restoration restoreSnapshot(String snapshotId,
                                       DuracloudEndPointConfig destination,
                                       String userEmail)
        throws SnapshotNotFoundException, SnapshotInProcessException, SnapshotException {

        checkInitialized();

        Snapshot snapshot = getSnapshot(snapshotId);

        if (!snapshot.getStatus().equals(SnapshotStatus.SNAPSHOT_COMPLETE)) {
            throw new SnapshotInProcessException("Snapshot is not complete. " +
                                                 "Restoration can only occur on a " +
                                                 "completed snapshot.");
        }

        Restoration restoration =
            createRestoration(snapshot, destination, userEmail);

        validateAndSet(restoration, RestoreStatus.RETRIEVING_FROM_STORAGE, "Restoration request issued");

        restoration = save(restoration);

        String restorationId = restoration.getRestorationId();
        File restoreDir = getRestoreDir(restorationId);
        restoreDir.mkdirs();

        //send email to snapshot storage owner to request restore
        String subject = "Snapshot Restoration Request for Snapshot ID = " +
                         snapshotId;
        String body = "Please perform a snapshot restore.\n" +
                      "\nSnapshot ID: " + snapshotId +
                      "\nRestore ID: " + restorationId +
                      "\nRestore Location: " + restoreDir.getAbsolutePath();
        notificationManager.sendNotification(NotificationType.EMAIL,
                                             subject,
                                             body,
                                             getAllEMailAddresses(this.config));
        return restoration;
    }
342936
@Help(
    help =
        "Resumes a NSR that failed while executing a script in a VNFR. The id in the URL specifies the Network Service Record that will be resumed."
  )
  public void resume(final String idNsr) throws SDKException {
    String url = idNsr + "/resume";
    requestPost(url);
  }
1298288
public void onResume(CmmnActivityExecution execution) {
    ensureTransitionAllowed(execution, SUSPENDED, AVAILABLE, "resume");

    CmmnActivityExecution parent = execution.getParent();
    if (parent != null) {
      if (!parent.isActive()) {
        String id = execution.getId();
        throw LOG.resumeInactiveCaseException("resume", id);
      }
    }

    resuming(execution);
  }
818041
public void restart(RuntimeException cause) {
        if (isProdMode()) throw cause;
        if (!(cause instanceof ClassReloadException)) {
            String msg = cause.getMessage();
            if (cause instanceof RythmException) {
                RythmException re = (RythmException) cause;
                msg = re.getSimpleMessage();
            }
            logger.warn("restarting rythm engine due to %s", msg);
        }
        restart();
    }
244183
private OnePidRecordListImpl restartRecordsInProcess(final RepositoryPointer after, long max, final IInternalRecordFilter recFilter) {
		if (!(after instanceof RepositoryPointerImpl)) {
			throw new IllegalArgumentException("Specified location does not belong to this repository.");
		}
		return new OnePidRecordListLocationImpl((RepositoryPointerImpl)after, max, recFilter);
	}
242936
public synchronized void restart() throws IllegalStateException {

        if (this.isShutdown) {
            throw new IllegalStateException("isShutdown==true");
        } else if (this.taskRunnerThread == null) {
            this.taskRunnerThread =
                this.threadFactory.newThread(this.taskRunner);

            this.taskRunnerThread.start();
        } else {
            this.taskQueue.unpark();
        }
    }
572983
public void restart(final String dev_name) throws DevFailed {
        Util.out4.println("In DServer.restart(" + dev_name + ") method");
        //
        // Check if the wanted device exists in each class
        //

        final Util tg = Util.instance();
        Vector dev_list = tg.get_device_list_by_class(((DeviceClass) class_list.elementAt(0))
                .get_name());
        final int nb_class = class_list.size();
        int i, j, nb_dev;
        DeviceImpl dev_to_del = null;
        DeviceClass dev_cl = null;

        j = 0;
        for (i = 0; i < nb_class; i++) {
            dev_list = tg.get_device_list_by_class(((DeviceClass) class_list.elementAt(i))
                    .get_name());
            nb_dev = dev_list.size();
            for (j = 0; j < nb_dev; j++) {
                if (((DeviceImpl) dev_list.elementAt(j)).get_name().equals(dev_name) == true) {
                    // Get device & class reference
                    dev_to_del = (DeviceImpl) dev_list.elementAt(j);
                    dev_cl = (DeviceClass) class_list.elementAt(i);
                    break;
                }
            }
            if (dev_to_del != null && dev_cl != null) {
                break;
            }
        }

        //
        // Throw exception if the device is not found
        //

        if (dev_to_del == null || dev_cl == null) // Have been found
        {
            final StringBuffer o = new StringBuffer("Device ");
            o.append(dev_name);
            o.append(" not found");

            Except.throw_exception("API_DeviceNotFound", new String(o), "Dserver.restart()");
        }

        //
        // Remove ourself from device list
        //

        dev_list.removeElementAt(j);

        // Store polling conditions if any
        assert dev_to_del != null;
        final Vector p_obj = dev_to_del.get_poll_obj_list(); // PollObj
        final Vector dev_pol = new Vector(); // Pol

        for (i = 0; i < p_obj.size(); i++) {
            dev_pol.add(p_obj.elementAt(i));
        }
        if (dev_pol.size() > 0) {
            stop_polling();
        }

        // Delete the device (deactivate it and remove it)
        final POA r_poa = tg.get_poa();
        if (dev_to_del.get_exported_flag() == true) {
            try {
                r_poa.deactivate_object(dev_to_del.get_obj_id());
            } catch (final WrongPolicy ex) {
            } catch (final ObjectNotActive ex) {
            }
        }

        // Re-create device
        final String[] dev_name_list = new String[1];
        dev_name_list[0] = dev_name;
        assert dev_cl != null;
        dev_cl.device_factory(dev_name_list);

        // Re-start device polling (if any)
        final DevVarLongStringArray send = new DevVarLongStringArray();
        send.lvalue = new int[1];
        send.svalue = new String[3];

        for (i = 0; i < dev_pol.size(); i++) {
            final PollObj poll_obj = (PollObj) dev_pol.elementAt(i);
            // Send command to the polling thread
            send.lvalue[0] = poll_obj.get_upd_i();
            send.svalue[0] = poll_obj.get_name();
            if (poll_obj.type == Tango_POLL_CMD) {
                send.svalue[1] = "command";
            } else {
                send.svalue[1] = "attribute";
            }
            send.svalue[2] = poll_obj.name;

            try {
                add_obj_polling(send, false);
            } catch (final DevFailed e) {
                if (Util._tracelevel >= 4) {
                    Except.print_exception(e);
                }
            }
        }
    }
547877
def do_restart_service(self, service):
        
        if not self.has_cluster():
            return None

        if self.service_action(service=service, action="restart"):
            print("%s is being restarted" % (service))
        else:
            print("Error restarting service")
            return None