KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > transaction > api > xid > XidState


1 /*====================================================================
2
3 ObjectWeb Transaction Working Group API
4 Contact: http://www.objectweb.org
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
20
21 Initial developer(s): Romain Rouvoy.
22 Contributor(s): ______________________________________.
23
24 ---------------------------------------------------------------------
25 $Id: XidState.java,v 1.1.1.1 2003/12/01 15:14:18 rouvoy Exp $
26 ====================================================================*/

27 package org.objectweb.transaction.api.xid;
28
29 import org.objectweb.transaction.api.State;
30
31 /**
32  * <p>
33  * The format of XID must follow these rules :
34  * <ul>
35  * <li>The Branch Qualifier length must be between 1 and 64</li>
36  * <li>The Transaction Identifier must be between the Branch Qualifier Length + 1
37  * and the Branch Qualifier Length + 64</li>
38  * <li>The Global Transaction Identifier is provided by the first bytes in the
39  * Transaction Identifier; the following Branch Qualifier Length bytes
40  * correspond to the Branch Qualifier part of the XID</li>
41  * </ul>
42  *
43  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>
44  * @version 0.1
45  *
46  * @adl.id name="XID_STATE" value="xid-state"
47  */

48 public interface XidState
49          extends State
50 {
51     /**
52      * ADL Identifier
53      */

54     public static final String JavaDoc XID_STATE = "xid-state";
55     
56     /**
57      * Branch Qualifier Minimal Length
58      */

59     public static int BQUAL_LENGTH_MIN = 1 ;
60     
61     /**
62      * Branch Qualifier Maximal Length
63      */

64     public static int BQUAL_LENGTH_MAX = 64 ;
65     
66     /**
67      * Transaction Identifier Minimal Length
68      */

69     public static int TID_LENGTH_MIN = 1 ;
70     
71     /**
72      * Transaction Identifier Maximal Length
73      */

74     public static int TID_LENGTH_MAX = 64 ;
75     
76     
77     /**
78      * Defines the value of the Branch Qualifier of the XID
79      *
80      * @param bqual - a byte array representing the Branch Qualifier
81      */

82     public void setBranchQualifier(byte[] bqual);
83     
84     /**
85      * Defines the value of the Format Identifier of the XID
86      *
87      * @param fid - the value of the Format Identifier
88      */

89     public void setFormatId(int fid);
90     
91     /**
92      * Defines the value of the Global Transaction Identifier
93      *
94      * @param gtid - the global transaction identifier
95      */

96     public void setGlobalTransactionId(byte[] gtid) ;
97     
98     /**
99      * Provides the value of the Branch Qualifier of the XID
100      *
101      * @return a byte array representing the Branch Qualifier
102      */

103     public byte[] getBranchQualifier() ;
104     
105     /**
106      * Provides the value of the Format Identifier used by the implementation
107      *
108      * @return the encoded Format Identifier value
109      */

110     public int getFormatId();
111     
112     /**
113      * Provides the value of the Global Transaction Identifier
114      *
115      * @return the encoded Global Transaction Identifier value
116      */

117     public byte[] getGlobalTransactionId();
118 }
119
Popular Tags