IDEMPIERE-391 Scheduler improvements
This commit is contained in:
parent
bdccbad711
commit
993116f1ea
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -25,4 +25,7 @@ public interface AdempiereProcessor2 {
|
|||
* server time is use as the base to the new DateNextRun value.
|
||||
*/
|
||||
public boolean isIgnoreProcessingTime();
|
||||
|
||||
// IDEMPIERE-391
|
||||
public int getAD_Schedule_ID();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_AD_AlertProcessor
|
|||
public static final String Table_Name = "AD_AlertProcessor";
|
||||
|
||||
/** AD_Table_ID=700 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 700;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -54,6 +54,15 @@ public interface I_AD_AlertProcessor
|
|||
*/
|
||||
public int getAD_AlertProcessor_ID();
|
||||
|
||||
/** Column name AD_AlertProcessor_UU */
|
||||
public static final String COLUMNNAME_AD_AlertProcessor_UU = "AD_AlertProcessor_UU";
|
||||
|
||||
/** Set AD_AlertProcessor_UU */
|
||||
public void setAD_AlertProcessor_UU (String AD_AlertProcessor_UU);
|
||||
|
||||
/** Get AD_AlertProcessor_UU */
|
||||
public String getAD_AlertProcessor_UU();
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
|
@ -75,6 +84,17 @@ public interface I_AD_AlertProcessor
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
|
@ -130,32 +150,6 @@ public interface I_AD_AlertProcessor
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -217,7 +211,7 @@ public interface I_AD_AlertProcessor
|
|||
*/
|
||||
public int getSupervisor_ID();
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException;
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
|
|
@ -0,0 +1,248 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software, you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program, if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
|
||||
/** Generated Interface for AD_Schedule
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS
|
||||
*/
|
||||
public interface I_AD_Schedule
|
||||
{
|
||||
|
||||
/** TableName=AD_Schedule */
|
||||
public static final String Table_Name = "AD_Schedule";
|
||||
|
||||
/** AD_Table_ID=200020 */
|
||||
public static final int Table_ID = 200020;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = - System
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(4);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
/** Column name AD_Client_ID */
|
||||
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
|
||||
|
||||
/** Get Client.
|
||||
* Client/Tenant for this installation.
|
||||
*/
|
||||
public int getAD_Client_ID();
|
||||
|
||||
/** Column name AD_Org_ID */
|
||||
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
|
||||
|
||||
/** Set Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public void setAD_Org_ID (int AD_Org_ID);
|
||||
|
||||
/** Get Organization.
|
||||
* Organizational entity within client
|
||||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
/** Get Created.
|
||||
* Date this record was created
|
||||
*/
|
||||
public Timestamp getCreated();
|
||||
|
||||
/** Column name CreatedBy */
|
||||
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
|
||||
|
||||
/** Get Created By.
|
||||
* User who created this records
|
||||
*/
|
||||
public int getCreatedBy();
|
||||
|
||||
/** Column name CronPattern */
|
||||
public static final String COLUMNNAME_CronPattern = "CronPattern";
|
||||
|
||||
/** Set Cron Scheduling Pattern.
|
||||
* Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public void setCronPattern (String CronPattern);
|
||||
|
||||
/** Get Cron Scheduling Pattern.
|
||||
* Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public String getCronPattern();
|
||||
|
||||
/** Column name Description */
|
||||
public static final String COLUMNNAME_Description = "Description";
|
||||
|
||||
/** Set Description.
|
||||
* Optional short description of the record
|
||||
*/
|
||||
public void setDescription (String Description);
|
||||
|
||||
/** Get Description.
|
||||
* Optional short description of the record
|
||||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
/** Set Active.
|
||||
* The record is active in the system
|
||||
*/
|
||||
public void setIsActive (boolean IsActive);
|
||||
|
||||
/** Get Active.
|
||||
* The record is active in the system
|
||||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name IsIgnoreProcessingTime */
|
||||
public static final String COLUMNNAME_IsIgnoreProcessingTime = "IsIgnoreProcessingTime";
|
||||
|
||||
/** Set Ignore Processing Time.
|
||||
* Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime);
|
||||
|
||||
/** Get Ignore Processing Time.
|
||||
* Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public boolean isIgnoreProcessingTime();
|
||||
|
||||
/** Column name MonthDay */
|
||||
public static final String COLUMNNAME_MonthDay = "MonthDay";
|
||||
|
||||
/** Set Day of the Month.
|
||||
* Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public void setMonthDay (int MonthDay);
|
||||
|
||||
/** Get Day of the Month.
|
||||
* Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public int getMonthDay();
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
/** Set Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name);
|
||||
|
||||
/** Get Name.
|
||||
* Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/** Column name RunOnlyOnIP */
|
||||
public static final String COLUMNNAME_RunOnlyOnIP = "RunOnlyOnIP";
|
||||
|
||||
/** Set RunOnlyOnIP.
|
||||
* Defines the IP address to transfer data to
|
||||
*/
|
||||
public void setRunOnlyOnIP (String RunOnlyOnIP);
|
||||
|
||||
/** Get RunOnlyOnIP.
|
||||
* Defines the IP address to transfer data to
|
||||
*/
|
||||
public String getRunOnlyOnIP();
|
||||
|
||||
/** Column name ScheduleType */
|
||||
public static final String COLUMNNAME_ScheduleType = "ScheduleType";
|
||||
|
||||
/** Set Schedule Type.
|
||||
* Type of schedule
|
||||
*/
|
||||
public void setScheduleType (String ScheduleType);
|
||||
|
||||
/** Get Schedule Type.
|
||||
* Type of schedule
|
||||
*/
|
||||
public String getScheduleType();
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
||||
/** Get Updated.
|
||||
* Date this record was updated
|
||||
*/
|
||||
public Timestamp getUpdated();
|
||||
|
||||
/** Column name UpdatedBy */
|
||||
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
|
||||
|
||||
/** Get Updated By.
|
||||
* User who updated this records
|
||||
*/
|
||||
public int getUpdatedBy();
|
||||
|
||||
/** Column name WeekDay */
|
||||
public static final String COLUMNNAME_WeekDay = "WeekDay";
|
||||
|
||||
/** Set Day of the Week.
|
||||
* Day of the Week
|
||||
*/
|
||||
public void setWeekDay (String WeekDay);
|
||||
|
||||
/** Get Day of the Week.
|
||||
* Day of the Week
|
||||
*/
|
||||
public String getWeekDay();
|
||||
}
|
|
@ -77,6 +77,17 @@ public interface I_AD_Scheduler
|
|||
|
||||
public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Scheduler_ID */
|
||||
public static final String COLUMNNAME_AD_Scheduler_ID = "AD_Scheduler_ID";
|
||||
|
||||
|
@ -90,6 +101,15 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public int getAD_Scheduler_ID();
|
||||
|
||||
/** Column name AD_Scheduler_UU */
|
||||
public static final String COLUMNNAME_AD_Scheduler_UU = "AD_Scheduler_UU";
|
||||
|
||||
/** Set AD_Scheduler_UU */
|
||||
public void setAD_Scheduler_UU (String AD_Scheduler_UU);
|
||||
|
||||
/** Get AD_Scheduler_UU */
|
||||
public String getAD_Scheduler_UU();
|
||||
|
||||
/** Column name AD_Table_ID */
|
||||
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
|
||||
|
||||
|
@ -121,19 +141,6 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public int getCreatedBy();
|
||||
|
||||
/** Column name CronPattern */
|
||||
public static final String COLUMNNAME_CronPattern = "CronPattern";
|
||||
|
||||
/** Set Cron Scheduling Pattern.
|
||||
* Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public void setCronPattern (String CronPattern);
|
||||
|
||||
/** Get Cron Scheduling Pattern.
|
||||
* Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public String getCronPattern();
|
||||
|
||||
/** Column name DateLastRun */
|
||||
public static final String COLUMNNAME_DateLastRun = "DateLastRun";
|
||||
|
||||
|
@ -173,32 +180,6 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -212,19 +193,6 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/** Column name IsIgnoreProcessingTime */
|
||||
public static final String COLUMNNAME_IsIgnoreProcessingTime = "IsIgnoreProcessingTime";
|
||||
|
||||
/** Set Ignore Processing Time.
|
||||
* Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime);
|
||||
|
||||
/** Get Ignore Processing Time.
|
||||
* Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public boolean isIgnoreProcessingTime();
|
||||
|
||||
/** Column name KeepLogDays */
|
||||
public static final String COLUMNNAME_KeepLogDays = "KeepLogDays";
|
||||
|
||||
|
@ -238,19 +206,6 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public int getKeepLogDays();
|
||||
|
||||
/** Column name MonthDay */
|
||||
public static final String COLUMNNAME_MonthDay = "MonthDay";
|
||||
|
||||
/** Set Day of the Month.
|
||||
* Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public void setMonthDay (int MonthDay);
|
||||
|
||||
/** Get Day of the Month.
|
||||
* Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public int getMonthDay();
|
||||
|
||||
/** Column name Name */
|
||||
public static final String COLUMNNAME_Name = "Name";
|
||||
|
||||
|
@ -286,19 +241,6 @@ public interface I_AD_Scheduler
|
|||
*/
|
||||
public int getRecord_ID();
|
||||
|
||||
/** Column name ScheduleType */
|
||||
public static final String COLUMNNAME_ScheduleType = "ScheduleType";
|
||||
|
||||
/** Set Schedule Type.
|
||||
* Type of schedule
|
||||
*/
|
||||
public void setScheduleType (String ScheduleType);
|
||||
|
||||
/** Get Schedule Type.
|
||||
* Type of schedule
|
||||
*/
|
||||
public String getScheduleType();
|
||||
|
||||
/** Column name Supervisor_ID */
|
||||
public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID";
|
||||
|
||||
|
@ -329,17 +271,4 @@ public interface I_AD_Scheduler
|
|||
* User who updated this records
|
||||
*/
|
||||
public int getUpdatedBy();
|
||||
|
||||
/** Column name WeekDay */
|
||||
public static final String COLUMNNAME_WeekDay = "WeekDay";
|
||||
|
||||
/** Set Day of the Week.
|
||||
* Day of the Week
|
||||
*/
|
||||
public void setWeekDay (String WeekDay);
|
||||
|
||||
/** Get Day of the Week.
|
||||
* Day of the Week
|
||||
*/
|
||||
public String getWeekDay();
|
||||
}
|
||||
|
|
|
@ -31,13 +31,13 @@ public interface I_AD_WorkflowProcessor
|
|||
public static final String Table_Name = "AD_WorkflowProcessor";
|
||||
|
||||
/** AD_Table_ID=697 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 697;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
/** AccessLevel = 4 - System
|
||||
/** AccessLevel = 6 - System - Client
|
||||
*/
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(4);
|
||||
BigDecimal accessLevel = BigDecimal.valueOf(6);
|
||||
|
||||
/** Load Meta Data */
|
||||
|
||||
|
@ -62,6 +62,17 @@ public interface I_AD_WorkflowProcessor
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException;
|
||||
|
||||
/** Column name AD_WorkflowProcessor_ID */
|
||||
public static final String COLUMNNAME_AD_WorkflowProcessor_ID = "AD_WorkflowProcessor_ID";
|
||||
|
||||
|
@ -75,6 +86,15 @@ public interface I_AD_WorkflowProcessor
|
|||
*/
|
||||
public int getAD_WorkflowProcessor_ID();
|
||||
|
||||
/** Column name AD_WorkflowProcessor_UU */
|
||||
public static final String COLUMNNAME_AD_WorkflowProcessor_UU = "AD_WorkflowProcessor_UU";
|
||||
|
||||
/** Set AD_WorkflowProcessor_UU */
|
||||
public void setAD_WorkflowProcessor_UU (String AD_WorkflowProcessor_UU);
|
||||
|
||||
/** Get AD_WorkflowProcessor_UU */
|
||||
public String getAD_WorkflowProcessor_UU();
|
||||
|
||||
/** Column name AlertOverPriority */
|
||||
public static final String COLUMNNAME_AlertOverPriority = "AlertOverPriority";
|
||||
|
||||
|
@ -143,32 +163,6 @@ public interface I_AD_WorkflowProcessor
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name InactivityAlertDays */
|
||||
public static final String COLUMNNAME_InactivityAlertDays = "InactivityAlertDays";
|
||||
|
||||
|
@ -256,7 +250,7 @@ public interface I_AD_WorkflowProcessor
|
|||
*/
|
||||
public int getSupervisor_ID();
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException;
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_C_AcctProcessor
|
|||
public static final String Table_Name = "C_AcctProcessor";
|
||||
|
||||
/** AD_Table_ID=695 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 695;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -62,6 +62,17 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException;
|
||||
|
||||
/** Column name AD_Table_ID */
|
||||
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
|
||||
|
||||
|
@ -75,7 +86,7 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public int getAD_Table_ID();
|
||||
|
||||
public I_AD_Table getAD_Table() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException;
|
||||
|
||||
/** Column name C_AcctProcessor_ID */
|
||||
public static final String COLUMNNAME_C_AcctProcessor_ID = "C_AcctProcessor_ID";
|
||||
|
@ -90,6 +101,15 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public int getC_AcctProcessor_ID();
|
||||
|
||||
/** Column name C_AcctProcessor_UU */
|
||||
public static final String COLUMNNAME_C_AcctProcessor_UU = "C_AcctProcessor_UU";
|
||||
|
||||
/** Set C_AcctProcessor_UU */
|
||||
public void setC_AcctProcessor_UU (String C_AcctProcessor_UU);
|
||||
|
||||
/** Get C_AcctProcessor_UU */
|
||||
public String getC_AcctProcessor_UU();
|
||||
|
||||
/** Column name C_AcctSchema_ID */
|
||||
public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID";
|
||||
|
||||
|
@ -103,7 +123,7 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public int getC_AcctSchema_ID();
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -160,32 +180,6 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name IsActive */
|
||||
public static final String COLUMNNAME_IsActive = "IsActive";
|
||||
|
||||
|
@ -247,7 +241,7 @@ public interface I_C_AcctProcessor
|
|||
*/
|
||||
public int getSupervisor_ID();
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException;
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface I_R_RequestProcessor
|
|||
public static final String Table_Name = "R_RequestProcessor";
|
||||
|
||||
/** AD_Table_ID=420 */
|
||||
public static final int Table_ID = MTable.getTable_ID(Table_Name);
|
||||
public static final int Table_ID = 420;
|
||||
|
||||
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
|
||||
|
||||
|
@ -62,6 +62,17 @@ public interface I_R_RequestProcessor
|
|||
*/
|
||||
public int getAD_Org_ID();
|
||||
|
||||
/** Column name AD_Schedule_ID */
|
||||
public static final String COLUMNNAME_AD_Schedule_ID = "AD_Schedule_ID";
|
||||
|
||||
/** Set AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID);
|
||||
|
||||
/** Get AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID();
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
||||
|
@ -117,32 +128,6 @@ public interface I_R_RequestProcessor
|
|||
*/
|
||||
public String getDescription();
|
||||
|
||||
/** Column name Frequency */
|
||||
public static final String COLUMNNAME_Frequency = "Frequency";
|
||||
|
||||
/** Set Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency);
|
||||
|
||||
/** Get Frequency.
|
||||
* Frequency of events
|
||||
*/
|
||||
public int getFrequency();
|
||||
|
||||
/** Column name FrequencyType */
|
||||
public static final String COLUMNNAME_FrequencyType = "FrequencyType";
|
||||
|
||||
/** Set Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType);
|
||||
|
||||
/** Get Frequency Type.
|
||||
* Frequency of event
|
||||
*/
|
||||
public String getFrequencyType();
|
||||
|
||||
/** Column name InactivityAlertDays */
|
||||
public static final String COLUMNNAME_InactivityAlertDays = "InactivityAlertDays";
|
||||
|
||||
|
@ -256,6 +241,15 @@ public interface I_R_RequestProcessor
|
|||
*/
|
||||
public int getR_RequestProcessor_ID();
|
||||
|
||||
/** Column name R_RequestProcessor_UU */
|
||||
public static final String COLUMNNAME_R_RequestProcessor_UU = "R_RequestProcessor_UU";
|
||||
|
||||
/** Set R_RequestProcessor_UU */
|
||||
public void setR_RequestProcessor_UU (String R_RequestProcessor_UU);
|
||||
|
||||
/** Get R_RequestProcessor_UU */
|
||||
public String getR_RequestProcessor_UU();
|
||||
|
||||
/** Column name R_RequestType_ID */
|
||||
public static final String COLUMNNAME_R_RequestType_ID = "R_RequestType_ID";
|
||||
|
||||
|
@ -269,7 +263,7 @@ public interface I_R_RequestProcessor
|
|||
*/
|
||||
public int getR_RequestType_ID();
|
||||
|
||||
public I_R_RequestType getR_RequestType() throws RuntimeException;
|
||||
public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException;
|
||||
|
||||
/** Column name Supervisor_ID */
|
||||
public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID";
|
||||
|
@ -284,7 +278,7 @@ public interface I_R_RequestProcessor
|
|||
*/
|
||||
public int getSupervisor_ID();
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException;
|
||||
|
||||
/** Column name Updated */
|
||||
public static final String COLUMNNAME_Updated = "Updated";
|
||||
|
|
|
@ -156,7 +156,7 @@ public interface I_R_RequestProcessorLog
|
|||
*/
|
||||
public int getR_RequestProcessor_ID();
|
||||
|
||||
public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException;
|
||||
public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException;
|
||||
|
||||
/** Column name R_RequestProcessorLog_ID */
|
||||
public static final String COLUMNNAME_R_RequestProcessorLog_ID = "R_RequestProcessorLog_ID";
|
||||
|
|
|
@ -75,7 +75,7 @@ public interface I_R_RequestProcessor_Route
|
|||
*/
|
||||
public int getAD_User_ID();
|
||||
|
||||
public I_AD_User getAD_User() throws RuntimeException;
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
|
||||
|
||||
/** Column name Created */
|
||||
public static final String COLUMNNAME_Created = "Created";
|
||||
|
@ -132,7 +132,7 @@ public interface I_R_RequestProcessor_Route
|
|||
*/
|
||||
public int getR_RequestProcessor_ID();
|
||||
|
||||
public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException;
|
||||
public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException;
|
||||
|
||||
/** Column name R_RequestProcessor_Route_ID */
|
||||
public static final String COLUMNNAME_R_RequestProcessor_Route_ID = "R_RequestProcessor_Route_ID";
|
||||
|
@ -160,7 +160,7 @@ public interface I_R_RequestProcessor_Route
|
|||
*/
|
||||
public int getR_RequestType_ID();
|
||||
|
||||
public I_R_RequestType getR_RequestType() throws RuntimeException;
|
||||
public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException;
|
||||
|
||||
/** Column name SeqNo */
|
||||
public static final String COLUMNNAME_SeqNo = "SeqNo";
|
||||
|
|
|
@ -35,12 +35,14 @@ import org.compiere.util.Msg;
|
|||
* @version $Id: MAcctProcessor.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
|
||||
*/
|
||||
public class MAcctProcessor extends X_C_AcctProcessor
|
||||
implements AdempiereProcessor
|
||||
implements AdempiereProcessor, AdempiereProcessor2
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6558688522646469260L;
|
||||
private static final long serialVersionUID = -7574845047521861399L;
|
||||
|
||||
/**
|
||||
* Get Active
|
||||
|
@ -68,8 +70,8 @@ public class MAcctProcessor extends X_C_AcctProcessor
|
|||
{
|
||||
// setName (null);
|
||||
// setSupervisor_ID (0);
|
||||
setFrequencyType (FREQUENCYTYPE_Hour);
|
||||
setFrequency (1);
|
||||
// setFrequencyType (FREQUENCYTYPE_Hour);
|
||||
// setFrequency (1);
|
||||
setKeepLogDays (7); // 7
|
||||
}
|
||||
} // MAcctProcessor
|
||||
|
@ -153,4 +155,33 @@ public class MAcctProcessor extends X_C_AcctProcessor
|
|||
return no;
|
||||
} // deleteLog
|
||||
|
||||
|
||||
@Override
|
||||
public String getFrequencyType() {
|
||||
int AD_Schedule_ID = this.getAD_Schedule_ID();
|
||||
if( AD_Schedule_ID > 0)
|
||||
{
|
||||
MSchedule schedule=MSchedule.get(getCtx(), AD_Schedule_ID);
|
||||
return schedule.getFrequencyType();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrequency() {
|
||||
int AD_Schedule_ID = this.getAD_Schedule_ID();
|
||||
if( AD_Schedule_ID > 0)
|
||||
{
|
||||
MSchedule schedule=MSchedule.get(getCtx(),AD_Schedule_ID);
|
||||
return schedule.getFrequency();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreProcessingTime() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(),getAD_Schedule_ID());
|
||||
return schedule.isIgnoreProcessingTime();
|
||||
}
|
||||
|
||||
} // MAcctProcessor
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.compiere.util.DB;
|
|||
* @version $Id: MAlertProcessor.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
|
||||
*/
|
||||
public class MAlertProcessor extends X_AD_AlertProcessor
|
||||
implements AdempiereProcessor
|
||||
implements AdempiereProcessor, AdempiereProcessor2
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
@ -162,4 +162,22 @@ public class MAlertProcessor extends X_AD_AlertProcessor
|
|||
return alerts;
|
||||
} // getAlerts
|
||||
|
||||
@Override
|
||||
public int getFrequency() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequency();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrequencyType() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequencyType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreProcessingTime() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.isIgnoreProcessingTime();
|
||||
}
|
||||
|
||||
} // MAlertProcessor
|
||||
|
|
|
@ -203,7 +203,7 @@ public class MLdapProcessor extends X_AD_LdapProcessor implements AdempiereProce
|
|||
*/
|
||||
public String getFrequencyType()
|
||||
{
|
||||
return X_R_RequestProcessor.FREQUENCYTYPE_Minute;
|
||||
return X_AD_Schedule.FREQUENCYTYPE_Minute;
|
||||
} // getFrequencyType
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.compiere.util.Msg;
|
|||
* @version $Id: MRequestProcessor.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
|
||||
*/
|
||||
public class MRequestProcessor extends X_R_RequestProcessor
|
||||
implements AdempiereProcessor
|
||||
implements AdempiereProcessor, AdempiereProcessor2
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
@ -96,8 +96,8 @@ public class MRequestProcessor extends X_R_RequestProcessor
|
|||
if (R_RequestProcessor_ID == 0)
|
||||
{
|
||||
// setName (null);
|
||||
setFrequencyType (FREQUENCYTYPE_Day);
|
||||
setFrequency (0);
|
||||
//setFrequencyType (FREQUENCYTYPE_Day);
|
||||
//setFrequency (0);
|
||||
setKeepLogDays (7);
|
||||
setOverdueAlertDays (0);
|
||||
setOverdueAssignDays (0);
|
||||
|
@ -255,5 +255,23 @@ public class MRequestProcessor extends X_R_RequestProcessor
|
|||
{
|
||||
return "RequestProcessor" + get_ID();
|
||||
} // getServerID
|
||||
|
||||
@Override
|
||||
public String getFrequencyType() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequencyType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrequency() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequency();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreProcessingTime() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.isIgnoreProcessingTime();
|
||||
}
|
||||
|
||||
} // MRequestProcessor
|
||||
|
|
|
@ -0,0 +1,273 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
|
||||
package org.compiere.model;
|
||||
|
||||
import it.sauronsoftware.cron4j.Predictor;
|
||||
import it.sauronsoftware.cron4j.SchedulingPattern;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.compiere.util.DisplayType;
|
||||
|
||||
public class MSchedule extends X_AD_Schedule
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2532063246191430056L;
|
||||
|
||||
private static Pattern VALID_IPV4_PATTERN = null;
|
||||
private static Pattern VALID_IPV6_PATTERN = null;
|
||||
private static final String ipv4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])";
|
||||
private static final String ipv6Pattern = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}";
|
||||
|
||||
private it.sauronsoftware.cron4j.Scheduler cronScheduler;
|
||||
private Predictor predictor;
|
||||
|
||||
public MSchedule(Properties ctx, int AD_Schedule_ID, String trxName) {
|
||||
super(ctx, AD_Schedule_ID, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public MSchedule(Properties ctx, ResultSet rs, String trxName) {
|
||||
super(ctx, rs, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
protected boolean beforeSave()
|
||||
{
|
||||
// Set Schedule Type & Frequencies
|
||||
if (SCHEDULETYPE_Frequency.equals(getScheduleType()))
|
||||
{
|
||||
if (getFrequencyType() == null)
|
||||
setFrequencyType(FREQUENCYTYPE_Day);
|
||||
if (getFrequency() < 1)
|
||||
setFrequency(1);
|
||||
setCronPattern(null);
|
||||
}
|
||||
else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType()))
|
||||
{
|
||||
String pattern = getCronPattern();
|
||||
if (pattern != null && pattern.trim().length() > 0)
|
||||
{
|
||||
if (!SchedulingPattern.validate(pattern))
|
||||
{
|
||||
log.saveError("Error", "InvalidCronPattern");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Brought from Compiere Open Source Community version 3.3.0
|
||||
* Is it OK to Run process On IP of this box
|
||||
* @return
|
||||
*/
|
||||
public boolean isOKtoRunOnIP()
|
||||
{
|
||||
String ipOnly = getRunOnlyOnIP();
|
||||
if ((ipOnly == null) || (ipOnly.length() == 0))
|
||||
return true;
|
||||
|
||||
StringTokenizer st = new StringTokenizer(ipOnly, ";");
|
||||
while (st.hasMoreElements())
|
||||
{
|
||||
String ip = st.nextToken();
|
||||
if (checkIP(ip))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} // isOKtoRunOnIP
|
||||
|
||||
/**
|
||||
*
|
||||
* Brought from Compiere Open Source Community version 3.3.0
|
||||
* check whether this IP is allowed to process
|
||||
* @param ipOnly
|
||||
* @return true if IP is correct
|
||||
*/
|
||||
private boolean checkIP(String ipOnly)
|
||||
{
|
||||
try
|
||||
{
|
||||
InetAddress box = InetAddress.getLocalHost();
|
||||
String ip = box.getHostAddress();
|
||||
if (chekIPFormat()) {
|
||||
if (ipOnly.indexOf(ip) == -1) {
|
||||
|
||||
log.fine("Not allowed here - IP=" + ip + " does not match "+ ipOnly);
|
||||
return false;
|
||||
}
|
||||
log.fine("Allowed here - IP=" + ip + " matches " + ipOnly);
|
||||
}
|
||||
else{
|
||||
String hostname=box.getHostName();
|
||||
if(ipOnly.equals(hostname)){
|
||||
log.fine("Not Allowed here -hostname " + hostname + " does not match "+ipOnly);
|
||||
return false;
|
||||
}
|
||||
log.fine("Allowed here - hostname=" + hostname + " matches " + ipOnly);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} // checkIP
|
||||
|
||||
public static MSchedule get(Properties ctx, int AD_Schedule_ID)
|
||||
{
|
||||
if(AD_Schedule_ID > 0)
|
||||
{
|
||||
MSchedule schedule=new MSchedule(ctx, AD_Schedule_ID, null);
|
||||
return schedule;
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public boolean chekIPFormat()
|
||||
{
|
||||
boolean IsIp = false;
|
||||
try {
|
||||
VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern,Pattern.CASE_INSENSITIVE);
|
||||
VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern,Pattern.CASE_INSENSITIVE);
|
||||
|
||||
Matcher m1 = VALID_IPV4_PATTERN.matcher(getRunOnlyOnIP());
|
||||
if (m1.matches()) {
|
||||
IsIp = true;
|
||||
} else {
|
||||
Matcher m2 = VALID_IPV6_PATTERN.matcher(getRunOnlyOnIP());
|
||||
if (m2.matches()) {
|
||||
IsIp = true;
|
||||
} else {
|
||||
IsIp = false;
|
||||
}
|
||||
}
|
||||
} catch (PatternSyntaxException e) {
|
||||
// TODO: handle exception
|
||||
log.fine("Error: " + e.getLocalizedMessage());
|
||||
}
|
||||
return IsIp;
|
||||
}
|
||||
/**
|
||||
* Brought from Compiere 330
|
||||
* Get Next Run
|
||||
* @param last in MS
|
||||
* @return next run in MS
|
||||
*/
|
||||
public long getNextRunMS (long last)
|
||||
{
|
||||
Calendar calNow = Calendar.getInstance();
|
||||
calNow.setTimeInMillis (last);
|
||||
//
|
||||
Calendar calNext = Calendar.getInstance();
|
||||
calNext.setTimeInMillis (last);
|
||||
|
||||
|
||||
String scheduleType = getScheduleType();
|
||||
if (SCHEDULETYPE_Frequency.equals(scheduleType))
|
||||
{
|
||||
String frequencyType = getFrequencyType();
|
||||
int frequency = getFrequency();
|
||||
|
||||
boolean increment=true;
|
||||
|
||||
|
||||
/***** DAY ******/
|
||||
if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType))
|
||||
{
|
||||
calNext.set (Calendar.HOUR_OF_DAY, 0);
|
||||
calNext.set (Calendar.MINUTE, 0);
|
||||
if(increment)
|
||||
{
|
||||
calNext.add(Calendar.DAY_OF_YEAR, frequency);
|
||||
}
|
||||
} // Day
|
||||
|
||||
/***** HOUR ******/
|
||||
else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType))
|
||||
{
|
||||
calNext.set (Calendar.MINUTE, 0);
|
||||
if(increment)
|
||||
{
|
||||
calNext.add (Calendar.HOUR_OF_DAY, frequency);
|
||||
}
|
||||
|
||||
} // Hour
|
||||
|
||||
/***** MINUTE ******/
|
||||
else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType))
|
||||
{
|
||||
if(increment)
|
||||
{
|
||||
calNext.add(Calendar.MINUTE, frequency);
|
||||
}
|
||||
} // Minute
|
||||
|
||||
long delta = calNext.getTimeInMillis() - calNow.getTimeInMillis();
|
||||
StringBuilder info = new StringBuilder("Now=") .append(calNow.getTime().toString())
|
||||
.append( ", Next=" + calNext.getTime().toString())
|
||||
.append( ", Delta=" + delta)
|
||||
.append( ", " + toString());
|
||||
|
||||
if (delta < 0)
|
||||
{
|
||||
log.warning(info.toString());
|
||||
}
|
||||
else
|
||||
log.info (info.toString());
|
||||
|
||||
return calNext.getTimeInMillis();
|
||||
}
|
||||
else
|
||||
{
|
||||
String cronPattern = (String) getCronPattern();
|
||||
if (cronPattern != null && cronPattern.trim().length() > 0
|
||||
&& SchedulingPattern.validate(cronPattern)) {
|
||||
cronScheduler = new it.sauronsoftware.cron4j.Scheduler();
|
||||
predictor = new Predictor(cronPattern);
|
||||
long next = predictor.nextMatchingTime();
|
||||
return next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
} // getNextRunMS
|
||||
|
||||
}
|
|
@ -72,16 +72,7 @@ public class MScheduler extends X_AD_Scheduler
|
|||
super (ctx, AD_Scheduler_ID, trxName);
|
||||
if (AD_Scheduler_ID == 0)
|
||||
{
|
||||
// setAD_Process_ID (0);
|
||||
// setName (null);
|
||||
setScheduleType (SCHEDULETYPE_Frequency); // F
|
||||
setFrequencyType (FREQUENCYTYPE_Day);
|
||||
// setFrequency (1);
|
||||
// setMonthDay(1);
|
||||
// setWeekDay(WEEKDAY_Monday);
|
||||
//
|
||||
setKeepLogDays (7);
|
||||
// setSupervisor_ID (0);
|
||||
}
|
||||
} // MScheduler
|
||||
|
||||
|
@ -248,27 +239,6 @@ public class MScheduler extends X_AD_Scheduler
|
|||
*/
|
||||
protected boolean beforeSave(boolean newRecord)
|
||||
{
|
||||
// Set Schedule Type & Frequencies
|
||||
if (SCHEDULETYPE_Frequency.equals(getScheduleType()))
|
||||
{
|
||||
if (getFrequencyType() == null)
|
||||
setFrequencyType(FREQUENCYTYPE_Day);
|
||||
if (getFrequency() < 1)
|
||||
setFrequency(1);
|
||||
setCronPattern(null);
|
||||
}
|
||||
else if (SCHEDULETYPE_CronSchedulingPattern.equals(getScheduleType()))
|
||||
{
|
||||
String pattern = getCronPattern();
|
||||
if (pattern != null && pattern.trim().length() > 0)
|
||||
{
|
||||
if (!SchedulingPattern.validate(pattern))
|
||||
{
|
||||
log.saveError("Error", "InvalidCronPattern");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FR [3135351] - Enable Scheduler for buttons
|
||||
if (getAD_Table_ID() > 0) {
|
||||
|
@ -315,4 +285,25 @@ public class MScheduler extends X_AD_Scheduler
|
|||
return sb.toString ();
|
||||
} // toString
|
||||
|
||||
@Override
|
||||
public String getFrequencyType() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
|
||||
return schedule.getFrequencyType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrequency() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequency();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreProcessingTime() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.isIgnoreProcessingTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // MScheduler
|
||||
|
|
|
@ -31,7 +31,7 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_AlertProcessor (Properties ctx, int AD_AlertProcessor_ID, String trxName)
|
||||
|
@ -40,8 +40,6 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe
|
|||
/** if (AD_AlertProcessor_ID == 0)
|
||||
{
|
||||
setAD_AlertProcessor_ID (0);
|
||||
setFrequency (0);
|
||||
setFrequencyType (null);
|
||||
setKeepLogDays (0);
|
||||
// 7
|
||||
setName (null);
|
||||
|
@ -100,6 +98,45 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set AD_AlertProcessor_UU.
|
||||
@param AD_AlertProcessor_UU AD_AlertProcessor_UU */
|
||||
public void setAD_AlertProcessor_UU (String AD_AlertProcessor_UU)
|
||||
{
|
||||
set_Value (COLUMNNAME_AD_AlertProcessor_UU, AD_AlertProcessor_UU);
|
||||
}
|
||||
|
||||
/** Get AD_AlertProcessor_UU.
|
||||
@return AD_AlertProcessor_UU */
|
||||
public String getAD_AlertProcessor_UU ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_AD_AlertProcessor_UU);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name)
|
||||
.getPO(getAD_Schedule_ID(), get_TrxName()); }
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Date last run.
|
||||
@param DateLastRun
|
||||
Date the process was last run.
|
||||
|
@ -151,52 +188,6 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe
|
|||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Days to keep Log.
|
||||
@param KeepLogDays
|
||||
Number of days to keep the log entries
|
||||
|
@ -263,9 +254,9 @@ public class X_AD_AlertProcessor extends PO implements I_AD_AlertProcessor, I_Pe
|
|||
return false;
|
||||
}
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException
|
||||
{
|
||||
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
.getPO(getSupervisor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Supervisor.
|
||||
|
|
|
@ -29,7 +29,7 @@ public class X_AD_AlertProcessorLog extends PO implements I_AD_AlertProcessorLog
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_AlertProcessorLog (Properties ctx, int AD_AlertProcessorLog_ID, String trxName)
|
||||
|
@ -71,9 +71,9 @@ public class X_AD_AlertProcessorLog extends PO implements I_AD_AlertProcessorLog
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public I_AD_AlertProcessor getAD_AlertProcessor() throws RuntimeException
|
||||
public org.compiere.model.I_AD_AlertProcessor getAD_AlertProcessor() throws RuntimeException
|
||||
{
|
||||
return (I_AD_AlertProcessor)MTable.get(getCtx(), I_AD_AlertProcessor.Table_Name)
|
||||
return (org.compiere.model.I_AD_AlertProcessor)MTable.get(getCtx(), org.compiere.model.I_AD_AlertProcessor.Table_Name)
|
||||
.getPO(getAD_AlertProcessor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Alert Processor.
|
||||
|
|
|
@ -0,0 +1,319 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software, you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program, if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
/** Generated Model - DO NOT CHANGE */
|
||||
package org.compiere.model;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
|
||||
/** Generated Model for AD_Schedule
|
||||
* @author Adempiere (generated)
|
||||
* @version Release 3.6.0LTS - $Id$ */
|
||||
public class X_AD_Schedule extends PO implements I_AD_Schedule, I_Persistent
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20120924L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_Schedule (Properties ctx, int AD_Schedule_ID, String trxName)
|
||||
{
|
||||
super (ctx, AD_Schedule_ID, trxName);
|
||||
/** if (AD_Schedule_ID == 0)
|
||||
{
|
||||
} */
|
||||
}
|
||||
|
||||
/** Load Constructor */
|
||||
public X_AD_Schedule (Properties ctx, ResultSet rs, String trxName)
|
||||
{
|
||||
super (ctx, rs, trxName);
|
||||
}
|
||||
|
||||
/** AccessLevel
|
||||
* @return 4 - System
|
||||
*/
|
||||
protected int get_AccessLevel()
|
||||
{
|
||||
return accessLevel.intValue();
|
||||
}
|
||||
|
||||
/** Load Meta Data */
|
||||
protected POInfo initPO (Properties ctx)
|
||||
{
|
||||
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
|
||||
return poi;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer ("X_AD_Schedule[")
|
||||
.append(get_ID()).append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_ValueNoCheck (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_ValueNoCheck (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Get Record ID/ColumnName
|
||||
@return ID/ColumnName pair
|
||||
*/
|
||||
public KeyNamePair getKeyNamePair()
|
||||
{
|
||||
return new KeyNamePair(get_ID(), String.valueOf(getAD_Schedule_ID()));
|
||||
}
|
||||
|
||||
/** Set Cron Scheduling Pattern.
|
||||
@param CronPattern
|
||||
Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public void setCronPattern (String CronPattern)
|
||||
{
|
||||
set_Value (COLUMNNAME_CronPattern, CronPattern);
|
||||
}
|
||||
|
||||
/** Get Cron Scheduling Pattern.
|
||||
@return Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public String getCronPattern ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_CronPattern);
|
||||
}
|
||||
|
||||
/** Set Description.
|
||||
@param Description
|
||||
Optional short description of the record
|
||||
*/
|
||||
public void setDescription (String Description)
|
||||
{
|
||||
set_Value (COLUMNNAME_Description, Description);
|
||||
}
|
||||
|
||||
/** Get Description.
|
||||
@return Optional short description of the record
|
||||
*/
|
||||
public String getDescription ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Ignore Processing Time.
|
||||
@param IsIgnoreProcessingTime
|
||||
Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime)
|
||||
{
|
||||
set_Value (COLUMNNAME_IsIgnoreProcessingTime, Boolean.valueOf(IsIgnoreProcessingTime));
|
||||
}
|
||||
|
||||
/** Get Ignore Processing Time.
|
||||
@return Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public boolean isIgnoreProcessingTime ()
|
||||
{
|
||||
Object oo = get_Value(COLUMNNAME_IsIgnoreProcessingTime);
|
||||
if (oo != null)
|
||||
{
|
||||
if (oo instanceof Boolean)
|
||||
return ((Boolean)oo).booleanValue();
|
||||
return "Y".equals(oo);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Set Day of the Month.
|
||||
@param MonthDay
|
||||
Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public void setMonthDay (int MonthDay)
|
||||
{
|
||||
set_Value (COLUMNNAME_MonthDay, Integer.valueOf(MonthDay));
|
||||
}
|
||||
|
||||
/** Get Day of the Month.
|
||||
@return Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public int getMonthDay ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_MonthDay);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Name.
|
||||
@param Name
|
||||
Alphanumeric identifier of the entity
|
||||
*/
|
||||
public void setName (String Name)
|
||||
{
|
||||
set_ValueNoCheck (COLUMNNAME_Name, Name);
|
||||
}
|
||||
|
||||
/** Get Name.
|
||||
@return Alphanumeric identifier of the entity
|
||||
*/
|
||||
public String getName ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_Name);
|
||||
}
|
||||
|
||||
/** Set RunOnlyOnIP.
|
||||
@param RunOnlyOnIP
|
||||
Defines the IP address to transfer data to
|
||||
*/
|
||||
public void setRunOnlyOnIP (String RunOnlyOnIP)
|
||||
{
|
||||
set_Value (COLUMNNAME_RunOnlyOnIP, RunOnlyOnIP);
|
||||
}
|
||||
|
||||
/** Get RunOnlyOnIP.
|
||||
@return Defines the IP address to transfer data to
|
||||
*/
|
||||
public String getRunOnlyOnIP ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_RunOnlyOnIP);
|
||||
}
|
||||
|
||||
/** ScheduleType AD_Reference_ID=318 */
|
||||
public static final int SCHEDULETYPE_AD_Reference_ID=318;
|
||||
/** Frequency = F */
|
||||
public static final String SCHEDULETYPE_Frequency = "F";
|
||||
/** Week Day = W */
|
||||
public static final String SCHEDULETYPE_WeekDay = "W";
|
||||
/** Month Day = M */
|
||||
public static final String SCHEDULETYPE_MonthDay = "M";
|
||||
/** Cron Scheduling Pattern = C */
|
||||
public static final String SCHEDULETYPE_CronSchedulingPattern = "C";
|
||||
/** Set Schedule Type.
|
||||
@param ScheduleType
|
||||
Type of schedule
|
||||
*/
|
||||
public void setScheduleType (String ScheduleType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_ScheduleType, ScheduleType);
|
||||
}
|
||||
|
||||
/** Get Schedule Type.
|
||||
@return Type of schedule
|
||||
*/
|
||||
public String getScheduleType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_ScheduleType);
|
||||
}
|
||||
|
||||
/** WeekDay AD_Reference_ID=167 */
|
||||
public static final int WEEKDAY_AD_Reference_ID=167;
|
||||
/** Sunday = 7 */
|
||||
public static final String WEEKDAY_Sunday = "7";
|
||||
/** Monday = 1 */
|
||||
public static final String WEEKDAY_Monday = "1";
|
||||
/** Tuesday = 2 */
|
||||
public static final String WEEKDAY_Tuesday = "2";
|
||||
/** Wednesday = 3 */
|
||||
public static final String WEEKDAY_Wednesday = "3";
|
||||
/** Thursday = 4 */
|
||||
public static final String WEEKDAY_Thursday = "4";
|
||||
/** Friday = 5 */
|
||||
public static final String WEEKDAY_Friday = "5";
|
||||
/** Saturday = 6 */
|
||||
public static final String WEEKDAY_Saturday = "6";
|
||||
/** Set Day of the Week.
|
||||
@param WeekDay
|
||||
Day of the Week
|
||||
*/
|
||||
public void setWeekDay (String WeekDay)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_WeekDay, WeekDay);
|
||||
}
|
||||
|
||||
/** Get Day of the Week.
|
||||
@return Day of the Week
|
||||
*/
|
||||
public String getWeekDay ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_WeekDay);
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20110325L;
|
||||
private static final long serialVersionUID = 20120924L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_Scheduler (Properties ctx, int AD_Scheduler_ID, String trxName)
|
||||
|
@ -44,8 +44,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
setKeepLogDays (0);
|
||||
// 7
|
||||
setName (null);
|
||||
setScheduleType (null);
|
||||
// F
|
||||
setSupervisor_ID (0);
|
||||
} */
|
||||
}
|
||||
|
@ -106,6 +104,31 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name)
|
||||
.getPO(getAD_Schedule_ID(), get_TrxName()); }
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Scheduler.
|
||||
@param AD_Scheduler_ID
|
||||
Schedule Processes
|
||||
|
@ -129,6 +152,20 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set AD_Scheduler_UU.
|
||||
@param AD_Scheduler_UU AD_Scheduler_UU */
|
||||
public void setAD_Scheduler_UU (String AD_Scheduler_UU)
|
||||
{
|
||||
set_Value (COLUMNNAME_AD_Scheduler_UU, AD_Scheduler_UU);
|
||||
}
|
||||
|
||||
/** Get AD_Scheduler_UU.
|
||||
@return AD_Scheduler_UU */
|
||||
public String getAD_Scheduler_UU ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_AD_Scheduler_UU);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name)
|
||||
|
@ -157,23 +194,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Cron Scheduling Pattern.
|
||||
@param CronPattern
|
||||
Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public void setCronPattern (String CronPattern)
|
||||
{
|
||||
set_Value (COLUMNNAME_CronPattern, CronPattern);
|
||||
}
|
||||
|
||||
/** Get Cron Scheduling Pattern.
|
||||
@return Cron pattern to define when the process should be invoked.
|
||||
*/
|
||||
public String getCronPattern ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_CronPattern);
|
||||
}
|
||||
|
||||
/** Set Date last run.
|
||||
@param DateLastRun
|
||||
Date the process was last run.
|
||||
|
@ -225,76 +245,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Ignore Processing Time.
|
||||
@param IsIgnoreProcessingTime
|
||||
Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public void setIsIgnoreProcessingTime (boolean IsIgnoreProcessingTime)
|
||||
{
|
||||
set_Value (COLUMNNAME_IsIgnoreProcessingTime, Boolean.valueOf(IsIgnoreProcessingTime));
|
||||
}
|
||||
|
||||
/** Get Ignore Processing Time.
|
||||
@return Do not include processing time for the DateNextRun calculation
|
||||
*/
|
||||
public boolean isIgnoreProcessingTime ()
|
||||
{
|
||||
Object oo = get_Value(COLUMNNAME_IsIgnoreProcessingTime);
|
||||
if (oo != null)
|
||||
{
|
||||
if (oo instanceof Boolean)
|
||||
return ((Boolean)oo).booleanValue();
|
||||
return "Y".equals(oo);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Set Days to keep Log.
|
||||
@param KeepLogDays
|
||||
Number of days to keep the log entries
|
||||
|
@ -315,26 +265,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Day of the Month.
|
||||
@param MonthDay
|
||||
Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public void setMonthDay (int MonthDay)
|
||||
{
|
||||
set_Value (COLUMNNAME_MonthDay, Integer.valueOf(MonthDay));
|
||||
}
|
||||
|
||||
/** Get Day of the Month.
|
||||
@return Day of the month 1 to 28/29/30/31
|
||||
*/
|
||||
public int getMonthDay ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_MonthDay);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Name.
|
||||
@param Name
|
||||
Alphanumeric identifier of the entity
|
||||
|
@ -404,34 +334,6 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** ScheduleType AD_Reference_ID=318 */
|
||||
public static final int SCHEDULETYPE_AD_Reference_ID=318;
|
||||
/** Frequency = F */
|
||||
public static final String SCHEDULETYPE_Frequency = "F";
|
||||
/** Week Day = W */
|
||||
public static final String SCHEDULETYPE_WeekDay = "W";
|
||||
/** Month Day = M */
|
||||
public static final String SCHEDULETYPE_MonthDay = "M";
|
||||
/** Cron Scheduling Pattern = C */
|
||||
public static final String SCHEDULETYPE_CronSchedulingPattern = "C";
|
||||
/** Set Schedule Type.
|
||||
@param ScheduleType
|
||||
Type of schedule
|
||||
*/
|
||||
public void setScheduleType (String ScheduleType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_ScheduleType, ScheduleType);
|
||||
}
|
||||
|
||||
/** Get Schedule Type.
|
||||
@return Type of schedule
|
||||
*/
|
||||
public String getScheduleType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_ScheduleType);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
|
@ -459,38 +361,4 @@ public class X_AD_Scheduler extends PO implements I_AD_Scheduler, I_Persistent
|
|||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** WeekDay AD_Reference_ID=167 */
|
||||
public static final int WEEKDAY_AD_Reference_ID=167;
|
||||
/** Sunday = 7 */
|
||||
public static final String WEEKDAY_Sunday = "7";
|
||||
/** Monday = 1 */
|
||||
public static final String WEEKDAY_Monday = "1";
|
||||
/** Tuesday = 2 */
|
||||
public static final String WEEKDAY_Tuesday = "2";
|
||||
/** Wednesday = 3 */
|
||||
public static final String WEEKDAY_Wednesday = "3";
|
||||
/** Thursday = 4 */
|
||||
public static final String WEEKDAY_Thursday = "4";
|
||||
/** Friday = 5 */
|
||||
public static final String WEEKDAY_Friday = "5";
|
||||
/** Saturday = 6 */
|
||||
public static final String WEEKDAY_Saturday = "6";
|
||||
/** Set Day of the Week.
|
||||
@param WeekDay
|
||||
Day of the Week
|
||||
*/
|
||||
public void setWeekDay (String WeekDay)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_WeekDay, WeekDay);
|
||||
}
|
||||
|
||||
/** Get Day of the Week.
|
||||
@return Day of the Week
|
||||
*/
|
||||
public String getWeekDay ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_WeekDay);
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_AD_WorkflowProcessor (Properties ctx, int AD_WorkflowProcessor_ID, String trxName)
|
||||
|
@ -40,8 +40,6 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
/** if (AD_WorkflowProcessor_ID == 0)
|
||||
{
|
||||
setAD_WorkflowProcessor_ID (0);
|
||||
setFrequency (0);
|
||||
setFrequencyType (null);
|
||||
setKeepLogDays (0);
|
||||
// 7
|
||||
setName (null);
|
||||
|
@ -56,7 +54,7 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
}
|
||||
|
||||
/** AccessLevel
|
||||
* @return 4 - System
|
||||
* @return 6 - System - Client
|
||||
*/
|
||||
protected int get_AccessLevel()
|
||||
{
|
||||
|
@ -77,6 +75,31 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name)
|
||||
.getPO(getAD_Schedule_ID(), get_TrxName()); }
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Workflow Processor.
|
||||
@param AD_WorkflowProcessor_ID
|
||||
Workflow Processor Server
|
||||
|
@ -100,6 +123,20 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set AD_WorkflowProcessor_UU.
|
||||
@param AD_WorkflowProcessor_UU AD_WorkflowProcessor_UU */
|
||||
public void setAD_WorkflowProcessor_UU (String AD_WorkflowProcessor_UU)
|
||||
{
|
||||
set_Value (COLUMNNAME_AD_WorkflowProcessor_UU, AD_WorkflowProcessor_UU);
|
||||
}
|
||||
|
||||
/** Get AD_WorkflowProcessor_UU.
|
||||
@return AD_WorkflowProcessor_UU */
|
||||
public String getAD_WorkflowProcessor_UU ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_AD_WorkflowProcessor_UU);
|
||||
}
|
||||
|
||||
/** Set Alert over Priority.
|
||||
@param AlertOverPriority
|
||||
Send alert email when over priority
|
||||
|
@ -171,52 +208,6 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Inactivity Alert Days.
|
||||
@param InactivityAlertDays
|
||||
Send Alert when there is no activity after days (0= no alert)
|
||||
|
@ -323,9 +314,9 @@ public class X_AD_WorkflowProcessor extends PO implements I_AD_WorkflowProcessor
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException
|
||||
{
|
||||
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
.getPO(getSupervisor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Supervisor.
|
||||
|
|
|
@ -31,7 +31,7 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_C_AcctProcessor (Properties ctx, int C_AcctProcessor_ID, String trxName)
|
||||
|
@ -40,8 +40,6 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
/** if (C_AcctProcessor_ID == 0)
|
||||
{
|
||||
setC_AcctProcessor_ID (0);
|
||||
setFrequency (0);
|
||||
setFrequencyType (null);
|
||||
setKeepLogDays (0);
|
||||
// 7
|
||||
setName (null);
|
||||
|
@ -77,9 +75,34 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public I_AD_Table getAD_Table() throws RuntimeException
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException
|
||||
{
|
||||
return (I_AD_Table)MTable.get(getCtx(), I_AD_Table.Table_Name)
|
||||
return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name)
|
||||
.getPO(getAD_Schedule_ID(), get_TrxName()); }
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name)
|
||||
.getPO(getAD_Table_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Table.
|
||||
|
@ -128,9 +151,23 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public I_C_AcctSchema getC_AcctSchema() throws RuntimeException
|
||||
/** Set C_AcctProcessor_UU.
|
||||
@param C_AcctProcessor_UU C_AcctProcessor_UU */
|
||||
public void setC_AcctProcessor_UU (String C_AcctProcessor_UU)
|
||||
{
|
||||
set_Value (COLUMNNAME_C_AcctProcessor_UU, C_AcctProcessor_UU);
|
||||
}
|
||||
|
||||
/** Get C_AcctProcessor_UU.
|
||||
@return C_AcctProcessor_UU */
|
||||
public String getC_AcctProcessor_UU ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_C_AcctProcessor_UU);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException
|
||||
{
|
||||
return (I_C_AcctSchema)MTable.get(getCtx(), I_C_AcctSchema.Table_Name)
|
||||
return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name)
|
||||
.getPO(getC_AcctSchema_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Accounting Schema.
|
||||
|
@ -207,52 +244,6 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Days to keep Log.
|
||||
@param KeepLogDays
|
||||
Number of days to keep the log entries
|
||||
|
@ -319,9 +310,9 @@ public class X_C_AcctProcessor extends PO implements I_C_AcctProcessor, I_Persis
|
|||
return false;
|
||||
}
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException
|
||||
{
|
||||
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
.getPO(getSupervisor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Supervisor.
|
||||
|
|
|
@ -29,7 +29,7 @@ public class X_C_AcctProcessorLog extends PO implements I_C_AcctProcessorLog, I_
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_C_AcctProcessorLog (Properties ctx, int C_AcctProcessorLog_ID, String trxName)
|
||||
|
@ -88,9 +88,9 @@ public class X_C_AcctProcessorLog extends PO implements I_C_AcctProcessorLog, I_
|
|||
return (byte[])get_Value(COLUMNNAME_BinaryData);
|
||||
}
|
||||
|
||||
public I_C_AcctProcessor getC_AcctProcessor() throws RuntimeException
|
||||
public org.compiere.model.I_C_AcctProcessor getC_AcctProcessor() throws RuntimeException
|
||||
{
|
||||
return (I_C_AcctProcessor)MTable.get(getCtx(), I_C_AcctProcessor.Table_Name)
|
||||
return (org.compiere.model.I_C_AcctProcessor)MTable.get(getCtx(), org.compiere.model.I_C_AcctProcessor.Table_Name)
|
||||
.getPO(getC_AcctProcessor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Accounting Processor.
|
||||
|
|
|
@ -31,7 +31,7 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_R_RequestProcessor (Properties ctx, int R_RequestProcessor_ID, String trxName)
|
||||
|
@ -39,9 +39,6 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
super (ctx, R_RequestProcessor_ID, trxName);
|
||||
/** if (R_RequestProcessor_ID == 0)
|
||||
{
|
||||
setFrequency (0);
|
||||
// 1
|
||||
setFrequencyType (null);
|
||||
setInactivityAlertDays (0);
|
||||
// 0
|
||||
setKeepLogDays (0);
|
||||
|
@ -86,6 +83,31 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public org.compiere.model.I_AD_Schedule getAD_Schedule() throws RuntimeException
|
||||
{
|
||||
return (org.compiere.model.I_AD_Schedule)MTable.get(getCtx(), org.compiere.model.I_AD_Schedule.Table_Name)
|
||||
.getPO(getAD_Schedule_ID(), get_TrxName()); }
|
||||
|
||||
/** Set AD_Schedule_ID.
|
||||
@param AD_Schedule_ID AD_Schedule_ID */
|
||||
public void setAD_Schedule_ID (int AD_Schedule_ID)
|
||||
{
|
||||
if (AD_Schedule_ID < 1)
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, null);
|
||||
else
|
||||
set_Value (COLUMNNAME_AD_Schedule_ID, Integer.valueOf(AD_Schedule_ID));
|
||||
}
|
||||
|
||||
/** Get AD_Schedule_ID.
|
||||
@return AD_Schedule_ID */
|
||||
public int getAD_Schedule_ID ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Schedule_ID);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** Set Date last run.
|
||||
@param DateLastRun
|
||||
Date the process was last run.
|
||||
|
@ -137,52 +159,6 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
return (String)get_Value(COLUMNNAME_Description);
|
||||
}
|
||||
|
||||
/** Set Frequency.
|
||||
@param Frequency
|
||||
Frequency of events
|
||||
*/
|
||||
public void setFrequency (int Frequency)
|
||||
{
|
||||
set_Value (COLUMNNAME_Frequency, Integer.valueOf(Frequency));
|
||||
}
|
||||
|
||||
/** Get Frequency.
|
||||
@return Frequency of events
|
||||
*/
|
||||
public int getFrequency ()
|
||||
{
|
||||
Integer ii = (Integer)get_Value(COLUMNNAME_Frequency);
|
||||
if (ii == null)
|
||||
return 0;
|
||||
return ii.intValue();
|
||||
}
|
||||
|
||||
/** FrequencyType AD_Reference_ID=221 */
|
||||
public static final int FREQUENCYTYPE_AD_Reference_ID=221;
|
||||
/** Minute = M */
|
||||
public static final String FREQUENCYTYPE_Minute = "M";
|
||||
/** Hour = H */
|
||||
public static final String FREQUENCYTYPE_Hour = "H";
|
||||
/** Day = D */
|
||||
public static final String FREQUENCYTYPE_Day = "D";
|
||||
/** Set Frequency Type.
|
||||
@param FrequencyType
|
||||
Frequency of event
|
||||
*/
|
||||
public void setFrequencyType (String FrequencyType)
|
||||
{
|
||||
|
||||
set_Value (COLUMNNAME_FrequencyType, FrequencyType);
|
||||
}
|
||||
|
||||
/** Get Frequency Type.
|
||||
@return Frequency of event
|
||||
*/
|
||||
public String getFrequencyType ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_FrequencyType);
|
||||
}
|
||||
|
||||
/** Set Inactivity Alert Days.
|
||||
@param InactivityAlertDays
|
||||
Send Alert when there is no activity after days (0= no alert)
|
||||
|
@ -352,9 +328,23 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public I_R_RequestType getR_RequestType() throws RuntimeException
|
||||
/** Set R_RequestProcessor_UU.
|
||||
@param R_RequestProcessor_UU R_RequestProcessor_UU */
|
||||
public void setR_RequestProcessor_UU (String R_RequestProcessor_UU)
|
||||
{
|
||||
set_Value (COLUMNNAME_R_RequestProcessor_UU, R_RequestProcessor_UU);
|
||||
}
|
||||
|
||||
/** Get R_RequestProcessor_UU.
|
||||
@return R_RequestProcessor_UU */
|
||||
public String getR_RequestProcessor_UU ()
|
||||
{
|
||||
return (String)get_Value(COLUMNNAME_R_RequestProcessor_UU);
|
||||
}
|
||||
|
||||
public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException
|
||||
{
|
||||
return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.Table_Name)
|
||||
return (org.compiere.model.I_R_RequestType)MTable.get(getCtx(), org.compiere.model.I_R_RequestType.Table_Name)
|
||||
.getPO(getR_RequestType_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Request Type.
|
||||
|
@ -380,9 +370,9 @@ public class X_R_RequestProcessor extends PO implements I_R_RequestProcessor, I_
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public I_AD_User getSupervisor() throws RuntimeException
|
||||
public org.compiere.model.I_AD_User getSupervisor() throws RuntimeException
|
||||
{
|
||||
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
.getPO(getSupervisor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Supervisor.
|
||||
|
|
|
@ -29,7 +29,7 @@ public class X_R_RequestProcessorLog extends PO implements I_R_RequestProcessorL
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_R_RequestProcessorLog (Properties ctx, int R_RequestProcessorLog_ID, String trxName)
|
||||
|
@ -146,9 +146,9 @@ public class X_R_RequestProcessorLog extends PO implements I_R_RequestProcessorL
|
|||
return (String)get_Value(COLUMNNAME_Reference);
|
||||
}
|
||||
|
||||
public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException
|
||||
public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException
|
||||
{
|
||||
return (I_R_RequestProcessor)MTable.get(getCtx(), I_R_RequestProcessor.Table_Name)
|
||||
return (org.compiere.model.I_R_RequestProcessor)MTable.get(getCtx(), org.compiere.model.I_R_RequestProcessor.Table_Name)
|
||||
.getPO(getR_RequestProcessor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Request Processor.
|
||||
|
|
|
@ -30,7 +30,7 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 20100614L;
|
||||
private static final long serialVersionUID = 20120920L;
|
||||
|
||||
/** Standard Constructor */
|
||||
public X_R_RequestProcessor_Route (Properties ctx, int R_RequestProcessor_Route_ID, String trxName)
|
||||
|
@ -73,9 +73,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public I_AD_User getAD_User() throws RuntimeException
|
||||
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
|
||||
{
|
||||
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
|
||||
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
|
||||
.getPO(getAD_User_ID(), get_TrxName()); }
|
||||
|
||||
/** Set User/Contact.
|
||||
|
@ -118,9 +118,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess
|
|||
return (String)get_Value(COLUMNNAME_Keyword);
|
||||
}
|
||||
|
||||
public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException
|
||||
public org.compiere.model.I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException
|
||||
{
|
||||
return (I_R_RequestProcessor)MTable.get(getCtx(), I_R_RequestProcessor.Table_Name)
|
||||
return (org.compiere.model.I_R_RequestProcessor)MTable.get(getCtx(), org.compiere.model.I_R_RequestProcessor.Table_Name)
|
||||
.getPO(getR_RequestProcessor_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Request Processor.
|
||||
|
@ -169,9 +169,9 @@ public class X_R_RequestProcessor_Route extends PO implements I_R_RequestProcess
|
|||
return ii.intValue();
|
||||
}
|
||||
|
||||
public I_R_RequestType getR_RequestType() throws RuntimeException
|
||||
public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException
|
||||
{
|
||||
return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.Table_Name)
|
||||
return (org.compiere.model.I_R_RequestType)MTable.get(getCtx(), org.compiere.model.I_R_RequestType.Table_Name)
|
||||
.getPO(getR_RequestType_ID(), get_TrxName()); }
|
||||
|
||||
/** Set Request Type.
|
||||
|
|
|
@ -22,7 +22,9 @@ import java.util.List;
|
|||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.AdempiereProcessor;
|
||||
import org.compiere.model.AdempiereProcessor2;
|
||||
import org.compiere.model.AdempiereProcessorLog;
|
||||
import org.compiere.model.MSchedule;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.model.X_AD_WorkflowProcessor;
|
||||
import org.compiere.util.DB;
|
||||
|
@ -35,7 +37,7 @@ import org.compiere.util.DB;
|
|||
* @version $Id: MWorkflowProcessor.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
|
||||
*/
|
||||
public class MWorkflowProcessor extends X_AD_WorkflowProcessor
|
||||
implements AdempiereProcessor
|
||||
implements AdempiereProcessor,AdempiereProcessor2
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
@ -132,4 +134,25 @@ public class MWorkflowProcessor extends X_AD_WorkflowProcessor
|
|||
return no;
|
||||
} // deleteLog
|
||||
|
||||
|
||||
@Override
|
||||
public String getFrequencyType() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequencyType();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getFrequency() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.getFrequency();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isIgnoreProcessingTime() {
|
||||
MSchedule schedule=MSchedule.get(getCtx(), getAD_Schedule_ID());
|
||||
return schedule.isIgnoreProcessingTime();
|
||||
}
|
||||
|
||||
} // MWorkflowProcessor
|
||||
|
|
|
@ -26,11 +26,13 @@ import java.util.List;
|
|||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.acct.DocManager;
|
||||
import org.compiere.model.AdempiereProcessor2;
|
||||
import org.compiere.model.MAcctProcessor;
|
||||
import org.compiere.model.MAcctProcessorLog;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MCost;
|
||||
import org.compiere.model.MSchedule;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
@ -42,7 +44,7 @@ import org.compiere.util.TimeUtil;
|
|||
* @author Jorg Janke
|
||||
* @version $Id: AcctProcessor.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
||||
*/
|
||||
public class AcctProcessor extends AdempiereServer
|
||||
public class AcctProcessor extends AdempiereServer
|
||||
{
|
||||
/**
|
||||
* Accounting Processor
|
||||
|
@ -243,4 +245,5 @@ public class AcctProcessor extends AdempiereServer
|
|||
return "#" + p_runCount + " - Last=" + m_summary.toString();
|
||||
} // getServerInfo
|
||||
|
||||
|
||||
} // AcctProcessor
|
||||
|
|
|
@ -29,8 +29,10 @@ import org.compiere.model.MAlertProcessor;
|
|||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MLdapProcessor;
|
||||
import org.compiere.model.MRequestProcessor;
|
||||
import org.compiere.model.MSchedule;
|
||||
import org.compiere.model.MScheduler;
|
||||
import org.compiere.model.MSystem;
|
||||
import org.compiere.model.X_AD_Schedule;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.TimeUtil;
|
||||
|
@ -42,7 +44,7 @@ import org.compiere.wf.MWorkflowProcessor;
|
|||
* @author Jorg Janke
|
||||
* @version $Id: AdempiereServer.java,v 1.3 2006/10/09 00:23:26 jjanke Exp $
|
||||
*/
|
||||
public abstract class AdempiereServer extends Thread
|
||||
public abstract class AdempiereServer extends Thread
|
||||
{
|
||||
/**
|
||||
* Create New Server Thead
|
||||
|
@ -190,7 +192,24 @@ public abstract class AdempiereServer extends Thread
|
|||
* Run async
|
||||
*/
|
||||
public void run ()
|
||||
{
|
||||
{
|
||||
|
||||
if(p_model instanceof AdempiereProcessor2)
|
||||
{
|
||||
AdempiereProcessor2 model=(AdempiereProcessor2) p_model;
|
||||
int AD_Schedule_ID = model.getAD_Schedule_ID();
|
||||
MSchedule schedule = null;
|
||||
if (AD_Schedule_ID != 0)
|
||||
{
|
||||
schedule = MSchedule.get (getCtx(), AD_Schedule_ID);
|
||||
if (!schedule.isOKtoRunOnIP())
|
||||
{
|
||||
log.warning (getName() + ": Stopped - IP Restriction " + schedule);
|
||||
return; // done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
log.fine(getName() + ": pre-nap - " + m_initialNap);
|
||||
|
@ -234,7 +253,7 @@ public abstract class AdempiereServer extends Thread
|
|||
m_runLastMS = now - p_startWork;
|
||||
m_runTotalMS += m_runLastMS;
|
||||
//
|
||||
m_sleepMS = calculateSleep();
|
||||
m_sleepMS = calculateSleep(m_start);
|
||||
Timestamp lastRun = new Timestamp(now);
|
||||
if (p_model instanceof AdempiereProcessor2)
|
||||
{
|
||||
|
@ -344,7 +363,7 @@ public abstract class AdempiereServer extends Thread
|
|||
* Calculate Sleep ms
|
||||
* @return miliseconds
|
||||
*/
|
||||
private long calculateSleep ()
|
||||
private long calculateSleep (long now)
|
||||
{
|
||||
String frequencyType = p_model.getFrequencyType();
|
||||
int frequency = p_model.getFrequency();
|
||||
|
@ -354,14 +373,32 @@ public abstract class AdempiereServer extends Thread
|
|||
long typeSec = 600; // 10 minutes
|
||||
if (frequencyType == null)
|
||||
typeSec = 300; // 5 minutes
|
||||
else if (MRequestProcessor.FREQUENCYTYPE_Minute.equals(frequencyType))
|
||||
else if (X_AD_Schedule.FREQUENCYTYPE_Minute.equals(frequencyType))
|
||||
typeSec = 60;
|
||||
else if (MRequestProcessor.FREQUENCYTYPE_Hour.equals(frequencyType))
|
||||
else if (X_AD_Schedule.FREQUENCYTYPE_Hour.equals(frequencyType))
|
||||
typeSec = 3600;
|
||||
else if (MRequestProcessor.FREQUENCYTYPE_Day.equals(frequencyType))
|
||||
else if (X_AD_Schedule.FREQUENCYTYPE_Day.equals(frequencyType))
|
||||
typeSec = 86400;
|
||||
//
|
||||
return typeSec * 1000 * frequency; // ms
|
||||
long sleep= typeSec * 1000 * frequency;
|
||||
|
||||
if (p_model instanceof AdempiereProcessor2)
|
||||
{
|
||||
AdempiereProcessor2 model=(AdempiereProcessor2) p_model;
|
||||
if (model.getAD_Schedule_ID() == 0)
|
||||
return sleep;
|
||||
|
||||
// Calculate Schedule
|
||||
MSchedule schedule = MSchedule.get(getCtx(),model.getAD_Schedule_ID());
|
||||
long next = schedule.getNextRunMS(now);
|
||||
long delta = next - now;
|
||||
if (delta < 0) {
|
||||
log.warning("Negative Delta=" + delta + " - set to " + sleep);
|
||||
delta = sleep;
|
||||
}
|
||||
return delta;
|
||||
}
|
||||
return sleep;
|
||||
} // calculateSleep
|
||||
|
||||
/**
|
||||
|
|
|
@ -103,10 +103,11 @@ public class AdempiereServerMgr
|
|||
* Start Environment
|
||||
* @return true if started
|
||||
*/
|
||||
private boolean startServers()
|
||||
public boolean startServers()
|
||||
{
|
||||
log.info("");
|
||||
int noServers = 0;
|
||||
m_servers=new ArrayList<AdempiereServer>();
|
||||
// Accounting
|
||||
MAcctProcessor[] acctModels = MAcctProcessor.getActive(m_ctx);
|
||||
for (int i = 0; i < acctModels.length; i++)
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.compiere.model.MPInstance;
|
|||
import org.compiere.model.MPInstancePara;
|
||||
import org.compiere.model.MProcess;
|
||||
import org.compiere.model.MRole;
|
||||
import org.compiere.model.MSchedule;
|
||||
import org.compiere.model.MScheduler;
|
||||
import org.compiere.model.MSchedulerLog;
|
||||
import org.compiere.model.MSchedulerPara;
|
||||
|
@ -422,33 +423,39 @@ public class Scheduler extends AdempiereServer
|
|||
} // getServerInfo
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String cronPattern = (String) m_model.getCronPattern();
|
||||
if (cronPattern != null && cronPattern.trim().length() > 0 && SchedulingPattern.validate(cronPattern)) {
|
||||
cronScheduler = new it.sauronsoftware.cron4j.Scheduler();
|
||||
cronScheduler.schedule(cronPattern, new Runnable() {
|
||||
public void run() {
|
||||
runNow();
|
||||
long next = predictor.nextMatchingTime();
|
||||
p_model.setDateNextRun(new Timestamp(next));
|
||||
p_model.saveEx();
|
||||
}
|
||||
});
|
||||
predictor = new Predictor(cronPattern);
|
||||
long next = predictor.nextMatchingTime();
|
||||
p_model.setDateNextRun(new Timestamp(next));
|
||||
p_model.saveEx();
|
||||
cronScheduler.start();
|
||||
while (true) {
|
||||
if (!sleep()) {
|
||||
cronScheduler.stop();
|
||||
break;
|
||||
} else if (!cronScheduler.isStarted()) {
|
||||
break;
|
||||
public void run()
|
||||
{
|
||||
if (m_model.getAD_Schedule_ID() > 0)
|
||||
{
|
||||
MSchedule time = new MSchedule(getCtx(),m_model.getAD_Schedule_ID(), null);
|
||||
String cronPattern = (String) time.getCronPattern();
|
||||
if (cronPattern != null && cronPattern.trim().length() > 0
|
||||
&& SchedulingPattern.validate(cronPattern)) {
|
||||
cronScheduler = new it.sauronsoftware.cron4j.Scheduler();
|
||||
cronScheduler.schedule(cronPattern, new Runnable() {
|
||||
public void run() {
|
||||
runNow();
|
||||
long next = predictor.nextMatchingTime();
|
||||
p_model.setDateNextRun(new Timestamp(next));
|
||||
p_model.saveEx();
|
||||
}
|
||||
});
|
||||
predictor = new Predictor(cronPattern);
|
||||
long next = predictor.nextMatchingTime();
|
||||
p_model.setDateNextRun(new Timestamp(next));
|
||||
p_model.saveEx();
|
||||
cronScheduler.start();
|
||||
while (true) {
|
||||
if (!sleep()) {
|
||||
cronScheduler.stop();
|
||||
break;
|
||||
} else if (!cronScheduler.isStarted()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.run();
|
||||
}
|
||||
} else {
|
||||
super.run();
|
||||
}
|
||||
}
|
||||
} // Scheduler
|
||||
|
|
|
@ -25,12 +25,15 @@ import java.lang.management.MemoryMXBean;
|
|||
import java.lang.management.RuntimeMXBean;
|
||||
import java.lang.management.ThreadMXBean;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -62,6 +65,7 @@ import org.compiere.model.MClient;
|
|||
import org.compiere.model.MStore;
|
||||
import org.compiere.model.MSystem;
|
||||
import org.compiere.server.AdempiereServer;
|
||||
import org.compiere.server.AdempiereServerGroup;
|
||||
import org.compiere.server.AdempiereServerMgr;
|
||||
import org.compiere.util.CLogFile;
|
||||
import org.compiere.util.CLogMgt;
|
||||
|
@ -139,12 +143,12 @@ public class AdempiereMonitor extends HttpServlet
|
|||
if (processRunNowParameter (request))
|
||||
;
|
||||
else
|
||||
processActionParameter (request);
|
||||
processActionParameter (request,response);
|
||||
|
||||
if (xmlOutput)
|
||||
createXMLSummaryPage(request, response);
|
||||
else
|
||||
createSummaryPage(request, response);
|
||||
createSummaryPage(request, response,false);
|
||||
} // doGet
|
||||
|
||||
/**
|
||||
|
@ -265,7 +269,7 @@ public class AdempiereMonitor extends HttpServlet
|
|||
* Process Action Parameter
|
||||
* @param request request
|
||||
*/
|
||||
private void processActionParameter (HttpServletRequest request)
|
||||
private void processActionParameter (HttpServletRequest request,HttpServletResponse response)
|
||||
{
|
||||
String action = WebUtil.getParameter (request, "Action");
|
||||
if (action == null || action.length() == 0)
|
||||
|
@ -274,6 +278,7 @@ public class AdempiereMonitor extends HttpServlet
|
|||
try
|
||||
{
|
||||
boolean start = action.startsWith("Start");
|
||||
boolean refresh=action.startsWith("Refresh");
|
||||
m_message = new p();
|
||||
String msg = (start ? "Started" : "Stopped") + ": ";
|
||||
m_message.addElement(new strong(msg));
|
||||
|
@ -283,28 +288,36 @@ public class AdempiereMonitor extends HttpServlet
|
|||
if (serverID.equals("All"))
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
ok = m_serverMgr.startAll();
|
||||
else
|
||||
} else{
|
||||
ok = m_serverMgr.stopAll();
|
||||
}
|
||||
|
||||
m_message.addElement("All");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdempiereServer server = m_serverMgr.getServer(serverID);
|
||||
if (server == null)
|
||||
{
|
||||
m_message = new p();
|
||||
m_message.addElement(new strong("Server not found: "));
|
||||
m_message.addElement(serverID);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (start)
|
||||
ok = m_serverMgr.start (serverID);
|
||||
else
|
||||
ok = m_serverMgr.stop (serverID);
|
||||
m_message.addElement(server.getName());
|
||||
if (refresh)
|
||||
{
|
||||
m_serverMgr.stopAll();
|
||||
ok=m_serverMgr.startServers();
|
||||
this.createSummaryPage(request, response,true);
|
||||
|
||||
} else {
|
||||
AdempiereServer server = m_serverMgr.getServer(serverID);
|
||||
if (server == null) {
|
||||
m_message = new p();
|
||||
m_message.addElement(new strong("Server not found: "));
|
||||
m_message.addElement(serverID);
|
||||
return;
|
||||
} else {
|
||||
if (start)
|
||||
ok = m_serverMgr.start(serverID);
|
||||
else
|
||||
ok = m_serverMgr.stop(serverID);
|
||||
m_message.addElement(server.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
m_message.addElement(ok ? " - OK" : " - Error!");
|
||||
|
@ -517,15 +530,17 @@ public class AdempiereMonitor extends HttpServlet
|
|||
* @throws ServletException
|
||||
* @throws IOException
|
||||
*/
|
||||
private void createSummaryPage (HttpServletRequest request, HttpServletResponse response)
|
||||
private void createSummaryPage (HttpServletRequest request, HttpServletResponse response,boolean refresh)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
WebDoc doc = WebDoc.create ("Adempiere Server Monitor");
|
||||
// log.info("ServletConfig=" + getServletConfig());
|
||||
// AdempiereServerGroup.get().dump();
|
||||
AdempiereServerGroup.get().dump();
|
||||
|
||||
// Body
|
||||
body bb = doc.getBody();
|
||||
body bb=new body();
|
||||
bb = doc.getBody();
|
||||
|
||||
// Message
|
||||
if (m_message != null)
|
||||
{
|
||||
|
@ -574,11 +589,11 @@ public class AdempiereMonitor extends HttpServlet
|
|||
link = new a ("adempiereMonitor?Action=Stop_All", "Stop All");
|
||||
para.addElement(link);
|
||||
para.addElement(" - ");
|
||||
link = new a ("adempiereMonitor", "Refresh");
|
||||
link = new a ("adempiereMonitor?Action=Refresh", "Refresh");
|
||||
para.addElement(link);
|
||||
bb.addElement(para);
|
||||
|
||||
// ***** Server Links *****
|
||||
// ***** Server Links *****
|
||||
bb.addElement(new hr());
|
||||
para = new p();
|
||||
AdempiereServer[] servers = m_serverMgr.getAll();
|
||||
|
@ -602,6 +617,7 @@ public class AdempiereMonitor extends HttpServlet
|
|||
createLogMgtPage(bb);
|
||||
|
||||
// ***** Server Details *****
|
||||
bb.removeEndEndModifier();
|
||||
for (int i = 0; i < servers.length; i++)
|
||||
{
|
||||
AdempiereServer server = servers[i];
|
||||
|
|
Loading…
Reference in New Issue