Package com.orientechnologies.common.exception

Examples of com.orientechnologies.common.exception.OException


          lockManager.releaseLock(recordLock);
        }
      } catch (RuntimeException e) {
        throw e;
      } catch (Exception e) {
        throw new OException("Error on nested call in lock", e);
      } finally {
        if (exclusiveLock) {
          lock.releaseExclusiveLock();
        } else
          lock.releaseSharedLock();
View Full Code Here


    if (iRecordNumber == null)
      checkCurrentObject();
    else {
      int recNumber = Integer.parseInt(iRecordNumber);
      if (currentResultSet.size() == 0)
        throw new OException("No result set where to find the requested record. Execute a query first.");

      if (currentResultSet.size() <= recNumber)
        throw new OException("The record requested is not part of current result set (0"
            + (currentResultSet.size() > 0 ? "-" + (currentResultSet.size() - 1) : "") + ")");

      setCurrentRecord(recNumber);
    }
View Full Code Here

    final ORawBuffer buffer = currentDatabase.getStorage()
        .readRecord(rid, null, false, null, false, OStorage.LOCKING_STRATEGY.DEFAULT).getResult();

    if (buffer == null)
      throw new OException("The record has been deleted");

    String content;
    if (Integer.parseInt(properties.get("maxBinaryDisplay")) < buffer.buffer.length)
      content = new String(Arrays.copyOf(buffer.buffer, Integer.parseInt(properties.get("maxBinaryDisplay"))));
    else
View Full Code Here

  /** Should be used only by console commands */
  public void checkForRemoteServer() {
    if (serverAdmin == null
        && (currentDatabase == null || !(currentDatabase.getStorage() instanceof OStorageRemoteThread) || currentDatabase
            .isClosed()))
      throw new OException("Remote server is not connected. Use 'connect remote:<host>[:<port>][/<database-name>]' to connect");
  }
View Full Code Here

  }

  /** Should be used only by console commands */
  public void checkForDatabase() {
    if (currentDatabase == null)
      throw new OException("Database not selected. Use 'connect <database-name>' to connect to a database.");
    if (currentDatabase.isClosed())
      throw new ODatabaseException("Database '" + currentDatabaseName + "' is closed");
  }
View Full Code Here

  }

  /** Should be used only by console commands */
  public void checkCurrentObject() {
    if (currentRecord == null)
      throw new OException("The is no current object selected: create a new one or load it");
  }
View Full Code Here

      String valueContainerAlgorithm = idx.field(OIndexInternal.VALUE_CONTAINER_ALGORITHM);

      ODocument metadata = idx.field(OIndexInternal.METADATA);
      if (indexType == null) {
        OLogManager.instance().error(this, "Index type is null, will process other record.");
        throw new OException("Index type is null, will process other record. Index configuration: " + idx.toString());
      }

      return OIndexes.createIndex(newDb, indexType, algorithm, valueContainerAlgorithm, metadata);
    }
View Full Code Here

    List<Class<?>> classes = null;
    try {
      classes = OReflectionHelper.getClassesFor(iPackageName, iClassLoader);
    } catch (ClassNotFoundException e) {
      throw new OException(e);
    }
    for (Class<?> c : classes) {
      generateSchema(c);
    }
  }
View Full Code Here

    List<Class<?>> classes = null;
    try {
      classes = OReflectionHelper.getClassesFor(iPackageName, iClassLoader);
    } catch (ClassNotFoundException e) {
      throw new OException(e);
    }
    for (Class<?> c : classes) {
      deregisterEntityClass(c);
    }
View Full Code Here

    OLogManager.instance().debug(this, "Discovering entity classes for class names: %s", iClassNames);

    try {
      registerEntityClasses(OReflectionHelper.getClassesFor(iClassNames, iClassLoader));
    } catch (ClassNotFoundException e) {
      throw new OException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.common.exception.OException

Copyright © 2018 www.massapicom. 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.