jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java
changeset 18551 882a3948c6e6
parent 14342 8435a30053c1
child 24969 afa6934dd8e8
equal deleted inserted replaced
18550:6d0f51c99930 18551:882a3948c6e6
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package java.security.cert;
    26 package java.security.cert;
    27 
    27 
    28 /**
    28 /**
    29  * Parameters used as input for the LDAP <code>CertStore</code> algorithm.
    29  * Parameters used as input for the LDAP {@code CertStore} algorithm.
    30  * <p>
    30  * <p>
    31  * This class is used to provide necessary configuration parameters (server
    31  * This class is used to provide necessary configuration parameters (server
    32  * name and port number) to implementations of the LDAP <code>CertStore</code>
    32  * name and port number) to implementations of the LDAP {@code CertStore}
    33  * algorithm.
    33  * algorithm.
    34  * <p>
    34  * <p>
    35  * <b>Concurrent Access</b>
    35  * <b>Concurrent Access</b>
    36  * <p>
    36  * <p>
    37  * Unless otherwise specified, the methods defined in this class are not
    37  * Unless otherwise specified, the methods defined in this class are not
    57      * the DNS name of the LDAP server
    57      * the DNS name of the LDAP server
    58      */
    58      */
    59     private String serverName;
    59     private String serverName;
    60 
    60 
    61     /**
    61     /**
    62      * Creates an instance of <code>LDAPCertStoreParameters</code> with the
    62      * Creates an instance of {@code LDAPCertStoreParameters} with the
    63      * specified parameter values.
    63      * specified parameter values.
    64      *
    64      *
    65      * @param serverName the DNS name of the LDAP server
    65      * @param serverName the DNS name of the LDAP server
    66      * @param port the port number of the LDAP server
    66      * @param port the port number of the LDAP server
    67      * @exception NullPointerException if <code>serverName</code> is
    67      * @exception NullPointerException if {@code serverName} is
    68      * <code>null</code>
    68      * {@code null}
    69      */
    69      */
    70     public LDAPCertStoreParameters(String serverName, int port) {
    70     public LDAPCertStoreParameters(String serverName, int port) {
    71         if (serverName == null)
    71         if (serverName == null)
    72             throw new NullPointerException();
    72             throw new NullPointerException();
    73         this.serverName = serverName;
    73         this.serverName = serverName;
    74         this.port = port;
    74         this.port = port;
    75     }
    75     }
    76 
    76 
    77     /**
    77     /**
    78      * Creates an instance of <code>LDAPCertStoreParameters</code> with the
    78      * Creates an instance of {@code LDAPCertStoreParameters} with the
    79      * specified server name and a default port of 389.
    79      * specified server name and a default port of 389.
    80      *
    80      *
    81      * @param serverName the DNS name of the LDAP server
    81      * @param serverName the DNS name of the LDAP server
    82      * @exception NullPointerException if <code>serverName</code> is
    82      * @exception NullPointerException if {@code serverName} is
    83      * <code>null</code>
    83      * {@code null}
    84      */
    84      */
    85     public LDAPCertStoreParameters(String serverName) {
    85     public LDAPCertStoreParameters(String serverName) {
    86         this(serverName, LDAP_DEFAULT_PORT);
    86         this(serverName, LDAP_DEFAULT_PORT);
    87     }
    87     }
    88 
    88 
    89     /**
    89     /**
    90      * Creates an instance of <code>LDAPCertStoreParameters</code> with the
    90      * Creates an instance of {@code LDAPCertStoreParameters} with the
    91      * default parameter values (server name "localhost", port 389).
    91      * default parameter values (server name "localhost", port 389).
    92      */
    92      */
    93     public LDAPCertStoreParameters() {
    93     public LDAPCertStoreParameters() {
    94         this("localhost", LDAP_DEFAULT_PORT);
    94         this("localhost", LDAP_DEFAULT_PORT);
    95     }
    95     }
    96 
    96 
    97     /**
    97     /**
    98      * Returns the DNS name of the LDAP server.
    98      * Returns the DNS name of the LDAP server.
    99      *
    99      *
   100      * @return the name (not <code>null</code>)
   100      * @return the name (not {@code null})
   101      */
   101      */
   102     public String getServerName() {
   102     public String getServerName() {
   103         return serverName;
   103         return serverName;
   104     }
   104     }
   105 
   105 
   115     /**
   115     /**
   116      * Returns a copy of this object. Changes to the copy will not affect
   116      * Returns a copy of this object. Changes to the copy will not affect
   117      * the original and vice versa.
   117      * the original and vice versa.
   118      * <p>
   118      * <p>
   119      * Note: this method currently performs a shallow copy of the object
   119      * Note: this method currently performs a shallow copy of the object
   120      * (simply calls <code>Object.clone()</code>). This may be changed in a
   120      * (simply calls {@code Object.clone()}). This may be changed in a
   121      * future revision to perform a deep copy if new parameters are added
   121      * future revision to perform a deep copy if new parameters are added
   122      * that should not be shared.
   122      * that should not be shared.
   123      *
   123      *
   124      * @return the copy
   124      * @return the copy
   125      */
   125      */