private int registerCluster(final OCluster cluster) {
    final int id;

    if (cluster != null) {
      // CHECK FOR DUPLICATION OF NAMES
      if (clusterMap.containsKey(cluster.getName().toLowerCase(configuration.getLocaleInstance()))) {
        throw new OConfigurationException(
            "Cannot add cluster '" + cluster.getName() + "' because it is already registered in database '" + name + "'");
      }
      // CREATE AND ADD THE NEW REF SEGMENT
      clusterMap.put(cluster.getName().toLowerCase(configuration.getLocaleInstance()), cluster);
      id = cluster.getId();
    } else {
      id = clusters.size();
    }

    setCluster(id, cluster);

    return id;
  }
private int registerCluster ( final OCluster cluster ) { final int id ; if ( cluster != null ) { if ( clusterMap . containsKey ( cluster . getName ( ) . toLowerCase ( configuration . getLocaleInstance ( ) ) ) ) { throw new OConfigurationException ( "Cannot add cluster '" + cluster . getName ( ) + "' because it is already registered in database '" + name + "'" ) ; } clusterMap . put ( cluster . getName ( ) . toLowerCase ( configuration . getLocaleInstance ( ) ) , cluster ) ; id = cluster . getId ( ) ; } else { id = clusters . size ( ) ; } setCluster ( id , cluster ) ; return id ; }
Register the cluster internally.

@param cluster OCluster implementation

@return The id (physical position into the array) of the new cluster just created. First is 0.