KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > acct > AcctServerWork


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.acct;
15
16 /**
17  * Acct Work Queue Element
18  *
19  * @author Jorg Janke
20  * @version $Id: AcctServerWork.java,v 1.1 2002/11/17 00:51:49 jjanke Exp $
21  */

22 class AcctServerWork
23 {
24     /**
25      * Constructor
26      * @param AD_Client_ID client
27      * @param AD_Table_ID table
28      */

29     public AcctServerWork (int AD_Client_ID, int AD_Table_ID)
30     {
31         m_AD_Client_ID = AD_Client_ID;
32         m_AD_Table_ID = AD_Table_ID;
33     } // AcctServerWork
34

35     private int m_AD_Client_ID;
36     private int m_AD_Table_ID;
37
38     private int m_noRuns = 0;
39     private int m_noSleeps = 0;
40
41     private int m_noOK = 0;
42     private int m_noFAIL = 0;
43     private int m_noTotalOK = 0;
44     private int m_noTotalFAIL = 0;
45
46     /**
47      * Get AD_Client_ID
48      * @return AD_Client_ID
49      */

50     public int get_AD_Client_ID()
51     {
52         return m_AD_Client_ID;
53     } // getAD_Client_ID
54

55     /**
56      * Get AD_Table_ID
57      * @return AD_Table_ID
58      */

59     public int get_AD_Table_ID()
60     {
61         return m_AD_Table_ID;
62     } // getAD_Table_ID
63

64     /**
65      * Add new Run
66      */

67     public void addRun()
68     {
69         m_noRuns++;
70         m_noOK = 0;
71         m_noFAIL = 0;
72     } // addRun
73

74     /**
75      * Add new Sleep
76      */

77     public void addSleep()
78     {
79         m_noSleeps++;
80     } // addSleep
81

82     /**
83      * Add Post
84      * @param ok ok
85      */

86     public void addPost (boolean ok)
87     {
88         if (ok)
89         {
90             m_noTotalOK++;
91             m_noOK++;
92         }
93         else
94         {
95             m_noTotalFAIL++;
96             m_noFAIL++;
97         }
98     } // addPost
99

100     /**
101      * Get Trx in run
102      * @return no OK trx
103      */

104     public int getTrxInRun()
105     {
106         return m_noOK; // + m_noFAIL;
107
} // getTrxInRun
108

109     /**
110      * String Representation
111      * @return String rep
112      */

113     public String JavaDoc toString()
114     {
115         return "AcctServerWork[AD_Client_ID=" + m_AD_Client_ID + ",AD_Table_ID=" + m_AD_Table_ID
116             + " - Run#=" + m_noRuns + ",Sleep#=" + m_noSleeps
117             + " - Last(OK=" + m_noOK + ",Fail=" + m_noFAIL + ")"
118             + " - Total(OK=" + m_noTotalOK + ",Fail=" + m_noTotalFAIL + ")]";
119     } // toString
120

121 } // AcctServerWork
Popular Tags