Renamed jni directory to java.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@245 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-04-03 15:42:40 +00:00
parent 0edea58de2
commit da50ce0a9d
46 changed files with 12295 additions and 0 deletions

View File

@@ -0,0 +1,195 @@
//------------------------------------------------------------------------------
// Desc: Backup
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: Backup.java 3109 2006-01-19 13:07:07 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
import java.io.FileNotFoundException;
/**
* This classes provides methods to back up an XFlaim database
*/
public class Backup
{
// This constructor doesn't need to do much of anything; it's here mostly
// to ensure that Backup does NOT have a public constructor. (The
// application is not supposed to call new on Backup; Backup objects
// are created by a call to Db.backupBegin
Backup(
long lThis,
Db jdb)
{
m_this = lThis;
m_jdb = jdb;
}
/**
* Finalize method used to release native resources on garbage collection.
*/
public void finalize()
{
if (m_this != 0)
{
_release( m_this);
m_this = 0;
}
m_jdb = null;
}
/**
* Get the transaction ID for this backup operation
* @return Returns the transaction ID for this backup operation.
*/
public long getBackupTransId()
{
return _getBackupTransId( m_this);
}
/**
* Gets the transaction ID for the last backup job run on this database.
* @return returns the transaction ID for the last backup job run on this
* database.
*/
public long getLastBackupTransId()
{
return _getLastBackupTransId( m_this);
}
/**
* Performs the backup operation. <code>sBackupPath</code> and <code>
* Client</code> are mutually exclusive. If <code>Client</code> is null,
* then an instance of <code>DefaultBackupClient</code> will be created
* and <code>sBackupPath</code> passed into its constructor. If <code>
* Client</code> is non-null, <code>sBackupPath</code> is ignored.
* @param sBackupPath Optional. The full pathname of a file to store the
* backed up data.
* @param Client Optional. If non-null, then it will be used as the backup
* client.
* @param Status Optional. If non-null, then <code>Status.backupStatus
* </code> will be called periodicly to inform the application about the
* progress of the backup operation.
* @return Returns the sequence number of this backup. (This is for
* informational purposes only; for instance, users can use it to label
* their backup tapes.)
* @throws XFlaimException
*/
public long backup(
String sBackupPath,
String sPassword,
BackupClient Client,
BackupStatus Status) throws XFlaimException
{
BackupClient BackupClient;
if (Client == null)
{
try
{
BackupClient = new DefaultBackupClient( sBackupPath);
}
catch (FileNotFoundException e)
{
throw new XFlaimException( xflaim.RCODE.NE_XFLM_OPENING_FILE,
"IOException opening " + sBackupPath + ". Message from JVM was" +
e.getMessage());
}
}
else
{
BackupClient = Client;
}
return _backup( m_this, sBackupPath, sPassword, BackupClient, Status);
}
/**
* Desc:
*/
public void endBackup() throws XFlaimException
{
_endBackup( m_this);
}
// Reassigns the object to "point" to a new F_Backup instance and a new
// Db. Called by any of the member functions that take a
// Db.backupBegin parameter. Shouldn't be called by outsiders, so it's
// not public, but it must be callable for other instances of this class.
// NOTE: This function does not result in a call to F_Backup::Release()
// because that is done by the native code when the F_Backup object is
// reused. Calling setRef() in any case except from within
// Db.backupBegin will result in a memory leak on the native side!
void setRef(
long lBackupRef,
Db jdb)
{
m_this = lBackupRef;
m_jdb = jdb;
}
/**
* Desc:
*/
long getRef()
{
return m_this;
}
/**
* Desc:
*/
private native long _backup(
long lThis,
String sBackupPath,
String sPassword,
BackupClient Client,
BackupStatus Status) throws XFlaimException;
/**
* Desc:
*/
private native void _endBackup(
long lThis) throws XFlaimException;
/**
* Desc:
*/
private native long _getBackupTransId(
long lThis);
/**
* Desc:
*/
private native long _getLastBackupTransId(
long lThis);
/**
* Desc:
*/
private native void _release(
long lThis);
private long m_this;
private Db m_jdb;
}

View File

@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// Desc: Backup Client
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: BackupClient.java 3109 2006-01-19 13:07:07 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface defines the client side interface to XFlaim's backup
* subsystem. Clients must pass an object that implements this interface
* into the call to {@link Backup#backup Backup::backup}
* See the documentation regarding Backup/Restore operations for more details.
* @see DefaultBackupClient
*/
public interface BackupClient
{
/**
* Called by XFlaim's backup subsystem when it has a block of data ready
* to be written. It is up to the implementation to decide what to
* do with the data (but presumably, it will write the data to disk,
* tape or some other storage medium).
* @param Buffer An array of bytes containing the data that needs to be
* written.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* backup operation to abort an XFLaimException to be thrown.
*/
public int WriteData(
byte[] Buffer);
}

View File

@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// Desc: Backup Status
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: BackupStatus.java 3109 2006-01-19 13:07:07 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface allows XFlaim's backup subsystem to periodicly pass
* information about the status of a backup operation (bytes completed and
* bytes remaining) while the operation is running. The implementor may do
* anything it wants with the information, such as using it to update a
* progress bar or simply ignoring it.
*/
public interface BackupStatus
{
/**
* Called by XFlaim's backup subsystem to pass information back
* to the user
* @param lBytesToDo The number of bytes that have not been backed up yet
* @param lBytesDone The number of bytes that have been backed up.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* backup operation to abort an XFLaimException to be thrown.
*/
public int backupStatus(
long lBytesToDo,
long lBytesDone);
}

View File

@@ -0,0 +1,67 @@
//------------------------------------------------------------------------------
// Desc: Progress Check Info Structure
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: CHECKINFO.java 3111 2006-01-19 13:10:50 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This class contains data about the status of an ongoing database
* check operation. It is passed to the
* <code>DbCheckStatus.reportProgress</code>.
*/
public final class CHECKINFO
{
public int iCheckPhase;
public boolean bStartFlag;
public long lFileSize;
public int iNumLFs;
public int iCurrLF;
public int iLfNumber; // Logical File Pass
public int iLfType;
public long lBytesExamined;
public int iNumProblemsFixed; // Number of corruptions repaired
public long lNumDomNodes; // in the current Lf
public long lNumDomLinksVerified; // in the current Lf
public long lNumBrokenDomLinks; // in the current Lf
// Index check progress
public long lNumKeys; // Number of keys in the result set
public long lNumDuplicateKeys; // Number of duplicate keys generated
public long lNumKeysExamined; // Number of keys checked
public long lNumKeysNotFound; // Extra keys found in indexes
public long lNumRecKeysNotFound; // Keys missing from indexes
public long lNumNonUniqueKeys; // Non-unique keys in indexes
public long lNumConflicts; // # of non-corruption conflicts
public long lNumRSUnits; // Number of rset sort items
public long lNumRSUnitsDone; // Number of rset items sorted
public static class CheckPhaseCodes
{
public static final int CHECK_GET_DICT_INFO = 1;
public static final int CHECK_B_TREE = 2;
public static final int CHECK_AVAIL_BLOCKS = 3;
public static final int CHECK_RS_SORT = 4;
public static final int CHECK_DOM_LINKS = 5;
}
}

View File

@@ -0,0 +1,56 @@
//------------------------------------------------------------------------------
// Desc: Corrupt Info Structure
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: CORRUPTINFO.java 3111 2006-01-19 13:10:50 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
import xflaim.DOMNode;
import xflaim.DataVector;
/**
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public final class CORRUPTINFO
{
int iErrCode; // Zero means no error is being reported
int iErrLocale;
int iErrLfNumber;
int iErrLfType;
int iErrBTreeLevel;
int iErrBlkAddress;
int iErrParentBlkAddress;
int iErrElmOffset;
long lErrNodeId;
DataVector ErrIxKey;
DOMNode ErrNode;
DataVector[] ErrNodeKeyList;
public static class LOCALE_CODES
{
public static final int LOCALE_NONE = 0;
public static final int LOCALE_LFH_LIST = 1;
public static final int LOCALE_AVAIL_LIST = 2;
public static final int LOCALE_B_TREE = 3;
public static final int LOCALE_INDEX = 4;
}
}

View File

@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// Desc: Create Options Structure
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: CREATEOPTS.java 3109 2006-01-19 13:07:07 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This class encapsulates the Database create options.
*/
public final class CREATEOPTS
{
public int iBlockSize;
public int iVersionNum;
public int iMinRflFileSize;
public int iMaxRflFileSize;
public boolean bKeepRflFiles;
public boolean bLogAbortedTransToRfl;
public int iDefaultLanguage;
public CREATEOPTS()
{
iBlockSize = 4096;
iVersionNum = 500;
iMinRflFileSize = (100 * 1024 * 1024);
iMaxRflFileSize = 0xFFFC0000;
bKeepRflFiles = false;
bLogAbortedTransToRfl = false;
iDefaultLanguage = 0;
}
}

View File

@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// Desc: XFLAIM Java Interface
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: Collections.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* The Collections class is a static class that defines some predefined collections.
*/
public final class Collections
{
public static final int DATA = 65534;
public static final int DICTIONARY = 65535;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,683 @@
//------------------------------------------------------------------------------
// Desc: Data Vector
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DataVector.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This class implements an interface to the XFlaim IF_DataVector class.
*/
public class DataVector
{
long m_this;
DbSystem m_dbSystem;
/**
* Constructor for the DataVector object. This object provides access to
* the XFlaim IF_DataVector interface. All methods defined by the
* IF_DataVector interace are accessible through this Java object.
*
* @param lRef A reference to a C++ IF_DataVector object
* @param dbSystem A reference to a DbSystem object
*/
public DataVector(
long lRef,
DbSystem dbSystem)
{
super();
m_this = lRef;
m_dbSystem = dbSystem;
}
/**
* Finalizer method, used to ensure that we release the actual C++ object.
*/
public void finalize()
{
if (m_this != 0)
{
_release( m_this);
m_this = 0;
}
m_dbSystem = null;
}
/**
* Method to set the document Id of the search target.
* @param lDocId
*/
public void setDocumentID(
long lDocId)
{
_setDocumentId( m_this, lDocId);
}
/**
* Method to set the ID of the search target. The ID referred to here is
* the node Id which is actually a 64 bit unsigned value in the XFlaim
* database.
* @param iElementNumber
* @param lID
* @throws XFlaimException
*/
public void setId(
int iElementNumber,
long lID) throws XFlaimException
{
_setID( m_this, iElementNumber, lID);
}
/**
* Method to set the name ID of the search target. the name Id is a
* numeric value that is used to represent the field or tag of the
* target element.
* @param iElementNumber
* @param iNameId
* @param bIsAttr A boolean flag that indicates whether or not the key
* is an attribute.
* @param bIsData A boolean flag that indicates whether or not the key
* is a data component.
* @throws XFlaimException
*/
public void setNameId(
int iElementNumber,
int iNameId,
boolean bIsAttr,
boolean bIsData) throws XFlaimException
{
_setNameId( m_this, iElementNumber, iNameId, bIsAttr, bIsData);
}
/**
* Method to set the value of the target key to an integer value. For
* purposes of this interface, an integer is defined to be 32 bits, signed.
* The iNum parameter will be tested to ensure that is falls within range.
* If it is too large, an exception will be thrown.
* @param iElementNumber
* @param iNum The 32 bit signed integer value
* @throws XFlaimException
*/
public void setINT(
int iElementNumber,
int iNum) throws XFlaimException
{
_setINT( m_this, iElementNumber, iNum);
}
/**
* Special purpose function - NOT for general consumption.
* @param iElementNumber
* @param iUNum
* @throws XFlaimException
*/
public void setUINT(
int iElementNumber,
int iUNum) throws XFlaimException
{
_setUINT( m_this, iElementNumber, iUNum);
}
/**
* Method to set the value of the target key to a long value. For
* purposes of this interface, a long is defined to be 64 bits, signed.
* @param iElementNumber
* @param lNum The 64 bit signed integer value
* @throws XFlaimException
*/
public void setLong(
int iElementNumber,
long lNum) throws XFlaimException
{
_setLong( m_this, iElementNumber, lNum);
}
/**
* Method to set the value of the target key to a string value.
* @param iElementNumber
* @param sValue
* @throws XFlaimException
*/
public void setString(
int iElementNumber,
String sValue) throws XFlaimException
{
_setString( m_this, iElementNumber, sValue);
}
/**
* Method to set the value of the target key to a binary value.
* @param iElementNumber
* @param Value
* @throws XFlaimException
*/
public void setBinary(
int iElementNumber,
byte[] Value) throws XFlaimException
{
_setBinary( m_this, iElementNumber, Value);
}
/**
* Method to set a flag in the target key that indicates that the key is
* right truncated.
* @param iElementNumber
*/
public void setRightTruncated(
int iElementNumber)
{
_setRightTruncated( m_this, iElementNumber);
}
/**
* Method to set a flag in the target key that indicates that the key is
* left truncated.
* @param iElementNumber
*/
public void setLeftTruncated(
int iElementNumber)
{
_setLeftTruncated( m_this, iElementNumber);
}
/**
* Method to clear a flag in the target key that indicates that the key
* is right truncated.
* @param iElementNumber
*/
public void clearRightTruncated(
int iElementNumber)
{
_clearRightTruncated( m_this, iElementNumber);
}
/**
* Method to clear a flag in the target key that indicates that the key
* is left truncated.
* @param iElementNumber
*/
public void clearLeftTruncated(
int iElementNumber)
{
_clearLeftTruncated( m_this, iElementNumber);
}
/**
* Method to get the Document ID of the target key.
* @return Document Id
*/
public long getDocumentID()
{
return _getDocumentID( m_this);
}
/**
* Method to get the node Id of the element specified (iElementNumber) of
* the target key.
* @param iElementNumber
* @return Node Id
*/
public long getID(
int iElementNumber)
{
return _getID( m_this, iElementNumber);
}
/**
* Method to get the name Id of the element specified (iElementNumber) of
* the target key.
* @param iElementNumber
* @return Name Id
*/
public int getNameId(
int iElementNumber)
{
return _getNameId( m_this, iElementNumber);
}
/**
* Method to find out if the element specified (iElementNumber) is an
* attribute of the target key.
* @param iElementNumber
* @return boolean true or false
*/
public boolean isAttr(
int iElementNumber)
{
return _isAttr( m_this, iElementNumber);
}
/**
* Method to find out if the element specified (iElementNumber) is a data
* component of the target key.
* @param iElementNumber
* @return boolean true or false
*/
public boolean isDataComponent(
int iElementNumber)
{
return _isDataComponent( m_this, iElementNumber);
}
/**
* Method to find out if the element specified (iElementNumber) is a key
* component of the target key.
* @param iElementNumber
* @return boolean true or false
*/
public boolean isKeyComponent(
int iElementNumber)
{
return _isKeyComponent( m_this, iElementNumber);
}
/**
* Method to get the length of the data value of the element specified
* (iElementNumber) of the target key.
* @param iElementNumber
* @return The data length
*/
public int getDataLength(
int iElementNumber)
{
return _getDataLength( m_this, iElementNumber);
}
/**
* Desc:
*/
public int getDataType(
int iElementNumber)
{
return _getDataType( m_this, iElementNumber);
}
/**
* Method to get the value of the element specified (iElementNumber) of the
* target key as an integer. An integer is a 32 bit signed value.
* @param iElementNumber
* @return 32 bit signed integer
* @throws XFlaimException
*/
public int getINT(
int iElementNumber) throws XFlaimException
{
return _getINT( m_this, iElementNumber);
}
/**
* ** This is a special purpose method and not for general consumption **
* @param iElementNumber
* @return 32 bit signed integer
* @throws XFlaimException
*/
public int getUINT(
int iElementNumber) throws XFlaimException
{
return _getUINT( m_this, iElementNumber);
}
/**
* Method to get the value of the element specified (iElementNumber) of the
* target key as a long. An long is a 64 bit signed value.
* @param iElementNumber
* @return 64 bit signed integer
* @throws XFlaimException
*/
public long getLong(
int iElementNumber) throws XFlaimException
{
return _getLong( m_this, iElementNumber);
}
/**
* Method to get the value of the element specified (iElementNumber) of the
* target key as a String.
* @param iElementNumber
* @return String
* @throws XFlaimException
*/
public String getString(
int iElementNumber) throws XFlaimException
{
return _getString( m_this, iElementNumber);
}
/**
* Method to get the value of the element specified (iElementNumber) of the
* target key as binary data.
* @param iElementNumber
* @return Returns a byte array containing the value of the specified
* element
* @throws XFlaimException
*/
public byte[] getBinary(
int iElementNumber) throws XFlaimException
{
return _getBinary( m_this, iElementNumber);
}
/**
* Method to generate a buffer that holds the target key as stored in
* the index.
* @param jDb
* @param iIndexNum
* @param bOutputIds
* @return byte[] key buffer
* @throws XFlaimException
*/
public byte[] outputKey(
Db jDb,
int iIndexNum,
boolean bOutputIds) throws XFlaimException
{
return _outputKey( m_this, jDb.m_this, iIndexNum, bOutputIds);
}
/**
* Method to generate a buffer that holds only the data of the target key.
* @param jDb
* @param iIndexNum
* @return byte[]
* @throws XFlaimException
*/
public byte[] outputData(
Db jDb,
int iIndexNum) throws XFlaimException
{
return _outputData( m_this, jDb.m_this, iIndexNum);
}
/**
* Method to populate a DataVector object from an index key.
* @param jDb
* @param iIndexNum
* @param Key
* @param iKeyLen
* @throws XFlaimException
*/
public void inputKey(
Db jDb,
int iIndexNum,
byte[] Key,
int iKeyLen) throws XFlaimException
{
_inputKey( m_this, jDb.m_this, iIndexNum, Key, iKeyLen);
}
/**
* Method to populate a portion of a DataVector object from the data part of
* an index key.
* @param jDb
* @param iIndexNum
* @throws XFlaimException
*/
public void inputData(
Db jDb,
int iIndexNum,
byte[] Data,
int iDataLen) throws XFlaimException
{
_inputData( m_this, jDb.m_this, iIndexNum, Data, iDataLen);
}
/**
* Method to reset the contents of the DataVector object.
*/
public void reset()
{
_reset( m_this);
}
/**
* Desc:
*/
private native void _release(
long lThis);
/**
* Desc:
*/
private native void _setDocumentId(
long lThis,
long lDocId);
/**
* Desc:
*/
private native void _setID(
long lThis,
int iElementNumber,
long lID);
/**
* Desc:
*/
private native void _setNameId(
long lThis,
int iElementNumber,
int iNameId,
boolean bIsAttr,
boolean bIsData);
/**
* Desc:
*/
private native void _setINT(
long lThis,
int iElementNumber,
int iNum);
/**
* Desc:
*/
private native void _setUINT(
long lThis,
int iElementNumber,
int iUNum);
/**
* Desc:
*/
private native void _setLong(
long lThis,
int iElementNumber,
long lNum);
/**
* Desc:
*/
private native void _setString(
long lThis,
int iElementNumber,
String sValue);
/**
* Desc:
*/
private native void _setBinary(
long lThis,
int iElementNumber,
byte[] Value);
/**
* Desc:
*/
private native void _setRightTruncated(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native void _setLeftTruncated(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native void _clearRightTruncated(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native void _clearLeftTruncated(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native long _getDocumentID(
long lThis);
/**
* Desc:
*/
private native long _getID(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native int _getNameId(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native boolean _isAttr(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native boolean _isDataComponent(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native boolean _isKeyComponent(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native int _getDataLength(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native int _getDataType(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native int _getINT(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native int _getUINT(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native long _getLong(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native String _getString(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native byte[] _getBinary(
long lThis,
int iElementNumber);
/**
* Desc:
*/
private native byte[] _outputKey(
long lThis,
long ljDbRef,
int iIndexNum,
boolean bOutputIds);
/**
* Desc:
*/
private native byte[] _outputData(
long lThis,
long ljDbRef,
int iIndexNum);
/**
* Desc:
*/
private native void _inputKey(
long lThis,
long ljDbRef,
int iIndexNum,
byte[] Key,
int iKeyLen);
/**
* Desc:
*/
private native void _inputData(
long lThis,
long ljDbRef,
int iIndexNum,
byte[] Data,
int iDataLen);
/**
* Desc:
*/
private native void _reset(
long lThis);
}

View File

@@ -0,0 +1,496 @@
//------------------------------------------------------------------------------
// Desc: Db Class
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: Db.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* The Db class provides a number of methods that allow java applications to
* access the XFlaim native environment, specifically, the IF_Db interface.
*/
public class Db
{
static
{
System.loadLibrary( "xflaimjni");
}
Db(
long ref,
DbSystem dbSystem) throws XFlaimException
{
super();
if( ref == 0)
{
throw new XFlaimException( -1, "No legal reference");
}
m_this = ref;
if( dbSystem == null)
{
throw new XFlaimException( -1, "No legal dbSystem reference");
}
m_dbSystem = dbSystem;
}
/**
* Finalize method used to release native resources on garbage collection.
*/
public void finalize()
{
close();
}
/**
* Closes the database.
*/
public void close()
{
// Release the native pDb!
if( m_this != 0)
{
_release( m_this);
m_this = 0;
}
// Remove our reference to the dbSystem so it can be released.
m_dbSystem = null;
}
/**
* Starts a transaction.
*
* @param eTransactionType The type of transaction to start (read or
* write). Should be one of the members of {@link
* xflaim.TransactionType TransactionType}.
* @param iMaxLockWait Maximum lock wait time. Specifies the amount of
* time to wait for lock requests occuring during the transaction to be
* granted. Valid values are 0 through 255 seconds. Zero is used to
* specify no-wait locks.
* @param iFlags Should be a logical OR'd combination of the members of
* the memers of {@link xflaim.TransactionFlags
* TransactionFlags}.
* @throws XFlaimException
*/
public void transBegin(
int eTransactionType,
int iMaxLockWait,
int iFlags) throws XFlaimException
{
_transBegin( m_this, eTransactionType, iMaxLockWait, iFlags);
}
/**
* Commits an existing transaction. If no transaction is running, or the
* transaction commit fails, an XFlaimException exception will be thrown.
* @throws XFlaimException
*/
public void transCommit() throws XFlaimException
{
_transCommit( m_this);
}
/**
* Aborts an existing transaction. If no transaction is running, or the
* transaction commit fails, an XFlaimException exception will be thrown.
*
* @throws XFlaimException
*/
public void transAbort() throws XFlaimException
{
_transAbort( m_this);
}
/**
* Uses the jSearchKey to retrieve the next key from the specified
* index.
*
* @param iIndex The index that is being searched
* @param jSearchKey The DataVector search key
* @param iFlags The search flags that direct how the next key will
* be determined.
* @param jFoundKey This parameter is used during subsequent calls
* to keyRetrieve. The returned DataVector is passed in as this
* parameter so that it may be reused, thus preventing the unnecessary
* accumulation of IF_DataVector objects in the C++ environment.
*/
public void keyRetrieve(
int iIndex,
DataVector jSearchKey,
int iFlags,
DataVector jFoundKey) throws XFlaimException
{
long lKey = jSearchKey.m_this;
long lFoundKey = (jFoundKey == null ? 0 : jFoundKey.m_this);
_keyRetrieve( m_this, iIndex, lKey, iFlags, lFoundKey);
}
/**
* Creates a new document node.
* @param iCollection The collection to store the new document in.
* @return Returns the DOMNode representing the new document.
* @throws XFlaimException
*/
public DOMNode createDocument(
int iCollection) throws XFlaimException
{
long lNewDocRef;
// See the comments in the DOMNode::finalize() function for an
// explanation of this call synchronized call
synchronized( this)
{
lNewDocRef = _createDocument( m_this, iCollection);
}
return (new DOMNode( lNewDocRef, this));
}
/**
* Creates a new root element node. This is the root node of a document
* in the XFlaim database.
* @param iCollection
* @param iTag
* @return
* @throws XFlaimException
*/
public DOMNode createRootElement(
int iCollection,
int iTag) throws XFlaimException
{
long lNewDocRef;
// See the comments in the DOMNode::finalize() function for an
// explanation of this call synchronized call
synchronized( this)
{
lNewDocRef = _createRootElement( m_this, iCollection, iTag);
}
return (new DOMNode( lNewDocRef, this));
}
/**
* Method to retrieve the first document in a specified collection.
* @param iCollection - The collection from which to retrieve the
* first document
* @param jDOMNode - If this parameter is non-null, it will be assumed
* that it is no longer needed and will be rendered unusable upon
* returning from this method.
* @return - Returns a DOMNode which is the root node of the requested
* document.
* @throws XFlaimException
*/
public DOMNode getFirstDocument(
int iCollection,
DOMNode jDOMNode) throws XFlaimException
{
DOMNode jNode = null;
long lRef = 0;
// See the comments in the DOMNode::finalize() function for an
// explanation of this call synchronized call
synchronized( this)
{
lRef = _getFirstDocument( m_this, iCollection, jDOMNode);
}
// If we got a reference to a native DOMNode back, let's
// create a new DOMNode.
if (lRef != 0)
{
if (jDOMNode != null)
{
jDOMNode.setRef( lRef, this);
jNode = jDOMNode;
}
else
{
jNode = new DOMNode( lRef, this);
}
}
return( jNode);
}
/**
* Creates a new element definition in the dictionary.
* @param sNamespaceURI The namespace URI that this definition should be
* created in. If null, the default namespace will be used.
* @param sElementName The name of the definition.
* @param iDataType The type of node this definition will represent.
* Should be one of the constants listed in
* {@link xflaim.FlmDataType FlmDataType}.
* @param iRequestedId If non-zero, then xflaim will try to use this
* number as the name ID of the new definition.
* @return Returns the name ID of the new definition.
* @throws XFlaimException
*/
public int createElementDef(
String sNamespaceURI,
String sElementName,
int iDataType,
int iRequestedId) throws XFlaimException
{
int iNewNameId;
// See the comments in the DOMNode::finalize() function for an
// explanation of this call synchronized call
synchronized( this)
{
iNewNameId = _createElementDef( m_this, sNamespaceURI,
sElementName, iDataType,
iRequestedId);
}
return( iNewNameId);
}
/**
* Retrieves the specified node from the specified collection
* @param iCollection The collection where the node is stored.
* @param lNodeId The ID number of the node to be retrieved
* @param ReusedNode Optional. An existing instance of DOMNode who's
* contents will be replaced with that of the new node. If null, a
* new instance will be allocated.
* @return Returns a DOMNode representing the retrieved node.
* @throws XFlaimException
*/
public DOMNode getNode(
int iCollection,
long lNodeId,
DOMNode ReusedNode) throws XFlaimException
{
long lReusedNodeRef = 0;
long lNewNodeRef = 0;
DOMNode NewNode;
if (ReusedNode != null)
{
lReusedNodeRef = ReusedNode.getRef();
}
// See the comments in DOMNode::finalize() for an explanation
// of this synchronized call
synchronized( this)
{
lNewNodeRef = _getNode( m_this, iCollection, lNodeId, lReusedNodeRef);
}
if (ReusedNode == null)
{
NewNode = new DOMNode(lNewNodeRef, this);
}
else
{
NewNode=ReusedNode;
NewNode.setRef( lNewNodeRef, this);
}
return( NewNode);
}
/**
* Sets up XFlaim to perform a backup operation
* @param eBackupType The type of backup to perform. Must be one of the
* members of {@link xflaim.FlmBackupType
* FlmBackupType}.
* @param eTransType The type of transaction in which the backup operation
* will take place. Must be one of the members of
* {@link xflaim.TransactionType TransactionType}.
* @param iMaxLockWait Maximum lock wait time. Specifies the amount of
* time to wait for lock requests occuring during the backup operation to
* be granted. Valid values are 0 through 255 seconds. Zero is used to
* specify no-wait locks.
* @param ReusedBackup Optional. An existing instance of Backup that
* will be reset with the new settings. If null, a new instance will
* be allocated.
* @return Returns an instance of Backup configured to perform the
* requested backup operation
* @throws XFlaimException
*/
public Backup backupBegin(
int eBackupType,
int eTransType,
int iMaxLockWait,
Backup ReusedBackup) throws XFlaimException
{
long lReusedRef = 0;
long lNewRef = 0;
Backup NewBackup;
if (ReusedBackup != null)
{
lReusedRef = ReusedBackup.getRef();
}
// See to comments in the finalize function for an explanation of this
// synchronized call
synchronized( this)
{
lNewRef = _backupBegin( m_this, eBackupType, eTransType,
iMaxLockWait, lReusedRef);
}
if (ReusedBackup == null)
{
NewBackup = new Backup(lNewRef, this);
}
else
{
NewBackup = ReusedBackup;
NewBackup.setRef( lNewRef, this);
}
return( NewBackup);
}
/**
* Imports an XML document into the XFlaim database. The import requires
* an update transaction (TransactionType.UPDATE_TRANS). If the document
* cannot be imported, an XFlaimEXception exception will be thrown.
* @param jIStream
* @param iCollection
* @throws XFlaimException
*/
public void Import(
PosIStream jIStream,
int iCollection) throws XFlaimException
{
_import( m_this, jIStream, iCollection);
}
/**
* Desc:
*/
private native void _release(
long lThis);
/**
* Desc:
*/
private native void _transBegin(
long lThis,
int iTransactionType,
int iMaxlockWait,
int iFlags);
/**
* Desc:
*/
private native void _transCommit( long lThis);
/**
* Desc:
*/
private native void _transAbort( long lThis);
/**
* Desc:
*/
private native void _import(
long lThis,
PosIStream jIStream,
int iCollection);
/**
* Desc:
*/
private native long _getFirstDocument(
long lThis,
int iCollection,
DOMNode jNode) throws XFlaimException;
/**
* Desc:
*/
private native long _getNode(
long lThis,
int iCollection,
long lNodeId,
long lpOldNodeRef) throws XFlaimException;
/**
* Desc:
*/
private native long _createDocument(
long lThis,
int iCollection) throws XFlaimException;
/**
* Desc:
*/
private native long _createRootElement(
long lThis,
int iCollection,
int iTag) throws XFlaimException;
/**
* Desc:
*/
private native int _createElementDef(
long lThis,
String sNamespaceURI,
String sElementName,
int iDataType,
int iRequestedId) throws XFlaimException;
/**
* Desc:
*/
private native long _backupBegin(
long lThis,
int eBackupType,
int eTransType,
int iMaxLockWait,
long lReusedRef) throws XFlaimException;
/**
* Desc:
*/
private native void _keyRetrieve(
long lThis,
int iIndex,
long lKey,
int iFlags,
long lFoundKey);
long m_this;
private DbSystem m_dbSystem;
}

View File

@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// Desc: Check Flags
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbCheckFlags.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* The members of this class are used by <code>DbSystem.dbCheck</code>.
* The values of these members must match exactly with the equivalent
* #defines in xflaim.h.
*/
public final class DbCheckFlags
{
public static final int FO_ONLINE = 0x0020;
public static final int FO_DO_LOGICAL_CHECK = 0x0100;
public static final int FO_SKIP_DOM_LINK_CHECK = 0x0400;
}

View File

@@ -0,0 +1,70 @@
//------------------------------------------------------------------------------
// Desc: Db Check Status
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbCheckStatus.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface alows XFlaim to periodically pass information back to the
* client about the status of an ongoing database check operation. The
* implementor may do anything it wants with the information, such as write
* it to a log file or display it on the screen. Additionally, it allows
* the implementor to chose, on a case-by-case basis, whether to attempt
* to fix problems manually, request XFLaim attempt to fix them or
* ignore them alltogether.
*/
public interface DbCheckStatus
{
/**
* Called periodically by XFlaim to inform the client of the status
* of an ongoing database check operation.
* @param ProgCheck A class who's public data members contain
* information about what exactly has been checked so far and
* what problems have been found.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* check operation to abort and an XFLaimException to be thrown.
* @see xflaim.CHECKINFO
*/
int reportProgress(
CHECKINFO ProgCheck);
/**
* Called by XFlaim when an error has been detected during a database
* check.
* @param CorruptInfo A class who's public data members contain
* information describing the nature of the currption.
* @param bFix This is an array containing a single element. If the
* client writes a true into that element, then XFlaim will attempt
* to fix the corruption.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* check operation to abort and an XFLaimException to be thrown.
* @see xflaim.CORRUPTINFO
*/
int reportCheckErr(
CORRUPTINFO CorruptInfo,
boolean[] bFix);
}

View File

@@ -0,0 +1,56 @@
//------------------------------------------------------------------------------
// Desc: Db Copy Status
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbCopyStatus.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface alows XFlaim to periodically pass information back to the
* client about the status of an ongoing database copy operation. The
* implementor may do anything it wants with the information, such as write
* it to a log file or display it on the screen.
*/
public interface DbCopyStatus
{
/**
* Called periodically to inform the client about the status of the copy
* operation.
* @param ui64BytesToCopy The total number of bytes that this operation
* will copy.
* @param ui64BytesCopied The number of bytes that have been copied so far.
* @param bNewSrcFile Set to true if the copy operation has started
* working on a new file.
* @param pszSrcFileName The name of the file that is currently being copied.
* @param pszDestFileName The name of the destination file.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* copy operation to abort and an XFLaimException to be thrown.
*/
int dbCopyStatus(
long ui64BytesToCopy,
long ui64BytesCopied,
boolean bNewSrcFile,
String pszSrcFileName,
String pszDestFileName);
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// Desc: Db Copy Status
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbInfo.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class DbInfo
{
DbInfo(
long lRef) throws XFlaimException
{
if (lRef == 0)
{
throw new XFlaimException( -1, "No legal reference");
}
m_this = lRef;
}
/**
* Desc:
*/
protected void finalize()
{
_release( m_this);
}
/**
* Desc:
*/
private native void _release(
long lThis);
private long m_this;
}

View File

@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// Desc: Db Rebuild
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbRebuildStatus.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public interface DbRebuildStatus
{
}

View File

@@ -0,0 +1,48 @@
//------------------------------------------------------------------------------
// Desc: Db Rename Status
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbRenameStatus.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface alows XFlaim to periodically pass information back to the
* client about the status of an ongoing database rename operation. The
* implementor may do anything it wants with the information, such as write
* it to a log file or display it on the screen.
*/
public interface DbRenameStatus
{
/**
* Called after each file is renamed.
* @param sSrcFileName The old name of the file.
* @param sDstFileName The new name of the file.
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* rename operation to abort and an XFLaimException to be thrown.
*/
public int dbRenameStatus(
String sSrcFileName,
String sDstFileName);
}

View File

@@ -0,0 +1,484 @@
//------------------------------------------------------------------------------
// Desc: Db System
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DbSystem.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* The DbSystem class provides a number of methods that allow java
* applications to access the XFlaim native environment, specifically, the
* IF_DbSystem interface.
*/
public class DbSystem
{
static
{
System.loadLibrary( "xflaimjni");
}
/**
* Loads the appropriate native library (as determined from the system
* properties).
*
* @throws XFlaimException
*/
public DbSystem()
throws XFlaimException
{
super();
m_this = _createDbSystem();
_init(m_this);
}
public void finalize()
{
_exit( m_this);
m_this = 0;
}
public void dbClose()
{
_exit( m_this);
m_this = 0;
}
/**
* Creates a new XFlaim database.
*
* @param sDbFileName The name of the database to create. (Should be a
* filename ending in .db)
* @param sDataDir The directory where the database should be created.
* If null, the current directory will be used.
* @param sRflDir The directory where the roll forward log files should be
* stored. If null, then they will be stored in a subdirectory under the
* directory containing the main database file.
* @param sDictFileName - The name of a file which contains dictionary
* definition items. May be null. Ignored if sDictBuf is non-null.
* @param sDictBuf - Contains dictionary definitions. If null,
* sDictFileName is used. If both sDictFileName and sDictBuf are null,
* the database is created with an empty dictionary.
* @param CreateOpts - An object containing several parameters that affect
* the creation of the database. (For advanced users.)
* @return Db reference.
* @throws XFlaimException
*/
public Db dbCreate(
String sDbFileName,
String sDataDir,
String sRflDir,
String sDictFileName,
String sDictBuf,
CREATEOPTS CreateOpts) throws XFlaimException
{
Db jDb = null;
long jDb_ref;
jDb_ref = _dbCreate( m_this, sDbFileName, sDataDir, sRflDir,
sDictFileName, sDictBuf, CreateOpts);
if( jDb_ref != 0)
{
jDb = new Db( jDb_ref, this);
}
return( jDb);
}
/**
* Opens an existing XFlaim database.
* @param sDbFileName The name of the database to open. (Should be a
* filename ending in .db)
* @param sDataDir The directory where the database should be created.
* If null, the current directory will be used.
* @param sRflDir The directory where the roll forward log files should be
* stored. If null, then they will be stored in a subdirectory under the
* directory containing the main database file.
* @return Returns an instance of Db.
* @throws XFlaimException
*/
public Db dbOpen(
String sDbFileName,
String sDataDir,
String sRflDir,
String sPassword,
boolean bAllowLimited) throws XFlaimException
{
Db jDb = null;
long jDb_ref;
if( (jDb_ref = _dbOpen( m_this, sDbFileName, sDataDir,
sRflDir, sPassword, bAllowLimited)) != 0)
{
jDb = new Db( jDb_ref, this);
}
return( jDb);
}
/**
* Removes (deletes) an XFlaim database.
* @param sDbFileName The name of the database to delete. (Should be a
* filename ending in .db)
* @param sDataDir The directory where the database currently exists.
* If null, the current directory is assumed.
* @param sRflDir The directory where the roll forward log files are
* stored. If null, then they are assumed to be stored in a subdirectory
* under the directory containing the main database file.
* @param bRemoveRflFiles If true, the roll forward log files will be
* deleted.
*/
public void dbRemove(
String sDbFileName,
String sDataDir,
String sRflDir,
boolean bRemoveRflFiles)
{
_dbRemove( m_this, sDbFileName, sDataDir, sRflDir, bRemoveRflFiles);
}
/**
* Restores a previously backed up database. <code>sBackupPath</code> and
* <code> RestoreClient</code> are mutually exclusive. If
* <code>RestoreClient</code> is null, then an instance of
* <code>DefaultRestoreClient</code> will be created and
* <code>sBackupPath</code> passed into its constructor. If <code>
* RestoreClient</code> is non-null, <code>sBackupPath</code> is ignored.
* @param sDbPath The name of the database to create. (Should be a
* filename ending in .db)
* @param sDataDir Optional. The directory where the new data files will
* be stored. If null, then they will be stored in the same directory as
* the .db file.
* @param sRflDir Optional. The directory where RFL files will be stored.
* If null, then they will be stored in a subdirectory under the directory
* containing the .db file.
* @param sBackupPath Optional. The path to the backup files.
* @param RestoreClient Optional. An object implementing the
* {@link RestoreClient RestoreClient} interface
* @param RestoreStatus Optional. An object implementing the
* {@link RestoreStatus RestoreStatus} interface
* @throws XFlaimException
*/
public void dbRestore(
String sDbPath,
String sDataDir,
String sRflDir,
String sBackupPath,
String sPassword,
RestoreClient RestoreClient,
RestoreStatus RestoreStatus) throws XFlaimException
{
RestoreClient Client;
if (RestoreClient != null)
{
Client = RestoreClient;
}
else
{
Client = new DefaultRestoreClient( sBackupPath);
}
_dbRestore( m_this, sDbPath, sDataDir, sRflDir, sBackupPath,
sPassword, Client, RestoreStatus);
}
/**
* Opens a buffered input stream.
* @param sBuffer
* @return Returns an instance of PosIStream.
*/
public PosIStream openBufferIStream(
String sBuffer) throws XFlaimException
{
PosIStream jPosIStream = null;
long lRef = 0;
lRef = _openBufferIStream( m_this, sBuffer);
if (lRef != 0)
{
jPosIStream = new PosIStream( lRef, sBuffer, this);
}
return( jPosIStream);
}
/**
* Opens a file to be used as an input stream.
* @param sPath The pathname of the file to be opened.
* @return Returns an instance of PosIStream.
* @throws XFlaimException
*/
public PosIStream openFileIStream( String sPath) throws XFlaimException
{
PosIStream jIStream = null;
long lRef = 0;
lRef = _openFileIStream(
m_this,
sPath);
if (lRef != 0)
{
jIStream = new PosIStream( lRef, this);
}
return( jIStream);
}
/**
* Creates and returns a DataVector object to be used when searching
* indexes.
* @return DataVector
*/
public DataVector createJDataVector() throws XFlaimException
{
DataVector jDataVector = null;
long lRef = 0;
lRef = _createJDataVector(m_this);
if (lRef != 0)
{
jDataVector = new DataVector(lRef, this);
}
return jDataVector;
}
/**
* Peforms an integrity check on the specified database.
* @param sDbFileName The name of the database to be checked. (Should be a
* filename ending in .db)
* @param sDataDir Optional. The directory where the data files are
* stored. If null, then XFlaim will assume that they are stored in the
* same directory as the .db file.
* @param sRflDir Optional. The directory where RFL files are stored.
* If null, then XFlaim will assume that they are stored in a subdirectory
* under the directory containing the .db file.
* @param iFlags Flags that control exactly what the operation checks.
* Should be a logical OR of the members of
* {@link xflaim.DbCheckFlags DbCheckFlags}.
* @param Status Optional. If non-null, then XFlaim will call member
* functions to report progress of the check and report any errors that
* are found.
* @return Returns an instance of DbInfo containing data on the physical
* structure of the database.
* @throws XFlaimException
*/
public DbInfo dbCheck(
String sDbFileName,
String sDataDir,
String sRflDir,
String sPassword,
int iFlags,
DbCheckStatus Status) throws XFlaimException
{
long lRef = _dbCheck( m_this, sDbFileName, sDataDir, sRflDir,
sPassword, iFlags, Status);
return new DbInfo( lRef);
}
/**
* Makes a copy of an existing database.
* @param sSrcDbName The name of the existing database. (Should be a
* filename ending in .db)
* @param sSrcDataDir Optional. The directory where the data files are
* stored. If null, then XFlaim will assume that they are stored in the
* same directory as the .db file.
* @param sSrcRflDir Optional. The directory where RFL files are stored.
* If null, then XFlaim will assume that they are stored in a subdirectory
* under the directory containing the .db file.
* @param sDestDbName The name for the new database.
* @param sDestDataDir Optional. The directory where the data files for
* the new database will be stored.
* @param sDestRflDir Optional. The directory where the RFL files for the
* new database will be stored.
* @param Status Optional. If non-null, then <code>Status.dbCopyStatus
* </code> will be called periodically.
* @throws XFlaimException
*/
public void dbCopy(
String sSrcDbName,
String sSrcDataDir,
String sSrcRflDir,
String sDestDbName,
String sDestDataDir,
String sDestRflDir,
DbCopyStatus Status) throws XFlaimException
{
_dbCopy( m_this, sSrcDbName, sSrcDataDir, sSrcRflDir,
sDestDbName, sDestDataDir, sDestRflDir, Status);
}
/**
* Renames a database.
* @param sDbName The name of the database to be renamed. (Should be a
* filename ending in .db)
* @param sDataDir Optional. The directory where the data files are
* stored. If null, then XFlaim will assume that they are stored in the
* same directory as the .db file.
* @param sRflDir Optional. The directory where RFL files are stored.
* If null, then XFlaim will assume that they are stored in a subdirectory
* under the directory containing the .db file.
* @param sNewDbName The new name for the database.
* @param bOverwriteDestOk If true, then if the database specified in
* sNewDbName already exists, it will be overwritten.
* @param Status Optional. If non-null, then <code>Status.dbRenameStatus
* </code> will be called as every file is renamed.
* @throws XFlaimException
*/
public void dbRename(
String sDbName,
String sDataDir,
String sRflDir,
String sNewDbName,
boolean bOverwriteDestOk,
DbRenameStatus Status) throws XFlaimException
{
_dbRename( m_this, sDbName, sDataDir, sRflDir, sNewDbName,
bOverwriteDestOk, Status);
}
/**
* Desc:
*/
private native long _createDbSystem();
/**
* Desc:
*/
private native void _init( long lThis);
/**
* Desc:
*/
private native void _exit( long lThis);
/**
* Desc:
*/
private native long _dbCreate(
long lThis,
String DbFileName,
String DataDir,
String RflDir,
String DictFileName,
String DictBuf,
CREATEOPTS CreateOpts);
private native long _dbOpen(
long lThis,
String DbFileName,
String DataDir,
String RflDir,
String Password,
boolean bAllowLimited);
/**
* Desc:
*/
private native void _dbRemove(
long lThis,
String DbFileName,
String DataDir,
String RflDir,
boolean bRemoveRflFiles);
/**
* Desc:
*/
private native long _dbCheck(
long lThis,
String sDbFileName,
String sDataDir,
String sRflDir,
String sPassword,
int iFlags,
DbCheckStatus Status) throws XFlaimException;
/**
* Desc:
*/
private native void _dbCopy(
long lThis,
String sSrcDbName,
String sSrcDataDir,
String sSrcRflDir,
String sDestDbName,
String sDestDataDir,
String sDestRflDir,
DbCopyStatus Status) throws XFlaimException;
/**
* Desc:
*/
private native void _dbRestore(
long lThis,
String sDbPath,
String sDataDir,
String sRflDir,
String sBackupPath,
String sPassword,
RestoreClient RestoreClient,
RestoreStatus RestoreStatus) throws XFlaimException;
/**
* Desc:
*/
private native void _dbRename(
long lThis,
String sDbName,
String sDataDir,
String sRflDir,
String sNewDbName,
boolean bOverwriteDestOk,
DbRenameStatus Status) throws XFlaimException;
/**
* Desc:
*/
private native long _openBufferIStream(
long lThis,
String sBuffer) throws XFlaimException;
/**
* Desc:
*/
private native long _openFileIStream(
long lThis,
String sPath);
/**
* Desc:
*/
private native long _createJDataVector(
long lRef);
private long m_this;
}

View File

@@ -0,0 +1,81 @@
//------------------------------------------------------------------------------
// Desc: Default Backup Client
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: DefaultBackupClient.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import xflaim.RCODE;
/**
* This is a simple example of an object that implements the <code>
* BackupClient</code> interface. It writes the backed up data
* to a file. Note that like the C++ default backup, this class can
* only be used for full backups. This class cannot be used for an
* incremental backup.
*/
public class DefaultBackupClient
implements BackupClient
{
public DefaultBackupClient(
String sBackupPath) throws FileNotFoundException
{
File BackupDir = new File( sBackupPath);
BackupDir.mkdirs();
// Note: This rather odd name comes from the desire to maintain
// compatibility with C++ default backup client
String sPathName = sBackupPath +
System.getProperty( "file.separator") +
"00000000.64";
m_OStream = new FileOutputStream( sPathName);
}
/**
* Desc:
*/
public int WriteData(
byte[] Buffer)
{
int iRCode = RCODE.NE_XFLM_OK;
try
{
m_OStream.write( Buffer);
}
catch (IOException e)
{
iRCode = RCODE.NE_XFLM_WRITING_FILE;
}
return( iRCode);
}
private FileOutputStream m_OStream;
}

View File

@@ -0,0 +1,165 @@
//------------------------------------------------------------------------------
// Desc: Default Restore Client
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
package xflaim;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import xflaim.RCODE;
/**
* This is a simple example of a class that implements the
* {@link RestoreClient RestoreClient} interface. It restores from a
* backup file created with {@link DefaultBackupClient
* DefaultBackupClient}. Note that this class is mostly intended as a
* demonstration. It only restores full backups; it cannot handle incremental
* or hot, continuous backups.
*/
public class DefaultRestoreClient implements RestoreClient
{
public DefaultRestoreClient(
String sBackupPath)
{
m_sBackupPath = sBackupPath;
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#openBackupSet()
*/
public int openBackupSet()
{
int iRc = RCODE.NE_XFLM_OK;
// Note: This rather odd name comes from the desire to maintain
// compatibility with C++ default backup client
String sPathName = m_sBackupPath +
System.getProperty( "file.separator") +
"00000000.64";
try
{
m_IStream = new FileInputStream( sPathName);
}
catch ( FileNotFoundException e)
{
iRc = RCODE.NE_XFLM_IO_PATH_NOT_FOUND;
}
return( iRc);
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#openRflFile(int)
*/
public int openRflFile(int iFileNum)
{
// This function is not, and probably never will be, implemented.
// If you really want to restore from a hot, continuous backup,
// you should write your own implementations of RestoreClient
// (and BackupClient).
return( RCODE.NE_XFLM_FAILURE);
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#openIncFile(int)
*/
public int openIncFile(int iFileNum)
{
// This function is not, and probably never will be, implemented.
// If you really want to restore from an incremental backup,
// you should write your own implementations of RestoreClient
// (and BackupClient).
// Note that this function will still be called by XFlaim. Returning
// PATH_NOT_FOUND is what tells XFLaim that there are no more incremental
// backups.
return( RCODE.NE_XFLM_IO_PATH_NOT_FOUND);
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#read(int, byte[])
*/
public int read(byte[] Buffer, int[] BytesRead)
{
// Try to read Buffer.length bytes from the file.
// Store the actual bytes read in BytesRead[0]. Note that
// BytesRead will have a length of 1.
int iBytesRead = 0;
int iRc = RCODE.NE_XFLM_OK;
try
{
iBytesRead = m_IStream.read( Buffer);
}
catch (IOException e)
{
iRc = RCODE.NE_XFLM_FAILURE;
}
if( iBytesRead == -1)
{
iBytesRead = 0;
iRc = RCODE.NE_XFLM_IO_END_OF_FILE;
}
BytesRead[0] = iBytesRead;
return( iRc);
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#close()
*/
public int close()
{
int iRc = RCODE.NE_XFLM_OK;
try
{
m_IStream.close();
}
catch ( IOException e)
{
iRc = RCODE.NE_XFLM_FAILURE;
}
m_IStream = null;
return( iRc);
}
/* (non-Javadoc)
* @see xflaim.RestoreClient#abortFile()
*/
public int abortFile() {
return close();
}
private String m_sBackupPath;
private FileInputStream m_IStream;
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// Desc: Backup
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: FlmBackupType.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Provides enums for all (currently 2) of the possible types of backups.
* NOTE: The values in this class must match *exactly* with the eFBackupType
* enum in xflaim.h
*/
public final class FlmBackupType
{
public static final int FULL_BACKUP = 0;
public static final int INCREMENTAL_BACKUP = 1;
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// Desc: Data Type
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: FlmDataType.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Provides enums for all of the possible data types a DOM node can hold.
* NOTE: The values in this class must match *exactly* with the equivalent
* #defines in xflaim.h
*/
public final class FlmDataType
{
public static final int FLM_NODATA_TYPE = 0;
public static final int FLM_TEXT_TYPE = 1;
public static final int FLM_NUMBER_TYPE = 2;
public static final int FLM_BINARY_TYPE = 3;
public static final int FLM_NUM_OF_TYPES = 4;
public static final int FLM_UNKNOWN_TYPE = 0xF;
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// Desc: Dictionary Index
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: FlmDictIndex.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* To change the template for this generated type comment go to
* Window->Preferences->Java->Code Generation->Code and Comments
*/
public final class FlmDictIndex
{
public static final int MAX_INDEX_NUM = 65500;
public static final int NUMBER_INDEX = 65534;
public static final int NAME_INDEX = 65535;
}

View File

@@ -0,0 +1,45 @@
//------------------------------------------------------------------------------
// Desc: DOM Node Type
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: FlmDomNodeType.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Provides enums for all of the possible DOM node types.
* NOTE: The values in this class must match *exactly* with the
* eFlmDomNodeType enum defined in xflaim.h
*/
public final class FlmDomNodeType
{
public final static int INVALID_NODE = 0x00;
public final static int DOCUMENT_NODE = 0x01;
public final static int ELEMENT_NODE = 0x02;
public final static int DATA_NODE = 0x03;
public final static int COMMENT_NODE = 0x04;
public final static int CDATA_SECTION_NODE = 0x05;
public final static int ANNOTATION_NODE = 0x06;
public final static int PROCESSING_INSTRUCTION_NODE = 0x07;
public final static int ATTRIBUTE_NODE = 0x08;
public final static int ANY_NODE_TYPE = 0xFFFF;
}

View File

@@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
// Desc: Insert Location
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: FlmInsertLoc.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Contains a class that provides enums for the different ways a new DOM node
* can be inserted into an existing document.
* NOTE: The values in this class must match *exactly* with the eFlmInsertLoc
* enum defined in xflaim.h
*/
public final class FlmInsertLoc
{
public static final int FLM_FIRST_CHILD = 1;
public static final int FLM_LAST_CHILD = 2;
public static final int FLM_PREV_SIB = 3;
public static final int FLM_NEXT_SIB = 4;
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// Desc: Key Retrieve Flags
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: KeyRetrieveFlags.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* To change the template for this generated type comment go to
* Window->Preferences->Java->Code Generation->Code and Comments
*/
public final class KeyRetrieveFlags
{
public static final int FO_INCL = 0x0010;
public static final int FO_EXCL = 0x0020;
public static final int FO_EXACT = 0x0040;
public static final int FO_KEY_EXACT = 0x0080;
public static final int FO_FIRST = 0x0100;
public static final int FO_LAST = 0x0200;
public static final int FO_MATCH_IDS = 0x0400;
}

View File

@@ -0,0 +1,118 @@
//------------------------------------------------------------------------------
// Desc: Positionable Input Stream
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: PosIStream.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* The PosIStream class provides a number of methods that allow java
* applications to access the XFlaim native environment, specifically, the
* IF_PosIStream interface.
*/
public class PosIStream
{
PosIStream(
long lRef,
String sBuffer,
DbSystem dbSystem) throws XFlaimException
{
if (lRef == 0)
{
throw new XFlaimException( -1, "No legal reference to an F_PosIStream");
}
m_this = lRef;
if (dbSystem==null)
{
throw new XFlaimException( -1, "No legal dbSystem reference");
}
m_dbSystem = dbSystem;
if (sBuffer == null)
{
throw new XFlaimException( -1, "No legal reference to a buffer");
}
m_sBuffer = sBuffer;
}
PosIStream(
long lRef,
DbSystem dbSystem) throws XFlaimException
{
if (lRef == 0)
{
throw new XFlaimException( -1, "No legal reference to an IF_PosIStream");
}
m_this = lRef;
if (dbSystem==null)
{
throw new XFlaimException( -1, "No legal dbSystem reference");
}
m_dbSystem = dbSystem;
m_sBuffer = null;
}
/**
* Finalizer method used to release native resources on garbage collection.
*/
public void finalize()
{
if (m_this != 0)
{
_release( m_this);
m_this = 0;
}
m_dbSystem = null;
}
/**
*
*/
public void release()
{
if (m_this != 0)
{
_release( m_this);
m_this = 0;
}
m_dbSystem = null;
}
/**
*
*/
private native void _release( long iThis);
private long m_this;
private DbSystem m_dbSystem;
private String m_sBuffer;
}

View File

@@ -0,0 +1,405 @@
//------------------------------------------------------------------------------
// Desc: RCODEs
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: RCODE.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006; dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Provides enums for some of the error codes that XFlaim might return in an
* {@link xflaim.XFlaimException XFlaimException}.
*/
public final class RCODE
{
public static final int NE_XFLM_OK = 0;
public static final int NE_XFLM_FIRST_COMMON_ERROR = 0x81050000; // NOTE: This is not an error code - do not document it
public static final int NE_XFLM_NOT_IMPLEMENTED = 0x81050001; // NE_NOT_IMPLEMENTED - Attempt was made to use a feature that is not implemented.
public static final int NE_XFLM_MEM = 0x81050002; // NE_INSUFFICIENT_MEMORY - Attempt to allocate memory failed.
public static final int NE_XFLM_INVALID_PARM = 0x81050005; // NE_INVALID_PARAMETER - Invalid parameter passed into a function.
public static final int NE_XFLM_TIMEOUT = 0x81050009; // NE_WAIT_TIMEOUT - Database operation timed out (usually a query operation;.
public static final int NE_XFLM_NOT_FOUND = 0x8105000A; // NE_OBJECT_NOT_FOUND - An object was not found.
public static final int NE_XFLM_EXISTS = 0x8105000C; // NE_OBJECT_ALREADY_EXISTS - Object already exists.
public static final int NE_XFLM_USER_ABORT = 0x81050010; // NE_CALLBACK_CANCELLED - User or application aborted (canceled; the operation
public static final int NE_XFLM_FAILURE = 0x81050011; // NE_RECOVERABLE_FAILURE - Internal failure.
public static final int NE_XFLM_LAST_COMMON_ERROR = 0x81050012; // NOTE: This is not an error code - do not document.
public static final int NE_XFLM_FIRST_GENERAL_ERROR = 0x81050100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_BOF_HIT = 0x81050101; // Beginning of results encountered. This error is may be returned when reading query results in reverse order (from last to first;.
public static final int NE_XFLM_EOF_HIT = 0x81050102; // End of results encountered. This error may be returned when reading query results in forward order (first to last;.
public static final int NE_XFLM_END = 0x81050103; // End of roll-forward log packets encountered. NOTE: This error code should never be returned to an application.
public static final int NE_XFLM_BAD_PREFIX = 0x81050104; // Invalid XLM namespace prefix specified. Either a prefix name or number that was specified was not defined.
public static final int NE_XFLM_ATTRIBUTE_PURGED = 0x81050105; // XML attribute cannot be used - it is being deleted from the database.
public static final int NE_XFLM_BAD_COLLECTION = 0x81050106; // Invalid collection number specified. Collection is not defined.
public static final int NE_XFLM_DATABASE_LOCK_REQ_TIMEOUT = 0x81050107; // Request to lock the database timed out.
public static final int NE_XFLM_ILLEGAL_DATA_COMPONENT = 0x81050108; // Cannot use ELM_ROOT_TAG as a data component in an index.
public static final int NE_XFLM_BAD_DATA_TYPE = 0x81050109; // Attempt to set/get data on an XML element or attribute using a data type that is incompatible with the data type specified in the dictionary.
public static final int NE_XFLM_MUST_INDEX_ON_PRESENCE = 0x8105010A; // When using ELM_ROOT_TAG in an index component, must specify PRESENCE indexing only.
public static final int NE_XFLM_BAD_IX = 0x8105010B; // Invalid index number specified. Index is not defined.
public static final int NE_XFLM_BACKUP_ACTIVE = 0x8105010C; // Operation could not be performed because a backup is currently in progress.
public static final int NE_XFLM_SERIAL_NUM_MISMATCH = 0x8105010D; // Serial number on backup file does not match the serial number that is expected.
public static final int NE_XFLM_BAD_RFL_DB_SERIAL_NUM = 0x8105010E; // Bad database serial number in roll-forward log file header.
public static final int NE_XFLM_BTREE_ERROR = 0x8105010F; // A B-Tree in the database is bad.
public static final int NE_XFLM_BTREE_FULL = 0x81050110; // A B-tree in the database is full, or a b-tree being used for a temporary result set is full.
public static final int NE_XFLM_BAD_RFL_FILE_NUMBER = 0x81050111; // Bad roll-forward log file number in roll-forward log file header.
public static final int NE_XFLM_CANNOT_DEL_ELEMENT = 0x81050112; // Cannot delete an XML element definition in the dictionary because it is in use.
public static final int NE_XFLM_CANNOT_MOD_DATA_TYPE = 0x81050113; // Cannot modify the data type for an XML element or attribute definition in the dictionary.
public static final int NE_XFLM_CANNOT_INDEX_DATA_TYPE = 0x81050114; // Data type of XML element or attribute is not one that can be indexed.
public static final int NE_XFLM_CONV_BAD_DIGIT = 0x81050115; // Non-numeric digit found in text to numeric conversion.
public static final int NE_XFLM_CONV_DEST_OVERFLOW = 0x81050116; // Destination buffer not large enough to hold data.
public static final int NE_XFLM_CONV_ILLEGAL = 0x81050117; // Attempt to convert between data types is an unsupported conversion.
public static final int NE_XFLM_CONV_NULL_SRC = 0x81050118; // Data source cannot be NULL when doing data conversion.
public static final int NE_XFLM_CONV_NUM_OVERFLOW = 0x81050119; // Numeric overflow (> upper bound; converting to numeric type.
public static final int NE_XFLM_CONV_NUM_UNDERFLOW = 0x8105011A; // Numeric underflow (< lower bound; converting to numeric type.
public static final int NE_XFLM_BAD_ELEMENT_NUM = 0x8105011B; // Bad element number specified - element not defined in dictionary.
public static final int NE_XFLM_BAD_ATTRIBUTE_NUM = 0x8105011C; // Bad attribute number specified - attribute not defined in dictionary.
public static final int NE_XFLM_BAD_ENCDEF_NUM = 0x8105011D; // Bad encryption number specified - encryption definition not defined in dictionary.
public static final int NE_XFLM_DATA_ERROR = 0x8105011E; // Encountered data in the database that was corrupted.
public static final int NE_XFLM_INVALID_FILE_SEQUENCE = 0x8105011F; // Incremental backup file number provided during a restore is invalid.
public static final int NE_XFLM_ILLEGAL_OP = 0x81050120; // Attempt to perform an illegal operation.
public static final int NE_XFLM_DUPLICATE_ELEMENT_NUM = 0x81050121; // Element number specified in element definition is already in use.
public static final int NE_XFLM_ILLEGAL_TRANS_TYPE = 0x81050122; // Illegal transaction type specified for transaction begin operation.
public static final int NE_XFLM_UNSUPPORTED_VERSION = 0x81050123; // Version of database found in database header is not supported.
public static final int NE_XFLM_ILLEGAL_TRANS_OP = 0x81050124; // Illegal operation for transaction type.
public static final int NE_XFLM_INCOMPLETE_LOG = 0x81050125; // Incomplete rollback log.
public static final int NE_XFLM_ILLEGAL_INDEX_DEF = 0x81050126; // Index definition document is illegal - does not conform to the expected form of an index definition document.
public static final int NE_XFLM_ILLEGAL_INDEX_ON = 0x81050127; // The "IndexOn" attribute of an index definition has an illegal value.
public static final int NE_XFLM_ILLEGAL_STATE_CHANGE = 0x81050128; // Attempted an illegal state change on an element or attribute definition.
public static final int NE_XFLM_BAD_RFL_SERIAL_NUM = 0x81050129; // Serial number in roll-forward log file header does not match expected serial number.
public static final int NE_XFLM_NEWER_FLAIM = 0x8105012A; // Running old code on a newer version of database. Newer code must be used.
public static final int NE_XFLM_CANNOT_MOD_ELEMENT_STATE = 0x8105012B; // Attempted to change state of a predefined element definition.
public static final int NE_XFLM_CANNOT_MOD_ATTRIBUTE_STATE = 0x8105012C; // Attempted to change state of a predefined attribute definition.
public static final int NE_XFLM_NO_MORE_ELEMENT_NUMS = 0x8105012D; // The highest element number has already been used, cannot create more element definitions.
public static final int NE_XFLM_NO_TRANS_ACTIVE = 0x8105012E; // Operation must be performed inside a database transaction.
public static final int NE_XFLM_NOT_UNIQUE = 0x8105012F; // Attempt was made to insert a key into a b-tree that was already in the b-tree.
public static final int NE_XFLM_NOT_FLAIM = 0x81050130; // The file specified is not a FLAIM database.
public static final int NE_XFLM_OLD_VIEW = 0x81050131; // Unable to maintain read transaction's view of the database.
public static final int NE_XFLM_SHARED_LOCK = 0x81050132; // Attempted to perform an operation on the database that requires exclusive access, but cannot because there is a shared lock.
public static final int NE_XFLM_SYNTAX = 0x81050133; // Syntax error while parsing XML or query.
public static final int NE_XFLM_TRANS_ACTIVE = 0x81050134; // Operation cannot be performed while a transaction is active.
public static final int NE_XFLM_RFL_TRANS_GAP = 0x81050135; // A gap was found in the transaction sequence in the roll-forward log.
public static final int NE_XFLM_BAD_COLLATED_KEY = 0x81050136; // Something in collated key is bad.
public static final int NE_XFLM_UNSUPPORTED_FEATURE = 0x81050137; // Attempting to use a feature for which full support has been disabled.
public static final int NE_XFLM_MUST_DELETE_INDEXES = 0x81050138; // Attempting to delete a collection that has indexes defined for it. Associated indexes must be deleted before the collection can be deleted.
public static final int NE_XFLM_RFL_INCOMPLETE = 0x81050139; // Roll-forward log file is incomplete.
public static final int NE_XFLM_CANNOT_RESTORE_RFL_FILES = 0x8105013A; // Cannot restore roll-forward log files - not using multiple roll-forward log files.
public static final int NE_XFLM_INCONSISTENT_BACKUP = 0x8105013B; // A problem (corruption, etc.; was detected in a backup set.
public static final int NE_XFLM_BLOCK_CRC = 0x8105013C; // CRC for database block was invalid. May indicate problems in reading from or writing to disk.
public static final int NE_XFLM_ABORT_TRANS = 0x8105013D; // Attempted operation after a critical error - transaction should be aborted.
public static final int NE_XFLM_NOT_RFL = 0x8105013E; // File was not a roll-forward log file as expected.
public static final int NE_XFLM_BAD_RFL_PACKET = 0x8105013F; // Roll-forward log file packet was bad.
public static final int NE_XFLM_DATA_PATH_MISMATCH = 0x81050140; // Bad data path specified to open database. Does not match data path specified for prior opens of the database.
public static final int NE_XFLM_STREAM_EXISTS = 0x81050141; // Attempt to create stream, but the file(s; already exists.
public static final int NE_XFLM_FILE_EXISTS = 0x81050142; // Attempt to create a database, but the file already exists.
public static final int NE_XFLM_COULD_NOT_CREATE_SEMAPHORE = 0x81050143; // Could not create a semaphore.
public static final int NE_XFLM_MUST_CLOSE_DATABASE = 0x81050144; // Database must be closed due to a critical error.
public static final int NE_XFLM_INVALID_ENCKEY_CRC = 0x81050145; // Encryption key CRC could not be verified.
public static final int NE_XFLM_BAD_UTF8 = 0x81050146; // An invalid byte sequence was found in a UTF-8 string
public static final int NE_XFLM_COULD_NOT_CREATE_MUTEX = 0x81050147; // Could not create a mutex.
public static final int NE_XFLM_ERROR_WAITING_ON_SEMPAHORE = 0x81050148; // Error occurred while waiting on a sempahore.
public static final int NE_XFLM_BAD_PLATFORM_FORMAT = 0x81050149; // Cannot support platform format. NOTE: No need to document this one, it is strictly internal.
public static final int NE_XFLM_HDR_CRC = 0x8105014A; // Database header has a bad CRC.
public static final int NE_XFLM_NO_NAME_TABLE = 0x8105014B; // No name table was set up for the database.
public static final int NE_XFLM_MULTIPLE_MATCHES = 0x8105014C; // Multiple entries match the name in the name table. Need to pass a namespace to disambiguate.
public static final int NE_XFLM_UNALLOWED_UPGRADE = 0x8105014D; // Cannot upgrade database from one version to another.
public static final int NE_XFLM_BTREE_BAD_STATE = 0x8105014E; // Btree function called before proper setup steps taken.
public static final int NE_XFLM_DUPLICATE_ATTRIBUTE_NUM = 0x8105014F; // Attribute number specified in attribute definition is already in use.
public static final int NE_XFLM_DUPLICATE_INDEX_NUM = 0x81050150; // Index number specified in index definition is already in use.
public static final int NE_XFLM_DUPLICATE_COLLECTION_NUM = 0x81050151; // Collection number specified in collection definition is already in use.
public static final int NE_XFLM_DUPLICATE_ELEMENT_NAME = 0x81050152; // Element name+namespace specified in element definition is already in use.
public static final int NE_XFLM_DUPLICATE_ATTRIBUTE_NAME = 0x81050153; // Attribute name+namespace specified in attribute definition is already in use.
public static final int NE_XFLM_DUPLICATE_INDEX_NAME = 0x81050154; // Index name specified in index definition is already in use.
public static final int NE_XFLM_DUPLICATE_COLLECTION_NAME = 0x81050155; // Collection name specified in collection definition is already in use.
public static final int NE_XFLM_ELEMENT_PURGED = 0x81050156; // XML element cannot be used - it is deleted from the database.
public static final int NE_XFLM_TOO_MANY_OPEN_DATABASES = 0x81050157; // Too many open databases, cannot open another one.
public static final int NE_XFLM_DATABASE_OPEN = 0x81050158; // Operation cannot be performed because the database is currently open.
public static final int NE_XFLM_CACHE_ERROR = 0x81050159; // Cached database block has been compromised while in cache.
public static final int NE_XFLM_BTREE_KEY_SIZE = 0x8105015A; // Key too large to insert/lookup in a b-tree.
public static final int NE_XFLM_DB_FULL = 0x8105015B; // Database is full, cannot create more blocks.
public static final int NE_XFLM_QUERY_SYNTAX = 0x8105015C; // Query expression had improper syntax.
public static final int NE_XFLM_COULD_NOT_START_THREAD = 0x8105015D; // Error occurred while attempting to start a thread.
public static final int NE_XFLM_INDEX_OFFLINE = 0x8105015E; // Index is offline, cannot be used in a query.
public static final int NE_XFLM_RFL_DISK_FULL = 0x8105015F; // Disk which contains roll-forward log is full.
public static final int NE_XFLM_MUST_WAIT_CHECKPOINT = 0x81050160; // Must wait for a checkpoint before starting transaction - due to disk problems - usually in disk containing roll-forward log files.
public static final int NE_XFLM_MISSING_ENC_ALGORITHM = 0x81050161; // Encryption definition is missing an encryption algorithm.
public static final int NE_XFLM_INVALID_ENC_ALGORITHM = 0x81050162; // Invalid encryption algorithm specified in encryption definition.
public static final int NE_XFLM_INVALID_ENC_KEY_SIZE = 0x81050163; // Invalid key size specified in encryption definition.
public static final int NE_XFLM_ILLEGAL_DATA_TYPE = 0x81050164; // Data type specified for XML element or attribute definition is illegal.
public static final int NE_XFLM_ILLEGAL_STATE = 0x81050165; // State specified for index definition or XML element or attribute definition is illegal.
public static final int NE_XFLM_ILLEGAL_ELEMENT_NAME = 0x81050166; // XML element name specified in element definition is illegal.
public static final int NE_XFLM_ILLEGAL_ATTRIBUTE_NAME = 0x81050167; // XML attribute name specified in attribute definition is illegal.
public static final int NE_XFLM_ILLEGAL_COLLECTION_NAME = 0x81050168; // Collection name specified in collection definition is illegal.
public static final int NE_XFLM_ILLEGAL_INDEX_NAME = 0x81050169; // Index name specified is illegal
public static final int NE_XFLM_ILLEGAL_ELEMENT_NUMBER = 0x8105016A; // Element number specified in element definition or index definition is illegal.
public static final int NE_XFLM_ILLEGAL_ATTRIBUTE_NUMBER = 0x8105016B; // Attribute number specified in attribute definition or index definition is illegal.
public static final int NE_XFLM_ILLEGAL_COLLECTION_NUMBER = 0x8105016C; // Collection number specified in collection definition or index definition is illegal.
public static final int NE_XFLM_ILLEGAL_INDEX_NUMBER = 0x8105016D; // Index number specified in index definition is illegal.
public static final int NE_XFLM_ILLEGAL_ENCDEF_NUMBER = 0x8105016E; // Encryption definition number specified in encryption definition is illegal.
public static final int NE_XFLM_COLLECTION_NAME_MISMATCH = 0x8105016F; // Collection name and number specified in index definition do not correspond to each other.
public static final int NE_XFLM_ELEMENT_NAME_MISMATCH = 0x81050170; // Element name+namespace and number specified in index definition do not correspond to each other.
public static final int NE_XFLM_ATTRIBUTE_NAME_MISMATCH = 0x81050171; // Attribute name+namespace and number specified in index definition do not correspond to each other.
public static final int NE_XFLM_INVALID_COMPARE_RULE = 0x81050172; // Invalid comparison rule specified in index definition.
public static final int NE_XFLM_DUPLICATE_KEY_COMPONENT = 0x81050173; // Duplicate key component number specified in index definition.
public static final int NE_XFLM_DUPLICATE_DATA_COMPONENT = 0x81050174; // Duplicate data component number specified in index definition.
public static final int NE_XFLM_MISSING_KEY_COMPONENT = 0x81050175; // Index definition is missing a key component.
public static final int NE_XFLM_MISSING_DATA_COMPONENT = 0x81050176; // Index definition is missing a data component.
public static final int NE_XFLM_INVALID_INDEX_OPTION = 0x81050177; // Invalid index option specified on index definition.
public static final int NE_XFLM_NO_MORE_ATTRIBUTE_NUMS = 0x81050178; // The highest attribute number has already been used, cannot create more.
public static final int NE_XFLM_MISSING_ELEMENT_NAME = 0x81050179; // Missing element name in XML element definition.
public static final int NE_XFLM_MISSING_ATTRIBUTE_NAME = 0x8105017A; // Missing attribute name in XML attribute definition.
public static final int NE_XFLM_MISSING_ELEMENT_NUMBER = 0x8105017B; // Missing element number in XML element definition.
public static final int NE_XFLM_MISSING_ATTRIBUTE_NUMBER = 0x8105017C; // Missing attribute number from XML attribute definition.
public static final int NE_XFLM_MISSING_INDEX_NAME = 0x8105017D; // Missing index name in index definition.
public static final int NE_XFLM_MISSING_INDEX_NUMBER = 0x8105017E; // Missing index number in index definition.
public static final int NE_XFLM_MISSING_COLLECTION_NAME = 0x8105017F; // Missing collection name in collection definition.
public static final int NE_XFLM_MISSING_COLLECTION_NUMBER = 0x81050180; // Missing collection number in collection definition.
public static final int NE_XFLM_BAD_SEN = 0x81050181; // Invalid simple encoded number.
public static final int NE_XFLM_MISSING_ENCDEF_NAME = 0x81050182; // Missing encryption definition name in encryption definition.
public static final int NE_XFLM_MISSING_ENCDEF_NUMBER = 0x81050183; // Missing encryption definition number in encryption definition.
public static final int NE_XFLM_NO_MORE_INDEX_NUMS = 0x81050184; // The highest index number has already been used, cannot create more.
public static final int NE_XFLM_NO_MORE_COLLECTION_NUMS = 0x81050185; // The highest collection number has already been used, cannot create more.
public static final int NE_XFLM_CANNOT_DEL_ATTRIBUTE = 0x81050186; // Cannot delete an XML attribute definition because it is in use.
public static final int NE_XFLM_TOO_MANY_PENDING_NODES = 0x81050187; // Too many documents in the pending document list.
public static final int NE_XFLM_UNSUPPORTED_INTERFACE = 0x81050188; // Requested COM interface is not supported.
public static final int NE_XFLM_BAD_USE_OF_ELM_ROOT_TAG = 0x81050189; // ELM_ROOT_TAG, if used, must be the sole root component of an index definition.
public static final int NE_XFLM_DUP_SIBLING_IX_COMPONENTS = 0x8105018A; // Sibling components in an index definition cannot have the same XML element or attribute number.
public static final int NE_XFLM_RFL_FILE_NOT_FOUND = 0x8105018B; // Could not open a roll-forward log file - was not found in the roll-forward log directory.
public static final int NE_XFLM_BAD_RCODE_TABLE = 0x8105018C; // The error code tables are incorrect. NOTE: This is an internal error that does not need to be documented.
public static final int NE_XFLM_ILLEGAL_KEY_COMPONENT_NUM = 0x8105018D; // Key component of zero in index definition is not allowed.
public static final int NE_XFLM_ILLEGAL_DATA_COMPONENT_NUM = 0x8105018E; // Data component of zero in index definition is not allowed.
public static final int NE_XFLM_CLASS_NOT_AVAILABLE = 0x8105018F; // Requested COM class is not available.
public static final int NE_XFLM_BUFFER_OVERFLOW = 0x81050190; // Buffer overflow.
public static final int NE_XFLM_ILLEGAL_PREFIX_NUMBER = 0x81050191; // Prefix number specified in prefix definition is illegal.
public static final int NE_XFLM_MISSING_PREFIX_NAME = 0x81050192; // Missing prefix name in prefix definition.
public static final int NE_XFLM_MISSING_PREFIX_NUMBER = 0x81050193; // Missing prefix number in prefix definition.
public static final int NE_XFLM_UNDEFINED_ELEMENT_NAME = 0x81050194; // XML element name+namespace that was specified in index definition or XML document is not defined in dictionary.
public static final int NE_XFLM_UNDEFINED_ATTRIBUTE_NAME = 0x81050195; // XML attribute name+namespace that was specified in index definition or XML document is not defined in dictionary.
public static final int NE_XFLM_DUPLICATE_PREFIX_NAME = 0x81050196; // Prefix name specified in prefix definition is already in use.
public static final int NE_XFLM_KEY_OVERFLOW = 0x81050197; // Generated index key too large.
public static final int NE_XFLM_UNESCAPED_METACHAR = 0x81050198; // Unescaped metacharacter in regular expression.
public static final int NE_XFLM_ILLEGAL_QUANTIFIER = 0x81050199; // Illegal quantifier in regular expression.
public static final int NE_XFLM_UNEXPECTED_END_OF_EXPR = 0x8105019A; // Unexpected end of regular expression.
public static final int NE_XFLM_ILLEGAL_MIN_COUNT = 0x8105019B; // Illegal minimum count in regular expression quantifier.
public static final int NE_XFLM_ILLEGAL_MAX_COUNT = 0x8105019C; // Illegal maximum count in regular expression quantifier.
public static final int NE_XFLM_EMPTY_BRANCH_IN_EXPR = 0x8105019D; // Illegal empty branch in a regular expression.
public static final int NE_XFLM_ILLEGAL_RPAREN_IN_EXPR = 0x8105019E; // Illegal right paren in a regular expression.
public static final int NE_XFLM_ILLEGAL_CLASS_SUBTRACTION = 0x8105019F; // Illegal class subtraction in regular expression.
public static final int NE_XFLM_ILLEGAL_CHAR_RANGE_IN_EXPR = 0x810501A0; // Illegal character range in regular expression.
public static final int NE_XFLM_BAD_BASE64_ENCODING = 0x810501A1; // Illegal character(s; found in a base64 stream.
public static final int NE_XFLM_NAMESPACE_NOT_ALLOWED = 0x810501A2; // Cannot define a namespace for XML attributes whose name begins with "xmlns:" or that is equal to "xmlns"
public static final int NE_XFLM_INVALID_NAMESPACE_DECL = 0x810501A3; // Name for namespace declaration attribute must be "xmlns" or begin with "xmlns:"
public static final int NE_XFLM_ILLEGAL_NAMESPACE_DECL_DATATYPE= 0x810501A4; // Data type for XML attributes that are namespace declarations must be text.
public static final int NE_XFLM_UNEXPECTED_END_OF_INPUT = 0x810501A5; // Encountered unexpected end of input when parsing XPATH expression.
public static final int NE_XFLM_NO_MORE_PREFIX_NUMS = 0x810501A6; // The highest prefix number has already been used, cannot create more.
public static final int NE_XFLM_NO_MORE_ENCDEF_NUMS = 0x810501A7; // The highest encryption definition number has already been used, cannot create more.
public static final int NE_XFLM_COLLECTION_OFFLINE = 0x810501A8; // Collection is encrypted, cannot be accessed while in operating in limited mode.
public static final int NE_XFLM_INVALID_XML = 0x810501A9; // Invalid XML encountered while parsing document.
public static final int NE_XFLM_READ_ONLY = 0x810501AA; // Item is read-only and cannot be updated.
public static final int NE_XFLM_DELETE_NOT_ALLOWED = 0x810501AB; // Item cannot be deleted.
public static final int NE_XFLM_RESET_NEEDED = 0x810501AC; // Used during check operations to indicate we need to reset the view. NOTE: This is an internal error code and should not be documented.
public static final int NE_XFLM_ILLEGAL_REQUIRED_VALUE = 0x810501AD; // An illegal value was specified for the "Required" attribute in an index definition.
public static final int NE_XFLM_ILLEGAL_INDEX_COMPONENT = 0x810501AE; // A leaf index component in an index definition was not marked as a data component or key component.
public static final int NE_XFLM_ILLEGAL_UNIQUE_SUB_ELEMENT_VALUE = 0x810501AF; // Illegal value for the "UniqueSubElements" attribute in an element definition.
public static final int NE_XFLM_DATA_TYPE_MUST_BE_NO_DATA = 0x810501B0; // Data type for an element definition with UniqueSubElements="yes" must be nodata.
public static final int NE_XFLM_ILLEGAL_FLAG = 0x810501B1; // Illegal flag passed to getChildElement method. Must be zero for elements that can have non-unique child elements.
public static final int NE_XFLM_CANNOT_SET_REQUIRED = 0x810501B2; // Cannot set the "Required" attribute on a non-key index component in index definition.
public static final int NE_XFLM_CANNOT_SET_LIMIT = 0x810501B3; // Cannot set the "Limit" attribute on a non-key index component in index definition.
public static final int NE_XFLM_CANNOT_SET_INDEX_ON = 0x810501B4; // Cannot set the "IndexOn" attribute on a non-key index component in index definition.
public static final int NE_XFLM_CANNOT_SET_COMPARE_RULES = 0x810501B5; // Cannot set the "CompareRules" on a non-key index component in index definition.
public static final int NE_XFLM_INPUT_PENDING = 0x810501B6; // Attempt to set a value while an input stream is still open.
public static final int NE_XFLM_INVALID_NODE_TYPE = 0x810501B7; // Bad node type
public static final int NE_XFLM_INVALID_CHILD_ELM_NODE_ID = 0x810501B8; // Attempt to insert a unique child element that has a lower node ID than the parent element
public static final int NE_XFLM_LAST_GENERAL_ERROR = 0x810501B9; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: DOM Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_DOM_ERROR = 0x81051100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_DOM_HIERARCHY_REQUEST_ERR = 0x81051101; // Attempt to insert a DOM node somewhere it doesn't belong.
public static final int NE_XFLM_DOM_WRONG_DOCUMENT_ERR = 0x81051102; // A DOM node is being used in a different document than the one that created it.
public static final int NE_XFLM_DOM_DATA_ERROR = 0x81051103; // Links between DOM nodes in a document are corrupt.
public static final int NE_XFLM_DOM_NODE_NOT_FOUND = 0x81051104; // The requested DOM node does not exist.
public static final int NE_XFLM_DOM_INVALID_CHILD_TYPE = 0x81051105; // Attempting to insert a child DOM node whose type cannot be inserted as a child node.
public static final int NE_XFLM_DOM_NODE_DELETED = 0x81051106; // DOM node being accessed has been deleted.
public static final int NE_XFLM_DOM_DUPLICATE_ELEMENT = 0x81051107; // Node already has a child element with the given name id - this node's child nodes must all be unique.
public static final int NE_XFLM_LAST_DOM_ERROR = 0x81051108; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: I/O Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_IO_ERROR = 0x81052100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_IO_ACCESS_DENIED = 0x81052101; // Access to file is denied. Caller is not allowed access to a file.
public static final int NE_XFLM_IO_BAD_FILE_HANDLE = 0x81052102; // Bad file handle or file descriptor.
public static final int NE_XFLM_IO_COPY_ERR = 0x81052103; // Error occurred while copying a file.
public static final int NE_XFLM_IO_DISK_FULL = 0x81052104; // Disk full.
public static final int NE_XFLM_IO_END_OF_FILE = 0x81052105; // End of file reached while reading from the file.
public static final int NE_XFLM_IO_OPEN_ERR = 0x81052106; // Error while opening the file.
public static final int NE_XFLM_IO_SEEK_ERR = 0x81052107; // Error occurred while positioning (seeking; within a file.
public static final int NE_XFLM_IO_DIRECTORY_ERR = 0x81052108; // Error occurred while accessing or deleting a directory.
public static final int NE_XFLM_IO_PATH_NOT_FOUND = 0x81052109; // File not found.
public static final int NE_XFLM_IO_TOO_MANY_OPEN_FILES = 0x8105210A; // Too many files open.
public static final int NE_XFLM_IO_PATH_TOO_LONG = 0x8105210B; // File name too long.
public static final int NE_XFLM_IO_NO_MORE_FILES = 0x8105210C; // No more files in directory.
public static final int NE_XFLM_IO_DELETING_FILE = 0x8105210D; // Error occurred while deleting a file.
public static final int NE_XFLM_IO_FILE_LOCK_ERR = 0x8105210E; // Error attempting to acquire a byte-range lock on a file.
public static final int NE_XFLM_IO_FILE_UNLOCK_ERR = 0x8105210F; // Error attempting to release a byte-range lock on a file.
public static final int NE_XFLM_IO_PATH_CREATE_FAILURE = 0x81052110; // Error occurred while attempting to create a directory or sub-directory.
public static final int NE_XFLM_IO_RENAME_FAILURE = 0x81052111; // Error occurred while renaming a file.
public static final int NE_XFLM_IO_INVALID_PASSWORD = 0x81052112; // Invalid file password.
public static final int NE_XFLM_SETTING_UP_FOR_READ = 0x81052113; // Error occurred while setting up to perform a file read operation.
public static final int NE_XFLM_SETTING_UP_FOR_WRITE = 0x81052114; // Error occurred while setting up to perform a file write operation.
public static final int NE_XFLM_IO_CANNOT_REDUCE_PATH = 0x81052115; // Cannot reduce file name into more components.
public static final int NE_XFLM_INITIALIZING_IO_SYSTEM = 0x81052116; // Error occurred while setting up to access the file system.
public static final int NE_XFLM_FLUSHING_FILE = 0x81052117; // Error occurred while flushing file data buffers to disk.
public static final int NE_XFLM_IO_INVALID_FILENAME = 0x81052118; // Invalid file name.
public static final int NE_XFLM_IO_CONNECT_ERROR = 0x81052119; // Error connecting to a remote network resource.
public static final int NE_XFLM_OPENING_FILE = 0x8105211A; // Unexpected error occurred while opening a file.
public static final int NE_XFLM_DIRECT_OPENING_FILE = 0x8105211B; // Unexpected error occurred while opening a file in direct access mode.
public static final int NE_XFLM_CREATING_FILE = 0x8105211C; // Unexpected error occurred while creating a file.
public static final int NE_XFLM_DIRECT_CREATING_FILE = 0x8105211D; // Unexpected error occurred while creating a file in direct access mode.
public static final int NE_XFLM_READING_FILE = 0x8105211E; // Unexpected error occurred while reading a file.
public static final int NE_XFLM_DIRECT_READING_FILE = 0x8105211F; // Unexpected error occurred while reading a file in direct access mode.
public static final int NE_XFLM_WRITING_FILE = 0x81052120; // Unexpected error occurred while writing to a file.
public static final int NE_XFLM_DIRECT_WRITING_FILE = 0x81052121; // Unexpected error occurred while writing a file in direct access mode.
public static final int NE_XFLM_POSITIONING_IN_FILE = 0x81052122; // Unexpected error occurred while positioning within a file.
public static final int NE_XFLM_GETTING_FILE_SIZE = 0x81052123; // Unexpected error occurred while getting a file's size.
public static final int NE_XFLM_TRUNCATING_FILE = 0x81052124; // Unexpected error occurred while truncating a file.
public static final int NE_XFLM_PARSING_FILE_NAME = 0x81052125; // Unexpected error occurred while parsing a file's name.
public static final int NE_XFLM_CLOSING_FILE = 0x81052126; // Unexpected error occurred while closing a file.
public static final int NE_XFLM_GETTING_FILE_INFO = 0x81052127; // Unexpected error occurred while getting information about a file.
public static final int NE_XFLM_EXPANDING_FILE = 0x81052128; // Unexpected error occurred while expanding a file.
public static final int NE_XFLM_CHECKING_FILE_EXISTENCE = 0x81052129; // Unexpected error occurred while checking to see if a file exists.
public static final int NE_XFLM_RENAMING_FILE = 0x8105212A; // Unexpected error occurred while renaming a file.
public static final int NE_XFLM_SETTING_FILE_INFO = 0x8105212B; // Unexpected error occurred while setting a file's information.
public static final int NE_XFLM_LAST_IO_ERROR = 0x8105212C; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: Network Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_NET_ERROR = 0x81053100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_SVR_NOIP_ADDR = 0x81053101; // IP address not found
public static final int NE_XFLM_SVR_SOCK_FAIL = 0x81053102; // IP socket failure
public static final int NE_XFLM_SVR_CONNECT_FAIL = 0x81053103; // TCP/IP connection failure
public static final int NE_XFLM_SVR_BIND_FAIL = 0x81053104; // The TCP/IP services on your system may not be configured or installed. If this POA is not to run Client/Server, use the /notcpip startup switch or disable TCP/IP through the NWADMIN snapin
public static final int NE_XFLM_SVR_LISTEN_FAIL = 0x81053105; // TCP/IP listen failed
public static final int NE_XFLM_SVR_ACCEPT_FAIL = 0x81053106; // TCP/IP accept failed
public static final int NE_XFLM_SVR_SELECT_ERR = 0x81053107; // TCP/IP select failed
public static final int NE_XFLM_SVR_SOCKOPT_FAIL = 0x81053108; // TCP/IP socket operation failed
public static final int NE_XFLM_SVR_DISCONNECT = 0x81053109; // TCP/IP disconnected
public static final int NE_XFLM_SVR_READ_FAIL = 0x8105310A; // TCP/IP read failed
public static final int NE_XFLM_SVR_WRT_FAIL = 0x8105310B; // TCP/IP write failed
public static final int NE_XFLM_SVR_READ_TIMEOUT = 0x8105310C; // TCP/IP read timeout
public static final int NE_XFLM_SVR_WRT_TIMEOUT = 0x8105310D; // TCP/IP write timeout
public static final int NE_XFLM_SVR_ALREADY_CLOSED = 0x8105310E; // Connection already closed
public static final int NE_XFLM_LAST_NET_ERROR = 0x8105310F; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: Query Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_QUERY_ERROR = 0x81054100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_Q_UNMATCHED_RPAREN = 0x81054101; // Query setup error: Unmatched right paren.
public static final int NE_XFLM_Q_UNEXPECTED_LPAREN = 0x81054102; // Query setup error: Unexpected left paren.
public static final int NE_XFLM_Q_UNEXPECTED_RPAREN = 0x81054103; // Query setup error: Unexpected right paren.
public static final int NE_XFLM_Q_EXPECTING_OPERAND = 0x81054104; // Query setup error: Expecting an operand.
public static final int NE_XFLM_Q_EXPECTING_OPERATOR = 0x81054105; // Query setup error: Expecting an operator.
public static final int NE_XFLM_Q_UNEXPECTED_COMMA = 0x81054106; // Query setup error: Unexpected comma.
public static final int NE_XFLM_Q_EXPECTING_LPAREN = 0x81054107; // Query setup error: Expecting a left paren.
public static final int NE_XFLM_Q_UNEXPECTED_VALUE = 0x81054108; // Query setup error: Unexpected value.
public static final int NE_XFLM_Q_INVALID_NUM_FUNC_ARGS = 0x81054109; // Query setup error: Invalid number of arguments for a function.
public static final int NE_XFLM_Q_UNEXPECTED_XPATH_COMPONENT = 0x8105410A; // Query setup error: Unexpected XPATH componenent.
public static final int NE_XFLM_Q_ILLEGAL_LBRACKET = 0x8105410B; // Query setup error: Illegal left bracket ([;.
public static final int NE_XFLM_Q_ILLEGAL_RBRACKET = 0x8105410C; // Query setup error: Illegal right bracket (];.
public static final int NE_XFLM_Q_ILLEGAL_OPERAND = 0x8105410D; // Query setup error: Operand for some operator is not valid for that operator type.
public static final int NE_XFLM_Q_ALREADY_OPTIMIZED = 0x8105410E; // Operation is illegal, cannot change certain things after query has been optimized.
public static final int NE_XFLM_Q_MISMATCHED_DB = 0x8105410F; // Database handle passed in does not match database associated with query.
public static final int NE_XFLM_Q_ILLEGAL_OPERATOR = 0x81054110; // Illegal operator - cannot pass this operator into the addOperator method.
public static final int NE_XFLM_Q_ILLEGAL_COMPARE_RULES = 0x81054111; // Illegal combination of comparison rules passed to addOperator method.
public static final int NE_XFLM_Q_INCOMPLETE_QUERY_EXPR = 0x81054112; // Query setup error: Query expression is incomplete.
public static final int NE_XFLM_Q_NOT_POSITIONED = 0x81054113; // Query not positioned due to previous error, cannot call getNext, getPrev, or getCurrent
public static final int NE_XFLM_Q_INVALID_NODE_ID_VALUE = 0x81054114; // Query setup error: Invalid type of value constant used for node id value comparison.
public static final int NE_XFLM_Q_INVALID_META_DATA_TYPE = 0x81054115; // Query setup error: Invalid meta data type specified.
public static final int NE_XFLM_Q_NEW_EXPR_NOT_ALLOWED = 0x81054116; // Query setup error: Cannot add an expression to an XPATH component after having added an expression that tests context position.
public static final int NE_XFLM_Q_INVALID_CONTEXT_POS = 0x81054117; // Invalid context position value encountered - must be a positive number.
public static final int NE_XFLM_Q_INVALID_FUNC_ARG = 0x81054118; // Query setup error: Parameter to user-defined functions must be a single XPATH only.
public static final int NE_XFLM_Q_EXPECTING_RPAREN = 0x81054119; // Query setup error: Expecting right paren.
public static final int NE_XFLM_Q_TOO_LATE_TO_ADD_SORT_KEYS = 0x8105411A; // Query setup error: Cannot add sort keys after having called getFirst, getLast, getNext, or getPrev.
public static final int NE_XFLM_Q_INVALID_SORT_KEY_COMPONENT = 0x8105411B; // Query setup error: Invalid sort key component number specified in query.
public static final int NE_XFLM_Q_DUPLICATE_SORT_KEY_COMPONENT = 0x8105411C; // Query setup error: Duplicate sort key component number specified in query.
public static final int NE_XFLM_Q_MISSING_SORT_KEY_COMPONENT = 0x8105411D; // Query setup error: Missing sort key component number in sort keys that were specified for query.
public static final int NE_XFLM_Q_NO_SORT_KEY_COMPONENTS_SPECIFIED = 0x8105411E; // Query setup error: addSortKeys was called, but no sort key components were specified.
public static final int NE_XFLM_Q_SORT_KEY_CONTEXT_MUST_BE_ELEMENT = 0x8105411F; // Query setup error: A sort key context cannot be an XML attribute.
public static final int NE_XFLM_Q_INVALID_ELEMENT_NUM_IN_SORT_KEYS = 0x81054120; // Query setup error: The XML element number specified for a sort key in a query is invalid - no element definition in the dictionary.
public static final int NE_XFLM_Q_INVALID_ATTR_NUM_IN_SORT_KEYS = 0x81054121; // Query setup error: The XML attribute number specified for a sort key in a query is invalid - no attribute definition in the dictionary.
public static final int NE_XFLM_Q_NON_POSITIONABLE_QUERY = 0x81054122; // Attempt is being made to position in a query that is not positionable.
public static final int NE_XFLM_Q_INVALID_POSITION = 0x81054123; // Attempt is being made to position to an invalid position in the result set.
public static final int NE_XFLM_LAST_QUERY_ERROR = 0x81054124; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: Stream Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_STREAM_ERROR = 0x81056100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_STREAM_DECOMPRESS_ERROR = 0x81056101; // Error decompressing data stream.
public static final int NE_XFLM_STREAM_NOT_COMPRESSED = 0x81056102; // Attempting to decompress a data stream that is not compressed.
public static final int NE_XFLM_STREAM_TOO_MANY_FILES = 0x81056103; // Too many files in input stream.
public static final int NE_XFLM_LAST_STREAM_ERROR = 0x81056104; // NOTE: This is not an error code - do not document
/****************************************************************************
Desc: NICI / Encryption Errors
****************************************************************************/
public static final int NE_XFLM_FIRST_NICI_ERROR = 0x81057100; // NOTE: This is not an error code - do not document
public static final int NE_XFLM_NICI_CONTEXT = 0x81057101; // Error occurred while creating NICI context for encryption/decryption.
public static final int NE_XFLM_NICI_ATTRIBUTE_VALUE = 0x81057102; // Error occurred while accessing an attribute on a NICI encryption key.
public static final int NE_XFLM_NICI_BAD_ATTRIBUTE = 0x81057103; // Value retrieved from an attribute on a NICI encryption key was bad.
public static final int NE_XFLM_NICI_WRAPKEY_FAILED = 0x81057104; // Error occurred while wrapping a NICI encryption key in another NICI encryption key.
public static final int NE_XFLM_NICI_UNWRAPKEY_FAILED = 0x81057105; // Error occurred while unwrapping a NICI encryption key that is wrapped in another NICI encryption key.
public static final int NE_XFLM_NICI_INVALID_ALGORITHM = 0x81057106; // Attempt to use invalid NICI encryption algorithm.
public static final int NE_XFLM_NICI_GENKEY_FAILED = 0x81057107; // Error occurred while attempting to generate a NICI encryption key.
public static final int NE_XFLM_NICI_BAD_RANDOM = 0x81057108; // Error occurred while generating random data using NICI.
public static final int NE_XFLM_PBE_ENCRYPT_FAILED = 0x81057109; // Error occurred while attempting to wrap a NICI encryption key in a password.
public static final int NE_XFLM_PBE_DECRYPT_FAILED = 0x8105710A; // Error occurred while attempting to unwrap a NICI encryption key that was previously wrapped in a password.
public static final int NE_XFLM_DIGEST_INIT_FAILED = 0x8105710B; // Error occurred while attempting to initialize the NICI digest functionality.
public static final int NE_XFLM_DIGEST_FAILED = 0x8105710C; // Error occurred while attempting to create a NICI digest.
public static final int NE_XFLM_INJECT_KEY_FAILED = 0x8105710D; // Error occurred while attempting to inject an encryption key into NICI.
public static final int NE_XFLM_NICI_FIND_INIT = 0x8105710E; // Error occurred while attempting to initialize NICI to find information on a NICI encryption key.
public static final int NE_XFLM_NICI_FIND_OBJECT = 0x8105710F; // Error occurred while attempting to find information on a NICI encryption key.
public static final int NE_XFLM_NICI_KEY_NOT_FOUND = 0x81057110; // Could not find the NICI encryption key or information on the NICI encryption key.
public static final int NE_XFLM_NICI_ENC_INIT_FAILED = 0x81057111; // Error occurred while initializing NICI to encrypt data.
public static final int NE_XFLM_NICI_ENCRYPT_FAILED = 0x81057112; // Error occurred while encrypting data.
public static final int NE_XFLM_NICI_DECRYPT_INIT_FAILED = 0x81057113; // Error occurred while initializing NICI to decrypt data.
public static final int NE_XFLM_NICI_DECRYPT_FAILED = 0x81057114; // Error occurred while decrypting data.
public static final int NE_XFLM_NICI_WRAPKEY_NOT_FOUND = 0x81057115; // Could not find the NICI encryption key used to wrap another NICI encryption key.
public static final int NE_XFLM_NOT_EXPECTING_PASSWORD = 0x81057116; // Password supplied when none was expected.
public static final int NE_XFLM_EXPECTING_PASSWORD = 0x81057117; // No password supplied when one was required.
public static final int NE_XFLM_EXTRACT_KEY_FAILED = 0x81057118; // Error occurred while attempting to extract a NICI encryption key.
public static final int NE_XFLM_NICI_INIT_FAILED = 0x81057119; // Error occurred while initializing NICI.
public static final int NE_XFLM_BAD_ENCKEY_SIZE = 0x8105711A; // Bad encryption key size found in roll-forward log packet.
public static final int NE_XFLM_ENCRYPTION_UNAVAILABLE = 0x8105711B; // Attempt was made to encrypt data when NICI is unavailable.
public static final int NE_XFLM_LAST_NICI_ERROR = 0x8105711C; // NOTE: This is not an error code - do not document
}

View File

@@ -0,0 +1,174 @@
//------------------------------------------------------------------------------
// Desc: Reserve ID
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: ReserveID.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This class provides enums for all of the reserved dictionay tags in XFlaim.
*/
public final class ReserveID
{
public static final int ELM_ELEMENT_TAG = 0xFFFFFE00;
public static final String ELM_ELEMENT_TAG_NAME = "element";
public static final int ELM_ATTRIBUTE_TAG = 0xFFFFFE01;
public static final String ELM_ATTRIBUTE_TAG_NAME = "attribute";
public static final int ELM_INDEX_TAG = 0xFFFFFE02;
public static final String ELM_INDEX_TAG_NAME = "Index";
public static final int ELM_ELEMENT_COMPONENT_TAG = 0xFFFFFE04;
public static final String ELM_ELEMENT_COMPONENT_TAG_NAME = "ElementComponent";
public static final int ELM_ATTRIBUTE_COMPONENT_TAG = 0xFFFFFE05;
public static final String ELM_ATTRIBUTE_COMPONENT_TAG_NAME = "AttributeComponent";
public static final int ELM_COLLECTION_TAG = 0xFFFFFE06;
public static final String ELM_COLLECTION_TAG_NAME = "Collection";
public static final int ELM_PREFIX_TAG = 0xFFFFFE07;
public static final String ELM_PREFIX_TAG_NAME = "Prefix";
public static final int ELM_NEXT_DICT_NUMS_TAG = 0xFFFFFE08;
public static final String ELM_NEXT_DICT_NUMS_TAG_NAME = "NextDictNums";
public static final int ELM_DOCUMENT_TITLE_TAG = 0xFFFFFE09;
public static final String ELM_DOCUMENT_TITLE_TAG_NAME = "DocumentTitle";
public static final int ELM_INVALID_TAG = 0xFFFFFE0A;
public static final String ELM_INVALID_TAG_NAME = "Invalid";
public static final int ELM_QUARANTINED_TAG = 0xFFFFFE0B;
public static final String ELM_QUARANTINED_TAG_NAME = "Quarantined";
public static final int ELM_ALL_TAG = 0xFFFFFE0C;
public static final String ELM_ALL_TAG_NAME = "All";
public static final int ELM_ANNOTATION_TAG = 0xFFFFFE0D;
public static final String ELM_ANNOTATION_TAG_NAME = "Annotation";
public static final int ELM_ANY_TAG = 0xFFFFFE0E;
public static final String ELM_ANY_TAG_NAME = "Any";
public static final int ELM_ATTRIBUTE_GROUP_TAG = 0xFFFFFE0F;
public static final String ELM_ATTRIBUTE_GROUP_TAG_NAME = "AttributeGroup";
public static final int ELM_CHOICE_TAG = 0xFFFFFE10;
public static final String ELM_CHOICE_TAG_NAME = "Choice";
public static final int ELM_COMPLEX_CONTENT_TAG = 0xFFFFFE11;
public static final String ELM_COMPLEX_CONTENT_TAG_NAME = "ComplexContent";
public static final int ELM_COMPLEX_TYPE_TAG = 0xFFFFFE12;
public static final String ELM_COMPLEX_TYPE_TAG_NAME = "ComplexType";
public static final int ELM_DOCUMENTATION_TAG = 0xFFFFFE13;
public static final String ELM_DOCUMENTATION_TAG_NAME = "Documentation";
public static final int ELM_ENUMERATION_TAG = 0xFFFFFE14;
public static final String ELM_ENUMERATION_TAG_NAME = "Enumeration";
public static final int ELM_EXTENSION_TAG = 0xFFFFFE15;
public static final String ELM_EXTENSION_TAG_NAME = "Extension";
public static final int ELM_GROUP_TAG = 0xFFFFFE16;
public static final String ELM_GROUP_TAG_NAME = "Group";
public static final int ELM_MAX_OCCURS_TAG = 0xFFFFFE17;
public static final String ELM_MAX_OCCURS_TAG_NAME = "MaxOccurs";
public static final int ELM_MIN_OCCURS_TAG = 0xFFFFFE18;
public static final String ELM_MIN_OCCURS_TAG_NAME = "MinOccurs";
public static final int ELM_RESTRICTION_TAG = 0xFFFFFE19;
public static final String ELM_RESTRICTION_TAG_NAME = "Restriction";
public static final int ELM_SEQUENCE_TAG = 0xFFFFFE1A;
public static final String ELM_SEQUENCE_TAG_NAME = "Sequence";
public static final int ELM_SIMPLE_CONTENT_TAG = 0xFFFFFE1B;
public static final String ELM_SIMPLE_TYPE_NAME = "SimpleType";
public static final int ELM_ROOT_TAG = 0xFFFFFE01;
public static final int ATTR_DICT_NUMBER_TAG = 0xFFFFFE00;
public static final String ATTR_DICT_NUMBER_TAG_NAME = "DictNumber";
public static final int ATTR_COLLECTION_NUMBER_TAG = 0xFFFFFE01;
public static final String ATTR_COLLECTION_NUMBER_TAG_NAME = "CollectionNumber";
public static final int ATTR_COLLECTION_NAME_TAG = 0xFFFFFE02;
public static final String ATTR_COLLECTION_NAME_TAG_NAME = "CollectionName";
public static final int ATTR_NAME_TAG = 0xFFFFFE03;
public static final String ATTR_NAME_TAG_NAME = "name";
public static final int ATTR_TARGET_NAMESPACE_TAG = 0xFFFFFE04;
public static final String ATTR_TARGET_NAMESPACE_TAG_NAME = "targetNameSpace";
public static final int ATTR_TYPE_TAG = 0xFFFFFE05;
public static final String ATTR_TYPE_TAG_NAME = "type";
public static final int ATTR_STATE_TAG = 0xFFFFFE06;
public static final String ATTR_STATE_TAG_NAME = "State";
public static final int ATTR_LANGUAGE_TAG = 0xFFFFFE07;
public static final String ATTR_LANGUAGE_TAG_NAME = "Language";
public static final int ATTR_INDEX_OPTIONS_TAG = 0xFFFFFE08;
public static final String ATTR_INDEX_OPTIONS_TAG_NAME = "IndexOptions";
public static final int ATTR_INDEX_ON_TAG = 0xFFFFFE09;
public static final String ATTR_INDEX_ON_TAG_NAME = "IndexOn";
public static final int ATTR_REQUIRED_TAG = 0xFFFFFE0A;
public static final String ATTR_REQUIRED_TAG_NAME = "Required";
public static final int ATTR_LIMIT_TAG = 0xFFFFFE0B;
public static final String ATTR_LIMIT_TAG_NAME = "Limit";
public static final int ATTR_COMPARE_RULES_TAG = 0xFFFFFE0C;
public static final String ATTR_COMPARE_RULES_TAG_NAME = "CompareRules";
public static final int ATTR_KEY_COMPONENT_TAG = 0xFFFFFE0D;
public static final String ATTR_KEY_COMPONENT_TAG_NAME = "KeyComponent";
public static final int ATTR_DATA_COMPONENT_TAG = 0xFFFFFE0E;
public static final String ATTR_DATA_COMPONENT_TAG_NAME = "DataComponent";
public static final int ATTR_LAST_DOC_INDEXED_TAG = 0xFFFFFE0F;
public static final String ATTR_LAST_DOC_INDEXED_TAG_NAME = "LastDocumentIndexed";
public static final int ATTR_NEXT_ELEMENT_NUM_TAG = 0xFFFFFE10;
public static final String ATTR_NEXT_ELEMENT_NUM_TAG_NAME = "NextElementNum";
public static final int ATTR_NEXT_ATTRIBUTE_NUM_TAG = 0xFFFFFE11;
public static final String ATTR_NEXT_ATTRIBUTE_NUM_TAG_NAME = "NextAttributeNum";
public static final int ATTR_NEXT_INDEX_NUM_TAG = 0xFFFFFE12;
public static final String ATTR_NEXT_INDEX_NUM_TAG_NAME = "NextIndexNum";
public static final int ATTR_NEXT_COLLECTION_NUM_TAG = 0xFFFFFE13;
public static final String ATTR_NEXT_COLLECTION_NUM_TAG_NAME = "NextCollectionNum";
public static final int ATTR_NEXT_PREFIX_NUM_TAG = 0xFFFFFE14;
public static final String ATTR_NEXT_PREFIX_NUM_TAG_NAME = "NextPrefixNum";
public static final int ATTR_DEFAULT_PREFIX_TAG = 0xFFFFFE15;
public static final String ATTR_DEFAULT_PREFIX_TAG_NAME = "DefaultPrefix";
public static final int ATTR_SOURCE_TAG = 0xFFFFFE16;
public static final String ATTR_SOURCE_TAG_NAME = "Source";
public static final int ATTR_STATE_CHANGE_COUNT_TAG = 0xFFFFFE17;
public static final String ATTR_STATE_CHANGE_COUNT_TAG_NAME = "StateChangeCount";
public static final int ATTR_XMLNS_TAG = 0xFFFFFE18;
public static final String ATTR_XMLNS_TAG_NAME = "xmlns";
public static final int ATTR_ABSTRACT_TAG = 0xFFFFFE19;
public static final String ATTR_ABSTRACT_TAG_NAME = "abstract";
public static final int ATTR_BASE_TAG = 0xFFFFFE1A;
public static final String ATTR_BASE_TAG_NAME = "base";
public static final int ATTR_BLOCK_TAG = 0xFFFFFE1B;
public static final String ATTR_BLOCK_TAG_NAME = "block";
public static final int ATTR_DEFAULT_TAG = 0xFFFFFE1C;
public static final String ATTR_DEFAULT_TAG_NAME = "default";
public static final int ATTR_FINAL_TAG = 0xFFFFFE1D;
public static final String ATTR_FINAL_TAG_NAME = "final";
public static final int ATTR_FIXED_TAG = 0xFFFFFE1E;
public static final String ATTR_FIXED_TAG_NAME = "fixed";
public static final int ATTR_ITEM_TYPE_TAG = 0xFFFFFE1F;
public static final String ATTR_ITEM_TYPE_TAG_NAME = "itemtype";
public static final int ATTR_MAX_OCCURS_TAG = 0xFFFFFE20;
public static final String ATTR_MAX_OCCURS_TAG_NAME = "maxoccurs";
public static final int ATTR_MEMBER_TYPES_TAG = 0xFFFFFE21;
public static final String ATTR_MEMBER_TYPES_TAG_NAME = "membertypes";
public static final int ATTR_MIN_OCCURS_TAG = 0xFFFFFE22;
public static final String ATTR_MIN_OCCURS_TAG_NAME = "minoccurs";
public static final int ATTR_MIXED_TAG = 0xFFFFFE23;
public static final String ATTR_MIXED_TAG_NAME = "mixed";
public static final int ATTR_NILLABLE_TAG = 0xFFFFFE24;
public static final String ATTR_NILLABLE_TAG_NAME = "nillable";
public static final int ATTR_REF_TAG = 0xFFFFFE25;
public static final String ATTR_REF_TAG_NAME = "ref";
public static final int ATTR_USE_TAG = 0xFFFFFE26;
public static final String ATTR_USE_TAG_NAME = "use";
public static final int ATTR_VALUE_TAG = 0xFFFFFE27;
public static final String ATTR_VALUE_TAG_NAME = "value";
public static final int XS_PREFIX_ID = 0xFFFFFE00;
public static final int XSI_PREFIX_ID = 0xFFFFFE01;
public static final int XFLAIM_PREFIX_ID = 0xFFFFFE02;
public static final int XMLNS_PREFIX_ID = 0xFFFFFE03;
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// Desc: Restore Actions
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: RestoreAction.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Provides enums for all of the possible return codes for the members of the
* {@link xflaim.RestoreStatus RestoreStatus} interface.
* NOTE: The values in this class must match *exactly* with the equivalent
* enum defined in xflaim.h
*/
public final class RestoreAction
{
public static final int CONTINUE = 0; // Continue recovery
public static final int STOP = 1; // Stop recovery
public static final int SKIP = 2; // Skip operation (future)
public static final int RETRY = 3; // Retry the operation
}

View File

@@ -0,0 +1,100 @@
//------------------------------------------------------------------------------
// Desc: Restore Client
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: RestoreClient.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface defines the client side interface to XFlaim's restore
* subsystem. Clients must pass an object that implements this interface
* into the call to {@link DbSystem#dbRestore DbSystem::dbRestore}
* See the documentation regarding Backup/Restore operations for more details.
* @see DefaultRestoreClient
*/
public interface RestoreClient
{
/**
*
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int openBackupSet();
/**
*
* @param iFileNum
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int openRflFile(
int iFileNum);
/**
*
* @param iFileNum
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int openIncFile(
int iFileNum);
/**
*
* @param Buffer
* @param BytesRead NOTE: Will have a length of 1 Function
* must store the number of valid bytes in Buffer into BytesRead[0].
* (This allows us to pass that value back to the calling function.)
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int read(
byte[] Buffer,
int[] BytesRead);
/**
*
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int close();
/**
*
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort an XFLaimException to be thrown.
*/
public int abortFile();
}

View File

@@ -0,0 +1,405 @@
//------------------------------------------------------------------------------
// Desc: Restore Status
//
// Tabs: 3
//
// Copyright (c) 2004-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: RestoreStatus.java 3110 2006-01-19 13:09:08 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* This interface allows XFlaim's backup subsystem to periodicly pass
* information about the status of a restore operation (bytes completed and
* bytes remaining) while the operation is running. The implementor may do
* anything it wants with the information, such as using it to update a
* progress bar or simply ignoring it.
*/
public interface RestoreStatus
{
/**
*
* @param lBytesToDo
* @param lBytesDone
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportProgress(
long lBytesToDo,
long lBytesDone);
/**
*
* @param eErrCode
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportError(
int eErrCode);
/**
*
* @param lTransId
* @param iStartTime
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportBeginTrans(
long lTransId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportCommitTrans(
long lTransId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportAbortTrans(
long lTransId);
/**
*
* @param lTransId
* @param iMaintDocNum
* @param iStartBlkAddr
* @param iEndBlkAddr
* @param iCount
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportBlockChainFree(
long lTransId,
int iMaintDocNum,
int iStartBlkAddr,
int iEndBlkAddr,
int iCount);
/**
*
* @param lTransId
* @param iIndexNum
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportIndexSuspend(
long lTransId,
int iIndexNum);
/**
*
* @param lTransId
* @param iIndexNum
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportIndexResume(
long lTransId,
int iIndexNum);
/**
*
* @param lTransId
* @param iCount
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportReduce(
long lTransId,
int iCount);
/**
*
* @param lTransId
* @param iOldDbVersion
* @param iNewDbVersion
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportUpgrade(
long lTransId,
int iOldDbVersion,
int iNewDbVersion);
/**
*
* @param iFileNum
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportOpenRflFile(
int iFileNum);
/**
*
* @param iFileNum
* @param iBytesRead
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportRflRead(
int iFileNum,
int iBytesRead);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportEnableEncryption(
long lTransId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportWrapKey(
long lTransId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportSetNextNodeId(
long lTransId,
int iCollection,
long lNextNodeId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeSetMetaValue(
long lTransId,
int iCollection,
long lNodeId,
long lMetaValue);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeSetPrefixId(
long lTransId,
int iCollection,
long lNodeId,
int iAttrNameId,
int iPrefixId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeFlagsUpdate(
long lTransId,
int iCollection,
long lNodeId,
int iFlags,
boolean bAdd);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportAttributeSetValue(
long lTransId,
int iCollection,
long lElementNodeId,
int iAttrNameId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeSetValue(
long lTransId,
int iCollection,
long lNodeId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeUpdate(
long lTransId,
int iCollection,
long lNodeId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportInsertBefore(
long lTransId,
int iCollection,
long lParentId,
long lNewChildId,
long lRefChildId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeCreate(
long lTransId,
int iCollection,
long lRefNodeId,
int eNodeType,
int iNameId,
int eLocation);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeChildrenDelete(
long lTransId,
int iCollection,
long lNodeId,
int iNameId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportAttributeDelete(
long lTransId,
int iCollection,
long lElementId,
int iAttrNameId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportNodeDelete(
long lTransId,
int iCollection,
long lNodeId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportDocumentDone(
long lTransId,
int iCollection,
long lNodeId);
/**
*
* @param lTransId
* @return Returns a status code. The integer should one of the constants
* found in {@link xflaim.RCODE xflaim.RCODE}.
* Note that returning anything other than NE_XFLM_OK will cause the
* restore operation to abort and an XFLaimException to be thrown.
*/
int reportRollOverDbKey(
long lTransId);
}

View File

@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// Desc: Transaction Flags
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: TransactionFlags.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Class to represent the posible transaction flags.
*/
public class TransactionFlags
{
public static final int DONT_KILL_TRANS = 1;
public static final int DONT_POISON_CACHE = 2;
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// Desc: Transaction Types
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: TransactionType.java 3113 2006-01-19 13:20:35 -0700 (Thu, 19 Jan 2006) dsanders $
//------------------------------------------------------------------------------
package xflaim;
/**
* Static class representing the transaction types.
*/
public class TransactionType
{
public static final int NO_TRANS = 0;
public static final int READ_TRANS = 1;
public static final int UPDATE_TRANS = 2;
}

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// Desc: XFLAIM Exceptions
//
// Tabs: 3
//
// Copyright (c) 2003,2005-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
package xflaim;
/**
* This is the XFlaim exception class.
*/
public class XFlaimException extends Exception
{
XFlaimException(
int iRcode,
String message)
{
super( message);
m_rc = iRcode;
}
public int getRCode()
{
return m_rc;
}
private int m_rc;
}

View File

@@ -0,0 +1,353 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "jniftk.h"
#include "xflaim_Backup.h"
#define THIS_BACKUP() \
((IF_Backup *)(FLMUINT)lThis)
/****************************************************************************
Desc:
****************************************************************************/
class JNIBackupClient : public IF_BackupClient
{
public:
JNIBackupClient(
jobject jClient,
JavaVM * pJvm)
{
flmAssert( jClient);
flmAssert( pJvm);
m_jClient = jClient;
m_pJvm = pJvm;
}
RCODE XFLMAPI JNIBackupClient::WriteData(
const void * pvBuffer,
FLMUINT uiBytesToWrite);
FINLINE FLMUINT getRefCount( void)
{
return( IF_BackupClient::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_BackupClient::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_BackupClient::Release());
}
private:
jobject m_jClient;
JavaVM * m_pJvm;
};
/****************************************************************************
Desc:
****************************************************************************/
class JNIBackupStatus : public IF_BackupStatus
{
public:
JNIBackupStatus(
jobject jStatus,
JavaVM * pJvm)
{
flmAssert(jStatus);
flmAssert(pJvm);
m_jStatus = jStatus;
m_pJvm = pJvm;
}
RCODE XFLMAPI backupStatus(
FLMUINT64 ui64BytesToDo,
FLMUINT64 ui64BytesDone);
FINLINE FLMUINT getRefCount( void)
{
return( IF_BackupStatus::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_BackupStatus::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_BackupStatus::Release());
}
private:
jobject m_jStatus;
JavaVM * m_pJvm;
};
/****************************************************************************
Desc:
****************************************************************************/
RCODE JNIBackupClient::WriteData(
const void * pvBuffer,
FLMUINT uiBytesToWrite)
{
RCODE rc = NE_XFLM_OK;
JNIEnv * pEnv;
jclass Cls;
jmethodID MId;
jbyteArray jBuff;
void * pvBuff;
FLMBOOL bMustDetach = FALSE;
if (m_pJvm->GetEnv( (void **)&pEnv, JNI_VERSION_1_2) != JNI_OK)
{
if (m_pJvm->AttachCurrentThread( (void **)&pEnv, NULL) != 0)
{
rc = RC_SET( NE_XFLM_FAILURE);
goto Exit;
}
bMustDetach = TRUE;
}
Cls = pEnv->GetObjectClass( m_jClient);
MId = pEnv->GetMethodID( Cls, "WriteData", "([B)I");
flmAssert( MId);
jBuff = pEnv->NewByteArray( uiBytesToWrite);
pvBuff = pEnv->GetPrimitiveArrayCritical(jBuff, NULL);
memcpy(pvBuff, pvBuffer, uiBytesToWrite);
pEnv->ReleasePrimitiveArrayCritical( jBuff, pvBuff, 0);
if( RC_BAD( rc = (RCODE)pEnv->CallIntMethod( m_jClient, MId, jBuff)))
{
goto Exit;
}
Exit:
if (bMustDetach)
{
if (m_pJvm->DetachCurrentThread() != 0)
{
flmAssert( 0);
rc = RC_SET( NE_XFLM_FAILURE);
}
}
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE JNIBackupStatus::backupStatus(
FLMUINT64 ui64BytesToDo,
FLMUINT64 ui64BytesDone)
{
RCODE rc = NE_XFLM_OK;
JNIEnv * pEnv;
jclass Cls;
jmethodID MId;
FLMBOOL bMustDetach = FALSE;
if (m_pJvm->GetEnv( (void **)&pEnv, JNI_VERSION_1_2) != JNI_OK)
{
if (m_pJvm->AttachCurrentThread( (void **)&pEnv, NULL) != 0)
{
rc = RC_SET(NE_XFLM_FAILURE);
goto Exit;
}
bMustDetach = TRUE;
}
Cls = pEnv->GetObjectClass( m_jStatus);
MId = pEnv->GetMethodID( Cls, "backupStatus", "(JJ)I");
flmAssert( MId);
rc = (RCODE)pEnv->CallIntMethod( m_jStatus, MId, (jlong)ui64BytesToDo,
(jlong)ui64BytesDone);
Exit:
if (bMustDetach)
{
if (m_pJvm->DetachCurrentThread() != 0)
{
flmAssert( 0);
rc = RC_SET( NE_XFLM_FAILURE);
}
}
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Backup__1backup(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sBackupPath,
jstring sPassword,
jobject Client,
jobject Status)
{
RCODE rc = NE_XFLM_OK;
IF_Backup * pBackup = THIS_BACKUP();
FLMUINT uiSeqNum = 0;
JavaVM * pJvm;
char * pszBackupPath = NULL;
char * pszPassword = NULL;
JNIBackupClient * pClient;
JNIBackupStatus * pStatus = NULL;
flmAssert( Client);
pEnv->GetJavaVM( &pJvm);
if( (pClient = new JNIBackupClient( Client, pJvm)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
if (sBackupPath)
{
pszBackupPath = (char *)pEnv->GetStringUTFChars( sBackupPath, NULL);
}
if (sPassword)
{
pszPassword = (char *)pEnv->GetStringUTFChars( sPassword, NULL);
}
if (Status)
{
if( (pStatus = new JNIBackupStatus( Status, pJvm)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
}
if (RC_BAD( rc = pBackup->backup( pszBackupPath, pszPassword, pClient,
pStatus, &uiSeqNum)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if( pszBackupPath)
{
pEnv->ReleaseStringUTFChars( sBackupPath, pszBackupPath);
}
if( pszPassword)
{
pEnv->ReleaseStringUTFChars( sPassword, pszPassword);
}
if (pClient)
{
pClient->Release();
}
if (pStatus)
{
pStatus->Release();
}
return( uiSeqNum);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Backup__1endBackup(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis)
{
RCODE rc = NE_XFLM_OK;
IF_Backup * pThisBackup = THIS_BACKUP();
if (RC_BAD( rc = pThisBackup->endBackup()))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Backup__1getBackupTransId(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
return( THIS_BACKUP()->getBackupTransId());
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Backup__1getLastBackupTransId(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
return( THIS_BACKUP()->getLastBackupTransId());
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Backup__1release(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_BACKUP()->Release();
}

View File

@@ -0,0 +1,779 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim.h"
#include "xflaim_DataVector.h"
#include "jniftk.h"
#define THIS_VECTOR() \
((IF_DataVector *)(FLMUINT)lThis)
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1release(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_VECTOR()->Release();
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setDocumentId(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jlong lDocumentId)
{
THIS_VECTOR()->setDocumentID( (FLMUINT64)lDocumentId);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setID(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementId,
jlong lID)
{
RCODE rc = NE_XFLM_OK;
if (RC_BAD( rc = THIS_VECTOR()->setID( (FLMUINT)iElementId, (FLMUINT64)lID)))
{
ThrowError( rc, pEnv);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setNameId(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jint iNameId,
jboolean bIsAttr,
jboolean bIsData)
{
RCODE rc = NE_XFLM_OK;
if (RC_BAD( rc = THIS_VECTOR()->setNameId( (FLMUINT)iElementNumber,
(FLMUINT)iNameId, (FLMBOOL)(bIsAttr ? TRUE : FALSE),
(FLMBOOL)(bIsData ? TRUE : FALSE))))
{
ThrowError( rc, pEnv);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setINT(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jint iNum)
{
RCODE rc = NE_XFLM_OK;
if (iNum > 0x7FFFFFFF)
{
ThrowError( NE_XFLM_CONV_DEST_OVERFLOW, pEnv);
goto Exit;
}
if (RC_BAD( rc = THIS_VECTOR()->setINT(
(FLMUINT)iElementNumber, (FLMINT)iNum)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setUINT(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jint iUNum)
{
RCODE rc = NE_XFLM_OK;
FLMUINT uiNum = (FLMUINT)iUNum;
if (uiNum > 0xFFFFFFFF)
{
ThrowError( NE_XFLM_CONV_DEST_OVERFLOW, pEnv);
goto Exit;
}
if (RC_BAD( rc = THIS_VECTOR()->setUINT( (FLMUINT)iElementNumber, uiNum)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setLong(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jlong lNum)
{
RCODE rc = NE_XFLM_OK;
if (RC_BAD( rc = THIS_VECTOR()->setINT64(
(FLMUINT)iElementNumber, (FLMUINT64)lNum)))
{
ThrowError( rc, pEnv);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setString(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jstring sValue)
{
RCODE rc = NE_XFLM_OK;
jchar * puzValue = NULL;
FLMBOOL bMustRelease = FALSE;
if (sValue)
{
puzValue = (jchar *)pEnv->GetStringCritical( sValue, NULL);
bMustRelease = TRUE;
}
if (RC_BAD( rc = THIS_VECTOR()->setUnicode(
(FLMUINT)iElementNumber, puzValue)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
pEnv->ReleaseStringCritical( sValue, puzValue);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setBinary(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber,
jbyteArray Value)
{
RCODE rc = NE_XFLM_OK;
FLMUINT uiLength = pEnv->GetArrayLength( Value);
void * pvValue = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
if ( (pvValue = pEnv->GetPrimitiveArrayCritical( Value, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->setBinary( (FLMUINT)iElementNumber,
pvValue, uiLength)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
pEnv->ReleasePrimitiveArrayCritical( Value, pvValue, JNI_ABORT);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setRightTruncated(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
THIS_VECTOR()->setRightTruncated( (FLMUINT)iElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1setLeftTruncated(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
THIS_VECTOR()->setLeftTruncated( (FLMUINT)iElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1clearRightTruncated(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
THIS_VECTOR()->clearRightTruncated( (FLMUINT)iElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1clearLeftTruncated(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
THIS_VECTOR()->clearLeftTruncated( (FLMUINT)iElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DataVector__1getDocumentID(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
return( (jlong)(THIS_VECTOR()->getDocumentID()));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DataVector__1getID(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( (jlong)THIS_VECTOR()->getID( (FLMUINT)iElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_DataVector__1getNameId(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( (jint)THIS_VECTOR()->getNameId( (FLMUINT)iElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jboolean JNICALL Java_xflaim_DataVector__1isAttr(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( THIS_VECTOR()->isAttr( (FLMUINT)iElementNumber) ? true : false);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jboolean JNICALL Java_xflaim_DataVector__1isDataComponent(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( THIS_VECTOR()->isDataComponent(
(FLMUINT)iElementNumber) ? true : false);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jboolean JNICALL Java_xflaim_DataVector__1isKeyComponent(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( THIS_VECTOR()->isKeyComponent(
(FLMUINT)iElementNumber) ? true : false);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_DataVector__1getDataLength(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( (jint)THIS_VECTOR()->getDataLength( (FLMUINT)iElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_DataVector__1getDataType(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
return( (jint)(THIS_VECTOR()->getDataType( (FLMUINT)iElementNumber)));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_DataVector__1getINT(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
RCODE rc = NE_XFLM_OK;
FLMINT iINT;
if (RC_BAD( rc = THIS_VECTOR()->getINT( (FLMUINT)iElementNumber, &iINT)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jint)iINT);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_DataVector__1getUINT(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
RCODE rc = NE_XFLM_OK;
FLMINT iINT;
if (RC_BAD( rc = THIS_VECTOR()->getUINT( (FLMUINT)iElementNumber,
(FLMUINT *)&iINT)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jint)iINT);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DataVector__1getLong(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
RCODE rc = NE_XFLM_OK;
FLMINT64 i64INT;
if (RC_BAD( rc = THIS_VECTOR()->getINT64( (FLMUINT)iElementNumber, &i64INT)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)i64INT);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jstring JNICALL Java_xflaim_DataVector__1getString(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
RCODE rc = NE_XFLM_OK;
FLMUNICODE uzBuffer[ 128];
FLMUNICODE * puzBuf = uzBuffer;
FLMUINT uiBufSize = sizeof( uzBuffer);
FLMUINT uiNumChars;
jstring sBuf = NULL;
if (RC_BAD( rc = THIS_VECTOR()->getUnicode( (FLMUINT)iElementNumber,
NULL, &uiNumChars)))
{
ThrowError( rc, pEnv);
goto Exit;
}
if (uiNumChars * sizeof( FLMUNICODE) >= uiBufSize)
{
uiBufSize = (uiNumChars + 1) * sizeof( FLMUNICODE);
if (RC_BAD( rc = f_alloc( uiBufSize, &puzBuf)))
{
ThrowError( rc, pEnv);
goto Exit;
}
}
if (RC_BAD( rc = THIS_VECTOR()->getUnicode( (FLMUINT)iElementNumber,
puzBuf, &uiBufSize)))
{
ThrowError( rc, pEnv);
goto Exit;
}
sBuf = pEnv->NewString( puzBuf, uiBufSize / sizeof( FLMUNICODE));
Exit:
if (puzBuf != uzBuffer)
{
f_free( &puzBuf);
}
return( sBuf);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jbyteArray JNICALL Java_xflaim_DataVector__1getBinary(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iElementNumber)
{
RCODE rc = NE_XFLM_OK;
FLMUINT uiLength;
jbyteArray Data;
void * pvData = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
uiLength = THIS_VECTOR()->getDataLength( (FLMUINT)iElementNumber);
Data = pEnv->NewByteArray( uiLength);
if ( (pvData = pEnv->GetPrimitiveArrayCritical( Data, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->getBinary( (FLMUINT)iElementNumber,
pvData, &uiLength)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
if (RC_BAD( rc))
{
pEnv->ReleasePrimitiveArrayCritical( Data, pvData, JNI_ABORT);
pEnv->DeleteLocalRef( Data);
Data = NULL;
}
else
{
pEnv->ReleasePrimitiveArrayCritical( Data, pvData, 0);
}
}
return( Data);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jbyteArray JNICALL Java_xflaim_DataVector__1outputKey(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jlong ljDbRef,
jint iIndexNum,
jboolean bOutputIds)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = (IF_Db *)(FLMUINT)ljDbRef;
FLMUINT uiLength;
jbyteArray Key;
void * pvKey = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
uiLength = XFLM_MAX_KEY_SIZE;
Key = pEnv->NewByteArray( uiLength);
if( (pvKey = pEnv->GetPrimitiveArrayCritical( Key, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->outputKey( pDb, (FLMUINT)iIndexNum,
(bOutputIds ? TRUE : FALSE), (FLMBYTE *)pvKey,
uiLength, &uiLength)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
if (RC_BAD( rc))
{
pEnv->ReleasePrimitiveArrayCritical( Key, pvKey, JNI_ABORT);
pEnv->DeleteLocalRef( Key);
Key = NULL;
}
else
{
pEnv->ReleasePrimitiveArrayCritical( Key, pvKey, 0);
}
}
return( Key);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jbyteArray JNICALL Java_xflaim_DataVector__1outputData(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jlong ljDbRef,
jint iIndexNum)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = (IF_Db *)(FLMUINT)ljDbRef;
FLMUINT uiLength;
jbyteArray Data;
void * pvData = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
uiLength = XFLM_MAX_KEY_SIZE;
Data = pEnv->NewByteArray( uiLength);
if ( (pvData = pEnv->GetPrimitiveArrayCritical( Data, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->outputData( pDb, (FLMUINT)iIndexNum,
(FLMBYTE *)pvData, uiLength, &uiLength)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
if (RC_BAD( rc))
{
pEnv->ReleasePrimitiveArrayCritical( Data, pvData, JNI_ABORT);
pEnv->DeleteLocalRef( Data);
Data = NULL;
}
else
{
pEnv->ReleasePrimitiveArrayCritical( Data, pvData, 0);
}
}
return( Data);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1inputKey(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jlong ljDbRef,
jint iIndexNum,
jbyteArray Key,
jint iKeyLen)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = (IF_Db *)(FLMUINT)ljDbRef;
void * pvKey = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
if ( (pvKey = pEnv->GetPrimitiveArrayCritical( Key, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->inputKey( pDb, (FLMUINT)iIndexNum,
(FLMBYTE *)pvKey, (FLMUINT)iKeyLen)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
pEnv->ReleasePrimitiveArrayCritical( Key, pvKey, JNI_ABORT);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1inputData(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jlong ljDbRef,
jint iIndexNum,
jbyteArray Data,
jint iDataLen)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = (IF_Db *)(FLMUINT)ljDbRef;
void * pvData = NULL;
jboolean bIsCopy = false;
FLMBOOL bMustRelease = false;
if( (pvData = pEnv->GetPrimitiveArrayCritical( Data, &bIsCopy)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
ThrowError( rc, pEnv);
goto Exit;
}
bMustRelease = true;
if (RC_BAD( rc = THIS_VECTOR()->inputKey( pDb, (FLMUINT)iIndexNum,
(FLMBYTE *)pvData, (FLMUINT)iDataLen)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (bMustRelease)
{
pEnv->ReleasePrimitiveArrayCritical( Data, pvData, JNI_ABORT);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DataVector__1reset(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_VECTOR()->reset();
}

View File

@@ -0,0 +1,378 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim.h"
#include "xflaim_Db.h"
#include "jniftk.h"
#define THIS_FDB() \
((IF_Db *)(FLMUINT)lThis)
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1release(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_FDB()->Release();
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1transBegin(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iTransactionType,
jint iMaxLockWait,
jint iFlags)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
if (RC_BAD( rc = pDb->transBegin( (eDbTransType)iTransactionType,
(FLMUINT)iMaxLockWait, (FLMUINT)iFlags)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1transCommit(
JNIEnv * pEnv,
jobject obj,
jlong lThis)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
(void)obj;
if (RC_BAD( rc = pDb->transCommit()))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1transAbort(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
if (RC_BAD( rc = pDb->transAbort()))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1import(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jobject jIStream,
jint iCollection)
{
RCODE rc = NE_XFLM_OK;
IF_PosIStream * pIStream = NULL;
IF_Db * pDb = THIS_FDB();
jclass class_JIStream = pEnv->FindClass( "xflaim/PosIStream");
jfieldID fid_this = pEnv->GetFieldID( class_JIStream, "m_this", "J");
pIStream = (IF_PosIStream *)((FLMUINT)pEnv->GetLongField( jIStream, fid_this));
if (!pIStream)
{
ThrowError( NE_XFLM_FAILURE, pEnv);
goto Exit;
}
if (RC_BAD( rc = pDb->import( pIStream, (FLMUINT)iCollection)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Db__1getFirstDocument(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iCollection,
jobject jNode)
{
RCODE rc = NE_XFLM_OK;
IF_DOMNode * pNode = NULL;
IF_Db * pDb = THIS_FDB();
// Get the real pNode if one was passed in so we can pass it to the
// getFirstDocument method.
if (jNode)
{
jclass class_JDOMNode = pEnv->FindClass( "xflaim.DOMNode");
jfieldID fid_this = pEnv->GetFieldID( class_JDOMNode, "m_this", "Z");
pNode = (IF_DOMNode *)(FLMUINT)pEnv->GetLongField( jNode, fid_this);
// Clear the jNode's reference to this node as it is going to go away.
pEnv->SetLongField( jNode, fid_this, (jlong)0);
}
if (RC_BAD( rc = pDb->getFirstDocument( (FLMUINT)iCollection, &pNode)))
{
ThrowError(rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)pNode);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Db__1getNode(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iCollection,
jlong lNodeId,
jlong lpOldNodeRef)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
IF_DOMNode * ifpNewNode = NULL;
if (lpOldNodeRef)
{
ifpNewNode = (IF_DOMNode *)(FLMUINT)lpOldNodeRef;
}
if (RC_BAD( rc = pDb->getNode( (FLMUINT)iCollection, (FLMUINT64)lNodeId,
&ifpNewNode)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)ifpNewNode);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Db__1createDocument(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iCollection)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
IF_DOMNode * ifpNewNode = NULL;
if (RC_BAD( rc = pDb->createDocument((FLMUINT)iCollection, &ifpNewNode)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)ifpNewNode);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Db__1createRootElement(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iCollection,
jint iTag)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
IF_DOMNode * ifpNewNode = NULL;
if (RC_BAD( rc = pDb->createRootElement((FLMUINT)iCollection,
(FLMUINT)iTag, &ifpNewNode)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)ifpNewNode);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jint JNICALL Java_xflaim_Db__1createElementDef(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sNamespaceURI,
jstring sElementName,
jint iDataType,
jint iRequestedNum)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
FLMUINT uiNameId = iRequestedNum;
jchar * pszNamespaceURI = NULL;
jchar * pszElementName;
if (sNamespaceURI)
{
pszNamespaceURI = (jchar *)pEnv->GetStringCritical( sNamespaceURI, NULL);
}
flmAssert( sElementName);
pszElementName = (jchar *)pEnv->GetStringCritical( sElementName, NULL);
if (RC_BAD( rc = pDb->createElementDef( pszNamespaceURI, pszElementName,
(FLMUINT)iDataType, &uiNameId, NULL)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (pszNamespaceURI)
{
pEnv->ReleaseStringCritical( sNamespaceURI, pszNamespaceURI);
}
pEnv->ReleaseStringCritical( sElementName, pszElementName);
return( (jlong)uiNameId);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_Db__1backupBegin(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint eBackupType,
jint eTransType,
jint iMaxLockWait,
jlong lReusedRef)
{
RCODE rc = NE_XFLM_OK;
IF_Db * pDb = THIS_FDB();
IF_Backup * ifpBackup = NULL;
if (lReusedRef)
{
ifpBackup = (IF_Backup *)(FLMUINT)lReusedRef;
}
if (RC_BAD( rc = pDb->backupBegin( (eDbBackupType)eBackupType,
(eDbTransType)eTransType, (FLMUINT)iMaxLockWait, &ifpBackup)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)ifpBackup);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_Db__1keyRetrieve(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jint iIndex,
jlong lKey,
jint iFlags,
jlong lFoundKey)
{
RCODE rc = NE_XFLM_OK;
IF_DataVector * pSearchKey = (IF_DataVector *)(FLMUINT)lKey;
IF_DataVector * pFoundKey = (IF_DataVector *)(FLMUINT)lFoundKey;
IF_Db * pDb = THIS_FDB();
FLMUINT uiIndex = (FLMUINT)iIndex;
FLMUINT uiFlags = (FLMUINT)iFlags;
if (RC_BAD( rc = pDb->keyRetrieve( uiIndex, pSearchKey, uiFlags, pFoundKey)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}

View File

@@ -0,0 +1,755 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim_DbSystem.h"
#include "flaimsys.h"
#include "jniftk.h"
#include "jnirestore.h"
#include "jnistatus.h"
#define THIS_DBSYS() \
((F_DbSystem *)(FLMUINT)lThis)
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1createDbSystem(
JNIEnv * pEnv,
jobject) // obj)
{
F_DbSystem * pDbSystem;
if( (pDbSystem = new F_DbSystem()) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
}
return( (jlong)(FLMUINT)pDbSystem);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1init(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis)
{
RCODE rc = NE_XFLM_OK;
if (RC_BAD( rc = THIS_DBSYS()->init()))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1exit(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_DBSYS()->exit();
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1dbCreate(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbFileName,
jstring sDataDir,
jstring sRflDir,
jstring sDictFileName,
jstring sDictBuf,
jobject CreateOpts)
{
RCODE rc = NE_XFLM_OK;
F_Db * pDb = NULL;
XFLM_CREATE_OPTS Opts;
XFLM_CREATE_OPTS * pOpts = &Opts;
char * pszFilePath = NULL;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
char * pszDictFileName = NULL;
char * pszDictBuf = NULL;
flmAssert( sDbFileName);
pszFilePath = (char *)pEnv->GetStringUTFChars( sDbFileName, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszRflDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
if (sDictFileName)
{
pszDictFileName = (char *)pEnv->GetStringUTFChars( sDictFileName, NULL);
}
if (sDictBuf)
{
pszDictBuf = (char *)pEnv->GetStringUTFChars( sDictBuf, NULL);
}
if (!CreateOpts)
{
pOpts = NULL;
}
else
{
jclass class_CREATEOPTS = pEnv->FindClass( "xflaim/CREATEOPTS");
Opts.uiBlockSize = pEnv->GetIntField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "iBlockSize", "I"));
Opts.uiVersionNum = pEnv->GetIntField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "iVersionNum", "I"));
Opts.uiMinRflFileSize = pEnv->GetIntField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "iMinRflFileSize", "I"));
Opts.uiMaxRflFileSize = pEnv->GetIntField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "iMaxRflFileSize", "I"));
Opts.bKeepRflFiles = pEnv->GetBooleanField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "bKeepRflFiles", "Z"))
? TRUE
: FALSE;
Opts.bLogAbortedTransToRfl = pEnv->GetBooleanField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "bLogAbortedTransToRfl", "Z"))
? TRUE
: FALSE;
Opts.uiDefaultLanguage = pEnv->GetIntField( CreateOpts,
pEnv->GetFieldID( class_CREATEOPTS, "iDefaultLanguage", "I"));
}
if (RC_BAD( rc = THIS_DBSYS()->dbCreate( pszFilePath, pszDataDir,
pszRflDir, pszDictFileName, pszDictBuf, pOpts, (IF_Db **)&pDb)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
pEnv->ReleaseStringUTFChars( sDbFileName, pszFilePath);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
if (pszDictFileName)
{
pEnv->ReleaseStringUTFChars( sDictFileName, pszDictFileName);
}
if (pszDictBuf)
{
pEnv->ReleaseStringUTFChars( sDictBuf, pszDictBuf);
}
return( (jlong)((FLMUINT)pDb));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1dbOpen(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbFileName,
jstring sDataDir,
jstring sRflDir,
jstring sPassword,
jboolean bAllowLimited)
{
RCODE rc = NE_XFLM_OK;
F_Db * pDb = NULL;
char * pszFilePath;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
char * pszPassword = NULL;
flmAssert( sDbFileName);
pszFilePath = (char *)pEnv->GetStringUTFChars( sDbFileName, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszRflDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
if (sPassword)
{
pszPassword = (char *)pEnv->GetStringUTFChars( sPassword, NULL);
}
if (RC_BAD( rc = THIS_DBSYS()->dbOpen( pszFilePath, pszDataDir,
pszRflDir, pszPassword, bAllowLimited ? TRUE : FALSE,
(IF_Db **)&pDb)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
pEnv->ReleaseStringUTFChars( sDbFileName, pszFilePath);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
if( pszPassword)
{
pEnv->ReleaseStringUTFChars( sPassword, pszPassword);
}
return( (jlong)(FLMUINT)pDb);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbRemove(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbName,
jstring sDataDir,
jstring sRflDir,
jboolean bRemove)
{
char * pszName;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
flmAssert( sDbName);
pszName = (char *)pEnv->GetStringUTFChars( sDbName, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszRflDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
THIS_DBSYS()->dbRemove( pszName, pszDataDir,
pszRflDir, bRemove ? TRUE : FALSE);
pEnv->ReleaseStringUTFChars( sDbName, pszName);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbRestore(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbPath,
jstring sDataDir,
jstring sRflDir,
jstring sBackupPath,
jstring sPassword,
jobject RestoreClient,
jobject RestoreStatus)
{
RCODE rc = NE_XFLM_OK;
char * pszName;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
char * pszBackupPath = NULL;
char * pszPassword = NULL;
JavaVM * pJvm = NULL;
JNIRestoreClient * pRestoreClient = NULL;
JNIRestoreStatus * pRestoreStatus = NULL;
pEnv->GetJavaVM( &pJvm);
flmAssert( sDbPath);
pszName = (char *)pEnv->GetStringUTFChars( sDbPath, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszRflDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
if (sBackupPath)
{
pszBackupPath = (char *)pEnv->GetStringUTFChars( sBackupPath, NULL);
}
if (sPassword)
{
pszPassword = (char *)pEnv->GetStringUTFChars( sPassword, NULL);
}
flmAssert( RestoreClient);
if ((pRestoreClient = new JNIRestoreClient( RestoreClient, pJvm)) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
goto Exit;
}
if (RestoreStatus != NULL)
{
if ((pRestoreStatus = new JNIRestoreStatus( RestoreStatus, pJvm)) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
goto Exit;
}
}
if (RC_BAD( rc = THIS_DBSYS()->dbRestore( pszName, pszDataDir, pszBackupPath,
pszRflDir, pszPassword, pRestoreClient, pRestoreStatus)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (pRestoreClient)
{
pRestoreClient->Release();
}
if (pRestoreStatus)
{
pRestoreStatus->Release();
}
pEnv->ReleaseStringUTFChars( sDbPath, pszName);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
if (pszBackupPath)
{
pEnv->ReleaseStringUTFChars( sBackupPath, pszBackupPath);
}
if (pszPassword)
{
pEnv->ReleaseStringUTFChars( sPassword, pszPassword);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbRename(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbName,
jstring sDataDir,
jstring sRflDir,
jstring sNewDbName,
jboolean bOverwriteDestOk,
jobject Status)
{
RCODE rc = NE_XFLM_OK;
char * pszDbName = NULL;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
char * pszNewDbName = NULL;
JavaVM * pJvm;
JNIRenameStatus * pStatus = NULL;
flmAssert( sDbName);
flmAssert( sNewDbName);
pszDbName = (char *)pEnv->GetStringUTFChars( sDbName, NULL);
pszNewDbName = (char *)pEnv->GetStringUTFChars( sNewDbName, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszRflDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
if (Status != NULL)
{
pEnv->GetJavaVM( &pJvm);
if ((pStatus = new JNIRenameStatus( Status, pJvm)) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
goto Exit;
}
}
if (RC_BAD(rc = THIS_DBSYS()->dbRename( pszDbName, pszDataDir, pszRflDir,
pszNewDbName, bOverwriteDestOk ? TRUE : FALSE, pStatus)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (pStatus)
{
pStatus->Release();
}
pEnv->ReleaseStringUTFChars( sDbName, pszDbName);
pEnv->ReleaseStringUTFChars( sNewDbName, pszNewDbName);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_DbSystem__1dbCopy(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sSrcDbName,
jstring sSrcDataDir,
jstring sSrcRflDir,
jstring sDestDbName,
jstring sDestDataDir,
jstring sDestRflDir,
jobject Status)
{
RCODE rc = NE_XFLM_OK;
char * pszSrcDbName = NULL;
char * pszSrcDataDir = NULL;
char * pszSrcRflDir = NULL;
char * pszDestDbName = NULL;
char * pszDestDataDir = NULL;
char * pszDestRflDir = NULL;
JavaVM * pJvm;
JNICopyStatus * pStatus = NULL;
flmAssert( sSrcDbName);
pszSrcDbName = (char *)pEnv->GetStringUTFChars( sSrcDbName, NULL);
if (sSrcDataDir)
{
pszSrcDataDir = (char *)pEnv->GetStringUTFChars( sSrcDataDir, NULL);
}
if (sSrcRflDir)
{
pszSrcRflDir = (char *)pEnv->GetStringUTFChars( sSrcRflDir, NULL);
}
flmAssert( sSrcDbName);
pszDestDbName = (char *)pEnv->GetStringUTFChars( sDestDbName, NULL);
if (sDestDataDir)
{
pszDestDataDir = (char *)pEnv->GetStringUTFChars( sDestDataDir, NULL);
}
if (sDestRflDir)
{
pszDestRflDir = (char *)pEnv->GetStringUTFChars( sDestRflDir, NULL);
}
if (Status)
{
pEnv->GetJavaVM( &pJvm);
if ( (pStatus = new JNICopyStatus( Status, pJvm)) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
goto Exit;
}
}
if (RC_BAD( rc = THIS_DBSYS()->dbCopy( pszSrcDbName, pszSrcDataDir,
pszSrcRflDir, pszDestDbName, pszDestDataDir, pszDestRflDir, pStatus)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (pStatus)
{
pStatus->Release();
}
pEnv->ReleaseStringUTFChars( sSrcDbName, pszSrcDbName);
if (pszSrcDataDir)
{
pEnv->ReleaseStringUTFChars( sSrcDataDir, pszSrcDataDir);
}
if (pszSrcRflDir)
{
pEnv->ReleaseStringUTFChars( sSrcRflDir, pszSrcRflDir);
}
pEnv->ReleaseStringUTFChars( sDestDbName, pszDestDbName);
if (pszDestDataDir)
{
pEnv->ReleaseStringUTFChars( sDestDataDir, pszDestDataDir);
}
if (pszDestRflDir)
{
pEnv->ReleaseStringUTFChars( sDestRflDir, pszDestRflDir);
}
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1dbCheck(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sDbName,
jstring sDataDir,
jstring sRflDir,
jstring sPassword,
jint iFlags,
jobject Status)
{
RCODE rc = NE_XFLM_OK;
char * pszDbName = NULL;
char * pszDataDir = NULL;
char * pszRflDir = NULL;
char * pszPassword = NULL;
JNICheckStatus * pStatus = NULL;
F_DbInfo * pDbInfo = NULL;
flmAssert( sDbName);
pszDbName = (char *)pEnv->GetStringUTFChars( sDbName, NULL);
if (sDataDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sDataDir, NULL);
}
if (sRflDir)
{
pszDataDir = (char *)pEnv->GetStringUTFChars( sRflDir, NULL);
}
if (sPassword)
{
pszPassword = (char *)pEnv->GetStringUTFChars( sPassword, NULL);
}
if (Status != NULL)
{
JavaVM * pJvm = NULL;
pEnv->GetJavaVM( &pJvm);
if ((pStatus = new JNICheckStatus( Status, pJvm)) == NULL)
{
ThrowError( NE_XFLM_MEM, pEnv);
goto Exit;
}
}
if (RC_BAD( rc = THIS_DBSYS()->dbCheck( pszDbName, pszDataDir, pszRflDir,
pszPassword, (FLMUINT)iFlags, (IF_DbInfo **)&pDbInfo, pStatus)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
if (pStatus)
{
pStatus->Release();
}
pEnv->ReleaseStringUTFChars( sDbName, pszDbName);
if (pszDataDir)
{
pEnv->ReleaseStringUTFChars( sDataDir, pszDataDir);
}
if (pszRflDir)
{
pEnv->ReleaseStringUTFChars( sRflDir, pszRflDir);
}
if (pszPassword)
{
pEnv->ReleaseStringUTFChars( sPassword, pszPassword);
}
return (jlong)(FLMUINT)pDbInfo;
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1openBufferIStream(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sBuffer)
{
RCODE rc = NE_XFLM_OK;
IF_PosIStream * pIStream = NULL;
char * pcBuffer = (char *)pEnv->GetStringUTFChars(sBuffer, NULL);
FLMUINT uiBufLen = pEnv->GetStringUTFLength( sBuffer);
if (RC_BAD( rc = THIS_DBSYS()->openBufferIStream( pcBuffer,
uiBufLen, &pIStream)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)((FLMUINT)pIStream));
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1openFileIStream(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis,
jstring sPath)
{
RCODE rc = NE_XFLM_OK;
char * pszPath = (char *)pEnv->GetStringUTFChars( sPath, NULL);
IF_PosIStream * pIStream = NULL;
if (RC_BAD( rc = THIS_DBSYS()->openFileIStream( pszPath, &pIStream)))
{
ThrowError( rc, pEnv);
goto Exit;
}
Exit:
pEnv->ReleaseStringUTFChars( sPath, pszPath);
return( (jlong)(FLMUINT)pIStream);
}
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT jlong JNICALL Java_xflaim_DbSystem__1createJDataVector(
JNIEnv * pEnv,
jobject, // obj,
jlong lThis)
{
RCODE rc = NE_XFLM_OK;
IF_DataVector * ifpDataVector = NULL;
if (RC_BAD( rc = THIS_DBSYS()->createIFDataVector( &ifpDataVector)))
{
ThrowError(rc, pEnv);
goto Exit;
}
Exit:
return( (jlong)(FLMUINT)ifpDataVector);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim.h"
#include "jniftk.h"
/****************************************************************************
Desc:
****************************************************************************/
void ThrowError(
RCODE rc,
JNIEnv * pEnv)
{
char szMsg[ 128];
jclass class_XFlaimException;
jmethodID id_Constructor;
jobject Exception;
f_sprintf( szMsg, "Error code from XFLAIM was %08X", (unsigned)rc);
class_XFlaimException = pEnv->FindClass( "xflaim/XFlaimException");
id_Constructor = pEnv->GetMethodID( class_XFlaimException,
"<init>", "(ILjava/lang/String;)V");
Exception = pEnv->NewObject( class_XFlaimException, id_Constructor,
(jint)rc, pEnv->NewStringUTF( szMsg));
pEnv->Throw( reinterpret_cast<jthrowable>(Exception));
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#ifndef JNIFTK_H
#define JNIFTK_H
#ifndef FLM_DONT_USE_COM
#define FLM_DONT_USE_COM
#endif
#include "xflaim.h"
#include "ftk.h"
#include "jni.h"
void ThrowError(
RCODE rc,
JNIEnv * pEnv);
#endif // JNIFTK_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,279 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
/****************************************************************************
Desc:
****************************************************************************/
class JNIRestoreClient : public IF_RestoreClient, public XF_Base
{
public:
JNIRestoreClient(
jobject jClient,
JavaVM * pJvm)
{
flmAssert( jClient);
flmAssert( pJvm);
m_jClient = jClient;
m_pJvm = pJvm;
}
RCODE XFLMAPI openBackupSet( void);
RCODE XFLMAPI openRflFile(
FLMUINT uiFileNum);
RCODE XFLMAPI openIncFile(
FLMUINT uiFileNum);
RCODE XFLMAPI read(
FLMUINT uiLength,
void * pvBuffer,
FLMUINT * puiBytesRead);
RCODE XFLMAPI close( void);
RCODE XFLMAPI abortFile( void);
FINLINE FLMUINT getRefCount( void)
{
return( IF_RestoreClient::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_RestoreClient::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_RestoreClient::Release());
}
private:
jobject m_jClient;
JavaVM * m_pJvm;
};
/****************************************************************************
Desc:
****************************************************************************/
class JNIRestoreStatus : public IF_RestoreStatus, public XF_Base
{
public:
JNIRestoreStatus(
jobject jStatus,
JavaVM * pJvm)
{
flmAssert( jStatus);
flmAssert( pJvm);
m_jStatus = jStatus;
m_pJvm = pJvm;
}
RCODE XFLMAPI reportProgress(
eRestoreAction * peAction,
FLMUINT64 ui64BytesToDo,
FLMUINT64 ui64BytesDone);
RCODE XFLMAPI reportError(
eRestoreAction * peAction,
RCODE rcErr);
RCODE XFLMAPI reportOpenRflFile(
eRestoreAction * peAction,
FLMUINT uiFileNum);
RCODE XFLMAPI reportRflRead(
eRestoreAction * peAction,
FLMUINT uiFileNum,
FLMUINT uiBytesRead);
RCODE XFLMAPI reportBeginTrans(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportCommitTrans(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportAbortTrans(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportBlockChainFree(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT64 ui64MaintDocNum,
FLMUINT uiStartBlkAddr,
FLMUINT uiEndBlkAddr,
FLMUINT uiCount);
RCODE XFLMAPI reportIndexSuspend(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiIndexNum);
RCODE XFLMAPI reportIndexResume(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiIndexNum);
RCODE XFLMAPI reportReduce(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCount);
RCODE XFLMAPI reportUpgrade(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiOldDbVersion,
FLMUINT uiNewDbVersion);
RCODE XFLMAPI reportEnableEncryption(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportWrapKey(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportRollOverDbKey(
eRestoreAction * peAction,
FLMUINT64 ui64TransId);
RCODE XFLMAPI reportDocumentDone(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId);
RCODE XFLMAPI reportNodeDelete(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId);
RCODE XFLMAPI reportAttributeDelete(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64ElementId,
FLMUINT uiAttrNameId);
RCODE XFLMAPI reportNodeChildrenDelete(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId,
FLMUINT uiNameId);
RCODE XFLMAPI reportNodeCreate(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64RefNodeId,
eDomNodeType eNodeType,
FLMUINT uiNameId,
eNodeInsertLoc eLocation);
RCODE XFLMAPI reportInsertBefore(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64ParentId,
FLMUINT64 ui64NewChildId,
FLMUINT64 ui64RefChildId);
RCODE XFLMAPI reportNodeUpdate(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId);
RCODE XFLMAPI reportNodeSetValue(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId);
RCODE XFLMAPI reportAttributeSetValue(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64ElementNodeId,
FLMUINT uiAttrNameId);
RCODE XFLMAPI reportNodeFlagsUpdate(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId,
FLMUINT uiFlags,
FLMBOOL bAdd);
RCODE XFLMAPI reportNodeSetPrefixId(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId,
FLMUINT uiAttrNameId,
FLMUINT uiPrefixId);
RCODE XFLMAPI reportNodeSetMetaValue(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NodeId,
FLMUINT64 ui64MetaValue);
RCODE XFLMAPI reportSetNextNodeId(
eRestoreAction * peAction,
FLMUINT64 ui64TransId,
FLMUINT uiCollection,
FLMUINT64 ui64NextNodeId);
FINLINE FLMUINT getRefCount( void)
{
return( IF_RestoreStatus::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_RestoreStatus::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_RestoreStatus::Release());
}
private:
jobject m_jStatus;
JavaVM * m_pJvm;
};

View File

@@ -0,0 +1,204 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "jnistatus.h"
/****************************************************************************
Desc:
****************************************************************************/
RCODE XFLMAPI JNIRenameStatus::dbRenameStatus(
const char * pszSrcFileName,
const char * pszDstFileName)
{
RCODE rc = NE_XFLM_OK;
JNIEnv * pEnv;
jclass Cls;
jmethodID MId;
jstring sSrcName;
jstring sDstName;
FLMBOOL bMustDetach = FALSE;
if (m_pJvm->GetEnv( (void **)&pEnv, JNI_VERSION_1_2) != JNI_OK)
{
if (m_pJvm->AttachCurrentThread( (void **)&pEnv, NULL) != 0)
{
rc = RC_SET( NE_XFLM_FAILURE);
goto Exit;
}
bMustDetach = TRUE;
}
Cls = pEnv->GetObjectClass( m_jStatus);
MId = pEnv->GetMethodID( Cls, "dbRenameStatus",
"(Ljava/lang/String;Ljava/lang/String)I");
flmAssert( MId);
sSrcName = pEnv->NewStringUTF( pszSrcFileName);
sDstName = pEnv->NewStringUTF( pszDstFileName);
if( RC_BAD( rc = (RCODE)pEnv->CallIntMethod( m_jStatus,
MId, sSrcName, sDstName)))
{
goto Exit;
}
Exit:
if (bMustDetach)
{
if (m_pJvm->DetachCurrentThread() != 0)
{
flmAssert( 0);
rc = RC_SET( NE_XFLM_FAILURE);
}
}
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE XFLMAPI JNICopyStatus::dbCopyStatus(
FLMUINT64 ui64BytesToCopy,
FLMUINT64 ui64BytesCopied,
FLMBOOL bNewSrcFile,
const char * pszSrcFileName,
const char * pszDestFileName)
{
RCODE rc = NE_XFLM_OK;
JNIEnv * pEnv;
jclass Cls;
jmethodID MId;
jstring sSrcName;
jstring sDstName;
FLMBOOL bMustDetach = FALSE;
if (m_pJvm->GetEnv( (void **)&pEnv, JNI_VERSION_1_2) != JNI_OK)
{
if (m_pJvm->AttachCurrentThread( (void **)&pEnv, NULL) != 0)
{
rc = RC_SET( NE_XFLM_FAILURE);
goto Exit;
}
bMustDetach = TRUE;
}
Cls = pEnv->GetObjectClass( m_jStatus);
MId = pEnv->GetMethodID( Cls, "dbCopyStatus",
"(JJZLjava/lang/String;Ljava/lang/String)I");
flmAssert( MId);
sSrcName = pEnv->NewStringUTF( pszSrcFileName);
sDstName = pEnv->NewStringUTF( pszDestFileName);
if( RC_BAD( rc = (RCODE)pEnv->CallIntMethod( m_jStatus, MId,
(jlong)ui64BytesToCopy, (jlong)ui64BytesCopied,
(bNewSrcFile) ? true : false, sSrcName, sDstName)))
{
goto Exit;
}
Exit:
if (bMustDetach)
{
if (m_pJvm->DetachCurrentThread() != 0)
{
flmAssert( 0);
rc = RC_SET( NE_XFLM_FAILURE);
}
}
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE XFLMAPI JNICheckStatus::reportProgress(
XFLM_PROGRESS_CHECK_INFO *) // pProgCheck)
{
RCODE rc = NE_XFLM_OK;
JNIEnv * pEnv;
jclass Cls;
jmethodID MId;
jobject JProgCheck;
FLMBOOL bMustDetach = FALSE;
if (m_pJvm->GetEnv( (void **)&pEnv, JNI_VERSION_1_2) != JNI_OK)
{
if (m_pJvm->AttachCurrentThread( (void **)&pEnv, NULL) != 0)
{
rc = RC_SET( NE_XFLM_FAILURE);
goto Exit;
}
bMustDetach = TRUE;
}
// Have to create a new XFLM_PROGRESS_CHECK_INFO java class
// and copy everything from pProgCheck into it.
Cls = pEnv->FindClass( "xflaim/Structures/PROGRESS_CHECK");
MId = pEnv->GetMethodID( Cls, "<init>", "()V");
flmAssert( MId);
JProgCheck = pEnv->NewObject( Cls, MId);
Cls = pEnv->GetObjectClass( m_jStatus);
MId = pEnv->GetMethodID( Cls, "reportProgress",
"(Lxflaim/Structures/PROGRESS_CHECK)I");
flmAssert( MId);
if( RC_BAD( rc = (RCODE)pEnv->CallIntMethod( m_jStatus, MId, JProgCheck)))
{
goto Exit;
}
Exit:
if (bMustDetach)
{
if (m_pJvm->DetachCurrentThread() != 0)
{
flmAssert( 0);
rc = RC_SET( NE_XFLM_FAILURE);
}
}
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE XFLMAPI JNICheckStatus::reportCheckErr(
XFLM_CORRUPT_INFO *, // pCorruptInfo,
FLMBOOL *) // pbFix)
{
return( NE_XFLM_NOT_IMPLEMENTED);
}

View File

@@ -0,0 +1,160 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim.h"
#include "flaimsys.h"
#include <jni.h>
/****************************************************************************
Desc:
****************************************************************************/
class JNIRenameStatus : public IF_DbRenameStatus, public XF_Base
{
public:
JNIRenameStatus(
jobject jStatus,
JavaVM * pJvm)
{
flmAssert( jStatus);
flmAssert( pJvm);
m_jStatus = jStatus;
m_pJvm = pJvm;
}
RCODE XFLMAPI dbRenameStatus(
const char * pszSrcFileName,
const char * pszDstFileName);
FINLINE FLMUINT getRefCount( void)
{
return( IF_DbRenameStatus::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_DbRenameStatus::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_DbRenameStatus::Release());
}
private:
JavaVM * m_pJvm;
jobject m_jStatus;
};
/****************************************************************************
Desc:
****************************************************************************/
class JNICopyStatus : public IF_DbCopyStatus, public XF_Base
{
public:
JNICopyStatus(
jobject jStatus,
JavaVM * pJvm)
{
flmAssert( jStatus);
flmAssert( pJvm);
m_jStatus = jStatus;
m_pJvm = pJvm;
}
RCODE XFLMAPI dbCopyStatus(
FLMUINT64 ui64BytesToCopy,
FLMUINT64 ui64BytesCopied,
FLMBOOL bNewSrcFile,
const char * pszSrcFileName,
const char * pszDestFileName);
FINLINE FLMUINT getRefCount( void)
{
return( IF_DbCopyStatus::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_DbCopyStatus::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_DbCopyStatus::Release());
}
private:
JavaVM * m_pJvm;
jobject m_jStatus;
};
/****************************************************************************
Desc:
****************************************************************************/
class JNICheckStatus : public IF_DbCheckStatus, public XF_Base
{
public:
JNICheckStatus(
jobject jStatus,
JavaVM * pJvm)
{
flmAssert( jStatus);
flmAssert( pJvm);
m_jStatus = jStatus;
m_pJvm = pJvm;
}
RCODE XFLMAPI reportProgress(
XFLM_PROGRESS_CHECK_INFO * pProgCheck);
RCODE XFLMAPI reportCheckErr(
XFLM_CORRUPT_INFO * pCorruptInfo,
FLMBOOL * pbFix);
FINLINE FLMUINT getRefCount( void)
{
return( IF_DbCheckStatus::getRefCount());
}
virtual FINLINE FLMUINT32 XFLMAPI AddRef( void)
{
return( IF_DbCheckStatus::AddRef());
}
virtual FINLINE FLMUINT32 XFLMAPI Release( void)
{
return( IF_DbCheckStatus::Release());
}
private:
JavaVM * m_pJvm;
jobject m_jStatus;
};

View File

@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// Desc:
//
// Tabs: 3
//
// Copyright (c) 2003-2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id: $
//------------------------------------------------------------------------------
#include "xflaim_PosIStream.h"
#include "flaimsys.h"
#include "jniftk.h"
#define THIS_STREAM() \
((F_PosIStream *)(FLMUINT)lThis)
/****************************************************************************
Desc:
****************************************************************************/
JNIEXPORT void JNICALL Java_xflaim_PosIStream__1release(
JNIEnv *, // pEnv,
jobject, // obj,
jlong lThis)
{
THIS_STREAM()->Release();
}