Examples of OperationStatus


Examples of com.sleepycat.db.OperationStatus

    }

    /** {@inheritDoc} */
    public boolean findNext() {
  try {
      OperationStatus status =
    cursor.getNext(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

Examples of com.sleepycat.db.OperationStatus

    /** {@inheritDoc} */
    public boolean findNext(byte[] key) {
  DatabaseEntry searchEntry = new DatabaseEntry(key);
  try {
      OperationStatus status =
    cursor.getSearchKeyRange(searchEntry, valueEntry, null);
      if (status == SUCCESS) {
    keyEntry = searchEntry;
    isCurrent = true;
    return true;
View Full Code Here

Examples of com.sleepycat.db.OperationStatus

    }

    /** {@inheritDoc} */
    public boolean findLast() {
  try {
      OperationStatus status =
    cursor.getLast(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

Examples of com.sleepycat.db.OperationStatus

    /** {@inheritDoc} */
    public boolean putNoOverwrite(byte[] key, byte[] value) {
  try {
      DatabaseEntry putKeyEntry = new DatabaseEntry(key);
      DatabaseEntry putValueEntry = new DatabaseEntry(value);
      OperationStatus status = cursor.putNoOverwrite(
    putKeyEntry, putValueEntry);
      if (status == SUCCESS) {
    isCurrent = true;
    keyEntry = putKeyEntry;
    valueEntry = putValueEntry;
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

    synchronized (mutex) {
      int matches = 0;
      List<WebURL> results = new ArrayList<WebURL>(max);

      Cursor cursor = null;
      OperationStatus result = null;
      DatabaseEntry key = new DatabaseEntry();
      DatabaseEntry value = new DatabaseEntry();
      Transaction txn;
      if (resumable) {
        txn = env.beginTransaction(null, null);
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

  public void delete(int count) throws DatabaseException {
    synchronized (mutex) {
      int matches = 0;

      Cursor cursor = null;
      OperationStatus result = null;
      DatabaseEntry key = new DatabaseEntry();
      DatabaseEntry value = new DatabaseEntry();
      Transaction txn;
      if (resumable) {
        txn = env.beginTransaction(null, null);
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

  public boolean removeURL(WebURL webUrl) {
    synchronized (mutex) {
      try {
        DatabaseEntry key = new DatabaseEntry(Util.int2ByteArray(webUrl.getDocid()));       
        Cursor cursor = null;
        OperationStatus result = null;
        DatabaseEntry value = new DatabaseEntry();
        Transaction txn = env.beginTransaction(null, null);
        try {
          cursor = urlsDB.openCursor(txn, null);
          result = cursor.getSearchKey(key, value, null);
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

  try
  { key = key.trim();
  DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
  DatabaseEntry  dbData = new DatabaseEntry();
  data.getBdbBinding().objectToEntry(data, dbData);
  OperationStatus ost = (dups) ? getCurrentDB().put(null, dbKey, dbData):
   getCurrentDB().putNoOverwrite(null, dbKey, dbData)

  if (ost != OperationStatus.KEYEXIST) valid = true;
  }
  catch (DatabaseException e)
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

  try
  {
   DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
   DatabaseEntry dbe = new DatabaseEntry();
   cursor = getCurrentDB().openCursor(null, null);
   OperationStatus ostat = (rangeFlag) ? cursor.getSearchKeyRange(dbKey, dbe, LockMode.DEFAULT):
                            cursor.getSearchKey(dbKey, dbe, LockMode.DEFAULT);

   int numRecords = 0;
   if (cursor.count() >= 1)
   { while ( (ostat == OperationStatus.SUCCESS) && (numRecords < RANGE) )
View Full Code Here

Examples of com.sleepycat.je.OperationStatus

   key = key.trim();
   DatabaseEntry dbKey = new DatabaseEntry( key.getBytes("UTF-8") );
   DatabaseEntry py = new DatabaseEntry();

   //*-- use the key to fetch the data from the primary database
   OperationStatus os = getSecDB().get(null, dbKey, py, dbData, LockMode.DEFAULT);
   if (os != OperationStatus.SUCCESS) dbData = null;
  }
  catch (RuntimeException re)
  { logger.error("Runtime error: Could not fetch sec. document with key " + key + " " + re.getMessage());
  dbData = null; }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.