KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > request > RequestProcessorVO


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2002 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.request;
15
16 import java.sql.*;
17 import java.util.*;
18
19 import org.apache.log4j.Logger;
20 import org.compiere.util.*;
21
22 /**
23  * Request Value Object
24  *
25  * @author Jorg Janke
26  * @version $Id: RequestProcessorVO.java,v 1.2 2003/06/20 14:44:50 jjanke Exp $
27  */

28 public class RequestProcessorVO
29 {
30     /**
31      * Get Request Processor Definitions (Value Object).
32      *
33      * @return Array of Request Processors
34      */

35     public static RequestProcessorVO[] get ()
36     {
37         String JavaDoc sql = "SELECT rp.R_RequestProcessor_ID, rp.AD_Client_ID, rp.Name," // 1..3
38
+ " rp.FrequencyType, rp.Frequency, rp.DateNextRun," // 4..6
39
+ " rp.OverdueAlertDays, rp.OverdueAssignDays," // 7..8
40
+ " c.SMTPHost, c.RequestEMail," // 9..10
41
+ " c.RequestUser, c.RequestUserPW, c.RequestFolder, " // 11..13
42
+ " c.AD_Language, rp.Supervisor_ID " // 14..15
43
+ "FROM R_RequestProcessor rp, AD_Client c "
44             + "WHERE rp.AD_Client_ID=c.AD_Client_ID"
45             + " AND rp.IsActive='Y'";
46
47         ArrayList list = new ArrayList();
48         try
49         {
50             PreparedStatement pstmt = DB.prepareStatement(sql);
51             ResultSet rs = pstmt.executeQuery();
52             while (rs.next())
53             {
54                 RequestProcessorVO vo = new RequestProcessorVO (
55                     rs.getInt(1), rs.getInt(2), rs.getString(3),
56                     rs.getString(4), rs.getInt(5), rs.getTimestamp(6),
57                     rs.getInt(7), rs.getInt(8),
58                     rs.getString(9), rs.getString(10),
59                     rs.getString(11), rs.getString(12), rs.getString(13),
60                     rs.getString(14), rs.getInt(15));
61                 list.add(vo);
62             }
63             rs.close();
64             pstmt.close();
65         }
66         catch (SQLException e)
67         {
68             log.error("get", e);
69         }
70         //
71
RequestProcessorVO[] retValue = new RequestProcessorVO[list.size()];
72         list.toArray(retValue);
73         return retValue;
74     } // get
75

76     /*************************************************************************/
77
78     /** Logger */
79     private static Logger log = Logger.getLogger(RequestProcessorVO.class);
80
81
82     public static final String JavaDoc FREQUENCY_DAY = "D";
83     public static final String JavaDoc FREQUENCY_HOUR = "H";
84     public static final String JavaDoc FREQUENCY_MINUTE = "M";
85
86
87     /*************************************************************************/
88
89     /**
90      * Value Object Constructor
91      *
92      * @param R_RequestProcessor_ID id
93      * @param AD_Client_ID client
94      * @param Name name
95      * @param FrequencyType frequency type
96      * @param Frequency frequency
97      * @param DateNextRun next run
98      * @param OverdueAlertDays overdue alert days
99      * @param OverdueAssignDays overdue assign days
100      * @param SMTPHost SMTP host
101      * @param RequestEMail mail id
102      * @param RequestUser user id
103      * @param RequestUserPW user password
104      * @param RequestFolder folder
105      * @param AD_Language language
106      * @param Supervisor_ID ultimate supervisor
107      */

108     public RequestProcessorVO (int R_RequestProcessor_ID, int AD_Client_ID, String JavaDoc Name,
109         String JavaDoc FrequencyType, int Frequency, Timestamp DateNextRun,
110         int OverdueAlertDays, int OverdueAssignDays,
111         String JavaDoc SMTPHost, String JavaDoc RequestEMail,
112         String JavaDoc RequestUser, String JavaDoc RequestUserPW, String JavaDoc RequestFolder,
113         String JavaDoc AD_Language, int Supervisor_ID)
114     {
115         this.R_RequestProcessor_ID = R_RequestProcessor_ID;
116         this.AD_Client_ID = AD_Client_ID;
117         this.Name = Name;
118         this.FrequencyType = FrequencyType;
119         this.Frequency = Frequency;
120         this.DateNextRun = DateNextRun;
121         this.OverdueAlertDays = OverdueAlertDays;
122         this.OverdueAssignDays = OverdueAssignDays;
123         this.SMTPHost = SMTPHost;
124         this.RequestEMail = RequestEMail;
125         this.RequestUser = RequestUser;
126         this.RequestUserPW = RequestUserPW;
127         this.RequestFolder = RequestFolder;
128         this.AD_Language = AD_Language;
129         this.Supervisor_ID = Supervisor_ID;
130     } // RequestProcessorVO
131

132     int R_RequestProcessor_ID;
133     int AD_Client_ID;
134     String JavaDoc Name;
135     String JavaDoc FrequencyType;
136     int Frequency;
137     Timestamp DateNextRun;
138     int OverdueAlertDays;
139     int OverdueAssignDays;
140     String JavaDoc SMTPHost;
141     String JavaDoc RequestEMail;
142     String JavaDoc RequestUser;
143     String JavaDoc RequestUserPW;
144     String JavaDoc RequestFolder;
145     String JavaDoc AD_Language;
146     int Supervisor_ID;
147
148 } // RequestProcessorVO
149
Popular Tags