Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.naming.jmod - Naming Module
JDK 17 java.naming.jmod is the JMOD file for JDK 17 Naming module.
JDK 17 Naming module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.naming.jmod.
JDK 17 Naming module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Naming module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.naming.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/jndi/ldap/ClientId.java
/* * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.jndi.ldap; import java.util.Locale; import java.util.Arrays; // JDK 1.2 import java.io.OutputStream; import javax.naming.ldap.Control; import java.lang.reflect.Method; import javax.net.SocketFactory; /** * Represents identity information about an anonymous LDAP connection. * This base class contains the following information: * - protocol version number * - server's hostname (case-insensitive) * - server's port number * - prototype type (plain or ssl) * - controls to be sent with the LDAP bind request * * All other identity classes must be a subclass of ClientId. * Identity subclasses would add more distinguishing information, depending * on the type of authentication that the connection is to have. * * The equals() and hashCode() methods of this class and its subclasses are * important because they are used to determine whether two requests for * the same connection are identical, and thus whether the same connection * may be shared. This is especially important for authenticated connections * because a mistake would result in a serious security violation. * * @author Rosanna Lee */ class ClientId { private final int version; private final String hostname; private final int port; private final String protocol; private final Control[] bindCtls; private final OutputStream trace; private final String socketFactory; private final int myHash; private final int ctlHash; private SocketFactory factory = null; private Method sockComparator = null; private boolean isDefaultSockFactory = false; public static final boolean debug = false; ClientId(int version, String hostname, int port, String protocol, Control[] bindCtls, OutputStream trace, String socketFactory) { this.version = version; this.hostname = hostname.toLowerCase(Locale.ENGLISH); // ignore case this.port = port; this.protocol = protocol; this.bindCtls = (bindCtls != null ? bindCtls.clone() : null); this.trace = trace; // // Needed for custom socket factory pooling // this.socketFactory = socketFactory; if ((socketFactory != null) && !socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) { try { Class<?> socketFactoryClass = Obj.helper.loadClass(socketFactory); this.sockComparator = socketFactoryClass.getMethod( "compare", new Class<?>[]{Object.class, Object.class}); Method getDefault = socketFactoryClass.getMethod( "getDefault", new Class<?>[]{}); this.factory = (SocketFactory)getDefault.invoke(null, new Object[]{}); } catch (Exception e) { // Ignore it here, the same exceptions are/will be handled by // LdapPoolManager and Connection classes. if (debug) { System.out.println("ClientId received an exception"); e.printStackTrace(); } } } else { isDefaultSockFactory = true; } // The SocketFactory field is not used in the myHash // computation as there is no right way to compute the hash code // for this field. There is no harm in skipping it from the hash // computation myHash = version + port + (trace != null ? trace.hashCode() : 0) + (this.hostname != null ? this.hostname.hashCode() : 0) + (protocol != null ? protocol.hashCode() : 0) + (ctlHash=hashCodeControls(bindCtls)); } public boolean equals(Object obj) { if (!(obj instanceof ClientId)) { return false; } ClientId other = (ClientId)obj; return myHash == other.myHash && version == other.version && port == other.port && trace == other.trace && (hostname == other.hostname // null OK || (hostname != null && hostname.equals(other.hostname))) && (protocol == other.protocol // null OK || (protocol != null && protocol.equals(other.protocol))) && ctlHash == other.ctlHash && (equalsControls(bindCtls, other.bindCtls)) && (equalsSockFactory(other)); } public int hashCode() { return myHash; } private static int hashCodeControls(Control[] c) { if (c == null) { return 0; } int code = 0; for (int i = 0; i < c.length; i++) { code = code * 31 + c[i].getID().hashCode(); } return code; } private static boolean equalsControls(Control[] a, Control[] b) { if (a == b) { return true; // both null or same } if (a == null || b == null) { return false; // one is non-null } if (a.length != b.length) { return false; } for (int i = 0; i < a.length; i++) { if (!a[i].getID().equals(b[i].getID()) || a[i].isCritical() != b[i].isCritical() || !Arrays.equals(a[i].getEncodedValue(), b[i].getEncodedValue())) { return false; } } return true; } private boolean equalsSockFactory(ClientId other) { if (this.isDefaultSockFactory && other.isDefaultSockFactory) { return true; } else if (!other.isDefaultSockFactory) { return invokeComparator(other, this); } else { return invokeComparator(this, other); } } // delegate the comparison work to the SocketFactory class // as there is no enough information here, to do the comparison private boolean invokeComparator(ClientId c1, ClientId c2) { Object ret; try { ret = (c1.sockComparator).invoke( c1.factory, c1.socketFactory, c2.socketFactory); } catch(Exception e) { if (debug) { System.out.println("ClientId received an exception"); e.printStackTrace(); } // Failed to invoke the comparator; flag inequality return false; } if (((Integer) ret) == 0) { return true; } return false; } private static String toStringControls(Control[] ctls) { if (ctls == null) { return ""; } StringBuilder str = new StringBuilder(); for (int i = 0; i < ctls.length; i++) { str.append(ctls[i].getID()); str.append(' '); } return str.toString(); } public String toString() { return (hostname + ":" + port + ":" + (protocol != null ? protocol : "") + ":" + toStringControls(bindCtls) + ":" + socketFactory); } }
⏎ com/sun/jndi/ldap/ClientId.java
Or download all of them as a single archive file:
File name: java.naming-17.0.5-src.zip File size: 490626 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.net.http.jmod - Net HTTP Module
2023-09-23, 6553👍, 0💬
Popular Posts:
JDK 11 jdk.jdi.jmod is the JMOD file for JDK 11 JDI (Java Debug Interface) tool. JDK 11 JDI tool com...
What is the sax\Writer.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 insta...
What is ojdbc.jar - JDBC Driver for Oracle? ojdbc.jar is a JDBC driver from Oracle that provides dat...
Apache Commons Codec library provides implementations of common encoders and decoders such as Base64...
How to download and install JDK (Java Development Kit) 7? If you want to write Java applications, yo...