1 /* 2 * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.transaction.xa; 27 28 /** 29 * The Xid interface is a Java mapping of the X/Open transaction identifier 30 * XID structure. This interface specifies three accessor methods to 31 * retrieve a global transaction format ID, global transaction ID, 32 * and branch qualifier. The Xid interface is used by the transaction 33 * manager and the resource managers. This interface is not visible to 34 * the application programs. 35 * 36 * @since 1.4 37 */ 38 public interface Xid { 39 40 /** 41 * Maximum number of bytes returned by {@link #getGlobalTransactionId }. 42 */ 43 final static int MAXGTRIDSIZE = 64; 44 45 /** 46 * Maximum number of bytes returned by {@link #getBranchQualifier }. 47 */ 48 final static int MAXBQUALSIZE = 64; 49 50 /** 51 * Obtain the format identifier part of the XID. 52 * 53 * @return Format identifier. O means the OSI CCR format. 54 */ 55 int getFormatId(); 56 57 /** 58 * Obtain the global transaction identifier part of XID as an array 59 * of bytes. 60 * 61 * @return Global transaction identifier. 62 */ 63 byte[] getGlobalTransactionId(); 64 65 /** 66 * Obtain the transaction branch identifier part of XID as an array 67 * of bytes. 68 * 69 * @return Global transaction identifier. 70 */ 71 byte[] getBranchQualifier(); 72 }