Example usage for org.apache.hadoop.registry.client.types Endpoint Endpoint

List of usage examples for org.apache.hadoop.registry.client.types Endpoint Endpoint

Introduction

In this page you can find the example usage for org.apache.hadoop.registry.client.types Endpoint Endpoint.

Prototype

public Endpoint(String api, String protocolType, URI... uris) 

Source Link

Document

Build an endpoint from a list of URIs; each URI is ASCII-encoded and added to the list of addresses.

Usage

From source file:org.apache.slider.providers.agent.AgentProviderService.java

License:Apache License

@Override
public void applyInitialRegistryDefinitions(URL amWebURI, URL agentOpsURI, URL agentStatusURI,
        ServiceRecord serviceRecord) throws IOException {
    super.applyInitialRegistryDefinitions(amWebURI, agentOpsURI, agentStatusURI, serviceRecord);

    try {//from w  ww .j av a2s . c  o m
        URL restURL = new URL(agentOpsURI, SLIDER_PATH_AGENTS);
        URL agentStatusURL = new URL(agentStatusURI, SLIDER_PATH_AGENTS);

        serviceRecord.addInternalEndpoint(new Endpoint(CustomRegistryConstants.AGENT_SECURE_REST_API,
                ProtocolTypes.PROTOCOL_REST, restURL.toURI()));
        serviceRecord.addInternalEndpoint(new Endpoint(CustomRegistryConstants.AGENT_ONEWAY_REST_API,
                ProtocolTypes.PROTOCOL_REST, agentStatusURL.toURI()));
    } catch (URISyntaxException e) {
        throw new IOException(e);
    }
}