diff --git a/base/ca/src/main/java/com/netscape/cmscore/dbs/CRLRepository.java b/base/ca/src/main/java/com/netscape/cmscore/dbs/CRLRepository.java index e740cee279f..1077082f565 100644 --- a/base/ca/src/main/java/com/netscape/cmscore/dbs/CRLRepository.java +++ b/base/ca/src/main/java/com/netscape/cmscore/dbs/CRLRepository.java @@ -67,21 +67,18 @@ public void init() throws Exception { rangeDN = dbConfig.getRequestRangeDN() + "," + dbSubsystem.getBaseDN(); logger.info("CRLRepository: - range DN: " + rangeDN); - minSerialName = DatabaseConfig.MIN_REQUEST_NUMBER; String minSerial = dbConfig.getBeginRequestNumber(); if (minSerial != null) { mMinSerialNo = new BigInteger(minSerial, mRadix); } logger.info("CRLRepository: - min serial: " + mMinSerialNo); - maxSerialName = DatabaseConfig.MAX_REQUEST_NUMBER; String maxSerial = dbConfig.getEndRequestNumber(); if (maxSerial != null) { mMaxSerialNo = new BigInteger(maxSerial, mRadix); } logger.info("CRLRepository: - max serial: " + mMaxSerialNo); - nextMinSerialName = DatabaseConfig.NEXT_MIN_REQUEST_NUMBER; String nextMinSerial = dbConfig.getNextBeginRequestNumber(); if (nextMinSerial == null || nextMinSerial.equals("-1")) { mNextMinSerialNo = null; @@ -90,7 +87,6 @@ public void init() throws Exception { } logger.info("CRLRepository: - next min serial: " + mNextMinSerialNo); - nextMaxSerialName = DatabaseConfig.NEXT_MAX_REQUEST_NUMBER; String nextMaxSerial = dbConfig.getNextEndRequestNumber(); if (nextMaxSerial == null || nextMaxSerial.equals("-1")) { mNextMaxSerialNo = null; @@ -129,6 +125,52 @@ public void init() throws Exception { */ } + public void setMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMinSerialNo.toString(mRadix); + logger.debug("CRLRepository: Setting min serial number: " + serial); + dbConfig.setBeginRequestNumber(serial); + } + + public void setMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMaxSerialNo.toString(mRadix); + logger.debug("CRLRepository: Setting max serial number: " + serial); + dbConfig.setEndRequestNumber(serial); + } + + public void setNextMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMinSerialNo == null) { + logger.debug("CRLRepository: Removing next min number"); + dbConfig.removeNextBeginRequestNumber(); + + } else { + String serial = mNextMinSerialNo.toString(mRadix); + logger.debug("CRLRepository: Setting next min number: " + serial); + dbConfig.setNextBeginRequestNumber(serial); + } + } + + public void setNextMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMaxSerialNo == null) { + logger.debug("CRLRepository: Removing next max number"); + dbConfig.removeNextEndRequestNumber(); + + } else { + String serial = mNextMaxSerialNo.toString(mRadix); + logger.debug("CRLRepository: Setting next max number: " + serial); + dbConfig.setNextEndRequestNumber(serial); + } + } + /** * Removes all objects with this repository. */ diff --git a/base/ca/src/main/java/com/netscape/cmscore/dbs/CertificateRepository.java b/base/ca/src/main/java/com/netscape/cmscore/dbs/CertificateRepository.java index 471e160d699..42b44efe876 100644 --- a/base/ca/src/main/java/com/netscape/cmscore/dbs/CertificateRepository.java +++ b/base/ca/src/main/java/com/netscape/cmscore/dbs/CertificateRepository.java @@ -137,21 +137,18 @@ public void initLegacyGenerator() throws Exception { rangeDN = mDBConfig.getSerialRangeDN() + "," + dbSubsystem.getBaseDN(); logger.debug("CertificateRepository: - range DN: " + rangeDN); - minSerialName = DatabaseConfig.MIN_SERIAL_NUMBER; String minSerial = mDBConfig.getBeginSerialNumber(); if (minSerial != null) { mMinSerialNo = new BigInteger(minSerial, mRadix); } logger.debug("CertificateRepository: - min serial: " + mMinSerialNo); - maxSerialName = DatabaseConfig.MAX_SERIAL_NUMBER; String maxSerial = mDBConfig.getEndSerialNumber(); if (maxSerial != null) { mMaxSerialNo = new BigInteger(maxSerial, mRadix); } logger.debug("CertificateRepository: - max serial: " + mMaxSerialNo); - nextMinSerialName = DatabaseConfig.NEXT_MIN_SERIAL_NUMBER; String nextMinSerial = mDBConfig.getNextBeginSerialNumber(); if (nextMinSerial == null || nextMinSerial.equals("-1")) { mNextMinSerialNo = null; @@ -160,7 +157,6 @@ public void initLegacyGenerator() throws Exception { } logger.debug("CertificateRepository: - next min serial: " + mNextMinSerialNo); - nextMaxSerialName = DatabaseConfig.NEXT_MAX_SERIAL_NUMBER; String nextMaxSerial = mDBConfig.getNextEndSerialNumber(); if (nextMaxSerial == null || nextMaxSerial.equals("-1")) { mNextMaxSerialNo = null; @@ -180,6 +176,52 @@ public void initLegacyGenerator() throws Exception { } } + public void setMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMinSerialNo.toString(mRadix); + logger.debug("CertificateRepository: Setting min serial number: " + serial); + dbConfig.setBeginSerialNumber(serial); + } + + public void setMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMaxSerialNo.toString(mRadix); + logger.debug("CertificateRepository: Setting max serial number: " + serial); + dbConfig.setEndSerialNumber(serial); + } + + public void setNextMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMinSerialNo == null) { + logger.debug("CertificateRepository: Removing next min number"); + dbConfig.removeNextBeginSerialNumber(); + + } else { + String serial = mNextMinSerialNo.toString(mRadix); + logger.debug("CertificateRepository: Setting next min number: " + serial); + dbConfig.setNextBeginSerialNumber(serial); + } + } + + public void setNextMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMaxSerialNo == null) { + logger.debug("CertificateRepository: Removing next max number"); + dbConfig.removeNextEndSerialNumber(); + + } else { + String serial = mNextMaxSerialNo.toString(mRadix); + logger.debug("CertificateRepository: Setting next max number: " + serial); + dbConfig.setNextEndSerialNumber(serial); + } + } + /** * Retrieves serial number management mode. * diff --git a/base/kra/src/main/java/com/netscape/cmscore/dbs/KeyRepository.java b/base/kra/src/main/java/com/netscape/cmscore/dbs/KeyRepository.java index dbc87cc0fc4..37f13eaa7ba 100644 --- a/base/kra/src/main/java/com/netscape/cmscore/dbs/KeyRepository.java +++ b/base/kra/src/main/java/com/netscape/cmscore/dbs/KeyRepository.java @@ -175,21 +175,18 @@ public void initLegacyGenerator() throws Exception { rangeDN = dbConfig.getSerialRangeDN() + "," + dbSubsystem.getBaseDN(); logger.info("KeyRepository: - range DN: {}", rangeDN); - minSerialName = DatabaseConfig.MIN_SERIAL_NUMBER; String minSerial = dbConfig.getBeginSerialNumber(); if (minSerial != null) { mMinSerialNo = new BigInteger(minSerial, mRadix); } logger.info("KeyRepository: - min serial: {}", mMinSerialNo); - maxSerialName = DatabaseConfig.MAX_SERIAL_NUMBER; String maxSerial = dbConfig.getEndSerialNumber(); if (maxSerial != null) { mMaxSerialNo = new BigInteger(maxSerial, mRadix); } logger.info("KeyRepository: - max serial: {}", mMaxSerialNo); - nextMinSerialName = DatabaseConfig.NEXT_MIN_SERIAL_NUMBER; String nextMinSerial = dbConfig.getNextBeginSerialNumber(); if (nextMinSerial == null || nextMinSerial.equals("-1")) { mNextMinSerialNo = null; @@ -198,7 +195,6 @@ public void initLegacyGenerator() throws Exception { } logger.info("KeyRepository: - next min serial: {}", mNextMinSerialNo); - nextMaxSerialName = DatabaseConfig.NEXT_MAX_SERIAL_NUMBER; String nextMaxSerial = dbConfig.getNextEndSerialNumber(); if (nextMaxSerial == null || nextMaxSerial.equals("-1")) { mNextMaxSerialNo = null; @@ -218,6 +214,52 @@ public void initLegacyGenerator() throws Exception { } } + public void setMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMinSerialNo.toString(mRadix); + logger.debug("KeyRepository: Setting min serial number: " + serial); + dbConfig.setBeginSerialNumber(serial); + } + + public void setMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMaxSerialNo.toString(mRadix); + logger.debug("KeyRepository: Setting max serial number: " + serial); + dbConfig.setEndSerialNumber(serial); + } + + public void setNextMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMinSerialNo == null) { + logger.debug("KeyRepository: Removing next min number"); + dbConfig.removeNextBeginSerialNumber(); + + } else { + String serial = mNextMinSerialNo.toString(mRadix); + logger.debug("KeyRepository: Setting next min number: " + serial); + dbConfig.setNextBeginSerialNumber(serial); + } + } + + public void setNextMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMaxSerialNo == null) { + logger.debug("KeyRepository: Removing next max number"); + dbConfig.removeNextEndSerialNumber(); + + } else { + String serial = mNextMaxSerialNo.toString(mRadix); + logger.debug("KeyRepository: Setting next max number: " + serial); + dbConfig.setNextEndSerialNumber(serial); + } + } + public DBSubsystem getDBSubsystem() { return dbSubsystem; } diff --git a/base/server/src/main/java/com/netscape/cmscore/apps/DatabaseConfig.java b/base/server/src/main/java/com/netscape/cmscore/apps/DatabaseConfig.java index e895b3c11ba..c4f171e9da1 100644 --- a/base/server/src/main/java/com/netscape/cmscore/apps/DatabaseConfig.java +++ b/base/server/src/main/java/com/netscape/cmscore/apps/DatabaseConfig.java @@ -148,6 +148,10 @@ public void setNextBeginSerialNumber(String nextBeginSerialNumber) { putString(NEXT_MIN_SERIAL_NUMBER, nextBeginSerialNumber); } + public void removeNextBeginSerialNumber() throws EBaseException { + remove(NEXT_MIN_SERIAL_NUMBER); + } + public String getNextEndSerialNumber() throws EBaseException { return getString(NEXT_MAX_SERIAL_NUMBER, "-1"); } @@ -156,6 +160,10 @@ public void setNextEndSerialNumber(String nextEndSerialNumber) { putString(NEXT_MAX_SERIAL_NUMBER, nextEndSerialNumber); } + public void removeNextEndSerialNumber() throws EBaseException { + remove(NEXT_MAX_SERIAL_NUMBER); + } + public String getSerialLowWaterMark() throws EBaseException { return getString(SERIAL_LOW_WATER_MARK, "5000"); } @@ -212,6 +220,10 @@ public void setNextBeginRequestNumber(String nextBeginRequestNumber) { putString(NEXT_MIN_REQUEST_NUMBER, nextBeginRequestNumber); } + public void removeNextBeginRequestNumber() throws EBaseException { + remove(NEXT_MIN_REQUEST_NUMBER); + } + public String getNextEndRequestNumber() throws EBaseException { return getString(NEXT_MAX_REQUEST_NUMBER, "-1"); } @@ -220,6 +232,10 @@ public void setNextEndRequestNumber(String nextEndRequestNumber) { putString(NEXT_MAX_REQUEST_NUMBER, nextEndRequestNumber); } + public void removeNextEndRequestNumber() throws EBaseException { + remove(NEXT_MAX_REQUEST_NUMBER); + } + public String getRequestLowWaterMark() throws EBaseException { return getString(REQUEST_LOW_WATER_MARK, "5000"); } @@ -276,6 +292,10 @@ public void setNextBeginReplicaNumber(String nextBeginReplicaNumber) { putString(NEXT_MIN_REPLICA_NUMBER, nextBeginReplicaNumber); } + public void removeNextBeginReplicaNumber() throws EBaseException { + remove(NEXT_MIN_REPLICA_NUMBER); + } + public String getNextEndReplicaNumber() throws EBaseException { return getString(NEXT_MAX_REPLICA_NUMBER, "-1"); } @@ -284,6 +304,10 @@ public void setNextEndReplicaNumber(String nextEndReplicaNumber) { putString(NEXT_MAX_REPLICA_NUMBER, nextEndReplicaNumber); } + public void removeNextEndReplicaNumber() throws EBaseException { + remove(NEXT_MAX_REPLICA_NUMBER); + } + public String getReplicaLowWaterMark() throws EBaseException { return getString(REPLICA_LOW_WATER_MARK, "10"); } diff --git a/base/server/src/main/java/com/netscape/cmscore/dbs/ReplicaIDRepository.java b/base/server/src/main/java/com/netscape/cmscore/dbs/ReplicaIDRepository.java index 089855003d4..d292730926c 100644 --- a/base/server/src/main/java/com/netscape/cmscore/dbs/ReplicaIDRepository.java +++ b/base/server/src/main/java/com/netscape/cmscore/dbs/ReplicaIDRepository.java @@ -54,21 +54,18 @@ public void init() throws Exception { rangeDN = dbConfig.getReplicaRangeDN() + "," + dbSubsystem.getBaseDN(); logger.info("ReplicaIDRepository: - range DN: " + rangeDN); - minSerialName = DatabaseConfig.MIN_REPLICA_NUMBER; String minSerial = dbConfig.getBeginReplicaNumber(); if (minSerial != null) { mMinSerialNo = new BigInteger(minSerial, mRadix); } logger.info("ReplicaIDRepository: - min serial: " + mMinSerialNo); - maxSerialName = DatabaseConfig.MAX_REPLICA_NUMBER; String maxSerial = dbConfig.getEndReplicaNumber(); if (maxSerial != null) { mMaxSerialNo = new BigInteger(maxSerial, mRadix); } logger.info("ReplicaIDRepository: - max serial: " + mMaxSerialNo); - nextMinSerialName = DatabaseConfig.NEXT_MIN_REPLICA_NUMBER; String nextMinSerial = dbConfig.getNextBeginReplicaNumber(); if (nextMinSerial == null || nextMinSerial.equals("-1")) { mNextMinSerialNo = null; @@ -77,7 +74,6 @@ public void init() throws Exception { } logger.info("ReplicaIDRepository: - next min serial: " + mNextMinSerialNo); - nextMaxSerialName = DatabaseConfig.NEXT_MAX_REPLICA_NUMBER; String nextMaxSerial = dbConfig.getNextEndReplicaNumber(); if (nextMaxSerial == null || nextMaxSerial.equals("-1")) { mNextMaxSerialNo = null; @@ -97,6 +93,52 @@ public void init() throws Exception { } } + public void setMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMinSerialNo.toString(mRadix); + logger.debug("ReplicaIDRepository: Setting min serial number: " + serial); + dbConfig.setBeginReplicaNumber(serial); + } + + public void setMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMaxSerialNo.toString(mRadix); + logger.debug("ReplicaIDRepository: Setting max serial number: " + serial); + dbConfig.setEndReplicaNumber(serial); + } + + public void setNextMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMinSerialNo == null) { + logger.debug("ReplicaIDRepository: Removing next min number"); + dbConfig.removeNextBeginReplicaNumber(); + + } else { + String serial = mNextMinSerialNo.toString(mRadix); + logger.debug("ReplicaIDRepository: Setting next min number: " + serial); + dbConfig.setNextBeginReplicaNumber(serial); + } + } + + public void setNextMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMaxSerialNo == null) { + logger.debug("ReplicaIDRepository: Removing next max number"); + dbConfig.removeNextEndReplicaNumber(); + + } else { + String serial = mNextMaxSerialNo.toString(mRadix); + logger.debug("ReplicaIDRepository: Setting next max number: " + serial); + dbConfig.setNextEndReplicaNumber(serial); + } + } + /** * Returns last serial number in given range */ diff --git a/base/server/src/main/java/com/netscape/cmscore/dbs/Repository.java b/base/server/src/main/java/com/netscape/cmscore/dbs/Repository.java index 90b905b6dce..a86a3d9fccd 100644 --- a/base/server/src/main/java/com/netscape/cmscore/dbs/Repository.java +++ b/base/server/src/main/java/com/netscape/cmscore/dbs/Repository.java @@ -25,7 +25,6 @@ import com.netscape.certsrv.dbs.DBException; import com.netscape.cmscore.apps.CMS; import com.netscape.cmscore.apps.CMSEngine; -import com.netscape.cmscore.apps.DatabaseConfig; import com.netscape.cmscore.apps.EngineConfig; import netscape.ldap.LDAPAttribute; @@ -78,16 +77,10 @@ public static IDGenerator fromString(String name) { // (the next serialNo to be issued) - 1 private BigInteger mSerialNo = null; - protected String minSerialName; protected BigInteger mMinSerialNo; - - protected String maxSerialName; protected BigInteger mMaxSerialNo; - protected String nextMinSerialName; protected BigInteger mNextMinSerialNo; - - protected String nextMaxSerialName; protected BigInteger mNextMaxSerialNo; protected BigInteger mCounter = null; @@ -422,78 +415,28 @@ private boolean hasNextRange() { * * @exception EBaseException failed to set */ - public void setMinSerialConfig() throws EBaseException { - - EngineConfig cs = engine.getConfig(); - DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); - - String serial = mMinSerialNo.toString(mRadix); - logger.debug("Repository: Setting min serial number: " + serial); - - dbConfig.putString(minSerialName, serial); - cs.commit(false); - } + public abstract void setMinSerialConfig() throws EBaseException; /** * Sets maximum serial number limit in config file * * @exception EBaseException failed to set */ - public void setMaxSerialConfig() throws EBaseException { - - EngineConfig cs = engine.getConfig(); - DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); - - String serial = mMaxSerialNo.toString(mRadix); - logger.debug("Repository: Setting max serial number: " + serial); - - dbConfig.putString(maxSerialName, serial); - cs.commit(false); - } + public abstract void setMaxSerialConfig() throws EBaseException; /** * Sets minimum serial number limit for next range in config file * * @exception EBaseException failed to set */ - public void setNextMinSerialConfig() throws EBaseException { - - EngineConfig cs = engine.getConfig(); - DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); - - if (mNextMinSerialNo == null) { - logger.debug("Repository: Removing next min number"); - dbConfig.remove(nextMinSerialName); - } else { - String serial = mNextMinSerialNo.toString(mRadix); - logger.debug("Repository: Setting next min number: " + serial); - dbConfig.putString(nextMinSerialName, serial); - } - - cs.commit(false); - } + public abstract void setNextMinSerialConfig() throws EBaseException; /** * Sets maximum serial number limit for next range in config file * * @exception EBaseException failed to set */ - public void setNextMaxSerialConfig() throws EBaseException { - - EngineConfig cs = engine.getConfig(); - DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); - - if (mNextMaxSerialNo == null) { - logger.debug("Repository: Removing next max number"); - dbConfig.remove(nextMaxSerialName); - } else { - String serial = mNextMaxSerialNo.toString(mRadix); - logger.debug("Repository: Setting next max number: " + serial); - dbConfig.putString(nextMaxSerialName, serial); - } - - cs.commit(false); - } + public abstract void setNextMaxSerialConfig() throws EBaseException; /** * Switch to the next range and persist the changes. @@ -512,6 +455,9 @@ private void switchToNextRange() throws EBaseException { setMaxSerialConfig(); setNextMinSerialConfig(); setNextMaxSerialConfig(); + + EngineConfig cs = engine.getConfig(); + cs.commit(false); } /** @@ -708,6 +654,9 @@ public void checkRanges() throws EBaseException { setNextMinSerialConfig(); setNextMaxSerialConfig(); + + EngineConfig cs = engine.getConfig(); + cs.commit(false); } } @@ -721,6 +670,9 @@ public void checkRanges() throws EBaseException { setNextMinSerialConfig(); setNextMaxSerialConfig(); + + EngineConfig cs = engine.getConfig(); + cs.commit(false); } } } diff --git a/base/server/src/main/java/com/netscape/cmscore/request/RequestRepository.java b/base/server/src/main/java/com/netscape/cmscore/request/RequestRepository.java index 0773d60de31..6f16ca8a687 100644 --- a/base/server/src/main/java/com/netscape/cmscore/request/RequestRepository.java +++ b/base/server/src/main/java/com/netscape/cmscore/request/RequestRepository.java @@ -119,21 +119,18 @@ public void initLegacyGenerator() throws Exception { rangeDN = dbConfig.getRequestRangeDN() + "," + dbSubsystem.getBaseDN(); logger.debug("RequestRepository: - range DN: " + rangeDN); - minSerialName = DatabaseConfig.MIN_REQUEST_NUMBER; String minSerial = dbConfig.getBeginRequestNumber(); if (minSerial != null) { mMinSerialNo = new BigInteger(minSerial, mRadix); } logger.debug("RequestRepository: - min serial: " + mMinSerialNo); - maxSerialName = DatabaseConfig.MAX_REQUEST_NUMBER; String maxSerial = dbConfig.getEndRequestNumber(); if (maxSerial != null) { mMaxSerialNo = new BigInteger(maxSerial, mRadix); } logger.debug("RequestRepository: - max serial: " + mMaxSerialNo); - nextMinSerialName = DatabaseConfig.NEXT_MIN_REQUEST_NUMBER; String nextMinSerial = dbConfig.getNextBeginRequestNumber(); if (nextMinSerial == null || nextMinSerial.equals("-1")) { mNextMinSerialNo = null; @@ -142,7 +139,6 @@ public void initLegacyGenerator() throws Exception { } logger.debug("RequestRepository: - next min serial: " + mNextMinSerialNo); - nextMaxSerialName = DatabaseConfig.NEXT_MAX_REQUEST_NUMBER; String nextMaxSerial = dbConfig.getNextEndRequestNumber(); if (nextMaxSerial == null || nextMaxSerial.equals("-1")) { mNextMaxSerialNo = null; @@ -162,6 +158,52 @@ public void initLegacyGenerator() throws Exception { } } + public void setMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMinSerialNo.toString(mRadix); + logger.debug("RequestRepository: Setting min serial number: " + serial); + dbConfig.setBeginRequestNumber(serial); + } + + public void setMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + String serial = mMaxSerialNo.toString(mRadix); + logger.debug("RequestRepository: Setting max serial number: " + serial); + dbConfig.setEndRequestNumber(serial); + } + + public void setNextMinSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMinSerialNo == null) { + logger.debug("RequestRepository: Removing next min number"); + dbConfig.removeNextBeginRequestNumber(); + + } else { + String serial = mNextMinSerialNo.toString(mRadix); + logger.debug("RequestRepository: Setting next min number: " + serial); + dbConfig.setNextBeginRequestNumber(serial); + } + } + + public void setNextMaxSerialConfig() throws EBaseException { + + DatabaseConfig dbConfig = dbSubsystem.getDBConfigStore(); + + if (mNextMaxSerialNo == null) { + logger.debug("RequestRepository: Removing next max number"); + dbConfig.removeNextEndRequestNumber(); + + } else { + String serial = mNextMaxSerialNo.toString(mRadix); + logger.debug("RequestRepository: Setting next max number: " + serial); + dbConfig.setNextEndRequestNumber(serial); + } + } + public void init(Hashtable repositoryConfig) throws Exception { this.repositoryConfig = repositoryConfig;