Package com.orientechnologies.common.exception

Examples of com.orientechnologies.common.exception.OException


    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

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

    out.println("Raw record content (size=" + buffer.buffer.length + "):\n\n" + new String(buffer.buffer));
  }
View Full Code Here


    out.println("OK");
  }

  protected void checkCurrentDatabase() {
    if (currentDatabase == null)
      throw new OException("Database not selected. Use 'connect <database-name>' to connect to a database.");
    if (currentDatabase.isClosed())
      throw new OException("Database is closed");
  }
View Full Code Here

      throw new OException("Database is closed");
  }

  protected 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

      // OPEN DB
      out.print("Connecting to database [" + iURL + "] with user '" + iUserName + "'...");

      currentDatabase = new ODatabaseDocumentTx(iURL);
      if (currentDatabase == null)
        throw new OException("Database " + iURL + " not found");
      currentDatabase.open(iUserName, iUserPassword);

      currentDatabaseName = currentDatabase.getName();

      if (currentDatabase.getStorage() instanceof OStorageRemote)
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) : "") + ")");

      currentRecord = currentResultSet.get(recNumber);
    }
View Full Code Here

    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

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

    out.println("Raw record content (size=" + buffer.buffer.length + "):\n\n" + new String(buffer.buffer));
  }
View Full Code Here

    out.println("+------------------------------------+--------------------------------+");
  }

  protected void checkCurrentDatabase() {
    if (currentDatabase == null)
      throw new OException("Database not selected. Use 'connect <database-name>' to connect to a database.");
    if (currentDatabase.isClosed())
      throw new OException("Database is closed");
  }
View Full Code Here

      throw new OException("Database is closed");
  }

  protected 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

    ODistributedConfiguration cfg = manager.getDatabaseConfiguration(databaseName);

    final String bestCluster = cfg.getLocalCluster(clusterNames, nodeName);
    if (bestCluster == null)
      throw new OException("Cannot find best cluster for class '" + cls.getName() + "'. ClusterStrategy=" + getName());

    bestClusterId = db.getClusterIdByName(bestCluster);
  }
View Full Code Here

  @Override
  public RESULT onRecordBeforeCreate(final ODocument iDocument) {
    String name = iDocument.field(OScheduler.PROP_NAME);
    OScheduler scheduler = ODatabaseRecordThreadLocal.INSTANCE.get().getMetadata().getSchedulerListener().getScheduler(name);
    if (scheduler != null) {
      throw new OException("Duplicate Scheduler");
    }
    boolean start = iDocument.field(OScheduler.PROP_STARTED) == null ? false : ((Boolean) iDocument.field(OScheduler.PROP_STARTED));
    if (start)
      iDocument.field(OScheduler.PROP_STATUS, SCHEDULER_STATUS.WAITING.name());
    else
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.