@Override
	public void add(Endpoint endpoint) {
		this.writeLock.lock();
		try {
			if(this.endpointsByPath.containsKey(endpoint.path())) {
				throw new IllegalArgumentException("An endpoint with path '"+endpoint.path()+"' already exists");
			}
			Endpoint other=endpointOfResource(endpoint.resourceId());
			if(other!=null) {
				throw new IllegalArgumentException("An endpoint with resource name '"+endpoint.resourceId()+"' already exists ("+other+")");
			}
			this.endpointsByPath.put(endpoint.path(), endpoint);
			this.endpointsByResourceName.put(endpoint.resourceId(),endpoint);
		} finally {
			this.writeLock.unlock();
		}
	}
@Override
	public void add(Endpoint endpoint) {
		this.writeLock.lock();
		try {
			if(this.endpointsByPath.containsKey(endpoint.path())) {
				throw new IllegalArgumentException("An endpoint with path '"+endpoint.path()+"' already exists");
			}
			Endpoint other=endpointOfResource(endpoint.resourceId());
			if(other!=null) {
				throw new IllegalArgumentException("An endpoint with resource name '"+endpoint.resourceId()+"' already exists ("+other+")");
			}
			this.endpointsByPath.put(endpoint.path(), endpoint);
			this.endpointsByResourceName.put(endpoint.resourceId(),endpoint);
		} finally {
			this.writeLock.unlock();
		}
	}
@ Override public void add ( Endpoint endpoint ) { this . writeLock . lock ( ) ; try { if ( this . endpointsByPath . containsKey ( endpoint . path ( ) ) ) { throw new IllegalArgumentException ( "An endpoint with path '" + endpoint . path ( ) + "' already exists" ) ; } Endpoint other = endpointOfResource ( endpoint . resourceId ( ) ) ; if ( other != null ) { throw new IllegalArgumentException ( "An endpoint with resource name '" + endpoint . resourceId ( ) + "' already exists (" + other + ")" ) ; } this . endpointsByPath . put ( endpoint . path ( ) , endpoint ) ; this . endpointsByResourceName . put ( endpoint . resourceId ( ) , endpoint ) ; } finally { this . writeLock . unlock ( ) ; } }
{@inheritDoc}
{