org.mobicents.slee.resource.parlay.fw
Class TokenAndServiceMap

java.lang.Object
  extended by org.mobicents.slee.resource.parlay.fw.TokenAndServiceMap

public class TokenAndServiceMap
extends java.lang.Object

This class stores service interfaces and service tokens as a dual look-up. The token:service relationship must be a unique key.


Constructor Summary
TokenAndServiceMap()
          Holds references to services and their token identifier.
 
Method Summary
 void clear()
          Removes all mappings from this map.
 java.lang.String get(org.csapi.IpService service)
          Retrieves the token corresponding to the specified service.
 org.csapi.IpService get(java.lang.String serviceToken)
          Retrieves the service corresponding to the specified token.
 void put(org.csapi.IpService service, java.lang.String serviceToken)
          Stores the specified service token and service interface cross reference.
 void put(java.lang.String serviceToken, org.csapi.IpService service)
          Stores the specified service token and service interface cross reference.
 java.lang.String remove(org.csapi.IpService service)
          Removes the lookup corresponding to the specified service.
 org.csapi.IpService remove(java.lang.String serviceToken)
          Removes the lookup corresponding to the specified token.
 java.lang.String[] tokens()
          Method tokens.
 java.lang.String toString()
          Defines a method used to provide the caller with a string representation of the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenAndServiceMap

public TokenAndServiceMap()
Holds references to services and their token identifier.

Method Detail

put

public void put(java.lang.String serviceToken,
                org.csapi.IpService service)
Stores the specified service token and service interface cross reference.

Parameters:
serviceToken - the service token
service - the service

put

public void put(org.csapi.IpService service,
                java.lang.String serviceToken)
Stores the specified service token and service interface cross reference.

Parameters:
service - the service
serviceToken - the service token

get

public org.csapi.IpService get(java.lang.String serviceToken)
Retrieves the service corresponding to the specified token.

Parameters:
serviceToken - the service token
Returns:
the service

get

public java.lang.String get(org.csapi.IpService service)
Retrieves the token corresponding to the specified service.

Parameters:
service - the service
Returns:
the service token

remove

public org.csapi.IpService remove(java.lang.String serviceToken)
Removes the lookup corresponding to the specified token.

Parameters:
serviceToken - the service token
Returns:
the service

remove

public java.lang.String remove(org.csapi.IpService service)
Removes the lookup corresponding to the specified service.

Parameters:
service - the service
Returns:
the service token

tokens

public java.lang.String[] tokens()
Method tokens.

Returns:
String[]

clear

public void clear()
Removes all mappings from this map.


toString

public java.lang.String toString()
Defines a method used to provide the caller with a string representation of the class.

Overrides:
toString in class java.lang.Object
Returns:
This is an developer defined representation of the class object as a string


Copyright © 2009. All Rights Reserved.