Add a peer given an endpoint specification.
@param url URL of the peer
@param pem permission
@return a new peer.
321437
public Peer addPeer(String url, String pem) {
        Peer peer = new Peer(url, pem, this);
        this.peers.add(peer);
        return peer;
    }
848393
public void addRemoteRepositoryByUrl(String url) throws NaetherException {
        try {
            addRemoteRepository(RepoBuilder.remoteRepositoryFromUrl(url));
        } catch (MalformedURLException e) {
            log.error( "Malformed url: {}", url, e);
            throw new NaetherException(e);
        }
    }
465674
public void addPeer(TrackedPeer peer) {
    this.peers.put(new PeerUID(peer.getAddress(), this.getHexInfoHash()), peer);
  }
645365
public UaTcpStackServer getServer(String endpointUrl) {
        String path = pathOrUrl(endpointUrl);

        UaTcpStackServer server = servers.get(path);

        if (server == null && servers.size() == 1 && !strictEndpointUrlsEnabled) {
            Iterator<UaTcpStackServer> iterator = servers.values().iterator();

            if (iterator.hasNext()) {
                server = iterator.next();
            }
        }

        return server;
    }
1359901
public static base_response add(nitro_service client, vpnvserver resource) throws Exception {
		vpnvserver addresource = new vpnvserver();
		addresource.name = resource.name;
		addresource.servicetype = resource.servicetype;
		addresource.ipv46 = resource.ipv46;
		addresource.range = resource.range;
		addresource.port = resource.port;
		addresource.state = resource.state;
		addresource.authentication = resource.authentication;
		addresource.doublehop = resource.doublehop;
		addresource.maxaaausers = resource.maxaaausers;
		addresource.icaonly = resource.icaonly;
		addresource.downstateflush = resource.downstateflush;
		addresource.listenpolicy = resource.listenpolicy;
		addresource.listenpriority = resource.listenpriority;
		addresource.tcpprofilename = resource.tcpprofilename;
		addresource.httpprofilename = resource.httpprofilename;
		addresource.comment = resource.comment;
		addresource.appflowlog = resource.appflowlog;
		addresource.icmpvsrresponse = resource.icmpvsrresponse;
		addresource.netprofile = resource.netprofile;
		addresource.cginfrahomepageredirect = resource.cginfrahomepageredirect;
		addresource.maxloginattempts = resource.maxloginattempts;
		addresource.failedlogintimeout = resource.failedlogintimeout;
		return addresource.add_resource(client);
	}
239206
public void addMovingEndpoint(Token token, InetAddress endpoint)
    {
        assert endpoint != null;

        lock.writeLock().lock();

        try
        {
            movingEndpoints.add(Pair.create(token, endpoint));
        }
        finally
        {
            lock.writeLock().unlock();
        }
    }
823186
function addPeer( sPeer )
{
	if ( assocKnownPeers[ sPeer ] )
	{
		return;
	}

	//
	//	save to memory
	//
	assocKnownPeers[ sPeer ] = true;

	//
	//	save to local storage
	//
	let sHost = getHostByPeer( sPeer );
	addPeerHost
	(
		sHost,
		() =>
		{
			console.log( "will insert peer " + sPeer );
			db.query( "INSERT " + db.getIgnore() + " INTO peers (peer_host, peer) VALUES (?,?)", [ sHost, sPeer ] );
		}
	);
}
689599
public ProcessEngineConfiguration addWsEndpointAddress(QName endpointName, URL address) {
      this.wsOverridenEndpointAddresses.put(endpointName, address);
      return this;
  }
396762
@Override
    public Association addServerAssociation(String peerAddress, int peerPort, String serverName, String assocName)
            throws Exception {
        return addServerAssociation(peerAddress, peerPort, serverName, assocName, IpChannelType.SCTP);
    }
845950
def add_membership(connection, peer_url)
      info "Adding new etcd membership info with peer URL #{peer_url}"
      connection.post(:body => JSON.generate(peerURLs: [peer_url]),
                      :headers => { 'Content-Type' => 'application/json' })
    end
577407
protected URLConnection createConnection(URL url) throws IOException
    {
        URLConnection con = url.openConnection();
        con.setRequestProperty("User-Agent", USER_AGENT);
        return con;
    }
980959
protected MessageEndpoint createEndpoint() throws ResourceException
    {
        final String methodName = "createEndpoint";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }


            // Ensure that in non-WAS environments the activation spec used to create
            // the current connection specified a specific messaging engine. This is
            // required so that we always connect to the same messaging engine when
            // using the same activation specification to permit transaction recovery.

        	//chetan liberty change :
        	//getTarget() check is removed since in liberty we have 1 ME per liberty profile
            if ((_endpointConfiguration.getTargetSignificance().equals(SibTrmConstants.TARGET_SIGNIFICANCE_REQUIRED)) &&
                (_endpointConfiguration.getTargetType().equals(SibTrmConstants.TARGET_TYPE_ME))) {
                _sibXaResource = new SibRaXaResource (getXaResource());
            } else {
              String p0;          // Connection property name
              String p1;          // Required connection property value

              if (!_endpointConfiguration.getTargetSignificance().equals(SibTrmConstants.TARGET_SIGNIFICANCE_REQUIRED)) {
                p0 = SibTrmConstants.TARGET_SIGNIFICANCE;
                p1 = SibTrmConstants.TARGET_SIGNIFICANCE_REQUIRED;
              } else if (!_endpointConfiguration.getTargetType().equals(SibTrmConstants.TARGET_TYPE_ME)) {
                p0 = SibTrmConstants.TARGET_TYPE;
                p1 = SibTrmConstants.TARGET_TYPE_ME;
              } else {
                p0 = SibTrmConstants.TARGET_GROUP;
                p1 = "!null";
              }

              SibTr.error(TRACE, "ME_NAME_REQUIRED_CWSIV0652",new Object[] {p0,p1});
              throw new NotSupportedException(NLS.getFormattedMessage("ME_NAME_REQUIRED_CWSIV0652", new Object[] {p0,p1}, null));
            }
        

        final MessageEndpoint endpoint = _endpointFactory
                .createEndpoint(_sibXaResource);

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName, endpoint);
        }
        return endpoint;
    }
850056
def add(peer)
      raise "Peer must have it's infoHash set." if ! peer.infoHash

      # Do not add if peer is already present by address
      if @peersByAddr.has_key?(byAddrKey(peer))
        @log.debug "Not adding peer #{peer} since it already exists by #{@peersById.has_key?(peer.trackerPeer.id) ? "id" : "addr"}."
        return
      end

      if peer.trackerPeer.id
        @peersById.pushToList(peer.trackerPeer.id, peer)
        
        # If id is null, this is probably a peer received from the tracker that has no ID.
      end

      @peersByAddr[byAddrKey(peer)] = peer

      @peersByInfoHash.pushToList(peer.infoHash, peer)
    end
662469
public static base_response add(nitro_service client, vpnnexthopserver resource) throws Exception {
		vpnnexthopserver addresource = new vpnnexthopserver();
		addresource.name = resource.name;
		addresource.nexthopip = resource.nexthopip;
		addresource.nexthopport = resource.nexthopport;
		addresource.secure = resource.secure;
		return addresource.add_resource(client);
	}
887421
function getOrCreatePeer(id)
    {
        if(scope.peers[id])
        {
            return scope.peers[id];
        }
        return createPeerInstance(id);
    }
659411
public static HttpHubConnectionBuilder create(String url) {
        if (url == null || url.isEmpty()) {
            throw new IllegalArgumentException("A valid url is required.");
        }
        return new HttpHubConnectionBuilder(url);
    }
533213
public static URI toUri(String endpoint, Protocol protocol) {
        if (endpoint == null) {
            throw new IllegalArgumentException("endpoint cannot be null");
        }

        /*
         * If the endpoint doesn't explicitly specify a protocol to use, then
         * we'll defer to the default protocol specified in the client
         * configuration.
         */
        if (!endpoint.contains("://")) {
            endpoint = protocol.toString() + "://" + endpoint;
        }

        try {
            return new URI(endpoint);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }