Package org.glassfish.api.admin.progress

Examples of org.glassfish.api.admin.progress.JobPersistence


        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        this.completionDate = System.currentTimeMillis();
        JobPersistence jobPersistenceService = null;
        if (isManagedJob) {
            if (scope != null)   {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
            else  {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            }

            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),userList.get(0),report.getMessage(),getJobsFile(),State.COMPLETED.name(),completionDate));
        }
        complete(report);
    }
View Full Code Here


        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        this.completionDate = System.currentTimeMillis();
        JobPersistence jobPersistenceService = null;
        if (isManagedJob) {
            if (scope != null)   {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
            else  {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            }

            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),userList.get(0),report.getMessage(),getJobsFile(),State.COMPLETED.name(),completionDate));
        }
        complete(report);
    }
View Full Code Here

            commandProgress.complete();
        }
        this.payload = outbound;
        complete(report);
        if (isManagedJob) {
            JobPersistence jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,state.name(),"admin",report.getMessage()));
        }
    }
View Full Code Here

        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        if (isManagedJob) {
            JobPersistence jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,State.COMPLETED.name(),userList.get(0),report.getMessage()));
        }
        complete(report);
    }
View Full Code Here

            commandProgress.complete();
        }
        this.payload = outbound;
        complete(report);
        if (isManagedJob) {
            JobPersistence jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            //todo fix user
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,state.name(),"admin",report.getMessage()));
        }
    }
View Full Code Here

    public void complete(ActionReport report, Payload.Outbound outbound) {
        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        JobPersistence jobPersistenceService = null;
        if (isManagedJob) {
            if (scope != null)   {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
            else  {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            }

            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),userList.get(0),report.getMessage(),getJobsFile(),State.COMPLETED.name()));
        }
        complete(report);
    }
View Full Code Here

        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        this.completionDate = System.currentTimeMillis();
        JobPersistence jobPersistenceService = null;
        if (isManagedJob) {
            if (scope != null)   {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
            else  {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            }

            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),userList.get(0),report.getMessage(),getJobsFile(),State.COMPLETED.name(),completionDate));
        }
        complete(report);
    }
View Full Code Here

        if (commandProgress != null && report != null && report.getActionExitCode() == ExitCode.SUCCESS) {
            commandProgress.complete();
        }
        this.payload = outbound;
        if (isManagedJob) {
            JobPersistence jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,State.COMPLETED.name(),"admin",report.getMessage()));
        }
        complete(report);
    }
View Full Code Here

                JobManagerService jobManager = Globals.getDefaultHabitat().getService(JobManagerService.class);
                jobManager.getRetryableJobsInfo().put(id, CheckpointHelper.CheckpointFilename.createBasic(this));
                jobManager.purgeJob(id);
                setState(State.FAILED_RETRYABLE);
            } else {
                JobPersistence jobPersistenceService;
                if (scope != null)   {
                    jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
                else  {
                    jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
                }
                State finalState = State.COMPLETED;
                if (getState().equals(State.REVERTING)) {
                    finalState = State.REVERTED;
                }
                String user = null;
                if(subjectUsernames.size() > 0){
                    user = subjectUsernames.get(0);
                }
                jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),user,report.getMessage(),getJobsFile(),finalState.name(),completionDate));
                if (getState().equals(State.RUNNING_RETRYABLE) || getState().equals(State.REVERTING)) {
                    JobManagerService jobManager = Globals.getDefaultHabitat().getService(JobManagerService.class);
                    File jobFile = getJobsFile();
                    if (jobFile == null) {
                        jobFile = jobManager.getJobsFile();
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.progress.JobPersistence

Copyright © 2018 www.massapicom. 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.