Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.impl.ldap.LdapDirectorySettingsImpl
All Implemented Interfaces:
Cloneable, LdapConstants, LdapDirectorySettings

public class LdapDirectorySettingsImpl
extends Object
implements LdapDirectorySettings

Author:
Sebastien Mazy Implementation of LdapDirectorySettings a wrapper around the settings needed to create an LdapDirectory

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.java.sip.communicator.service.ldap.LdapConstants
LdapConstants.Auth, LdapConstants.Encryption, LdapConstants.Scope
 
Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.ldap.LdapConstants
LDAP_CONNECT_TIMEOUT, LDAP_READ_TIMEOUT
 
Constructor Summary
LdapDirectorySettingsImpl()
          Simple constructor for this class, sets default values, note that you won't be able to create an LdapDirectory with these defaults (empty name, empty hostname forbidden by LdapDirectory)
LdapDirectorySettingsImpl(LdapDirectorySettingsImpl settings)
          Constructor.
 
Method Summary
 LdapDirectorySettings clone()
          Clone this object.
 boolean equals(LdapDirectorySettings other)
          Checks if both LdapDirectorySettings instance have the same content
 LdapConstants.Auth getAuth()
          simple getter for auth
 String getBaseDN()
          simple getter for baseDN
 String getBindDN()
          simple getter for bindDN
 LdapConstants.Encryption getEncryption()
          simple getter for encryption
 String getGlobalPhonePrefix()
          Returns the global prefix to be used when calling phones from this ldap source.
 List<String> getHomePhoneSearchFields()
          Returns home phone fields that we will lookup.
 String getHostname()
          simple getter for hostname
 List<String> getMailSearchFields()
          Returns mail fields that we will lookup.
 String getMailSuffix()
          Returns mail suffix.
 List<String> getMobilePhoneSearchFields()
          Returns mobile phone fields that we will lookup.
 String getName()
          simple getter for name
 String getPassword()
          simple getter for password
 int getPort()
          simple getter for port
 LdapConstants.Scope getScope()
          Returns the search scope: one level under the base distinguished name or all the subtree.
 String getUserName()
          Returns the user name associated with the corresponding ldap directory.
 List<String> getWorkPhoneSearchFields()
          Returns work phone fields that we will lookup.
 int hashCode()
          Returns the hash code for this instance.
 boolean isEnabled()
          Simple getter for enabled.
static List<String> mergeString(String attrs)
          Merge String elements separated by space into a List.
static String mergeStrings(List<String> lst)
          Merge String elements from a list to a single String separated by space.
 void persistentLoad(String name)
          Loads the settings with the given name from the config files into the LdapDirectorySetting.
 void persistentRemove()
          Removes settings with this name from the configuration files (package private)
 void persistentSave()
          Saves these settings through the configuration service
 void setAuth(LdapConstants.Auth auth)
          simple setter for auth
 void setBaseDN(String baseDN)
          simple setter for baseDN
 void setBindDN(String bindDN)
          simple setter for bindDN
 void setEnabled(boolean enabled)
          simple setter for enabled.
 void setEncryption(LdapConstants.Encryption encryption)
          simple setter for encryption
 void setGlobalPhonePrefix(String prefix)
          Sets the global prefix to be used when calling phones from this ldap source.
 void setHomePhoneSearchFields(List<String> list)
          Set home phone fields that we will lookup.
 void setHostname(String hostname)
          simple setter for hostname
 void setMailSearchFields(List<String> list)
          Set mail fields that we will lookup.
 void setMailSuffix(String suffix)
          Set mail suffix.
 void setMobilePhoneSearchFields(List<String> list)
          Set mobile phone fields that we will lookup.
 void setName(String name)
          simple setter for name
 void setPassword(String password)
          simple setter for password
 void setPort(int port)
          simple setter for port
 void setScope(LdapConstants.Scope scope)
          Sets the search scope: one level under the base distinguished name or all the subtree.
 void setWorkPhoneSearchFields(List<String> list)
          Set work phone fields that we will lookup.
 String toString()
          meant for debugging
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapDirectorySettingsImpl

public LdapDirectorySettingsImpl()
Simple constructor for this class, sets default values, note that you won't be able to create an LdapDirectory with these defaults (empty name, empty hostname forbidden by LdapDirectory)


LdapDirectorySettingsImpl

public LdapDirectorySettingsImpl(LdapDirectorySettingsImpl settings)
Constructor.

Parameters:
settings - existing settings
Method Detail

getName

public String getName()
simple getter for name

Specified by:
getName in interface LdapDirectorySettings
Returns:
the name property

setName

public void setName(String name)
simple setter for name

Specified by:
setName in interface LdapDirectorySettings
Parameters:
name - the name property

isEnabled

public boolean isEnabled()
Simple getter for enabled. Required by LdapDirectorySettings interface.

Specified by:
isEnabled in interface LdapDirectorySettings
Returns:
whether the server is marked as enabled
See Also:
LdapDirectorySettings.isEnabled()

setEnabled

public void setEnabled(boolean enabled)
simple setter for enabled. Required by LdapDirectorySettings interface.

Specified by:
setEnabled in interface LdapDirectorySettings
Parameters:
enabled - whether the server is marked as enabled
See Also:
LdapDirectorySettings.setEnabled(boolean)

getHostname

public String getHostname()
simple getter for hostname

Specified by:
getHostname in interface LdapDirectorySettings
Returns:
the hostname property

setHostname

public void setHostname(String hostname)
simple setter for hostname

Specified by:
setHostname in interface LdapDirectorySettings
Parameters:
hostname - the hostname property

getEncryption

public LdapConstants.Encryption getEncryption()
simple getter for encryption

Specified by:
getEncryption in interface LdapDirectorySettings
Returns:
the encryption property
See Also:
LdapConstants.Encryption

setEncryption

public void setEncryption(LdapConstants.Encryption encryption)
simple setter for encryption

Specified by:
setEncryption in interface LdapDirectorySettings
Parameters:
encryption - the encryption property
See Also:
LdapConstants.Encryption

getPort

public int getPort()
simple getter for port

Specified by:
getPort in interface LdapDirectorySettings
Returns:
the port property

setPort

public void setPort(int port)
simple setter for port

Specified by:
setPort in interface LdapDirectorySettings
Parameters:
port - the port property

getAuth

public LdapConstants.Auth getAuth()
simple getter for auth

Specified by:
getAuth in interface LdapDirectorySettings
Returns:
the auth property
See Also:
LdapConstants.Auth

setAuth

public void setAuth(LdapConstants.Auth auth)
simple setter for auth

Specified by:
setAuth in interface LdapDirectorySettings
Parameters:
auth - the auth property
See Also:
LdapConstants.Auth

getBindDN

public String getBindDN()
simple getter for bindDN

Specified by:
getBindDN in interface LdapDirectorySettings
Returns:
the bindDN property

getUserName

public String getUserName()
Returns the user name associated with the corresponding ldap directory.

Returns:
the user name associated with the corresponding ldap directory

setBindDN

public void setBindDN(String bindDN)
simple setter for bindDN

Specified by:
setBindDN in interface LdapDirectorySettings
Parameters:
bindDN - the bindDN property

getPassword

public String getPassword()
simple getter for password

Specified by:
getPassword in interface LdapDirectorySettings
Returns:
the password property

setPassword

public void setPassword(String password)
simple setter for password

Specified by:
setPassword in interface LdapDirectorySettings
Parameters:
password - the password property

getBaseDN

public String getBaseDN()
simple getter for baseDN

Specified by:
getBaseDN in interface LdapDirectorySettings
Returns:
the baseDN property

setBaseDN

public void setBaseDN(String baseDN)
simple setter for baseDN

Specified by:
setBaseDN in interface LdapDirectorySettings
Parameters:
baseDN - the baseDN property

getScope

public LdapConstants.Scope getScope()
Returns the search scope: one level under the base distinguished name or all the subtree. Required by LdapDirectorySettings interface.

Specified by:
getScope in interface LdapDirectorySettings
Returns:
the search scope
See Also:
LdapConstants.Scope, LdapDirectorySettings.getScope()

setScope

public void setScope(LdapConstants.Scope scope)
Sets the search scope: one level under the base distinguished name or all the subtree. Required by LdapDirectorySettings interface.

Specified by:
setScope in interface LdapDirectorySettings
Parameters:
scope - the new search scope
See Also:
LdapConstants.Scope, LdapDirectorySettings.setScope(net.java.sip.communicator.service.ldap.LdapConstants.Scope)

getGlobalPhonePrefix

public String getGlobalPhonePrefix()
Returns the global prefix to be used when calling phones from this ldap source.

Specified by:
getGlobalPhonePrefix in interface LdapDirectorySettings
Returns:
the global prefix to be used when calling phones from this ldap source

setGlobalPhonePrefix

public void setGlobalPhonePrefix(String prefix)
Sets the global prefix to be used when calling phones from this ldap source.

Specified by:
setGlobalPhonePrefix in interface LdapDirectorySettings
Parameters:
prefix - the global prefix to be used when calling phones from this ldap source

equals

public boolean equals(LdapDirectorySettings other)
Checks if both LdapDirectorySettings instance have the same content

Specified by:
equals in interface LdapDirectorySettings
Parameters:
other - object to compare
Returns:
whether both LdapDirectorySettings instance have the same content
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Returns the hash code for this instance. It has to be consistent with equals.

Specified by:
hashCode in interface LdapDirectorySettings
Overrides:
hashCode in class Object
Returns:
the hash code dor this instance
See Also:
Object.hashCode()

getMailSearchFields

public List<String> getMailSearchFields()
Returns mail fields that we will lookup.

Specified by:
getMailSearchFields in interface LdapDirectorySettings
Returns:
mail fields that we will lookup

setMailSearchFields

public void setMailSearchFields(List<String> list)
Set mail fields that we will lookup.

Specified by:
setMailSearchFields in interface LdapDirectorySettings
Parameters:
list - of mail fields that we will lookup

getMailSuffix

public String getMailSuffix()
Returns mail suffix.

Specified by:
getMailSuffix in interface LdapDirectorySettings
Returns:
mail suffix

setMailSuffix

public void setMailSuffix(String suffix)
Set mail suffix.

Specified by:
setMailSuffix in interface LdapDirectorySettings
Parameters:
suffix - mail suffix

getWorkPhoneSearchFields

public List<String> getWorkPhoneSearchFields()
Returns work phone fields that we will lookup.

Specified by:
getWorkPhoneSearchFields in interface LdapDirectorySettings
Returns:
work phone fields that we will lookup

setWorkPhoneSearchFields

public void setWorkPhoneSearchFields(List<String> list)
Set work phone fields that we will lookup.

Specified by:
setWorkPhoneSearchFields in interface LdapDirectorySettings
Parameters:
list - of work phone fields that we will lookup

getMobilePhoneSearchFields

public List<String> getMobilePhoneSearchFields()
Returns mobile phone fields that we will lookup.

Specified by:
getMobilePhoneSearchFields in interface LdapDirectorySettings
Returns:
mobile phone fields that we will lookup

setMobilePhoneSearchFields

public void setMobilePhoneSearchFields(List<String> list)
Set mobile phone fields that we will lookup.

Specified by:
setMobilePhoneSearchFields in interface LdapDirectorySettings
Parameters:
list - of mobile phone fields that we will lookup

getHomePhoneSearchFields

public List<String> getHomePhoneSearchFields()
Returns home phone fields that we will lookup.

Specified by:
getHomePhoneSearchFields in interface LdapDirectorySettings
Returns:
home phone fields that we will lookup

setHomePhoneSearchFields

public void setHomePhoneSearchFields(List<String> list)
Set home phone fields that we will lookup.

Specified by:
setHomePhoneSearchFields in interface LdapDirectorySettings
Parameters:
list - of home phone fields that we will lookup

mergeStrings

public static String mergeStrings(List<String> lst)
Merge String elements from a list to a single String separated by space.

Parameters:
lst - list of Strings
Returns:
String

mergeString

public static List<String> mergeString(String attrs)
Merge String elements separated by space into a List.

Parameters:
attrs - String
Returns:
list of String

persistentSave

public void persistentSave()
Saves these settings through the configuration service

Specified by:
persistentSave in interface LdapDirectorySettings
See Also:
LdapDirectorySettings.persistentSave()

persistentLoad

public void persistentLoad(String name)
Loads the settings with the given name from the config files into the LdapDirectorySetting.

Specified by:
persistentLoad in interface LdapDirectorySettings
Parameters:
name - name of the settings
See Also:
LdapDirectorySettings.persistentLoad(java.lang.String)

persistentRemove

public void persistentRemove()
Removes settings with this name from the configuration files (package private)

Specified by:
persistentRemove in interface LdapDirectorySettings
See Also:
LdapDirectorySettings.persistentRemove()

toString

public String toString()
meant for debugging

Overrides:
toString in class Object
Returns:
a string description of this instance

clone

public LdapDirectorySettings clone()
Description copied from interface: LdapDirectorySettings
Clone this object.

Specified by:
clone in interface LdapDirectorySettings
Overrides:
clone in class Object
Returns:
clone of this object

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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