From c52e50847585ea47b5c6ae41e36c7e64b297cb4c Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Wed, 16 Aug 2006 19:56:16 +0000 Subject: [PATCH] Added more methods for DbSystem class in java. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@770 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- xflaim/java/jni/jdbsystem.cpp | 571 ++++++++++++++++++++++++++++++ xflaim/java/jni/xflaim_DbSystem.h | 216 +++++++++++ xflaim/java/xflaim/DbSystem.java | 445 ++++++++++++++++------- 3 files changed, 1096 insertions(+), 136 deletions(-) diff --git a/xflaim/java/jni/jdbsystem.cpp b/xflaim/java/jni/jdbsystem.cpp index 0132843..399750b 100644 --- a/xflaim/java/jni/jdbsystem.cpp +++ b/xflaim/java/jni/jdbsystem.cpp @@ -3195,3 +3195,574 @@ Exit: return( jStats); } +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setTempDir( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jstring sPath) +{ + RCODE rc = NE_XFLM_OK; + FLMBYTE ucPath [F_PATH_MAX_SIZE]; + F_DynaBuf pathBuf( ucPath, sizeof( ucPath)); + + if (RC_BAD( rc = getUTF8String( pEnv, sPath, &pathBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + if (RC_BAD( rc = THIS_DBSYS()->setTempDir( (const char *)pathBuf.getBufferPtr()))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jstring JNICALL Java_xflaim_DbSystem__1getTempDir( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis) +{ + RCODE rc = NE_XFLM_OK; + char szPath [F_PATH_MAX_SIZE]; + jstring jPath = NULL; + + if (RC_BAD( rc = THIS_DBSYS()->setTempDir( szPath))) + { + ThrowError( rc, pEnv); + goto Exit; + } + jPath = pEnv->NewStringUTF( szPath); + +Exit: + + return( jPath); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCheckpointInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iSeconds) +{ + THIS_DBSYS()->setCheckpointInterval( (FLMUINT)iSeconds); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCheckpointInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getCheckpointInterval()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCacheAdjustInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iSeconds) +{ + THIS_DBSYS()->setCacheAdjustInterval( (FLMUINT)iSeconds); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCacheAdjustInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getCacheAdjustInterval()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCacheCleanupInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iSeconds) +{ + THIS_DBSYS()->setCacheCleanupInterval( (FLMUINT)iSeconds); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCacheCleanupInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getCacheCleanupInterval()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setUnusedCleanupInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iSeconds) +{ + THIS_DBSYS()->setUnusedCleanupInterval( (FLMUINT)iSeconds); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getUnusedCleanupInterval( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getUnusedCleanupInterval()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setMaxUnusedTime( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iSeconds) +{ + THIS_DBSYS()->setMaxUnusedTime( (FLMUINT)iSeconds); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getMaxUnusedTime( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getMaxUnusedTime()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1deactivateOpenDb( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jstring sDatabasePath, + jstring sDataFilePath) +{ + RCODE rc = NE_XFLM_OK; + FLMBYTE ucDatabasePath [F_PATH_MAX_SIZE]; + F_DynaBuf databasePathBuf( ucDatabasePath, sizeof( ucDatabasePath)); + FLMBYTE ucDataFilePath [F_PATH_MAX_SIZE]; + F_DynaBuf dataFilePathBuf( ucDataFilePath, sizeof( ucDataFilePath)); + + // Get the strings. + + if (RC_BAD( rc = getUTF8String( pEnv, sDatabasePath, &databasePathBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + if (RC_BAD( rc = getUTF8String( pEnv, sDataFilePath, &dataFilePathBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + THIS_DBSYS()->deactivateOpenDb( (const char *)databasePathBuf.getBufferPtr(), + (const char *)(dataFilePathBuf.getDataLength() > 1 + ? (const char *)dataFilePathBuf.getBufferPtr() + : (const char *)NULL)); + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setQuerySaveMax( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iMaxToSave) +{ + THIS_DBSYS()->setQuerySaveMax( (FLMUINT)iMaxToSave); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getQuerySaveMax( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + return( (jint)THIS_DBSYS()->getQuerySaveMax()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setDirtyCacheLimits( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jint iMaxDirty, + jint iLowDirty) +{ + THIS_DBSYS()->setDirtyCacheLimits( (FLMUINT)iMaxDirty, (FLMUINT)iLowDirty); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getMaxDirtyCacheLimit( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + FLMUINT uiMaxDirty; + FLMUINT uiLowDirty; + + THIS_DBSYS()->getDirtyCacheLimits( &uiMaxDirty, &uiLowDirty); + return( (jint)uiMaxDirty); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getLowDirtyCacheLimit( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis) +{ + FLMUINT uiMaxDirty; + FLMUINT uiLowDirty; + + THIS_DBSYS()->getDirtyCacheLimits( &uiMaxDirty, &uiLowDirty); + return( (jint)uiLowDirty); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jstring sLeftString, + jboolean bLeftWild, + jstring sRightString, + jboolean bRightWild, + jboolean bCaseInsensitive, + jboolean bCompressWhitespace, + jboolean bNoWhitespace, + jboolean bNoUnderscores, + jboolean bNoDashes, + jboolean bWhitespaceAsSpace, + jboolean bIgnoreLeadingSpace, + jboolean bIgnoreTrailingSpace, + jint iLanguage) +{ + RCODE rc = NE_XFLM_OK; + FLMBYTE ucLeftString [100]; + F_DynaBuf leftStringBuf( ucLeftString, sizeof( ucLeftString)); + FLMBYTE ucRightString [100]; + F_DynaBuf rightStringBuf( ucRightString, sizeof( ucRightString)); + FLMUINT uiCompareRules; + FLMINT iResult = 0; + + // Get the strings. + + if (RC_BAD( rc = getUTF8String( pEnv, sLeftString, &leftStringBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + if (RC_BAD( rc = getUTF8String( pEnv, sRightString, &rightStringBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + uiCompareRules = 0; + if (bCaseInsensitive) + { + uiCompareRules |= XFLM_COMP_CASE_INSENSITIVE; + } + if (bCompressWhitespace) + { + uiCompareRules |= XFLM_COMP_COMPRESS_WHITESPACE; + } + if (bNoWhitespace) + { + uiCompareRules |= XFLM_COMP_NO_WHITESPACE; + } + if (bNoUnderscores) + { + uiCompareRules |= XFLM_COMP_NO_UNDERSCORES; + } + if (bNoDashes) + { + uiCompareRules |= XFLM_COMP_NO_DASHES; + } + if (bWhitespaceAsSpace) + { + uiCompareRules |= XFLM_COMP_WHITESPACE_AS_SPACE; + } + if (bIgnoreLeadingSpace) + { + uiCompareRules |= XFLM_COMP_IGNORE_LEADING_SPACE; + } + if (bIgnoreTrailingSpace) + { + uiCompareRules |= XFLM_COMP_IGNORE_TRAILING_SPACE; + } + + if (RC_BAD( rc = THIS_DBSYS()->compareUTF8Strings( + (const FLMBYTE *)leftStringBuf.getBufferPtr(), + leftStringBuf.getDataLength() - 1, + bLeftWild ? TRUE : FALSE, + (const FLMBYTE *)rightStringBuf.getBufferPtr(), + rightStringBuf.getDataLength() - 1, + bRightWild ? TRUE : FALSE, + uiCompareRules, (FLMUINT)iLanguage, &iResult))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jint)iResult); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jstring sString, + jstring sSubString, + jboolean bCaseInsensitive, + jboolean bCompressWhitespace, + jboolean bNoWhitespace, + jboolean bNoUnderscores, + jboolean bNoDashes, + jboolean bWhitespaceAsSpace, + jboolean bIgnoreLeadingSpace, + jboolean bIgnoreTrailingSpace, + jint iLanguage) +{ + RCODE rc = NE_XFLM_OK; + FLMBYTE ucString [100]; + F_DynaBuf stringBuf( ucString, sizeof( ucString)); + FLMBYTE ucSubString [100]; + F_DynaBuf subStringBuf( ucSubString, sizeof( ucSubString)); + FLMUINT uiCompareRules; + FLMBOOL bExists = FALSE; + + // Get the strings. + + if (RC_BAD( rc = getUTF8String( pEnv, sString, &stringBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + if (RC_BAD( rc = getUTF8String( pEnv, sSubString, &subStringBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + + uiCompareRules = 0; + if (bCaseInsensitive) + { + uiCompareRules |= XFLM_COMP_CASE_INSENSITIVE; + } + if (bCompressWhitespace) + { + uiCompareRules |= XFLM_COMP_COMPRESS_WHITESPACE; + } + if (bNoWhitespace) + { + uiCompareRules |= XFLM_COMP_NO_WHITESPACE; + } + if (bNoUnderscores) + { + uiCompareRules |= XFLM_COMP_NO_UNDERSCORES; + } + if (bNoDashes) + { + uiCompareRules |= XFLM_COMP_NO_DASHES; + } + if (bWhitespaceAsSpace) + { + uiCompareRules |= XFLM_COMP_WHITESPACE_AS_SPACE; + } + if (bIgnoreLeadingSpace) + { + uiCompareRules |= XFLM_COMP_IGNORE_LEADING_SPACE; + } + if (bIgnoreTrailingSpace) + { + uiCompareRules |= XFLM_COMP_IGNORE_TRAILING_SPACE; + } + + if (RC_BAD( rc = THIS_DBSYS()->utf8IsSubStr( + (const FLMBYTE *)stringBuf.getBufferPtr(), + (const FLMBYTE *)subStringBuf.getBufferPtr(), + uiCompareRules, (FLMUINT)iLanguage, &bExists))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return( (jboolean)(bExists ? JNI_TRUE : JNI_FALSE)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsUpper( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jchar uzChar) +{ + return( THIS_DBSYS()->uniIsUpper( (FLMUNICODE)uzChar) ? JNI_TRUE : JNI_FALSE); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsLower( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jchar uzChar) +{ + return( THIS_DBSYS()->uniIsLower( (FLMUNICODE)uzChar) ? JNI_TRUE : JNI_FALSE); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsAlpha( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jchar uzChar) +{ + return( THIS_DBSYS()->uniIsAlpha( (FLMUNICODE)uzChar) ? JNI_TRUE : JNI_FALSE); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsDecimalDigit( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jchar uzChar) +{ + return( THIS_DBSYS()->uniIsDecimalDigit( (FLMUNICODE)uzChar) ? JNI_TRUE : JNI_FALSE); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT jchar JNICALL Java_xflaim_DbSystem__1uniToLower( + JNIEnv *, // pEnv, + jobject, // obj, + jlong lThis, + jchar uzChar) +{ + return( (jchar)THIS_DBSYS()->uniToLower( (FLMUNICODE)uzChar)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1waitToClose( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jstring sDbName) +{ + RCODE rc = NE_XFLM_OK; + FLMBYTE ucDbName [F_PATH_MAX_SIZE]; + F_DynaBuf dbNameBuf( ucDbName, sizeof( ucDbName)); + + // Get the strings. + + if (RC_BAD( rc = getUTF8String( pEnv, sDbName, &dbNameBuf))) + { + ThrowError( rc, pEnv); + goto Exit; + } + if (RC_BAD( rc = THIS_DBSYS()->waitToClose( + (const char *)dbNameBuf.getBufferPtr()))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + +/**************************************************************************** +Desc: +****************************************************************************/ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1clearCache( + JNIEnv * pEnv, + jobject, // obj, + jlong lThis, + jlong lDbToClear) +{ + RCODE rc = NE_XFLM_OK; + IF_Db * pDbToClear = (IF_Db *)((FLMUINT)lDbToClear); + + if (RC_BAD( rc = THIS_DBSYS()->clearCache( pDbToClear))) + { + ThrowError( rc, pEnv); + goto Exit; + } + +Exit: + + return; +} + diff --git a/xflaim/java/jni/xflaim_DbSystem.h b/xflaim/java/jni/xflaim_DbSystem.h index 2647bf0..23ee08d 100644 --- a/xflaim/java/jni/xflaim_DbSystem.h +++ b/xflaim/java/jni/xflaim_DbSystem.h @@ -311,6 +311,222 @@ JNIEXPORT void JNICALL Java_xflaim_DbSystem__1resetStats JNIEXPORT jobject JNICALL Java_xflaim_DbSystem__1getStats (JNIEnv *, jobject, jlong); +/* + * Class: xflaim_DbSystem + * Method: _setTempDir + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setTempDir + (JNIEnv *, jobject, jlong, jstring); + +/* + * Class: xflaim_DbSystem + * Method: _getTempDir + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_xflaim_DbSystem__1getTempDir + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setCheckpointInterval + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCheckpointInterval + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getCheckpointInterval + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCheckpointInterval + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setCacheAdjustInterval + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCacheAdjustInterval + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getCacheAdjustInterval + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCacheAdjustInterval + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setCacheCleanupInterval + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setCacheCleanupInterval + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getCacheCleanupInterval + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getCacheCleanupInterval + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setUnusedCleanupInterval + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setUnusedCleanupInterval + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getUnusedCleanupInterval + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getUnusedCleanupInterval + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setMaxUnusedTime + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setMaxUnusedTime + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getMaxUnusedTime + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getMaxUnusedTime + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _deactivateOpenDb + * Signature: (JLjava/lang/String;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1deactivateOpenDb + (JNIEnv *, jobject, jlong, jstring, jstring); + +/* + * Class: xflaim_DbSystem + * Method: _setQuerySaveMax + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setQuerySaveMax + (JNIEnv *, jobject, jlong, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getQuerySaveMax + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getQuerySaveMax + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _setDirtyCacheLimits + * Signature: (JII)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1setDirtyCacheLimits + (JNIEnv *, jobject, jlong, jint, jint); + +/* + * Class: xflaim_DbSystem + * Method: _getMaxDirtyCacheLimit + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getMaxDirtyCacheLimit + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _getLowDirtyCacheLimit + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1getLowDirtyCacheLimit + (JNIEnv *, jobject, jlong); + +/* + * Class: xflaim_DbSystem + * Method: _compareStrings + * Signature: (JLjava/lang/String;ZLjava/lang/String;ZZZZZZZZZI)I + */ +JNIEXPORT jint JNICALL Java_xflaim_DbSystem__1compareStrings + (JNIEnv *, jobject, jlong, jstring, jboolean, jstring, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jint); + +/* + * Class: xflaim_DbSystem + * Method: _hasSubStr + * Signature: (JLjava/lang/String;Ljava/lang/String;ZZZZZZZZI)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1hasSubStr + (JNIEnv *, jobject, jlong, jstring, jstring, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jint); + +/* + * Class: xflaim_DbSystem + * Method: _uniIsUpper + * Signature: (JC)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsUpper + (JNIEnv *, jobject, jlong, jchar); + +/* + * Class: xflaim_DbSystem + * Method: _uniIsLower + * Signature: (JC)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsLower + (JNIEnv *, jobject, jlong, jchar); + +/* + * Class: xflaim_DbSystem + * Method: _uniIsAlpha + * Signature: (JC)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsAlpha + (JNIEnv *, jobject, jlong, jchar); + +/* + * Class: xflaim_DbSystem + * Method: _uniIsDecimalDigit + * Signature: (JC)Z + */ +JNIEXPORT jboolean JNICALL Java_xflaim_DbSystem__1uniIsDecimalDigit + (JNIEnv *, jobject, jlong, jchar); + +/* + * Class: xflaim_DbSystem + * Method: _uniToLower + * Signature: (JC)C + */ +JNIEXPORT jchar JNICALL Java_xflaim_DbSystem__1uniToLower + (JNIEnv *, jobject, jlong, jchar); + +/* + * Class: xflaim_DbSystem + * Method: _waitToClose + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1waitToClose + (JNIEnv *, jobject, jlong, jstring); + +/* + * Class: xflaim_DbSystem + * Method: _clearCache + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_xflaim_DbSystem__1clearCache + (JNIEnv *, jobject, jlong, jlong); + #ifdef __cplusplus } #endif diff --git a/xflaim/java/xflaim/DbSystem.java b/xflaim/java/xflaim/DbSystem.java index ffd7887..0d90dae 100644 --- a/xflaim/java/xflaim/DbSystem.java +++ b/xflaim/java/xflaim/DbSystem.java @@ -629,6 +629,191 @@ public class DbSystem return( _getStats( m_this)); } + public void setTempDir( + String sPath) throws XFlaimException + { + _setTempDir( m_this, sPath); + } + + public String getTempDir() throws XFlaimException + { + return( _getTempDir( m_this)); + } + + public void setCheckpointInterval( + int iSeconds) throws XFlaimException + { + _setCheckpointInterval( m_this, iSeconds); + } + + public int getCheckpointInterval() throws XFlaimException + { + return( _getCheckpointInterval( m_this)); + } + + public void setCacheAdjustInterval( + int iSeconds) throws XFlaimException + { + _setCacheAdjustInterval( m_this, iSeconds); + } + + public int getCacheAdjustInterval() throws XFlaimException + { + return( _getCacheAdjustInterval( m_this)); + } + + public void setCacheCleanupInterval( + int iSeconds) throws XFlaimException + { + _setCacheCleanupInterval( m_this, iSeconds); + } + + public int getCacheCleanupInterval() throws XFlaimException + { + return( _getCacheCleanupInterval( m_this)); + } + + public void setUnusedCleanupInterval( + int iSeconds) throws XFlaimException + { + _setUnusedCleanupInterval( m_this, iSeconds); + } + + public int getUnusedCleanupInterval() throws XFlaimException + { + return( _getUnusedCleanupInterval( m_this)); + } + + public void setMaxUnusedTime( + int iSeconds) throws XFlaimException + { + _setMaxUnusedTime( m_this, iSeconds); + } + + public int getMaxUnusedTime() throws XFlaimException + { + return( _getMaxUnusedTime( m_this)); + } + + public void deactivateOpenDb( + String sDatabasePath, + String sDataFilePath) throws XFlaimException + { + _deactivateOpenDb( m_this, sDatabasePath, sDataFilePath); + } + + public void setQuerySaveMax( + int iMaxToSave) throws XFlaimException + { + _setQuerySaveMax( m_this, iMaxToSave); + } + + public int getQuerySaveMax() throws XFlaimException + { + return( _getQuerySaveMax( m_this)); + } + + public void setDirtyCacheLimits( + int iMaxDirty, + int iLowDirty) throws XFlaimException + { + _setDirtyCacheLimits( m_this, iMaxDirty, iLowDirty); + } + + public int getMaxDirtyCacheLimit() throws XFlaimException + { + return( _getMaxDirtyCacheLimit( m_this)); + } + + public int getLowDirtyCacheLimit() throws XFlaimException + { + return( _getLowDirtyCacheLimit( m_this)); + } + + public int compareStrings( + String sLeftString, + boolean bLeftWild, + String sRightString, + boolean bRightWild, + boolean bCaseInsensitive, + boolean bCompressWhitespace, + boolean bNoWhitespace, + boolean bNoUnderscores, + boolean bNoDashes, + boolean bWhitespaceAsSpace, + boolean bIgnoreLeadingSpace, + boolean bIgnoreTrailingSpace, + int iLanguage) throws XFlaimException + { + return( _compareStrings( m_this, + sLeftString, bLeftWild, + sRightString, bRightWild, + bCaseInsensitive, bCompressWhitespace, bNoWhitespace, + bNoUnderscores, bNoDashes, bWhitespaceAsSpace, + bIgnoreLeadingSpace, bIgnoreTrailingSpace, iLanguage)); + } + + public boolean hasSubStr( + String sString, + String sSubString, + boolean bCaseInsensitive, + boolean bCompressWhitespace, + boolean bNoWhitespace, + boolean bNoUnderscores, + boolean bNoDashes, + boolean bWhitespaceAsSpace, + boolean bIgnoreLeadingSpace, + boolean bIgnoreTrailingSpace, + int iLanguage) throws XFlaimException + { + return( _hasSubStr( m_this, sString, sSubString, bCaseInsensitive, + bCompressWhitespace, bNoWhitespace, bNoUnderscores, bNoDashes, + bWhitespaceAsSpace, bIgnoreLeadingSpace, bIgnoreTrailingSpace, + iLanguage)); + } + + public boolean uniIsUpper( + char uzChar) throws XFlaimException + { + return( _uniIsUpper( m_this, uzChar)); + } + + public boolean _uniIsLower( + char uzChar) throws XFlaimException + { + return( _uniIsLower( m_this, uzChar)); + } + + public boolean uniIsAlpha( + char uzChar) throws XFlaimException + { + return( _uniIsAlpha( m_this, uzChar)); + } + + public boolean uniIsDecimalDigit( + char uzChar) throws XFlaimException + { + return( _uniIsDecimalDigit( m_this, uzChar)); + } + + public char uniToLower( + char uzChar) throws XFlaimException + { + return( _uniToLower( m_this, uzChar)); + } + + public void waitToClose( + String sDbName) throws XFlaimException + { + _waitToClose( m_this, sDbName); + } + + public void clearCache( + Db dbToClear) throws XFlaimException + { + _clearCache( m_this, dbToClear.getThis()); + } + private native long _createDbSystem(); private native void _init( long lThis); @@ -828,6 +1013,129 @@ public class DbSystem private native Stats _getStats( long lThis) throws XFlaimException; + private native void _setTempDir( + long lThis, + String sPath) throws XFlaimException; + + private native String _getTempDir( + long lThis) throws XFlaimException; + + private native void _setCheckpointInterval( + long lThis, + int iSeconds) throws XFlaimException; + + private native int _getCheckpointInterval( + long lThis) throws XFlaimException; + + private native void _setCacheAdjustInterval( + long lThis, + int iSeconds) throws XFlaimException; + + private native int _getCacheAdjustInterval( + long lThis) throws XFlaimException; + + private native void _setCacheCleanupInterval( + long lThis, + int iSeconds) throws XFlaimException; + + private native int _getCacheCleanupInterval( + long lThis) throws XFlaimException; + + private native void _setUnusedCleanupInterval( + long lThis, + int iSeconds) throws XFlaimException; + + private native int _getUnusedCleanupInterval( + long lThis) throws XFlaimException; + + private native void _setMaxUnusedTime( + long lThis, + int iSeconds) throws XFlaimException; + + private native int _getMaxUnusedTime( + long lThis) throws XFlaimException; + + private native void _deactivateOpenDb( + long lThis, + String sDatabasePath, + String sDataFilePath) throws XFlaimException; + + private native void _setQuerySaveMax( + long lThis, + int iMaxToSave) throws XFlaimException; + + private native int _getQuerySaveMax( + long lThis) throws XFlaimException; + + private native void _setDirtyCacheLimits( + long lThis, + int iMaxDirty, + int iLowDirty) throws XFlaimException; + + private native int _getMaxDirtyCacheLimit( + long lThis) throws XFlaimException; + + private native int _getLowDirtyCacheLimit( + long lThis) throws XFlaimException; + + private native int _compareStrings( + long lThis, + String sLeftString, + boolean bLeftWild, + String sRightString, + boolean bRightWild, + boolean bCaseInsensitive, + boolean bCompressWhitespace, + boolean bNoWhitespace, + boolean bNoUnderscores, + boolean bNoDashes, + boolean bWhitespaceAsSpace, + boolean bIgnoreLeadingSpace, + boolean bIgnoreTrailingSpace, + int iLanguage) throws XFlaimException; + + private native boolean _hasSubStr( + long lThis, + String sString, + String sSubString, + boolean bCaseInsensitive, + boolean bCompressWhitespace, + boolean bNoWhitespace, + boolean bNoUnderscores, + boolean bNoDashes, + boolean bWhitespaceAsSpace, + boolean bIgnoreLeadingSpace, + boolean bIgnoreTrailingSpace, + int iLanguage) throws XFlaimException; + + private native boolean _uniIsUpper( + long lThis, + char uzChar) throws XFlaimException; + + private native boolean _uniIsLower( + long lThis, + char uzChar) throws XFlaimException; + + private native boolean _uniIsAlpha( + long lThis, + char uzChar) throws XFlaimException; + + private native boolean _uniIsDecimalDigit( + long lThis, + char uzChar) throws XFlaimException; + + private native char _uniToLower( + long lThis, + char uzChar) throws XFlaimException; + + private native void _waitToClose( + long lThis, + String sDbName) throws XFlaimException; + + private native void _clearCache( + long lThis, + long lDbRef) throws XFlaimException; + private long m_this; } @@ -835,60 +1143,9 @@ public class DbSystem METHODS NOT YET IMPLEMENTED -virtual void FLMAPI getFileSystem( - IF_FileSystem ** ppFileSystem) = 0; - virtual const char * FLMAPI checkErrorToStr( FLMINT iCheckErrorCode) = 0; -virtual RCODE FLMAPI createIFResultSet( - IF_ResultSet ** ifppResultSet) = 0; - -virtual RCODE FLMAPI createIFQuery( - IF_Query ** ifppQuery) = 0; - -virtual void FLMAPI freeMem( - void ** ppMem) = 0; - -//here - -virtual RCODE FLMAPI getStats( - XFLM_STATS * pFlmStats) = 0; - -virtual void FLMAPI freeStats( - XFLM_STATS * pFlmStats) = 0; - -virtual RCODE FLMAPI setTempDir( - const char * pszPath) = 0; - -virtual RCODE FLMAPI getTempDir( - char * pszPath) = 0; - -virtual void FLMAPI setCheckpointInterval( - FLMUINT uiSeconds) = 0; - -virtual FLMUINT FLMAPI getCheckpointInterval( void) = 0; - -virtual void FLMAPI setCacheAdjustInterval( - FLMUINT uiSeconds) = 0; - -virtual FLMUINT FLMAPI getCacheAdjustInterval( void) = 0; - -virtual void FLMAPI setCacheCleanupInterval( - FLMUINT uiSeconds) = 0; - -virtual FLMUINT FLMAPI getCacheCleanupInterval( void) = 0; - -virtual void FLMAPI setUnusedCleanupInterval( - FLMUINT uiSeconds) = 0; - -virtual FLMUINT FLMAPI getUnusedCleanupInterval( void) = 0; - -virtual void FLMAPI setMaxUnusedTime( - FLMUINT uiSeconds) = 0; - -virtual FLMUINT FLMAPI getMaxUnusedTime( void) = 0; - virtual void FLMAPI setLogger( IF_LoggerClient * pLogger) = 0; @@ -897,26 +1154,6 @@ virtual void FLMAPI enableExtendedServerMemory( virtual FLMBOOL FLMAPI extendedServerMemoryEnabled( void) = 0; -virtual void FLMAPI deactivateOpenDb( - const char * pszDatabasePath, - const char * pszDataFilePath) = 0; - -virtual void FLMAPI setQuerySaveMax( - FLMUINT uiMaxToSave) = 0; - -virtual FLMUINT FLMAPI getQuerySaveMax( void) = 0; - -virtual void FLMAPI setDirtyCacheLimits( - FLMUINT uiMaxDirty, - FLMUINT uiLowDirty) = 0; - -virtual void FLMAPI getDirtyCacheLimits( - FLMUINT * puiMaxDirty, - FLMUINT * puiLowDirty) = 0; - -virtual RCODE FLMAPI getThreadInfo( - IF_ThreadInfo ** ifppThreadInfo) = 0; - virtual RCODE FLMAPI registerForEvent( eEventCategory eCategory, IF_EventClient * ifpEventClient) = 0; @@ -930,69 +1167,5 @@ virtual RCODE FLMAPI getNextMetaphone( FLMUINT * puiMetaphone, FLMUINT * puiAltMetaphone = NULL) = 0; -virtual RCODE FLMAPI compareUTF8Strings( - const FLMBYTE * pucLString, - FLMUINT uiLStrBytes, - FLMBOOL bLeftWild, - const FLMBYTE * pucRString, - FLMUINT uiRStrBytes, - FLMBOOL bRightWild, - FLMUINT uiCompareRules, - FLMUINT uiLanguage, - FLMINT * piResult) = 0; - -virtual RCODE FLMAPI compareUnicodeStrings( - const FLMUNICODE * puzLString, - FLMUINT uiLStrBytes, - FLMBOOL bLeftWild, - const FLMUNICODE * puzRString, - FLMUINT uiRStrBytes, - FLMBOOL bRightWild, - FLMUINT uiCompareRules, - FLMUINT uiLanguage, - FLMINT * piResult) = 0; - -virtual RCODE FLMAPI utf8IsSubStr( - const FLMBYTE * pszString, - const FLMBYTE * pszSubString, - FLMUINT uiCompareRules, - FLMUINT uiLanguage, - FLMBOOL * pbExists) = 0; - -virtual FLMBOOL FLMAPI uniIsUpper( - FLMUNICODE uzChar) = 0; - -virtual FLMBOOL FLMAPI uniIsLower( - FLMUNICODE uzChar) = 0; - -virtual FLMBOOL FLMAPI uniIsAlpha( - FLMUNICODE uzChar) = 0; - -virtual FLMBOOL FLMAPI uniIsDecimalDigit( - FLMUNICODE uzChar) = 0; - -virtual FLMUNICODE FLMAPI uniToLower( - FLMUNICODE uzChar) = 0; - -virtual RCODE FLMAPI nextUCS2Char( - const FLMBYTE ** ppszUTF8, - const FLMBYTE * pszEndOfUTF8String, - FLMUNICODE * puzChar) = 0; - -virtual RCODE FLMAPI numUCS2Chars( - const FLMBYTE * pszUTF8, - FLMUINT * puiNumChars) = 0; - -virtual RCODE FLMAPI waitToClose( - const char * pszDbFileName) = 0; - -virtual RCODE FLMAPI createIFNodeInfo( - IF_NodeInfo ** ifppNodeInfo) = 0; - -virtual RCODE FLMAPI createIFBTreeInfo( - IF_BTreeInfo ** ifppBTreeInfo) = 0; - -virtual RCODE FLMAPI clearCache( - IF_Db * pDb) = 0; - */ +