Class ServiceAliasManager

java.lang.Object
i5.las2peer.p2p.ServiceAliasManager

public class ServiceAliasManager extends Object
Responsible for mapping service aliases to service names and resolving paths to service names.
  • Constructor Details

    • ServiceAliasManager

      public ServiceAliasManager(Node node)
  • 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 agent
      alias - an alias, optionally seperated by SEPERATOR and not deeper than MAX_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