Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.ldap
Interface LdapDirectorySet

All Superinterfaces:
EventListener, Iterable<LdapDirectory>, LdapEventManager, LdapListener
All Known Implementing Classes:
LdapDirectorySetImpl

public interface LdapDirectorySet
extends Iterable<LdapDirectory>, LdapEventManager, LdapListener

The LdapDirectorySet is a simple data structure linking server names (ie displayed name) to LdapDirectory objects. It store all the servers registered in the configuration and provides methods that address them all.

Author:
Sebastien Mazy

Method Summary
 boolean addServer(LdapDirectory server)
          Tries to add an LdapDirectory to the LdapDirectorySet
 boolean containsServerWithName(String name)
           
 SortedSet<LdapDirectory> getDisabledServers()
          Returns a set of the marked disabled LdapDirectory(s) alphabetically sorted
 SortedSet<LdapDirectory> getEnabledServers()
          Returns a set of the marked enabled LdapDirectory(s) alphabetically sorted
 LdapDirectory getServerWithName(String name)
           
 LdapDirectory removeServerWithName(String name)
          Tries to remove an LdapDirectory from the LdapDirectorySet using the name given by the getName method.
 void searchPerson(LdapQuery query, LdapListener caller, LdapSearchSettings searchSettings)
          Performs a search on every enabled LdapDirectory of this set.
 void searchPerson(Set<LdapDirectory> servers, LdapQuery query, LdapListener caller, LdapSearchSettings searchSettings)
          Performs a search on every LdapDirectory provided
 int size()
           
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface net.java.sip.communicator.service.ldap.event.LdapEventManager
addLdapListener, fireLdapEvent, fireLdapEvent, removeLdapListener
 
Methods inherited from interface net.java.sip.communicator.service.ldap.event.LdapListener
ldapEventReceived
 

Method Detail

getServerWithName

LdapDirectory getServerWithName(String name)
Parameters:
name - server name
Returns:
the LdapDirectory with name name or null if it isn't present in the LdapDirectorySet

removeServerWithName

LdapDirectory removeServerWithName(String name)
Tries to remove an LdapDirectory from the LdapDirectorySet using the name given by the getName method.

Parameters:
name - name of the LdapDirectory to remove
Returns:
LdapDirectory removed LdapDirectory or null if failed

addServer

boolean addServer(LdapDirectory server)
Tries to add an LdapDirectory to the LdapDirectorySet

Parameters:
server - the server to be added
Returns:
whether it succeeded

containsServerWithName

boolean containsServerWithName(String name)
Parameters:
name - of the server to check presence in the LdapDirectorySet
Returns:
whether the server is in the LdapDirectorySet

size

int size()
Returns:
the number of LdapDirectory(s) in the LdapDirectorySet

getEnabledServers

SortedSet<LdapDirectory> getEnabledServers()
Returns a set of the marked enabled LdapDirectory(s) alphabetically sorted

Returns:
a set of the enabled LdapDirectory(s)

getDisabledServers

SortedSet<LdapDirectory> getDisabledServers()
Returns a set of the marked disabled LdapDirectory(s) alphabetically sorted

Returns:
a set of the disabled LdapDirectory(s)

searchPerson

void searchPerson(Set<LdapDirectory> servers,
                  LdapQuery query,
                  LdapListener caller,
                  LdapSearchSettings searchSettings)
Performs a search on every LdapDirectory provided

Parameters:
servers - a set of LdapDirectory to search for the person
query - the query to perform
caller - the LdapListener that will receive the results
searchSettings - the custom settings for this search

searchPerson

void searchPerson(LdapQuery query,
                  LdapListener caller,
                  LdapSearchSettings searchSettings)
Performs a search on every enabled LdapDirectory of this set.

Parameters:
query - the query to perform
caller - the LdapListener that will receive the results
searchSettings - the custom settings for this search

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.