Examples of ProcessStatus


Examples of com.netflix.genie.common.util.ProcessStatus

     */
    @Override
    @Transactional
    public int markZombies() {
        LOG.debug("called");
        final ProcessStatus zombie = ProcessStatus.ZOMBIE_JOB;
        final long currentTime = new Date().getTime();
        final long zombieTime = CONF.getLong(
                "netflix.genie.server.janitor.zombie.delta.ms", 1800000);

        @SuppressWarnings("unchecked")
        final List<Job> jobs = this.jobRepo.findAll(
                JobSpecs.findZombies(currentTime, zombieTime)
        );
        for (final Job job : jobs) {
            job.setStatus(JobStatus.FAILED);
            job.setFinished(new Date());
            job.setExitCode(zombie.getExitCode());
            job.setStatusMsg(zombie.getMessage());
        }
        return jobs.size();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProcessStatus

        // already existing non-obsolete document.
        if (document != null) {
            if (!document.isObsolete()) {
                // updates must happen through PUT on the actual resource
                ProcessStatus status = new ProcessStatus();
                status.setStatusCode(ProcessStatusCode.Failed);
                status.getMessages().add(
                        "A document with name " + resource.getName()
                                + " already exists.");
                return status;
            }
        }
View Full Code Here

Examples of org.zanata.rest.dto.ProcessStatus

        MergeType mergeType;
        try {
            mergeType = MergeType.valueOf(merge.toUpperCase());
        } catch (Exception e) {
            ProcessStatus status = new ProcessStatus();
            status.setStatusCode(ProcessStatusCode.Failed);
            status.getMessages().add("bad merge type " + merge);
            return status;
        }

        final String id = URIHelper.convertFromDocumentURIId(idNoSlash);
        final MergeType finalMergeType = mergeType;
View Full Code Here

Examples of org.zanata.rest.dto.ProcessStatus

        if (handle == null) {
            throw new NotFoundException("A process was not found for id "
                    + processId);
        }

        ProcessStatus status = new ProcessStatus();
        status.setStatusCode(handle.isDone() ? ProcessStatusCode.Finished
                : ProcessStatusCode.Running);
        int perComplete = 100;
        if (handle.getMaxProgress() > 0) {
            perComplete =
                    (handle.getCurrentProgress() * 100 / handle
                            .getMaxProgress());
        }
        status.setPercentageComplete(perComplete);
        status.setUrl("" + processId);

        if (handle.isDone()) {
            Object result = null;
            try {
                result = handle.getResult();
            } catch (InterruptedException e) {
                // The process was forcefully cancelled
                status.setStatusCode(ProcessStatusCode.Failed);
                status.setMessages(Lists.newArrayList(e.getMessage()));
            } catch (ExecutionException e) {
                // Exception thrown while running the task
                status.setStatusCode(ProcessStatusCode.Failed);
                status.setMessages(Lists
                        .newArrayList(e.getCause().getMessage()));
            }

            // TODO Need to find a generic way of returning all object types.
            // Since the only current
            // scenario involves lists of strings, hardcoding to that
            if (result != null && result instanceof List) {
                status.getMessages().addAll((List) result);
            }
        }

        return status;
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProcessStatus

    public void asyncPushSource(String projectSlug, String iterationSlug,
            Resource sourceResource, boolean copyTrans) {
        IAsynchronousProcessResource resource =
                zanataProxyFactory.getAsynchronousProcessResource();
        ProcessStatus processStatus = resource.startSourceDocCreationOrUpdate(
                sourceResource.getName(), projectSlug, iterationSlug,
                sourceResource,
                Sets.<String>newHashSet(), false);
        processStatus = waitUntilFinished(resource, processStatus);
        log.info("finished async source push ({}-{}): {}", projectSlug,
                iterationSlug, processStatus.getStatusCode());
        if (copyTrans) {
            log.info("start copyTrans for {} - {}", projectSlug, iterationSlug);
            ICopyTransResource copyTransResource =
                    zanataProxyFactory.getCopyTransResource();
            CopyTransStatus copyTransStatus =
View Full Code Here

Examples of org.zanata.rest.dto.ProcessStatus

    public void asyncPushTarget(String projectSlug, String iterationSlug,
            String docId, LocaleId localeId, TranslationsResource transResource,
            String mergeType) {
        IAsynchronousProcessResource resource =
                zanataProxyFactory.getAsynchronousProcessResource();
        ProcessStatus processStatus =
                resource.startTranslatedDocCreationOrUpdate(docId, projectSlug,
                        iterationSlug, localeId, transResource,
                        Collections.<String>emptySet(), mergeType);
        processStatus = waitUntilFinished(resource, processStatus);
        log.info("finished async translation({}-{}) push: {}", projectSlug,
                iterationSlug, processStatus.getStatusCode());
    }
View Full Code Here

Examples of pl.net.bluesoft.rnd.processtool.model.ProcessStatus

           else
               broadcastEvent(ctx, new BpmEvent(BpmEvent.Type.SIGNAL_PROCESS, bpmTask, log.getUserSubstitute()));

           if (Strings.hasText(action.getAssignProcessStatus())) {
               String processStatus = action.getAssignProcessStatus();
               ProcessStatus ps = processStatus.length() == 1 ? ProcessStatus.fromChar(processStatus.charAt(0)) : ProcessStatus.fromString(processStatus);
               processInstance.setStatus(ps);
           }
           else
           {
             boolean isProcessRunning = processInstance.isProcessRunning();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.