View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.services.scheduling;
16  
17  import org.figure8.join.core.EntityObject;
18  /**
19   * This class represents an entity of cron parameter instance. A quartz cron instance
20   * can have N quartz cron parameter. 
21   * @author <a href="mailto:jerome.evrard@gmail.com">Jerome Evrard</a>
22   * @version $Revision: 1.3 $
23   * 
24   * @hibernate.class table="join_quartzcronparameter"
25   * @hibernate.cache usage="read-write"
26   * 
27   * @hibernate.query name="join.quartzcronparameter_findByName" query="from QuartzCronParameterInfo cronParameter where cronParameter.name = :cronParameterName and cronParameter.cronInfo.id = :cronId"
28   * @hibernate.query name="join.quartzcronparameter_findJobParameter" query="from QuartzCronParameterInfo cronParameter where cronParameter.cronInfo.name = :cronName and cronParameter.jobParameter = true"
29   * @hibernate.query name="join.quartzcronparameter_findUserParameter" query="from QuartzCronParameterInfo cronParameter where cronParameter.cronInfo.name = :cronName and cronParameter.jobParameter = false"
30   */
31  public class QuartzCronParameterInfo extends EntityObject{
32  
33     // Attributes ---------------------------------------------------------------
34     
35     /** <code>name</code>: The cron job parameter name */
36     private String name;
37     /** <code>value</code>: The cron job parameter value */
38     private String value;
39     /** <code>jobParameter</code>: whether the parameter is a job instance parameter or a user parameter */
40     private boolean jobParameter;
41  
42     /** The bean wrapping info about the cron this parameter apply to. */
43     private QuartzCronInfo cronInfo;
44  
45  
46     // Constructors -------------------------------------------------------------
47     
48     /** Build a new instance. */
49     public QuartzCronParameterInfo(){
50     }
51     
52     /**
53      * Build a new instance.
54      * @param name The cron parameter name.
55      * @param value The cron parameter value.
56      * @param jobParameter The parameter is a job parameter (true), or the parameter is an user parameter (false).
57      */
58     public QuartzCronParameterInfo(String name, String value, boolean jobParameter){
59        this.name = name;
60        this.value = value;
61        this.jobParameter = jobParameter;
62     }
63  
64  
65     // Public -------------------------------------------------------------------
66  
67     /**
68      * @return Returns the name.
69      * @hibernate.property column="s_name"
70      *    not-null="true" length="80"
71      */
72     public String getName(){
73        return name;
74     }
75     /** @param name The name to set. */
76     public void setName(String name){
77        this.name = name;
78     }
79     
80     /**
81      * @return Returns the value.
82      * @hibernate.property column="s_value"
83      *    not-null="true" length="200"
84      */
85     public String getValue(){
86        return value;
87     }
88     /** @param value The value to set. */
89     public void setValue(String value){
90        this.value = value;
91     }
92  
93     /**
94      * @return Returns the jobParameter.
95      * @hibernate.property column="b_jobparameter" not-null="true"
96      */
97     public boolean isJobParameter(){
98        return jobParameter;
99     }
100    /** @param jobParameter The jobParameter to set. */
101    public void setJobParameter(boolean jobParameter){
102       this.jobParameter = jobParameter;
103    }
104 
105    /**
106     * @return Returns the cronInfo.
107     * @hibernate.many-to-one column="n_cron_fk"
108     *    not-null="true" foreign-key="n_id"
109     */
110    public QuartzCronInfo getCronInfo(){
111       return cronInfo;
112    }
113    /** @param cronInfo The cronInfo to set. */
114    public void setCronInfo(QuartzCronInfo cronInfo){
115       this.cronInfo = cronInfo;
116    }
117 }