blob: dc64e69ca22f4b67816dfec8c5db914c7135e4bb [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang=""><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>JobEntryNonPersistent.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Turbine</a> &gt; <a href="index.source.html" class="el_package">org.apache.turbine.services.schedule</a> &gt; <span class="el_source">JobEntryNonPersistent.java</span></div><h1>JobEntryNonPersistent.java</h1><pre class="source lang-java linenums">package org.apache.turbine.services.schedule;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* &quot;License&quot;); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.turbine.util.TurbineException;
/**
* This is an implementation of a JobEntry with no persistence. It is used by the
* {@link TurbineNonPersistentSchedulerService}
*
*/
public class JobEntryNonPersistent extends AbstractJobEntry
{
private int jobId;
private int sec;
private int min;
private int hour;
private int wd;
private int day_mo;
private String task;
<span class="nc" id="L38"> private boolean isnew = true;</span>
/**
* Default constructor
*/
public JobEntryNonPersistent()
{
<span class="nc" id="L45"> super();</span>
<span class="nc" id="L46"> }</span>
/**
* Constructor.
*
* Schedule a job to run on a certain point of time.&lt;br&gt;
*
* Example 1: Run the DefaultScheduledJob at 8:00am every 15th of
* the month - &lt;br&gt;
*
* JobEntry je = new JobEntry(0,0,8,15,&quot;DefaultScheduledJob&quot;);&lt;br&gt;
*
* Example 2: Run the DefaultScheduledJob at 8:00am every day -
* &lt;br&gt;
*
* JobEntry je = new JobEntry(0,0,8,-1,&quot;DefaultScheduledJob&quot;);&lt;br&gt;
*
* Example 3: Run the DefaultScheduledJob every 2 hours. - &lt;br&gt;
*
* JobEntry je = new JobEntry(0,120,-1,-1,&quot;DefaultScheduledJob&quot;);&lt;br&gt;
*
* Example 4: Run the DefaultScheduledJob every 30 seconds. - &lt;br&gt;
*
* JobEntry je = new JobEntry(30,-1,-1,-1,&quot;DefaultScheduledJob&quot;);&lt;br&gt;
*
* @param sec Value for entry &quot;seconds&quot;.
* @param min Value for entry &quot;minutes&quot;.
* @param hour Value for entry &quot;hours&quot;.
* @param wd Value for entry &quot;week days&quot;.
* @param day_mo Value for entry &quot;month days&quot;.
* @param task Task to execute.
* @throws TurbineException a generic exception.
*/
public JobEntryNonPersistent(int sec,
int min,
int hour,
int wd,
int day_mo,
String task)
throws TurbineException
{
<span class="nc" id="L87"> super(sec, min, hour, wd, day_mo, task);</span>
<span class="nc" id="L88"> }</span>
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode()
{
<span class="nc" id="L96"> return Integer.valueOf(jobId).hashCode();</span>
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj)
{
<span class="nc bnc" id="L105" title="All 2 branches missed."> if (obj instanceof JobEntry)</span>
{
<span class="nc bnc" id="L107" title="All 2 branches missed."> return compareTo((JobEntry)obj) == 0;</span>
}
<span class="nc" id="L110"> return false;</span>
}
/**
* Return true, if the entry is not yet persisted
*/
@Override
public boolean isNew()
{
<span class="nc" id="L119"> boolean _isnew = isnew;</span>
<span class="nc" id="L120"> isnew = false;</span>
<span class="nc" id="L121"> return _isnew;</span>
}
/**
* Get the value of jobId.
*
* @return int
*/
@Override
public int getJobId()
{
<span class="nc" id="L132"> return jobId;</span>
}
/**
* Set the value of jobId.
*
* @param v new value
*/
@Override
public void setJobId(int v)
{
<span class="nc" id="L143"> this.jobId = v;</span>
<span class="nc" id="L144"> }</span>
/**
* Get the value of second.
*
* @return int
*/
@Override
public int getSecond()
{
<span class="nc" id="L154"> return sec;</span>
}
/**
* Set the value of second.
*
* @param v new value
*/
@Override
public void setSecond(int v)
{
<span class="nc" id="L165"> this.sec = v;</span>
<span class="nc" id="L166"> }</span>
/**
* Get the value of minute.
*
* @return int
*/
@Override
public int getMinute()
{
<span class="nc" id="L176"> return min;</span>
}
/**
* Set the value of minute.
*
* @param v new value
*/
@Override
public void setMinute(int v)
{
<span class="nc" id="L187"> this.min = v;</span>
<span class="nc" id="L188"> }</span>
/**
* Get the value of hour.
*
* @return int
*/
@Override
public int getHour()
{
<span class="nc" id="L198"> return hour;</span>
}
/**
* Set the value of hour.
*
* @param v new value
*/
@Override
public void setHour(int v)
{
<span class="nc" id="L209"> this.hour = v;</span>
<span class="nc" id="L210"> }</span>
/**
* Get the value of weekDay.
*
* @return int
*/
@Override
public int getWeekDay()
{
<span class="nc" id="L220"> return wd;</span>
}
/**
* Set the value of weekDay.
*
* @param v new value
*/
@Override
public void setWeekDay(int v)
{
<span class="nc" id="L231"> this.wd = v;</span>
<span class="nc" id="L232"> }</span>
/**
* Get the value of dayOfMonth.
*
* @return int
*/
@Override
public int getDayOfMonth()
{
<span class="nc" id="L242"> return day_mo;</span>
}
/**
* Set the value of dayOfMonth.
*
* @param v new value
*/
@Override
public void setDayOfMonth(int v)
{
<span class="nc" id="L253"> this.day_mo = v;</span>
<span class="nc" id="L254"> }</span>
/**
* Get the value of task.
*
* @return String
*/
@Override
public String getTask()
{
<span class="nc" id="L264"> return task;</span>
}
/**
* Set the value of task.
*
* @param v new value
*/
@Override
public void setTask(String v)
{
<span class="nc" id="L275"> this.task = v;</span>
<span class="nc" id="L276"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html>