1 7 8 package java.security.cert; 9 10 30 public class LDAPCertStoreParameters implements CertStoreParameters { 31 32 private static final int LDAP_DEFAULT_PORT = 389; 33 34 37 private int port; 38 39 42 private String serverName; 43 44 53 public LDAPCertStoreParameters(String serverName, int port) { 54 if (serverName == null) 55 throw new NullPointerException (); 56 this.serverName = serverName; 57 this.port = port; 58 } 59 60 68 public LDAPCertStoreParameters(String serverName) { 69 this(serverName, LDAP_DEFAULT_PORT); 70 } 71 72 76 public LDAPCertStoreParameters() { 77 this("localhost", LDAP_DEFAULT_PORT); 78 } 79 80 85 public String getServerName() { 86 return serverName; 87 } 88 89 94 public int getPort() { 95 return port; 96 } 97 98 109 public Object clone() { 110 try { 111 return super.clone(); 112 } catch (CloneNotSupportedException e) { 113 114 throw new InternalError (e.toString()); 115 } 116 } 117 118 123 public String toString() { 124 StringBuffer sb = new StringBuffer (); 125 sb.append("LDAPCertStoreParameters: [\n"); 126 127 sb.append(" serverName: " + serverName + "\n"); 128 sb.append(" port: " + port + "\n"); 129 sb.append("]"); 130 return sb.toString(); 131 } 132 } 133 | Popular Tags |