FileDocCategorySizeDatePackage
LDAPCertStoreParameters.javaAPI DocJava SE 5 API3867Fri Aug 26 14:57:16 BST 2005java.security.cert

LDAPCertStoreParameters

public class LDAPCertStoreParameters extends Object implements CertStoreParameters
Parameters used as input for the LDAP CertStore algorithm.

This class is used to provide necessary configuration parameters (server name and port number) to implementations of the LDAP CertStore algorithm.

Concurrent Access

Unless otherwise specified, the methods defined in this class are not thread-safe. Multiple threads that need to access a single object concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating separate objects need not synchronize.

version
1.8 12/19/03
since
1.4
author
Steve Hanna
see
CertStore

Fields Summary
private static final int
LDAP_DEFAULT_PORT
private int
port
the port number of the LDAP server
private String
serverName
the DNS name of the LDAP server
Constructors Summary
public LDAPCertStoreParameters(String serverName, int port)
Creates an instance of LDAPCertStoreParameters with the specified parameter values.

param
serverName the DNS name of the LDAP server
param
port the port number of the LDAP server
exception
NullPointerException if serverName is null


                                           
         
        if (serverName == null)
            throw new NullPointerException();
        this.serverName = serverName;
        this.port = port;
    
public LDAPCertStoreParameters(String serverName)
Creates an instance of LDAPCertStoreParameters with the specified server name and a default port of 389.

param
serverName the DNS name of the LDAP server
exception
NullPointerException if serverName is null

	this(serverName, LDAP_DEFAULT_PORT);
    
public LDAPCertStoreParameters()
Creates an instance of LDAPCertStoreParameters with the default parameter values (server name "localhost", port 389).

        this("localhost", LDAP_DEFAULT_PORT);
    
Methods Summary
public java.lang.Objectclone()
Returns a copy of this object. Changes to the copy will not affect the original and vice versa.

Note: this method currently performs a shallow copy of the object (simply calls Object.clone()). This may be changed in a future revision to perform a deep copy if new parameters are added that should not be shared.

return
the copy

        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            /* Cannot happen */
            throw new InternalError(e.toString());
        }
    
public intgetPort()
Returns the port number of the LDAP server.

return
the port number

        return port;
    
public java.lang.StringgetServerName()
Returns the DNS name of the LDAP server.

return
the name (not null)

        return serverName;
    
public java.lang.StringtoString()
Returns a formatted string describing the parameters.

return
a formatted string describing the parameters

        StringBuffer sb = new StringBuffer();
        sb.append("LDAPCertStoreParameters: [\n");

        sb.append("  serverName: " + serverName + "\n");
        sb.append("  port: " + port + "\n");
        sb.append("]");
        return sb.toString();