public class ClientRegistryBinder extends Object
| Constructor and Description |
|---|
ClientRegistryBinder(org.apache.hadoop.registry.client.api.RegistryOperations operations) |
| Modifier and Type | Method and Description |
|---|---|
static String |
currentUsernameUnencoded()
Get the current username, before any encoding has been applied.
|
static org.apache.hadoop.registry.client.types.Endpoint |
getEndpoint(org.apache.hadoop.registry.client.types.ServiceRecord record,
String api,
boolean external)
Get an endpont by API
|
static String |
homePathForUser(String username)
Buld the user path -switches to the system path if the user is "".
|
String |
lookupExternalRestAPI(String user,
String serviceClass,
String instance,
String api)
Look up an external REST API
|
static String |
lookupRestAPI(org.apache.hadoop.registry.client.types.ServiceRecord record,
String api,
boolean external)
Look up an external REST API endpoint
|
static String |
qualifyUser(String user)
Qualify a user.
|
protected String |
resolveExternalRestAPI(String api,
String path)
Resolve a service record then return an external REST API exported it.
|
public ClientRegistryBinder(org.apache.hadoop.registry.client.api.RegistryOperations operations)
public static String homePathForUser(String username)
username - username or ""public static String currentUsernameUnencoded()
public static String qualifyUser(String user)
"~" maps to user home path home"~user" maps to /users/$user"/" maps to /services/user - the usernamepublic String lookupExternalRestAPI(String user, String serviceClass, String instance, String api) throws IOException
user - user which will be qualified as per qualifyUser(String)serviceClass - service classinstance - instance nameapi - APIIOExceptionprotected String resolveExternalRestAPI(String api, String path) throws IOException
api - API to resolvepath - path of the service recordIOException - resolution problems, as covered in
RegistryOperations.resolve(String)public static String lookupRestAPI(org.apache.hadoop.registry.client.types.ServiceRecord record, String api, boolean external) throws org.apache.hadoop.registry.client.exceptions.InvalidRecordException
record - service recordapi - URI of apiexternal - flag to indicate this is an external recordorg.apache.hadoop.registry.client.exceptions.InvalidRecordExceptionpublic static org.apache.hadoop.registry.client.types.Endpoint getEndpoint(org.apache.hadoop.registry.client.types.ServiceRecord record,
String api,
boolean external)
record - service recordapi - APIexternal - flag to indicate this is an external recordCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.