1 /*
2   Copyright 2010 Sun Microsystems, Inc.
3   All rights reserved. Use is subject to license terms.
4 
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License, version 2.0,
7   as published by the Free Software Foundation.
8 
9   This program is also distributed with certain software (including
10   but not limited to OpenSSL) that is licensed under separate terms,
11   as designated in a particular file or component or in included license
12   documentation.  The authors of MySQL hereby grant you an additional
13   permission to link the program and your derivative works with the
14   separately licensed software that they have included with MySQL.
15 
16   This program is distributed in the hope that it will be useful,
17   but WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   GNU General Public License, version 2.0, for more details.
20 
21   You should have received a copy of the GNU General Public License
22   along with this program; if not, write to the Free Software
23   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
24 */
25 /*
26  * NdbBlob.java
27  */
28 
29 package com.mysql.ndbjtie.ndbapi;
30 
31 import java.nio.ByteBuffer;
32 
33 import com.mysql.jtie.Wrapper;
34 
35 public class NdbBlob extends Wrapper implements NdbBlobConst
36 {
getNdbError()37     public final native NdbErrorConst/*_const NdbError &_*/ getNdbError() /*_const_*/;
getNdbOperation()38     public final native NdbOperationConst/*_const NdbOperation *_*/ getNdbOperation() /*_const_*/;
39     public interface /*_enum_*/ State
40     {
41         int Idle = 0,
42             Prepared = 1,
43             Active = 2,
44             Closed = 3,
45             Invalid = 9;
46     }
getState()47     public final native int/*_State_*/ getState();
48     // MMM! support variable-width type non-const references or check if needed: public final native void getVersion(int[]/*_int &_*/ version);
getValue(ByteBuffer data, int bytes)49     public final native int getValue(ByteBuffer/*_void *_*/ data, int/*_Uint32_*/ bytes);
setValue(ByteBuffer data, int bytes)50     public final native int setValue(ByteBuffer/*_const void *_*/ data, int/*_Uint32_*/ bytes);
51     // MMM no need to map: public final native typedef int ActiveHook(NdbBlob/*_NdbBlob *_*/ me, ByteBuffer/*_void *_*/ arg);
52     // MMM no need to map: public final native int setActiveHook(ActiveHook/*_ActiveHook *_*/ activeHook, ByteBuffer/*_void *_*/ arg);
53     // MMM! support variable-width type non-const references or check if needed: public final native int getNull(int[]/*_int &_*/ isNull);
setNull()54     public final native int setNull();
getLength(long[] length)55     public final native int getLength(long[]/*_Uint64 &_*/ length);
truncate(long length )56     public final native int truncate(long/*_Uint64_*/ length /*_= 0_*/);
getPos(long[] pos)57     public final native int getPos(long[]/*_Uint64 &_*/ pos);
setPos(long pos)58     public final native int setPos(long/*_Uint64_*/ pos);
readData(ByteBuffer data, int[] bytes)59     public final native int readData(ByteBuffer/*_void *_*/ data, int[]/*_Uint32 &_*/ bytes);
writeData(ByteBuffer data, int bytes)60     public final native int writeData(ByteBuffer/*_const void *_*/ data, int/*_Uint32_*/ bytes);
getColumn()61     public final native NdbDictionary.ColumnConst/*_const NdbDictionary.Column *_*/ getColumn();
getBlobTableName(ByteBuffer btname, Ndb anNdb, String tableName, String columnName)62     static public final native int getBlobTableName(ByteBuffer/*_char *_*/ btname, Ndb/*_Ndb *_*/ anNdb, String/*_const char *_*/ tableName, String/*_const char *_*/ columnName);
getBlobEventName(ByteBuffer bename, Ndb anNdb, String eventName, String columnName)63     static public final native int getBlobEventName(ByteBuffer/*_char *_*/ bename, Ndb/*_Ndb *_*/ anNdb, String/*_const char *_*/ eventName, String/*_const char *_*/ columnName);
blobsFirstBlob()64     public final native NdbBlob/*_NdbBlob *_*/ blobsFirstBlob();
blobsNextBlob()65     public final native NdbBlob/*_NdbBlob *_*/ blobsNextBlob();
close(boolean execPendingBlobOps )66     public final native int close(boolean execPendingBlobOps /*= true*/);
67 }
68