Package i5.las2peer.p2p
Class ServiceAliasManager
java.lang.Object
i5.las2peer.p2p.ServiceAliasManager
Responsible for mapping service aliases to service names and resolving paths to service names.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
registerServiceAlias
(ServiceAgentImpl agent, String alias) Registers the service alias of the given service.Resolves a path to a service alias.
-
Constructor Details
-
ServiceAliasManager
-
-
Method Details
-
registerServiceAlias
public void registerServiceAlias(ServiceAgentImpl agent, String alias) throws AliasConflictException Registers the service alias of the given service. Note that a service alias cannot be a prefix of another service alias.- Parameters:
agent
- an unlocked service agentalias
- an alias, optionally seperated bySEPERATOR
and not deeper thanMAX_PATH_LEVEL
.- Throws:
AliasConflictException
- if a conflict occurs (a prefix or whole alias is already registered)
-
resolvePathToServiceName
public ServiceAliasManager.AliasResolveResponse resolvePathToServiceName(String path) throws AliasNotFoundException Resolves a path to a service alias.- Parameters:
path
- the path- Returns:
- the service name
- Throws:
AliasNotFoundException
- if the path cannot be resolves to a service name
-