| <?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> > <a href="index.source.html" class="el_package">org.apache.turbine.services.schedule</a> > <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 |
| * "License"); 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 |
| * "AS IS" 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.<br> |
| * |
| * Example 1: Run the DefaultScheduledJob at 8:00am every 15th of |
| * the month - <br> |
| * |
| * JobEntry je = new JobEntry(0,0,8,15,"DefaultScheduledJob");<br> |
| * |
| * Example 2: Run the DefaultScheduledJob at 8:00am every day - |
| * <br> |
| * |
| * JobEntry je = new JobEntry(0,0,8,-1,"DefaultScheduledJob");<br> |
| * |
| * Example 3: Run the DefaultScheduledJob every 2 hours. - <br> |
| * |
| * JobEntry je = new JobEntry(0,120,-1,-1,"DefaultScheduledJob");<br> |
| * |
| * Example 4: Run the DefaultScheduledJob every 30 seconds. - <br> |
| * |
| * JobEntry je = new JobEntry(30,-1,-1,-1,"DefaultScheduledJob");<br> |
| * |
| * @param sec Value for entry "seconds". |
| * @param min Value for entry "minutes". |
| * @param hour Value for entry "hours". |
| * @param wd Value for entry "week days". |
| * @param day_mo Value for entry "month days". |
| * @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> |