Package org.glassfish.api.admin.progress

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


    protected static final LocalStringManagerImpl adminStrings =
            new LocalStringManagerImpl(JobPersistenceService.class);
    @Override
    public  void persist(Object obj) {
        JobInfo jobInfo = (JobInfo)obj;

        jobInfos = jobManager.getCompletedJobs();

        doPersist(jobInfos,jobInfo);
View Full Code Here


         */
        if (job != null) {
            userID = SubjectUtil.getUsernamesFromSubject(job.getSubject()).get(0);
        } else {
            if (jobManager.getCompletedJobs() != null) {
                    final JobInfo jobInfo = (JobInfo) jobManager.getCompletedJobForId(jobID);
                    if (jobInfo != null) {
                        userID = jobInfo.user;
                    }
                }
        }
View Full Code Here

    @Override
    public void execute(AdminCommandContext context) {
        eventBroker = context.getEventBroker();

        attached = registry.get(jobID);
        JobInfo jobInfo = null;
        String jobName = null;

        if (attached == null) {
            //try for completed jobs
            if (registry.getCompletedJobs() != null) {
View Full Code Here

    private List<JobInfo> chooseJobs() {
        List<JobInfo> jobsToReport = new ArrayList<JobInfo>();

        if (jobID != null) {
            Job oneJob = jobManagerService.get(jobID);
            JobInfo info = null;

            if (isSingleJobOK(oneJob)) {
                List<String> userList =  SubjectUtil.getUsernamesFromSubject(oneJob.getSubject());
                ActionReport actionReport = oneJob.getActionReport();
                String message = actionReport == null ? "" : actionReport.getMessage();

                if (!StringUtils.ok(message)) {
                    message = ProgressStatusClient.composeMessageForPrint(oneJob.getCommandProgress());
                }
                String exitCode =  actionReport == null ? "" : actionReport.getActionExitCode().name();
                info = new JobInfo(oneJob.getId(),oneJob.getName(),oneJob.getCommandExecutionDate(),exitCode,userList.get(0),message,oneJob.getJobsFile(),oneJob.getState().name(),0);

            else {
                if (getCompletedJobs() != null) {
                    info = getCompletedJobForId(jobID);
                }
            }

          if (info != null && !skipJob(info.jobName)) {
              jobsToReport.add(info);
          }

        }  else {

            for (Iterator<Job> iterator = jobManagerService.getJobs(); iterator.hasNext(); ) {
                Job job = iterator.next();
                if (isJobEligible(job)) {
                    List<String> userList =  SubjectUtil.getUsernamesFromSubject(job.getSubject());
                    ActionReport actionReport = job.getActionReport();

                    String message = actionReport == null ? "" : actionReport.getMessage();
                    if (!StringUtils.ok(message)) {
                        message = ProgressStatusClient.composeMessageForPrint(job.getCommandProgress());
                    }
                    String exitCode = actionReport == null ? "" : actionReport.getActionExitCode().name();
                    jobsToReport.add(new JobInfo(job.getId(),job.getName(),job.getCommandExecutionDate(),exitCode,userList.get(0),message,job.getJobsFile(),job.getState().name(),0));
                }
            }

            JobInfos completedJobs = getCompletedJobs();
            if (completedJobs != null ) {
View Full Code Here

    @Override
    public void execute(AdminCommandContext context) {
        eventBroker = context.getEventBroker();

        attached = registry.get(jobID);
        JobInfo jobInfo = null;
        String jobName = null;

        if (attached == null) {
            //try for completed jobs
            if (registry.getCompletedJobs(registry.getJobsFile()) != null) {
View Full Code Here

    private static final LocalStringManagerImpl adminStrings =
            new LocalStringManagerImpl(JobPersistenceService.class);
    @Override
    public synchronized void persist(Object obj) {
        JobInfo jobInfo = (JobInfo)obj;
        File file = new File(
              serverEnvironment.getConfigDirPath(),JOBS_FILE);
        jobInfos = jobManager.getCompletedJobs();
                if (jobInfos == null)
                    jobInfos = new JobInfos();
View Full Code Here

        List<JobInfo> jobInfoList = new ArrayList<JobInfo>();

        StringBuilder sb = new StringBuilder();
        if (jobID != null) {
            Job oneJob = jobManagerService.get(jobID);
            JobInfo info = null;
            if (oneJob != null) {
                String message = oneJob.getActionReport() == null ? "" : oneJob.getActionReport().getMessage();
                info = new JobInfo(oneJob.getId(),oneJob.getName(),oneJob.getCommandExecutionDate(),oneJob.getState().name(),"user",message);
            else {
                if (jobManagerService.getCompletedJobs() != null) {
                    info = getCompletedJobForId(jobID);
                }
            }

          if (info != null && !skipJob(info.jobName)) {
              jobInfoList.add(info);
          }

        }  else {

            for (Iterator<Job> iterator = jobManagerService.getJobs(); iterator.hasNext(); ) {
                Job job = iterator.next();
                if (!skipJob(job.getName())) {
                    //Todo fix user
                    String message = job.getActionReport() == null ? "" : job.getActionReport().getMessage();
                    jobInfoList.add(new JobInfo(job.getId(),job.getName(),job.getCommandExecutionDate(),job.getState().name(),"user",message));
                }
            }

            JobInfos completedJobs = jobManagerService.getCompletedJobs();
            if (completedJobs != null ) {
View Full Code Here

        }
        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

    @Override
    public void execute(AdminCommandContext context) {
        eventBroker = context.getEventBroker();
        ActionReport ar = context.getActionReport();
        attached = registry.get(jobID);
        JobInfo jobInfo = null;
        String jobName = null;
        String attachedUser = SubjectUtil.getUsernamesFromSubject(context.getSubject()).get(0);
        if (attached == null) {
            //try for completed jobs
            if (registry.getCompletedJobs() != null)
View Full Code Here

        List<JobInfo> jobInfoList = new ArrayList<JobInfo>();

        if (jobID != null) {
            Job oneJob = jobManagerService.get(jobID);
            JobInfo info = null;

            if (oneJob != null) {
                List<String> userList =  SubjectUtil.getUsernamesFromSubject(oneJob.getSubject());
                String message = oneJob.getActionReport() == null ? "" : oneJob.getActionReport().getMessage();
                info = new JobInfo(oneJob.getId(),oneJob.getName(),oneJob.getCommandExecutionDate(),oneJob.getState().name(),"admin",message);

            else {
                if (jobManagerService.getCompletedJobs() != null) {
                    info = (JobInfo) jobManagerService.getCompletedJobForId(jobID);
                }
            }

          if (info != null && !skipJob(info.jobName)) {
              jobInfoList.add(info);
          }

        }  else {

            for (Iterator<Job> iterator = jobManagerService.getJobs(); iterator.hasNext(); ) {
                Job job = iterator.next();
                if (!skipJob(job.getName())) {
                    List<String> userList =  SubjectUtil.getUsernamesFromSubject(job.getSubject());
                    String message = job.getActionReport() == null ? "" : job.getActionReport().getMessage();
                    jobInfoList.add(new JobInfo(job.getId(),job.getName(),job.getCommandExecutionDate(),job.getState().name(),userList.get(0),message));
                }
            }

            JobInfos completedJobs = jobManagerService.getCompletedJobs();
            if (completedJobs != null ) {
View Full Code Here

TOP

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

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.