001: /**********************************************************************************
002: * $URL$
003: * $Id$
004: **********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005 The Regents of the University of Michigan, Trustees of Indiana University,
007: * Board of Trustees of the Leland Stanford, Jr., University, and The MIT Corporation
008: *
009: * Licensed under the Educational Community License Version 1.0 (the "License");
010: * By obtaining, using and/or copying this Original Work, you agree that you have read,
011: * understand, and will comply with the terms and conditions of the Educational Community License.
012: * You may obtain a copy of the License at:
013: *
014: * http://cvs.sakaiproject.org/licenses/license_1_0.html
015: *
016: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
017: * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
018: * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
019: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
020: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
021: *
022: **********************************************************************************/package org.sakaiproject.component.app.scheduler;
023:
024: import java.util.List;
025:
026: import org.apache.commons.logging.Log;
027: import org.apache.commons.logging.LogFactory;
028: import org.quartz.JobDetail;
029: import org.sakaiproject.api.app.scheduler.JobDetailWrapper;
030: import org.sakaiproject.api.app.scheduler.JobBeanWrapper;
031:
032: public class JobDetailWrapperImpl implements JobDetailWrapper {
033: private JobDetail jobDetail;
034: private boolean isSelected = false;
035: private List triggerWrapperList;
036: private Integer triggerCount;
037:
038: private static final Log LOG = LogFactory
039: .getLog(JobDetailWrapperImpl.class);
040:
041: public JobDetailWrapperImpl() {
042: }
043:
044: /**
045: * @return Returns the triggerCount.
046: */
047: public Integer getTriggerCount() {
048: return triggerCount;
049: }
050:
051: /**
052: * @param triggerCount The triggerCount to set.
053: */
054: public void setTriggerCount(Integer triggerCount) {
055: this .triggerCount = triggerCount;
056: }
057:
058: /**
059: * @return Returns the triggerWrapperList.
060: */
061: public List getTriggerWrapperList() {
062: return triggerWrapperList;
063: }
064:
065: /**
066: * @param triggerWrapperList The triggerWrapperList to set.
067: */
068: public void setTriggerWrapperList(List triggerWrapperList) {
069: this .triggerCount = new Integer(triggerWrapperList.size());
070: this .triggerWrapperList = triggerWrapperList;
071: }
072:
073: /**
074: * @return Returns the jobDetail.
075: */
076: public JobDetail getJobDetail() {
077: return jobDetail;
078: }
079:
080: /**
081: * @param jobDetail The jobDetail to set.
082: */
083: public void setJobDetail(JobDetail jobDetail) {
084: this .jobDetail = jobDetail;
085: }
086:
087: /**
088: * @return Returns the isSelected.
089: */
090: public boolean getIsSelected() {
091: return isSelected;
092: }
093:
094: /**
095: * @param isSelected The isSelected to set.
096: */
097: public void setIsSelected(boolean isSelected) {
098: this .isSelected = isSelected;
099: }
100:
101: public String getJobType() {
102: String jobType = (String) getJobDetail().getJobDataMap().get(
103: JobBeanWrapper.JOB_TYPE);
104: if (jobType != null) {
105: return jobType;
106: }
107: return getJobDetail().getJobClass().getName();
108: }
109: }
|