Adds a server to the list of available servers.
@param id Neo4j cluster id
359748
public synchronized void onServerAvailable(final String id, final String role) {
        logger.debug("[onServerAvailable] id = {}, role = {}", id, role);

        Server server = getServerById(id);
        boolean isMaster = role.equals("master");
        boolean isSlave = role.equals("slave");

        if (server == null) {
            return;
        }

        if (server.isAvailable()) {
            if (server.isMaster() && isMaster) return;
            if (!server.isMaster() && isSlave) return;
        }

        if (isMaster || isSlave) {
            server.setAvailable(true);
            try {
                server.connect();
            }
            catch (Exception e) {
                logger.error("[onServerAvailable]", e);
            }
        }

        server.setAvailable(true);

        if (isMaster) {
            setWriteServer(server);
        }

        refreshServers();
    }
139192
public void setId(String id) {
      if (StringUtils.isNullOrBlank(id)) {
         this.id = UUID.randomUUID().toString();
      } else {
         this.id = id;
      }
   }
426934
public void addId(final URI id, final String value) {
        if (id != null && value != null) {
            final URI localId = id.normalize();
            final String localValue = value.trim();
            idMap.put(localId, localValue);
        }
    }
928600
def add_nodes(network_id, nodes,**kwargs):
    
    start_time = datetime.datetime.now()

    names=[]        # used to check uniqueness of node name
    for n_i in nodes:
        if n_i.name in names:
            raise HydraError("Duplicate Node Name: %s"%(n_i.name))
        names.append(n_i.name)

    user_id = kwargs.get('user_id')
    try:
        net_i = db.DBSession.query(Network).filter(Network.id == network_id).one()
        net_i.check_write_permission(user_id)
    except NoResultFound:
        raise ResourceNotFoundError("Network %s not found"%(network_id))

    _add_nodes_to_database(net_i, nodes)

    net_i.project_id=net_i.project_id
    db.DBSession.flush()

    node_s =  db.DBSession.query(Node).filter(Node.network_id==network_id).all()

    #Maps temporary node_ids to real node_ids
    node_id_map = dict()

    iface_nodes = dict()
    for n_i in node_s:
        iface_nodes[n_i.name] = n_i

    for node in nodes:
        node_id_map[node.id] = iface_nodes[node.name]

    _bulk_add_resource_attrs(network_id, 'NODE', nodes, iface_nodes)

    log.info("Nodes added in %s", get_timing(start_time))
    return node_s
566208
public synchronized void add(int id, SICoreConnection connection) {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "add", "" + id);
        map.put(id, connection);
        if (tc.isEntryEnabled())
            SibTr.exit(tc, "add");
    }
102579
function(id, callback) {
        var self = this;

        var requestOptions = {
            uri: '/servers/' + id
        };

        self.authorizedRequest(requestOptions, function(err, res, body) {
            if (err || !body.server) {
                callback(err);
                return;
            }

            callback(err, new rackspace.Server(self, body.server));
        });
    }
881454
public void addEntityId(long entityId)
    {
        if(this.entityIds == null)
            this.entityIds = new ArrayList<Long>();
        this.entityIds.add(entityId);
    }
583741
protected void setId(String id) {
		if (!StringUtils.hasText(id)) {
			id = null;
		}
		this.id = id;
	}
1234101
public void setAddSubnetIds(java.util.Collection<String> addSubnetIds) {
        if (addSubnetIds == null) {
            this.addSubnetIds = null;
            return;
        }

        this.addSubnetIds = new com.amazonaws.internal.SdkInternalList<String>(addSubnetIds);
    }
717670
@SuppressWarnings("unchecked")
    public <M extends T> M byId(ID id) {
        return (M) server().find(getModelType(), id);
    }
116354
public void add(List<T> resources)
    {
        for(T resource : resources)
        {
            if(resource.getId() != null)
                ids.put(resource.getId(), resource);
            if(resource instanceof NamedResource)
                addName((NamedResource)resource);
        }
    }
908716
public void setId(String id)
	{
		if (id == null || id.length() == 0)
			throw new IllegalArgumentException(
			"id required in setId");

		this.setId(Integer.valueOf(id));
	}
156411
public void updateTree(CmsUUID id) {

        CmsObject cms = A_CmsUI.getCmsObject();
        updateResourceInTree(cms, id);

    }
485543
def add_node(self, p_id):
        
        if not self.has_node(p_id):
            self._edges[p_id] = set()
911147
public LocalTrustGraphNode addNode(final TrustGraphNodeId nodeId) {
        final LocalTrustGraphNode node = createNode(nodeId);
        addNode(node);
        return node;
    }
685815
public void addState(final String id, final Collection<Attribute> attributes) {
    this.stateMap.put(id, attributes);
  }
175272
function (id)
		{
			var m = this.getModule('server-'+id, function (server) {
				self.e.loadServer(server);
			});
			_serverModules.push(m);
			return m;
		}