Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OConfigurationException


            OConfigurationException.class);

      id = distributedNetworkListener.getInboundAddr().getHostName() + ":" + distributedNetworkListener.getInboundAddr().getPort();

    } catch (Exception e) {
      throw new OConfigurationException("Can't configure OrientDB Server as Cluster Node", e);
    }
  }
View Full Code Here


      configuration.dataSegments.add(conf);

      final int pos = registerDataSegment(conf);

      if (pos == -1)
        throw new OConfigurationException("Can't add segment " + conf.name + " because it's already part of current storage");

      dataSegments[pos].create(-1);
      configuration.update();

      return pos;
View Full Code Here

      long tot = 0;

      OCluster c;
      for (int i = 0; i < iClusterIds.length; ++i) {
        if (iClusterIds[i] >= clusters.length)
          throw new OConfigurationException("Cluster id " + iClusterIds[i] + "was not found");

        c = clusters[iClusterIds[i]];
        if (c != null)
          tot += c.getEntries();
      }
View Full Code Here

   * @throws IOException
   */
  private int registerCluster(final OCluster iCluster) throws IOException {
    // CHECK FOR DUPLICATION OF NAMES
    if (clusterMap.containsKey(iCluster.getName()))
      throw new OConfigurationException("Can't add segment '" + iCluster.getName() + "' because it was already registered");

    // CREATE AND ADD THE NEW REF SEGMENT
    clusterMap.put(iCluster.getName(), iCluster);

    final int id = iCluster.getId();
View Full Code Here

  public void fromStream() {
    // READ CURRENT SCHEMA VERSION
    int schemaVersion = (Integer) document.field("schemaVersion");
    if (schemaVersion != CURRENT_VERSION_NUMBER) {
      // HANDLE SCHEMA UPGRADE
      throw new OConfigurationException(
          "Database schema is different. Please export your old database with the previous verison of OrientDB and reimport it using the current one.");
    }

    // REGISTER ALL THE CLASSES
    classes.clear();
    OClass cls;
    Collection<ODocument> storedClasses = document.field("classes");
    for (ODocument c : storedClasses) {
      c.setDatabase(document.getDatabase());
      cls = new OClass(this, c);
      cls.fromStream();
      classes.put(cls.getName().toLowerCase(), cls);
    }

    // REBUILD THE INHERITANCE TREE
    String superClassName;
    OClass superClass;
    for (ODocument c : storedClasses) {
      superClassName = c.field("superClass");

      if (superClassName != null) {
        // HAS A SUPER CLASS
        cls = classes.get(((String) c.field("name")).toLowerCase());

        superClass = classes.get(superClassName.toLowerCase());

        if (superClass == null)
          throw new OConfigurationException("Super class '" + superClassName + "' was declared in class '" + cls.getName()
              + "' but was not found in schema. Remove the dependency or create the class to continue.");

        cls.setSuperClass(superClass);
      }
    }
View Full Code Here

      throw new IllegalArgumentException("Index type is null");

    final Class<? extends OIndexInternal> indexClass = registry.get(iIndexType);

    if (indexClass == null)
      throw new OConfigurationException("Index type '" + iIndexType + "' is not configured");

    try {
      return (T) indexClass.newInstance();
    } catch (Exception e) {
      throw new OConfigurationException("Can't create index type '" + iIndexType + "'", e);
    }
  }
View Full Code Here

          return (ORecordId) id;
        } else if (id instanceof Number) {
          // TREATS AS CLUSTER POSITION
          final OClass cls = iDb.getMetadata().getSchema().getClass(iPojo.getClass());
          if (cls == null)
            throw new OConfigurationException("Class " + iPojo.getClass() + " is not managed by current database");

          return new ORecordId(cls.getDefaultClusterId(), ((Number) id).longValue());
        } else if (id instanceof String)
          return new ORecordId((String) id);
      }
View Full Code Here

        if (m.getParameterTypes().length > 0)
          m.invoke(iPojo, iDocument);
        else
          m.invoke(iPojo);
      } catch (Exception e) {
        throw new OConfigurationException("Error on executing user callback '" + m.getName() + "' annotated with '"
            + iAnnotation.getSimpleName() + "'", e);
      }
  }
View Full Code Here

  public ONetworkProtocolDistributed() {
    super("Distributed-DB");

    manager = OServerMain.server().getHandler(ODistributedServerManager.class);
    if (manager == null)
      throw new OConfigurationException(
          "Can't find a ODistributedServerDiscoveryManager instance registered as handler. Check the server configuration in the handlers section.");
  }
View Full Code Here

    return recordClass;
  }

  public <RET extends Object> RET newInstance() {
    if (recordClass == null)
      throw new OConfigurationException("Can't create record since no record class was specified");

    return (RET) ORecordFactory.instance().newInstance(this, recordClass);
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OConfigurationException

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.