PHP Class LdapTools\Connection\LdapServerPool

Author: Chad Sikorra ([email protected])
Mostrar archivo Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$config LdapTools\DomainConfiguration
$dns LdapTools\Utilities\Dns
$selectionMethod The method to use when ordering the servers array.
$tcp LdapTools\Utilities\TcpSocket

Public Methods

Method Description
__construct ( DomainConfiguration $config, TcpSocket $tcp = null, Dns $dns = null )
getSelectionMethod ( ) : string Get the selection method for checking servers.
getServer ( ) : string Retrieve the first available LDAP server.
getSortedServersArray ( ) : array Uses the selected method to decide how to return the server array for the check.
setSelectionMethod ( string $method ) Set the selection method for checking servers (ie. 'random', 'order').

Protected Methods

Method Description
getServersFromDns ( ) : array Attempt to lookup the LDAP servers from the DNS name.
isServerAvailable ( string $server ) : boolean Check if a LDAP server is up and available.
shuffleServers ( array $servers ) : array Returns a randomized array of the servers.

Method Details

__construct() public method

public __construct ( DomainConfiguration $config, TcpSocket $tcp = null, Dns $dns = null )
$config LdapTools\DomainConfiguration
$tcp LdapTools\Utilities\TcpSocket
$dns LdapTools\Utilities\Dns

getSelectionMethod() public method

Get the selection method for checking servers.
public getSelectionMethod ( ) : string
return string

getServer() public method

Retrieve the first available LDAP server.
public getServer ( ) : string
return string

getServersFromDns() protected method

Attempt to lookup the LDAP servers from the DNS name.
protected getServersFromDns ( ) : array
return array The LDAP servers.

getSortedServersArray() public method

Uses the selected method to decide how to return the server array for the check.
public getSortedServersArray ( ) : array
return array

isServerAvailable() protected method

Check if a LDAP server is up and available.
protected isServerAvailable ( string $server ) : boolean
$server string
return boolean

setSelectionMethod() public method

Set the selection method for checking servers (ie. 'random', 'order').
public setSelectionMethod ( string $method )
$method string

shuffleServers() protected method

Returns a randomized array of the servers.
protected shuffleServers ( array $servers ) : array
$servers array
return array

Property Details

$config protected_oe property

protected DomainConfiguration,LdapTools $config
return LdapTools\DomainConfiguration

$dns protected_oe property

protected Dns,LdapTools\Utilities $dns
return LdapTools\Utilities\Dns

$selectionMethod protected_oe property

The method to use when ordering the servers array.
protected $selectionMethod

$tcp protected_oe property

protected TcpSocket,LdapTools\Utilities $tcp
return LdapTools\Utilities\TcpSocket