Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.ldap
Class LdapPersonFoundImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.ldap.LdapPersonFoundImpl
All Implemented Interfaces:
Comparable<LdapPersonFound>, LdapPersonFound

public class LdapPersonFoundImpl
extends Object
implements LdapPersonFound

Implementation of LdapPersonFound An LdapPersonFound is contained in each LdapEvent sent by an LdapDirectory after a successful LDAP search. Each instance corresponds to a person found in the LDAP directory, as well as its contact addresses.

Author:
Sebastien Mazy

Constructor Summary
LdapPersonFoundImpl(LdapDirectoryImpl server, String dn, LdapQuery query)
          the constructor for this class
 
Method Summary
 void addHomePhone(String telephoneNumber)
          Adds a home telephone number to this person
 void addMail(String mail)
          Adds a mail address to this person
 void addMobilePhone(String telephoneNumber)
          Adds a mobile telephone number to this person
 void addWorkPhone(String telephoneNumber)
          Adds a work telephone number to this person
 int compareTo(LdapPersonFound other)
          Compare this object with another ones.
 boolean equals(Object o)
          Test equality between this object and another ones.
 byte[] fetchPhoto()
          Tries to fetch the photo in the the directory for this person
 Set<String> getAllPhone()
          Returns telephone numbers from this person
 String getDepartment()
          Returns the department found in the the directory for this person
 String getDisplayName()
          Returns the name/pseudo found in the the directory for this person
 String getDN()
          Returns the distinguished name for this person
 String getFirstName()
          Returns the first name found in the the directory for this person
 Set<String> getHomePhone()
          Returns home telephone numbers from this person
 Set<String> getMail()
          Returns mail addresss from this person
 Set<String> getMobilePhone()
          Returns mobile telephone numbers from this person
 String getOrganization()
          Returns the organization found in the the directory for this person
 LdapQuery getQuery()
          Returns the query which this Ldap person found is a result of
 LdapDirectory getServer()
          Returns the server which this person was found on
 String getSurname()
          Returns the surname found in the the directory for this person
 Set<String> getWorkPhone()
          Returns work telephone numbers from this person
 void setDepartment(String department)
          Sets the department found in the the directory for this person
 void setDisplayName(String name)
          Sets the name/pseudo found in the the directory for this person
 void setFirstName(String firstName)
          Sets the first name found in the the directory for this person
 void setOrganization(String organization)
          Sets the organization found in the the directory for this person
 void setSurname(String surname)
          Sets the surname found in the the directory for this person
 String toString()
          A string representation of this LdapPersonFoundImpl (created for debugging purposes)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapPersonFoundImpl

public LdapPersonFoundImpl(LdapDirectoryImpl server,
                           String dn,
                           LdapQuery query)
the constructor for this class

Parameters:
server - the server on which this person was found
dn - distinguished name for this person in the directory
query - the search query
Method Detail

getQuery

public LdapQuery getQuery()
Returns the query which this Ldap person found is a result of

Specified by:
getQuery in interface LdapPersonFound
Returns:
the initial query

getServer

public LdapDirectory getServer()
Returns the server which this person was found on

Specified by:
getServer in interface LdapPersonFound
Returns:
the server

setDisplayName

public void setDisplayName(String name)
Sets the name/pseudo found in the the directory for this person

Specified by:
setDisplayName in interface LdapPersonFound
Parameters:
name - the name/pseudo found in the the directory for this person

getDisplayName

public String getDisplayName()
Returns the name/pseudo found in the the directory for this person

Specified by:
getDisplayName in interface LdapPersonFound
Returns:
the name/pseudo found in the the directory for this person

fetchPhoto

public byte[] fetchPhoto()
Tries to fetch the photo in the the directory for this person

Specified by:
fetchPhoto in interface LdapPersonFound
Returns:
the photo found in the the directory for this person or null if not found

setFirstName

public void setFirstName(String firstName)
Sets the first name found in the the directory for this person

Specified by:
setFirstName in interface LdapPersonFound
Parameters:
firstName - the name/pseudo found in the the directory for this person

getFirstName

public String getFirstName()
Returns the first name found in the the directory for this person

Specified by:
getFirstName in interface LdapPersonFound
Returns:
the first name found in the the directory for this person

setSurname

public void setSurname(String surname)
Sets the surname found in the the directory for this person

Specified by:
setSurname in interface LdapPersonFound
Parameters:
surname - the surname found in the the directory for this person

getSurname

public String getSurname()
Returns the surname found in the the directory for this person

Specified by:
getSurname in interface LdapPersonFound
Returns:
the surname found in the the directory for this person

setOrganization

public void setOrganization(String organization)
Sets the organization found in the the directory for this person

Specified by:
setOrganization in interface LdapPersonFound
Parameters:
organization - the organization found in the the directory for this person

getOrganization

public String getOrganization()
Returns the organization found in the the directory for this person

Specified by:
getOrganization in interface LdapPersonFound
Returns:
the organization found in the the directory for this person

setDepartment

public void setDepartment(String department)
Sets the department found in the the directory for this person

Specified by:
setDepartment in interface LdapPersonFound
Parameters:
department - the department found in the the directory for this person

getDepartment

public String getDepartment()
Returns the department found in the the directory for this person

Specified by:
getDepartment in interface LdapPersonFound
Returns:
the department found in the the directory for this person

addMail

public void addMail(String mail)
Adds a mail address to this person

Specified by:
addMail in interface LdapPersonFound
Parameters:
mail - the mail address

getMail

public Set<String> getMail()
Returns mail addresss from this person

Specified by:
getMail in interface LdapPersonFound
Returns:
mail addresss from this person

getAllPhone

public Set<String> getAllPhone()
Returns telephone numbers from this person

Specified by:
getAllPhone in interface LdapPersonFound
Returns:
telephone numbers from this person

addWorkPhone

public void addWorkPhone(String telephoneNumber)
Adds a work telephone number to this person

Specified by:
addWorkPhone in interface LdapPersonFound
Parameters:
telephoneNumber - the work telephone number

getWorkPhone

public Set<String> getWorkPhone()
Returns work telephone numbers from this person

Specified by:
getWorkPhone in interface LdapPersonFound
Returns:
work telephone numbers from this person

addMobilePhone

public void addMobilePhone(String telephoneNumber)
Adds a mobile telephone number to this person

Specified by:
addMobilePhone in interface LdapPersonFound
Parameters:
telephoneNumber - the mobile telephone number

getMobilePhone

public Set<String> getMobilePhone()
Returns mobile telephone numbers from this person

Specified by:
getMobilePhone in interface LdapPersonFound
Returns:
mobile telephone numbers from this person

addHomePhone

public void addHomePhone(String telephoneNumber)
Adds a home telephone number to this person

Specified by:
addHomePhone in interface LdapPersonFound
Parameters:
telephoneNumber - the home telephone number

getHomePhone

public Set<String> getHomePhone()
Returns home telephone numbers from this person

Specified by:
getHomePhone in interface LdapPersonFound
Returns:
home telephone numbers from this person

getDN

public String getDN()
Returns the distinguished name for this person

Specified by:
getDN in interface LdapPersonFound
Returns:
the distinguished name for this person

toString

public String toString()
A string representation of this LdapPersonFoundImpl (created for debugging purposes)

Overrides:
toString in class Object
Returns:
a printable String

compareTo

public int compareTo(LdapPersonFound other)
Compare this object with another ones.

Specified by:
compareTo in interface Comparable<LdapPersonFound>
Parameters:
other - other object to compare with
Returns:
negative integer if less, 0 if equals and positive integer if over

equals

public boolean equals(Object o)
Test equality between this object and another ones.

Overrides:
equals in class Object
Returns:
true if the two objects are equal, false otherwise

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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