local.server
Interface LocationService

All Superinterfaces:
Repository
All Known Implementing Classes:
LocationServiceImpl

public interface LocationService
extends Repository

LocationService is the interface used by a SIP registrar to access to a location repository.

A LocationService allows the maintinance of bindings between users and contacts.
For each user the LocationService should maintain information regarding:
- username, that is a fully qualified name for this service (e.g. alice@wonderland.net)
- data, that is an opaque block of data (a string), that can be set and fetched for any service-depending use,
- contacts/expires, that is the list of user contacts with the time when it expires,

LocationService has a set of methods for query and modifing such data.

Some of these methods include an optional parameter app that could be used to implement application-dependent mobility, i.e. lists of contacts that are specific for particular applications. This feature might be used by guessing the application by the SIP body (e.g. SDP) or by a new non-standard Application header (ref. [draft-XX.txt])


Method Summary
 LocationService addUserContact(java.lang.String user, org.zoolu.sip.address.NameAddress contact, java.util.Date expire)
          Adds a contact.
 java.util.Date getUserContactExpirationDate(java.lang.String user, java.lang.String url)
          Gets expiration date of the user contact.
 org.zoolu.sip.address.NameAddress getUserContactNameAddress(java.lang.String user, java.lang.String url)
          Gets NameAddress value of the user contact.
 java.util.Enumeration getUserContactURLs(java.lang.String user)
          Gets the user contacts that are not expired.
 boolean hasUserContact(java.lang.String user, java.lang.String url)
          Whether the user has contact url.
 boolean isUserContactExpired(java.lang.String user, java.lang.String url)
          Whether the contact is expired.
 LocationService removeAllContacts()
          Removes all contacts from the database.
 LocationService removeUserContact(java.lang.String user, java.lang.String url)
          Removes a contact.
 
Methods inherited from interface local.server.Repository
addUser, getUsers, hasUser, removeAllUsers, removeUser, size, sync, toString
 

Method Detail

hasUserContact

public boolean hasUserContact(java.lang.String user,
                              java.lang.String url)
Whether the user has contact url.
Parameters:
user - the user name
url - the contact URL
Returns:
true if is the contact present

addUserContact

public LocationService addUserContact(java.lang.String user,
                                      org.zoolu.sip.address.NameAddress contact,
                                      java.util.Date expire)
Adds a contact.
Parameters:
user - the user name
contact - the contact NameAddress
expire - the contact expire Date
Returns:
this object

getUserContactURLs

public java.util.Enumeration getUserContactURLs(java.lang.String user)
Gets the user contacts that are not expired.
Parameters:
user - the user name
Returns:
the list of contact URLs as Enumeration of String

removeUserContact

public LocationService removeUserContact(java.lang.String user,
                                         java.lang.String url)
Removes a contact.
Parameters:
user - the user name
url - the contact URL
Returns:
this object

getUserContactNameAddress

public org.zoolu.sip.address.NameAddress getUserContactNameAddress(java.lang.String user,
                                                                   java.lang.String url)
Gets NameAddress value of the user contact.
Parameters:
user - the user name
url - the contact URL
Returns:
the contact NameAddress

getUserContactExpirationDate

public java.util.Date getUserContactExpirationDate(java.lang.String user,
                                                   java.lang.String url)
Gets expiration date of the user contact.
Parameters:
user - the user name
url - the contact URL
Returns:
the contact expire Date

isUserContactExpired

public boolean isUserContactExpired(java.lang.String user,
                                    java.lang.String url)
Whether the contact is expired.
Parameters:
user - the user name
url - the contact URL
Returns:
true if it has expired

removeAllContacts

public LocationService removeAllContacts()
Removes all contacts from the database.
Returns:
this object