Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 15099 invoked from network); 7 Jun 2008 07:48:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jun 2008 07:48:55 -0000 Received: (qmail 59112 invoked by uid 500); 7 Jun 2008 07:48:58 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 59039 invoked by uid 500); 7 Jun 2008 07:48:58 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 59030 invoked by uid 99); 7 Jun 2008 07:48:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2008 00:48:58 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2008 07:48:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2E5382388A62; Sat, 7 Jun 2008 00:48:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r664295 [4/5] - in /directory/apacheds/branches/bigbang: ./ apacheds-jdbm/src/examples/ apacheds-jdbm/src/main/java/jdbm/ apacheds-jdbm/src/main/java/jdbm/btree/ bootstrap-extract/src/main/java/org/apache/directory/server/schema/bootstrap/p... Date: Sat, 07 Jun 2008 07:48:20 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080607074826.2E5382388A62@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: directory/apacheds/branches/bigbang/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java (original) +++ directory/apacheds/branches/bigbang/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java Sat Jun 7 00:48:16 2008 @@ -44,253 +44,253 @@ * */ public abstract class AbstractDhcpService implements DhcpService { - private static final Logger logger = LoggerFactory - .getLogger(AbstractDhcpService.class); + private static final Logger logger = LoggerFactory + .getLogger(AbstractDhcpService.class); - /* - * @see org.apache.directory.server.dhcp.DhcpService#getReplyFor(org.apache.directory.server.dhcp.messages.DhcpMessage) - */ - public final DhcpMessage getReplyFor(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - // ignore messages with an op != REQUEST/REPLY - if (request.getOp() != DhcpMessage.OP_BOOTREQUEST - && request.getOp() != DhcpMessage.OP_BOOTREPLY) - return null; - - // message type option MUST be set - we don't support plain BOOTP. - if (null == request.getMessageType()) { - logger.warn("Missing message type option - plain BOOTP not supported."); - return null; - } - - // dispatch based on the message type - switch (request.getMessageType().getCode()){ - // client-to-server messages - case MessageType.CODE_DHCPDISCOVER : - return handleDISCOVER(localAddress, clientAddress, request); - case MessageType.CODE_DHCPREQUEST : - return handleREQUEST(localAddress, clientAddress, request); - case MessageType.CODE_DHCPRELEASE : - return handleRELEASE(localAddress, clientAddress, request); - case MessageType.CODE_DHCPINFORM : - return handleINFORM(localAddress, clientAddress, request); - - case MessageType.CODE_DHCPOFFER : - return handleOFFER(localAddress, clientAddress, request); - - // server-to-client messages - case MessageType.CODE_DHCPDECLINE : - case MessageType.CODE_DHCPACK : - case MessageType.CODE_DHCPNAK : - return null; // just ignore them - - default : - return handleUnknownMessage(clientAddress, request); - } - } - - /** - * Handle unknown DHCP message. The default implementation just logs and - * ignores it. - * - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - */ - protected DhcpMessage handleUnknownMessage(InetSocketAddress clientAddress, - DhcpMessage request) { - if (logger.isWarnEnabled()) - logger.warn("Got unknkown DHCP message: " + request + " from: " - + clientAddress); - return null; - } - - /** - * Handle DHCPINFORM message. The default implementation just ignores it. - * - * @param localAddress - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - */ - protected DhcpMessage handleINFORM(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - if (logger.isDebugEnabled()) - logger.debug("Got INFORM message: " + request + " from: " - + clientAddress); - return null; - } - - /** - * Handle DHCPRELEASE message. The default implementation just ignores it. - * - * @param localAddress - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - */ - protected DhcpMessage handleRELEASE(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - if (logger.isDebugEnabled()) - logger.debug("Got RELEASE message: " + request + " from: " - + clientAddress); - return null; - } - - /** - * Handle DHCPREQUEST message. The default implementation just ignores it. - * - * @param localAddress - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - */ - protected DhcpMessage handleREQUEST(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - if (logger.isDebugEnabled()) - logger.debug("Got REQUEST message: " + request + " from: " - + clientAddress); - return null; - } - - /** - * Handle DHCPDISCOVER message. The default implementation just ignores it. - * - * @param localAddress - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - * @throws DhcpException - */ - protected DhcpMessage handleDISCOVER(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - if (logger.isDebugEnabled()) - logger.debug("Got DISCOVER message: " + request + " from: " - + clientAddress); - return null; - } - - /** - * Handle DHCPOFFER message. The default implementation just ignores it. - * - * @param localAddress - * @param clientAddress - * @param request the request message - * @return DhcpMessage response message or null to ignore (don't reply to) - * it. - * @throws DhcpException - */ - protected DhcpMessage handleOFFER(InetSocketAddress localAddress, - InetSocketAddress clientAddress, DhcpMessage request) - throws DhcpException { - if (logger.isDebugEnabled()) - logger - .debug("Got OFFER message: " + request + " from: " + clientAddress); - return null; - } - - /** - * Initialize a general DHCP reply message. Sets: - *
    - *
  • op=BOOTREPLY - *
  • htype, hlen, xid, flags, giaddr, chaddr like in request message - *
  • hops, secs to 0. - *
  • server hostname to the hostname appropriate for the interface the - * request was received on - *
  • the server identifier set to the address of the interface the request - * was received on - *
- * - * @param localAddress - * @param request - * @return DhcpMessage - */ - protected final DhcpMessage initGeneralReply(InetSocketAddress localAddress, - DhcpMessage request) { - final DhcpMessage reply = new DhcpMessage(); - - reply.setOp(DhcpMessage.OP_BOOTREPLY); - - reply.setHardwareAddress(request.getHardwareAddress()); - reply.setTransactionId(request.getTransactionId()); - reply.setFlags(request.getFlags()); - reply.setRelayAgentAddress(request.getRelayAgentAddress()); - - // set server hostname - reply.setServerHostname(localAddress.getHostName()); - - // set server identifier based on the IF on which we received the packet - reply.getOptions().add(new ServerIdentifier(localAddress.getAddress())); - - return reply; - } - - /** - * Check if an address is the zero-address - * - * @param addr - * @return boolean - */ - private boolean isZeroAddress(byte[] addr) { - for (int i = 0; i < addr.length; i++) - if (addr[i] != 0) - return false; - return true; - } - - /** - * Determine address on which to base selection. If the relay agent address is - * set, we use the relay agent's address, otherwise we use the address we - * received the request from. - * - * @param clientAddress - * @param request - * @return InetAddress - */ - protected final InetAddress determineSelectionBase( - InetSocketAddress clientAddress, DhcpMessage request) { - // FIXME: do we know - // a) the interface address over which we received a message (!) - // b) the client address (if specified) - // c) the relay agent address? - - // if the relay agent address is set, we use it as the selection base - if (!isZeroAddress(request.getRelayAgentAddress().getAddress())) - return request.getRelayAgentAddress(); - - return clientAddress.getAddress(); - } - - /** - * Strip options that the client doesn't want, if the ParameterRequestList - * option is present. - * - * @param request - * @param options - */ - protected final void stripUnwantedOptions(DhcpMessage request, - OptionsField options) { - final ParameterRequestList prl = (ParameterRequestList) request - .getOptions().get(ParameterRequestList.class); - if (null != prl) { - final byte[] list = prl.getData(); - for (final Iterator i = options.iterator(); i.hasNext();) { - final DhcpOption o = (DhcpOption) i.next(); - for (int j = 0; j < list.length; j++) - if (list[j] == o.getTag()) - continue; - i.remove(); - } - } - } + /* + * @see org.apache.directory.server.dhcp.DhcpService#getReplyFor(org.apache.directory.server.dhcp.messages.DhcpMessage) + */ + public final DhcpMessage getReplyFor(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + // ignore messages with an op != REQUEST/REPLY + if (request.getOp() != DhcpMessage.OP_BOOTREQUEST + && request.getOp() != DhcpMessage.OP_BOOTREPLY) + return null; + + // message type option MUST be set - we don't support plain BOOTP. + if (null == request.getMessageType()) { + logger.warn("Missing message type option - plain BOOTP not supported."); + return null; + } + + // dispatch based on the message type + switch (request.getMessageType().getCode()){ + // client-to-server messages + case MessageType.CODE_DHCPDISCOVER : + return handleDISCOVER(localAddress, clientAddress, request); + case MessageType.CODE_DHCPREQUEST : + return handleREQUEST(localAddress, clientAddress, request); + case MessageType.CODE_DHCPRELEASE : + return handleRELEASE(localAddress, clientAddress, request); + case MessageType.CODE_DHCPINFORM : + return handleINFORM(localAddress, clientAddress, request); + + case MessageType.CODE_DHCPOFFER : + return handleOFFER(localAddress, clientAddress, request); + + // server-to-client messages + case MessageType.CODE_DHCPDECLINE : + case MessageType.CODE_DHCPACK : + case MessageType.CODE_DHCPNAK : + return null; // just ignore them + + default : + return handleUnknownMessage(clientAddress, request); + } + } + + /** + * Handle unknown DHCP message. The default implementation just logs and + * ignores it. + * + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + */ + protected DhcpMessage handleUnknownMessage(InetSocketAddress clientAddress, + DhcpMessage request) { + if (logger.isWarnEnabled()) + logger.warn("Got unknkown DHCP message: " + request + " from: " + + clientAddress); + return null; + } + + /** + * Handle DHCPINFORM message. The default implementation just ignores it. + * + * @param localAddress + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + */ + protected DhcpMessage handleINFORM(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + if (logger.isDebugEnabled()) + logger.debug("Got INFORM message: " + request + " from: " + + clientAddress); + return null; + } + + /** + * Handle DHCPRELEASE message. The default implementation just ignores it. + * + * @param localAddress + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + */ + protected DhcpMessage handleRELEASE(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + if (logger.isDebugEnabled()) + logger.debug("Got RELEASE message: " + request + " from: " + + clientAddress); + return null; + } + + /** + * Handle DHCPREQUEST message. The default implementation just ignores it. + * + * @param localAddress + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + */ + protected DhcpMessage handleREQUEST(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + if (logger.isDebugEnabled()) + logger.debug("Got REQUEST message: " + request + " from: " + + clientAddress); + return null; + } + + /** + * Handle DHCPDISCOVER message. The default implementation just ignores it. + * + * @param localAddress + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + * @throws DhcpException + */ + protected DhcpMessage handleDISCOVER(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + if (logger.isDebugEnabled()) + logger.debug("Got DISCOVER message: " + request + " from: " + + clientAddress); + return null; + } + + /** + * Handle DHCPOFFER message. The default implementation just ignores it. + * + * @param localAddress + * @param clientAddress + * @param request the request message + * @return DhcpMessage response message or null to ignore (don't reply to) + * it. + * @throws DhcpException + */ + protected DhcpMessage handleOFFER(InetSocketAddress localAddress, + InetSocketAddress clientAddress, DhcpMessage request) + throws DhcpException { + if (logger.isDebugEnabled()) + logger + .debug("Got OFFER message: " + request + " from: " + clientAddress); + return null; + } + + /** + * Initialize a general DHCP reply message. Sets: + *
    + *
  • op=BOOTREPLY + *
  • htype, hlen, xid, flags, giaddr, chaddr like in request message + *
  • hops, secs to 0. + *
  • server hostname to the hostname appropriate for the interface the + * request was received on + *
  • the server identifier set to the address of the interface the request + * was received on + *
+ * + * @param localAddress + * @param request + * @return DhcpMessage + */ + protected final DhcpMessage initGeneralReply(InetSocketAddress localAddress, + DhcpMessage request) { + final DhcpMessage reply = new DhcpMessage(); + + reply.setOp(DhcpMessage.OP_BOOTREPLY); + + reply.setHardwareAddress(request.getHardwareAddress()); + reply.setTransactionId(request.getTransactionId()); + reply.setFlags(request.getFlags()); + reply.setRelayAgentAddress(request.getRelayAgentAddress()); + + // set server hostname + reply.setServerHostname(localAddress.getHostName()); + + // set server identifier based on the IF on which we received the packet + reply.getOptions().add(new ServerIdentifier(localAddress.getAddress())); + + return reply; + } + + /** + * Check if an address is the zero-address + * + * @param addr + * @return boolean + */ + private boolean isZeroAddress(byte[] addr) { + for (int i = 0; i < addr.length; i++) + if (addr[i] != 0) + return false; + return true; + } + + /** + * Determine address on which to base selection. If the relay agent address is + * set, we use the relay agent's address, otherwise we use the address we + * received the request from. + * + * @param clientAddress + * @param request + * @return InetAddress + */ + protected final InetAddress determineSelectionBase( + InetSocketAddress clientAddress, DhcpMessage request) { + // FIXME: do we know + // a) the interface address over which we received a message (!) + // b) the client address (if specified) + // c) the relay agent address? + + // if the relay agent address is set, we use it as the selection base + if (!isZeroAddress(request.getRelayAgentAddress().getAddress())) + return request.getRelayAgentAddress(); + + return clientAddress.getAddress(); + } + + /** + * Strip options that the client doesn't want, if the ParameterRequestList + * option is present. + * + * @param request + * @param options + */ + protected final void stripUnwantedOptions(DhcpMessage request, + OptionsField options) { + final ParameterRequestList prl = (ParameterRequestList) request + .getOptions().get(ParameterRequestList.class); + if (null != prl) { + final byte[] list = prl.getData(); + for (final Iterator i = options.iterator(); i.hasNext();) { + final DhcpOption o = (DhcpOption) i.next(); + for (int j = 0; j < list.length; j++) + if (list[j] == o.getTag()) + continue; + i.remove(); + } + } + } } Modified: directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java (original) +++ directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/DnsMessage.java Sat Jun 7 00:48:16 2008 @@ -267,6 +267,7 @@ /** * @see java.lang.Object#hashCode() + * @return the instance's hash code */ public int hashCode() { Modified: directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java (original) +++ directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/QuestionRecord.java Sat Jun 7 00:48:16 2008 @@ -142,6 +142,7 @@ /** * @see java.lang.Object#hashCode() + * @return the instance's hash code */ public int hashCode() { Modified: directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java (original) +++ directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java Sat Jun 7 00:48:16 2008 @@ -176,6 +176,10 @@ } + /** + * Compute the instance hash code + * @return the instance's hash code + */ public int hashCode() { return domainName.hashCode() + recordType.hashCode() + recordClass.hashCode(); Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Sat Jun 7 00:48:16 2008 @@ -808,7 +808,6 @@ return saslMechanismHandlers; } - public void setSaslMechanismHandlers( Map saslMechanismHandlers ) { this.saslMechanismHandlers = saslMechanismHandlers; Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java Sat Jun 7 00:48:16 2008 @@ -110,9 +110,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getJPanel() { @@ -129,9 +129,9 @@ /** - * This method initializes jScrollPane - * - * @return javax.swing.JScrollPane + * This method initializes jScrollPane + * + * @return javax.swing.JScrollPane */ private JScrollPane getJScrollPane() { @@ -145,9 +145,9 @@ /** - * This method initializes jTable - * - * @return javax.swing.JTable + * This method initializes jTable + * + * @return javax.swing.JTable */ private JTable getJTable() { @@ -203,9 +203,9 @@ /** - * This method initializes jPanel1 - * - * @return javax.swing.JPanel + * This method initializes jPanel1 + * + * @return javax.swing.JPanel */ private JPanel getJPanel1() { @@ -220,9 +220,9 @@ /** - * This method initializes jButton - * - * @return javax.swing.JButton + * This method initializes jButton + * + * @return javax.swing.JButton */ private JButton getJButton() { @@ -244,9 +244,9 @@ /** - * This method initializes jPanel2 - * - * @return javax.swing.JPanel + * This method initializes jPanel2 + * + * @return javax.swing.JPanel */ private JPanel getJPanel2() { @@ -265,9 +265,9 @@ /** - * This method initializes jTextArea - * - * @return javax.swing.JTextArea + * This method initializes jTextArea + * + * @return javax.swing.JTextArea */ private JTextArea getJTextArea() { @@ -283,9 +283,9 @@ /** - * This method initializes jButton1 - * - * @return javax.swing.JButton + * This method initializes jButton1 + * + * @return javax.swing.JButton */ private JButton getJButton1() { @@ -309,9 +309,9 @@ /** - * This method initializes jButton2 - * - * @return javax.swing.JButton + * This method initializes jButton2 + * + * @return javax.swing.JButton */ private JButton getJButton2() { Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java Sat Jun 7 00:48:16 2008 @@ -144,9 +144,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getMainPanel() { @@ -163,9 +163,9 @@ /** - * This method initializes jScrollPane - * - * @return javax.swing.JScrollPane + * This method initializes jScrollPane + * + * @return javax.swing.JScrollPane */ private JScrollPane getSessionsPane() { @@ -180,9 +180,9 @@ /** - * This method initializes jTable - * - * @return javax.swing.JTable + * This method initializes jTable + * + * @return javax.swing.JTable */ private JTable getSessionsTable() { @@ -215,9 +215,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getFilterPanel() { @@ -235,9 +235,9 @@ /** - * This method initializes jButton - * - * @return javax.swing.JButton + * This method initializes jButton + * + * @return javax.swing.JButton */ private JButton getFilterButton() { @@ -251,9 +251,9 @@ /** - * This method initializes jTextField - * - * @return javax.swing.JTextField + * This method initializes jTextField + * + * @return javax.swing.JTextField */ private JTextField getFilterText() { @@ -266,9 +266,9 @@ /** - * This method initializes jJMenuBar - * - * @return javax.swing.JMenuBar + * This method initializes jJMenuBar + * + * @return javax.swing.JMenuBar */ private JMenuBar getMainMenuBar() { @@ -283,9 +283,9 @@ /** - * This method initializes jMenu - * - * @return javax.swing.JMenu + * This method initializes jMenu + * + * @return javax.swing.JMenu */ private JMenu getMenuFile() { @@ -300,9 +300,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getExitItem() { @@ -324,9 +324,9 @@ /** - * This method initializes jMenu - * - * @return javax.swing.JMenu + * This method initializes jMenu + * + * @return javax.swing.JMenu */ private JMenu getMenuSession() { @@ -348,9 +348,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getCloseItem() { @@ -380,9 +380,9 @@ /** - * This method initializes jMenu - * - * @return javax.swing.JMenu + * This method initializes jMenu + * + * @return javax.swing.JMenu */ private JMenu getMenuSendNoD() { @@ -399,9 +399,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getUnavailableItem() { @@ -431,9 +431,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getProtocolErrorItem() { @@ -463,9 +463,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getStrongAuthRequiredItem() { @@ -497,9 +497,9 @@ // /** - // * This method initializes jPopupMenu - // * - // * @return javax.swing.JPopupMenu + // * This method initializes jPopupMenu + // * + // * @return javax.swing.JPopupMenu // */ // private JPopupMenu getSessionsPopupMenu() // { @@ -514,9 +514,9 @@ // } /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getSouthPanel() { @@ -532,9 +532,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getShowRequests() { @@ -564,9 +564,9 @@ // /** - // * This method initializes jMenuItem - // * - // * @return javax.swing.JMenuItem + // * This method initializes jMenuItem + // * + // * @return javax.swing.JMenuItem // */ // private JMenuItem getJMenuItem() // { @@ -580,9 +580,9 @@ // // // /** - // * This method initializes jMenu - // * - // * @return javax.swing.JMenu + // * This method initializes jMenu + // * + // * @return javax.swing.JMenu // */ // private JMenu getJMenu() // { @@ -599,9 +599,9 @@ // // // /** - // * This method initializes jMenuItem1 - // * - // * @return javax.swing.JMenuItem + // * This method initializes jMenuItem1 + // * + // * @return javax.swing.JMenuItem // */ // private JMenuItem getJMenuItem1() // { @@ -615,9 +615,9 @@ // // // /** - // * This method initializes jMenuItem2 - // * - // * @return javax.swing.JMenuItem + // * This method initializes jMenuItem2 + // * + // * @return javax.swing.JMenuItem // */ // private JMenuItem getJMenuItem2() // { @@ -631,9 +631,9 @@ // // // /** - // * This method initializes jMenuItem3 - // * - // * @return javax.swing.JMenuItem + // * This method initializes jMenuItem3 + // * + // * @return javax.swing.JMenuItem // */ // private JMenuItem getJMenuItem3() // { @@ -647,9 +647,9 @@ // // // /** - // * This method initializes jMenuItem4 - // * - // * @return javax.swing.JMenuItem + // * This method initializes jMenuItem4 + // * + // * @return javax.swing.JMenuItem // */ // private JMenuItem getJMenuItem4() // { @@ -662,9 +662,9 @@ // } /** - * This method initializes jButton2 - * - * @return javax.swing.JButton + * This method initializes jButton2 + * + * @return javax.swing.JButton */ private JButton getRefreshButton() { @@ -704,9 +704,9 @@ } /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getUnbindItem() { @@ -808,9 +808,9 @@ /** - * This method initializes jMenuItem - * - * @return javax.swing.JMenuItem + * This method initializes jMenuItem + * + * @return javax.swing.JMenuItem */ private JMenuItem getBindItem() { Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownDialog.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownDialog.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownDialog.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownDialog.java Sat Jun 7 00:48:16 2008 @@ -115,9 +115,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getJPanel() { @@ -135,9 +135,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getJPanel2() { @@ -152,9 +152,9 @@ /** - * This method initializes jButton - * - * @return javax.swing.JButton + * This method initializes jButton + * + * @return javax.swing.JButton */ private JButton getJButton() { @@ -215,9 +215,9 @@ /** - * This method initializes jButton - * - * @return javax.swing.JButton + * This method initializes jButton + * + * @return javax.swing.JButton */ private JButton getJButton2() { @@ -242,9 +242,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getJPanel3() { @@ -263,9 +263,9 @@ /** - * This method initializes jPanel1 - * - * @return javax.swing.JPanel + * This method initializes jPanel1 + * + * @return javax.swing.JPanel */ private JPanel getJPanel1() { @@ -284,9 +284,9 @@ /** - * This method initializes jTextField - * - * @return javax.swing.JTextField + * This method initializes jTextField + * + * @return javax.swing.JTextField */ private JTextField getJTextField() { @@ -299,9 +299,9 @@ /** - * This method initializes jTextField1 - * - * @return javax.swing.JTextField + * This method initializes jTextField1 + * + * @return javax.swing.JTextField */ private JTextField getJTextField1() { Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownProgress.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownProgress.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownProgress.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownProgress.java Sat Jun 7 00:48:16 2008 @@ -119,9 +119,9 @@ /** - * This method initializes jPanel - * - * @return javax.swing.JPanel + * This method initializes jPanel + * + * @return javax.swing.JPanel */ private JPanel getJPanel() { @@ -135,9 +135,9 @@ /** - * This method initializes jButton - * - * @return javax.swing.JButton + * This method initializes jButton + * + * @return javax.swing.JButton */ private JButton getJButton() { @@ -159,9 +159,9 @@ /** - * This method initializes jProgressBar - * - * @return javax.swing.JProgressBar + * This method initializes jProgressBar + * + * @return javax.swing.JProgressBar */ private JProgressBar getJProgressBar() { Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/AbstractLdapHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/AbstractLdapHandler.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/AbstractLdapHandler.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/AbstractLdapHandler.java Sat Jun 7 00:48:16 2008 @@ -60,24 +60,24 @@ /** - * Return an array containing the controls for this message. - * - * @param context The context in which we will store teh found controls - * @param message The message for which we want to extract the controls - */ - protected void setRequestControls( LdapContext context, Message message ) throws NamingException - { - MutableControl[] controls = null; - - if ( message.getControls() != null ) - { - int nbControls = message.getControls().size(); - - if ( nbControls != 0 ) - { - controls = new MutableControl[ nbControls ]; - context.setRequestControls( message.getControls().values().toArray( controls ) ); - } - } - } + * Return an array containing the controls for this message. + * + * @param context The context in which we will store teh found controls + * @param message The message for which we want to extract the controls + */ + protected void setRequestControls( LdapContext context, Message message ) throws NamingException + { + MutableControl[] controls = null; + + if ( message.getControls() != null ) + { + int nbControls = message.getControls().size(); + + if ( nbControls != 0 ) + { + controls = new MutableControl[ nbControls ]; + context.setRequestControls( message.getControls().values().toArray( controls ) ); + } + } + } } Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java Sat Jun 7 00:48:16 2008 @@ -20,6 +20,24 @@ package org.apache.directory.server.ldap.handlers; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.Set; + +import javax.naming.Context; +import javax.naming.NamingException; +import javax.naming.directory.DirContext; +import javax.naming.ldap.InitialLdapContext; +import javax.naming.ldap.LdapContext; +import javax.naming.spi.InitialContextFactory; +import javax.security.auth.Subject; +import javax.security.auth.kerberos.KerberosKey; +import javax.security.auth.kerberos.KerberosPrincipal; +import javax.security.sasl.Sasl; +import javax.security.sasl.SaslException; +import javax.security.sasl.SaslServer; + import org.apache.directory.server.constants.ServerDNConstants; import org.apache.directory.server.core.DirectoryService; import org.apache.directory.server.core.authn.LdapPrincipal; @@ -49,25 +67,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.naming.Context; -import javax.naming.NamingException; -import javax.naming.directory.DirContext; -import javax.naming.ldap.InitialLdapContext; -import javax.naming.ldap.LdapContext; -import javax.naming.spi.InitialContextFactory; -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosKey; -import javax.security.auth.kerberos.KerberosPrincipal; -import javax.security.sasl.Sasl; -import javax.security.sasl.SaslException; -import javax.security.sasl.SaslServer; - -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - /** * A single reply handler for {@link BindRequest}s. @@ -81,7 +80,7 @@ { private static final Logger LOG = LoggerFactory.getLogger( BindHandler.class ); - /** An empty Contol array used to get back the controls if any */ + /** An empty Control array used to get back the controls if any */ private static final MutableControl[] EMPTY_CONTROL = new MutableControl[0]; private DirContext ctx; @@ -99,15 +98,28 @@ */ public DefaultBindHandler() { + registry = null; + handlers = null; + ctx = null; } + /** + * Set the mechanisms handler map. + * + * @param handlers The associations btween a machanism and its handler + */ public void setSaslMechanismHandlers( Map handlers ) { this.handlers = handlers; } + /** + * Associated a Registry to the handler + * + * @param registry The registry to attach + */ public void setSessionRegistry( SessionRegistry registry ) { this.registry = registry; @@ -126,6 +138,7 @@ * - the credentials : principal's password, if auth level is 'simple' * - the authentication level : either 'simple' or 'strong' * - how to handle referral : either 'ignore' or 'throw' + * * @param bindRequest the bind request object * @param authenticationLevel the level of the authentication * @return the environment for the session @@ -185,7 +198,7 @@ private LdapContext getLdapContext( IoSession session, BindRequest bindRequest, Hashtable env ) { LdapResult result = bindRequest.getResultResponse().getLdapResult(); - LdapContext ctx; + LdapContext context = null; try { @@ -200,18 +213,18 @@ } // Bind is a special case where we have to use the referral property to deal - ctx = ( LdapContext ) factory.getInitialContext( env ); + context = ( LdapContext ) factory.getInitialContext( env ); } else { //noinspection SuspiciousToArrayCall MutableControl[] connCtls = bindRequest.getControls().values().toArray( EMPTY_CONTROL ); - ctx = new InitialLdapContext( env, connCtls ); + context = new InitialLdapContext( env, connCtls ); } } catch ( NamingException e ) { - ResultCodeEnum code; + ResultCodeEnum code = null; if ( e instanceof LdapException ) { @@ -242,15 +255,14 @@ result.setErrorMessage( msg ); session.write( bindRequest.getResultResponse() ); - ctx = null; + context = null; } - return ctx; + return context; } /** - * This method handle a 'simple' authentication. Of course, the 'SIMPLE' mechanism - * must have been allowed in the configuration, otherwise an error is thrown. + * This method handles 'simple' authentication. * * @param bindRequest the bind request * @param session the mina IoSession @@ -264,12 +276,12 @@ Hashtable env = getEnvironment( bindRequest, AuthenticationLevel.SIMPLE.toString() ); // Now, get the context - LdapContext ctx = getLdapContext( session, bindRequest, env ); + LdapContext context = getLdapContext( session, bindRequest, env ); // Test that we successfully got one. If not, an error has already been returned. - if ( ctx != null ) + if ( context != null ) { - ServerLdapContext newCtx = ( ServerLdapContext ) ctx.lookup( "" ); + ServerLdapContext newCtx = ( ServerLdapContext ) context.lookup( "" ); setRequestControls( newCtx, bindRequest ); getSessionRegistry().setLdapContext( session, newCtx ); bindResult.setResultCode( ResultCodeEnum.SUCCESS ); @@ -281,6 +293,13 @@ } + /** + * Handle the SASL authentication. + * + * @param session The associated Session + * @param message The BindRequest received + * @throws Exception If the authentication cannot be done + */ public void handleSaslAuth( IoSession session, Object message ) throws Exception { LdapServer ldapServer = ( LdapServer ) @@ -315,7 +334,8 @@ // Guard clause: Reject unsupported SASL mechanisms. if ( !ldapServer.getSupportedMechanisms().contains( bindRequest.getSaslMechanism() ) ) { - LOG.error( "Bind error : {} mechanism not supported. Please check the server.xml configuration file (supportedMechanisms field)", + LOG.error( "Bind error : {} mechanism not supported. Please check the server.xml " + + "configuration file (supportedMechanisms field)", bindRequest.getSaslMechanism() ); LdapResult bindResult = bindRequest.getResultResponse().getLdapResult(); @@ -331,12 +351,17 @@ /** * Deal with a SASL bind request + * + * @param session The IoSession for this Bind Request + * @param bindRequest The BindRequest received + * + * @exception Exception if the mechanism cannot handle the authentication */ public void handleSasl( IoSession session, BindRequest bindRequest ) throws Exception { String sessionMechanism = bindRequest.getSaslMechanism(); - if ( sessionMechanism.equals( SupportedSaslMechanisms.SIMPLE ) ) + if ( sessionMechanism.equals( SupportedSaslMechanisms.PLAIN ) ) { /* * This is the principal name that will be used to bind to the DIT. @@ -381,12 +406,15 @@ if ( ss.isComplete() ) { - /* - * There may be a token to return to the client. We set it here - * so it will be returned in a SUCCESS message, after an LdapContext - * has been initialized for the client. - */ - session.setAttribute( "saslCreds", tokenBytes ); + if ( tokenBytes != null ) + { + /* + * There may be a token to return to the client. We set it here + * so it will be returned in a SUCCESS message, after an LdapContext + * has been initialized for the client. + */ + session.setAttribute( "saslCreds", tokenBytes ); + } /* * If we got here, we're ready to try getting an initial LDAP context. @@ -417,6 +445,9 @@ /** * Create a list of all the configured realms. + * + * @param ldapServer the LdapServer for which we want to get the realms + * @return a list of relms, separated by spaces */ private String getActiveRealms( LdapServer ldapServer ) { @@ -441,24 +472,24 @@ } - private Subject getSubject( LdapServer ldapServer ) throws ServiceConfigurationException + private Subject getSubject( LdapServer ldapServer ) throws Exception { String servicePrincipalName = ldapServer.getSaslPrincipal(); KerberosPrincipal servicePrincipal = new KerberosPrincipal( servicePrincipalName ); GetPrincipal getPrincipal = new GetPrincipal( servicePrincipal ); - PrincipalStoreEntry entry; + PrincipalStoreEntry entry = null; try { entry = findPrincipal( ldapServer, getPrincipal ); } - catch ( Exception e ) + catch ( ServiceConfigurationException sce ) { String message = "Service principal " + servicePrincipalName + " not found at search base DN " + ldapServer.getSearchBaseDn() + "."; - throw new ServiceConfigurationException( message, e ); + throw new ServiceConfigurationException( message, sce ); } if ( entry == null ) @@ -470,11 +501,9 @@ Subject subject = new Subject(); - Iterator it = entry.getKeyMap().keySet().iterator(); - - while ( it.hasNext() ) + for ( EncryptionType encryptionType:entry.getKeyMap().keySet() ) { - EncryptionKey key = entry.getKeyMap().get( it.next() ); + EncryptionKey key = entry.getKeyMap().get( encryptionType ); byte[] keyBytes = key.getKeyValue(); int type = key.getKeyType().getOrdinal(); @@ -488,15 +517,18 @@ return subject; } - + private PrincipalStoreEntry findPrincipal( LdapServer ldapServer, GetPrincipal getPrincipal ) throws Exception { if ( ctx == null ) { try { - LdapPrincipal principal = new LdapPrincipal( - new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN ), AuthenticationLevel.SIMPLE ); + LdapDN adminDN = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN ); + + adminDN.normalize( + ldapServer.getDirectoryService().getRegistries().getAttributeTypeRegistry().getNormalizerMapping() ); + LdapPrincipal principal = new LdapPrincipal( adminDN, AuthenticationLevel.SIMPLE ); ctx = new ServerLdapContext( ldapServer.getDirectoryService(), principal, new LdapDN( ldapServer.getSearchBaseDn() ) ); @@ -552,27 +584,27 @@ } - private void getLdapContext( IoSession session, BindRequest bindRequest ) throws Exception + private void getLdapContext( IoSession session, BindRequest bindRequest ) //throws Exception { Hashtable env = getEnvironment( session, bindRequest ); LdapResult result = bindRequest.getResultResponse().getLdapResult(); - LdapContext ctx; + LdapContext context = null; try { MutableControl[] connCtls = bindRequest.getControls().values().toArray( EMPTY_CONTROL ); - ctx = new InitialLdapContext( env, connCtls ); + context = new InitialLdapContext( env, connCtls ); - registry.setLdapContext( session, ctx ); + registry.setLdapContext( session, context ); // add the bind response controls - bindRequest.getResultResponse().addAll( ctx.getResponseControls() ); + bindRequest.getResultResponse().addAll( context.getResponseControls() ); returnSuccess( session, bindRequest ); } catch ( NamingException e ) { - ResultCodeEnum code; + ResultCodeEnum code = null; if ( e instanceof LdapException ) { @@ -602,13 +634,11 @@ result.setErrorMessage( msg ); session.write( bindRequest.getResultResponse() ); - - ctx = null; } } - private void returnSuccess( IoSession session, BindRequest bindRequest ) throws Exception + private void returnSuccess( IoSession session, BindRequest bindRequest ) //throws Exception { /* * We have now both authenticated the client and retrieved a JNDI context for them. @@ -654,12 +684,12 @@ /** * Convert a SASL mechanism to an Authentication level * - * @param sessionMechanism The resquested mechanism + * @param sessionMechanism The requested mechanism * @return The corresponding authentication level */ private String getAuthenticationLevel( String sessionMechanism ) { - if ( sessionMechanism.equals( SupportedSaslMechanisms.SIMPLE ) ) + if ( sessionMechanism.equals( SupportedSaslMechanisms.PLAIN ) ) { return AuthenticationLevel.SIMPLE.toString(); } @@ -672,12 +702,16 @@ /** * Deal with a received BindRequest + * + * @param session The current session + * @param bindRequest The received BindRequest + * @throws Exception If the euthentication cannot be handled */ protected void bindMessageReceived( IoSession session, BindRequest bindRequest ) throws Exception { if ( LOG.isDebugEnabled() ) { - LOG.debug( "User {} is binding", bindRequest.getName() ); + LOG.debug( "User {} is binding", bindRequest.getName() ); if ( bindRequest.isSimple() ) { @@ -701,7 +735,7 @@ return; } - // Deal with the two kinds of authen : + // Deal with the two kinds of authent : // - if it's simple, handle it in this class for speed // - for sasl, we go through a chain right now (but it may change in the near future) if ( bindRequest.isSimple() ) @@ -713,4 +747,4 @@ handleSaslAuth( session, bindRequest ); } } -} \ No newline at end of file +} Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultModifyHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultModifyHandler.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultModifyHandler.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultModifyHandler.java Sat Jun 7 00:48:16 2008 @@ -74,22 +74,22 @@ // Process the modifications if ( req.getModificationItems() != null ) { - int nbItems = req.getModificationItems().size(); + int nbItems = req.getModificationItems().size(); - if ( nbItems != 0 ) - { - ModificationItemImpl[] mods = new ModificationItemImpl[nbItems]; + if ( nbItems != 0 ) + { + ModificationItemImpl[] mods = new ModificationItemImpl[nbItems]; //noinspection SuspiciousToArrayCall ctx.modifyAttributes( req.getName(), req.getModificationItems().toArray( mods ) ); - } - else - { - // What should we do if we don't have any modification ??? - } + } + else + { + // What should we do if we don't have any modification ??? + } } else { - // What should we do if we don't have any modification ??? + // What should we do if we don't have any modification ??? } result.setResultCode( ResultCodeEnum.SUCCESS ); Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultSearchHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultSearchHandler.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultSearchHandler.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultSearchHandler.java Sat Jun 7 00:48:16 2008 @@ -221,12 +221,12 @@ LdapServer ldapServer = ( LdapServer ) session.getAttribute( LdapServer.class.toString() ); - if ( IS_DEBUG ) - { - LOG.debug( "Message received: {}", req.toString() ); - } + if ( IS_DEBUG ) + { + LOG.debug( "Message received: {}", req.toString() ); + } - ServerLdapContext ctx; + ServerLdapContext ctx; NamingEnumeration list = null; String[] ids = null; Collection retAttrs = new HashSet(); Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java Sat Jun 7 00:48:16 2008 @@ -20,13 +20,16 @@ package org.apache.directory.server.ldap.handlers.bind.ntlm; +import org.apache.mina.common.IoSession; + + /** * An NTLM authentication service provider. Multiple providers may be * utilized to conduct the NTLM negotiation over various protocols or by * calling native SSPI interfaces. * * @author Apache Directory Project - * @version $$Rev$$ + * @version $Rev$ */ public interface NtlmProvider { @@ -34,17 +37,19 @@ * Handles a Type 1 NTLM response from the client to generate an NTLM * Type 2 challenge message. * + * @param session the MINA IoSession to store any state to be thread safe * @param type1reponse the Type 1 NTLM response from client * @return the NTLM Type 2 message with the challenge */ - byte[] generateChallenge( byte[] type1reponse ) throws Exception; + byte[] generateChallenge( IoSession session, byte[] type1reponse ) throws Exception; /** - * Handles a Type 3 NTLM reponse from the client. + * Handles a Type 3 NTLM response from the client. * - * @param type3response the Type 3 NTLM reponse from the client - * @return the result of the successful authentication from the server + * @param session the MINA IoSession to store any state to be thread safe + * @param type3response the Type 3 NTLM response from the client + * @return the result of the authentication from the server */ - NtlmAuthenticationResult authenticate( byte[] type3response ) throws Exception; + boolean authenticate( IoSession session, byte[] type3response ) throws Exception; } Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java Sat Jun 7 00:48:16 2008 @@ -121,7 +121,7 @@ case TYPE_1_RECEIVED: try { - retval = provider.generateChallenge( response ); + retval = provider.generateChallenge( session, response ); } catch ( Exception e ) { @@ -129,11 +129,10 @@ } break; case TYPE_3_RECEIVED: - NtlmAuthenticationResult result = null; + boolean result; try { - result = provider.authenticate( response ); - retval = result.getResponse(); + result = provider.authenticate( session, response ); session.setAttribute( Context.SECURITY_PRINCIPAL, request.getName().toString() ); } catch ( Exception e ) @@ -141,7 +140,7 @@ throw new SaslException( "There was a failure during NTLM Type 3 message handling.", e ); } - if ( ! result.isSuccess() ) + if ( ! result ) { throw new SaslException( "Authentication occurred but the credentials were invalid." ); } Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java Sat Jun 7 00:48:16 2008 @@ -177,7 +177,7 @@ } - public void setLdapProvider( LdapServer provider) + public void setLdapProvider( LdapServer provider) { - } + } } Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java (original) +++ directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java Sat Jun 7 00:48:16 2008 @@ -76,11 +76,11 @@ LdapServer server = new LdapServer(); Map handlers = new HashMap(); MechanismHandler handler = new SimpleMechanismHandler(); - handlers.put( SupportedSaslMechanisms.SIMPLE, handler ); + handlers.put( SupportedSaslMechanisms.PLAIN, handler ); server.setSaslMechanismHandlers( handlers ); - assertEquals( handler, server.getMechanismHandler( SupportedSaslMechanisms.SIMPLE ) ); - assertTrue( server.getSupportedMechanisms().contains( SupportedSaslMechanisms.SIMPLE ) ); - server.removeSaslMechanismHandler( SupportedSaslMechanisms.SIMPLE ); - assertNull( server.getMechanismHandler( SupportedSaslMechanisms.SIMPLE ) ); + assertEquals( handler, server.getMechanismHandler( SupportedSaslMechanisms.PLAIN ) ); + assertTrue( server.getSupportedMechanisms().contains( SupportedSaslMechanisms.PLAIN ) ); + server.removeSaslMechanismHandler( SupportedSaslMechanisms.PLAIN ); + assertNull( server.getMechanismHandler( SupportedSaslMechanisms.PLAIN ) ); } } Modified: directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java (original) +++ directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java Sat Jun 7 00:48:16 2008 @@ -173,23 +173,20 @@ */ public int execute() { - Name rdn; + Name rdn = null; InputStream in = null; try { in = getLdifStream(); - LdifReader ldifIterator = new LdifReader( new BufferedReader( new InputStreamReader( in ) ) ); - while ( ldifIterator.hasNext() ) + for ( LdifEntry ldifEntry:new LdifReader( new BufferedReader( new InputStreamReader( in ) ) ) ) { - LdifEntry entry = ldifIterator.next(); + String dn = ldifEntry.getDn(); - String dn = entry.getDn(); - - if ( entry.isEntry() ) + if ( ldifEntry.isEntry() ) { - Attributes attributes = entry.getAttributes(); + Attributes attributes = ldifEntry.getAttributes(); boolean filterAccepted = applyFilters( dn, attributes ); if ( !filterAccepted ) @@ -219,7 +216,7 @@ } else { //modify - List items = entry.getModificationItems(); + List items = ldifEntry.getModificationItems(); try { ctx.modifyAttributes( dn, items.toArray( new ModificationItem[items.size()] ) ); Modified: directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java (original) +++ directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/AbstractBootstrapProducer.java Sat Jun 7 00:48:16 2008 @@ -301,17 +301,17 @@ */ public MatchingRule getEquality() throws NamingException { - if ( equalityMR == null ) - { - if ( equalityId != null ) - { - equalityMR = this.matchingRuleRegistry.lookup( equalityId ); - } - else if ( superiorId != null ) - { - equalityMR = getSuperior().getEquality(); - } - } + if ( equalityMR == null ) + { + if ( equalityId != null ) + { + equalityMR = this.matchingRuleRegistry.lookup( equalityId ); + } + else if ( superiorId != null ) + { + equalityMR = getSuperior().getEquality(); + } + } return equalityMR; } @@ -397,19 +397,19 @@ */ public Syntax getSyntax() throws NamingException { - if ( syntax == null ) - { - if ( syntaxId != null ) - { - syntax = syntaxRegistry.lookup( syntaxId ); - } - else if ( superiorId != null ) - { - syntax = getSuperior().getSyntax(); - } - } + if ( syntax == null ) + { + if ( syntaxId != null ) + { + syntax = syntaxRegistry.lookup( syntaxId ); + } + else if ( superiorId != null ) + { + syntax = getSuperior().getSyntax(); + } + } - return syntax; + return syntax; } @@ -524,17 +524,17 @@ public boolean isStructural() { - return type == ObjectClassTypeEnum.STRUCTURAL; + return type == ObjectClassTypeEnum.STRUCTURAL; } public boolean isAbstract() { - return type == ObjectClassTypeEnum.ABSTRACT; + return type == ObjectClassTypeEnum.ABSTRACT; } public boolean isAuxiliary() { - return type == ObjectClassTypeEnum.AUXILIARY; + return type == ObjectClassTypeEnum.AUXILIARY; } public void setSchema( String schema ) Modified: directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java (original) +++ directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java Sat Jun 7 00:48:16 2008 @@ -125,7 +125,7 @@ return NAMES[0]; } - public String[] getNames() + public String[] getNamesRef() { return NAMES; } @@ -191,7 +191,7 @@ return NAMES[0]; } - public String[] getNames() + public String[] getNamesRef() { return NAMES; } @@ -257,7 +257,7 @@ return NAMES[0]; } - public String[] getNames() + public String[] getNamesRef() { return NAMES; } @@ -320,7 +320,7 @@ return NAMES[0]; } - public String[] getNames() + public String[] getNamesRef() { return NAMES; } Modified: directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java (original) +++ directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java Sat Jun 7 00:48:16 2008 @@ -106,7 +106,7 @@ return NAMES[0]; } - public final String[] getNames() + public final String[] getNamesRef() { return NAMES; } @@ -160,7 +160,7 @@ return NAMES[0]; } - public final String[] getNames() + public final String[] getNamesRef() { return NAMES; } @@ -214,7 +214,7 @@ return NAMES[0]; } - public final String[] getNames() + public final String[] getNamesRef() { return NAMES; } @@ -268,7 +268,7 @@ return NAMES[0]; } - public final String[] getNames() + public final String[] getNamesRef() { return NAMES; } @@ -321,7 +321,7 @@ return NAMES[0]; } - public final String[] getNames() + public final String[] getNamesRef() { return NAMES; } Modified: directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java (original) +++ directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java Sat Jun 7 00:48:16 2008 @@ -118,9 +118,9 @@ /* (non-Javadoc) - * @see org.apache.directory.shared.ldap.schema.SchemaObject#getNames() + * @see org.apache.directory.shared.ldap.schema.SchemaObject#getNamesRef() */ - public String[] getNames() + public String[] getNamesRef() { return NAMES; } Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/DnComparator.java Sat Jun 7 00:48:16 2008 @@ -72,7 +72,7 @@ catch ( NamingException e ) { // -- what do we do here ? - return -1; + return -1; } return dn0.compareTo( dn1 ); Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDComparator.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDComparator.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDComparator.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDComparator.java Sat Jun 7 00:48:16 2008 @@ -71,26 +71,26 @@ if ( ( obj0 instanceof String ) && ( obj1 instanceof String) ) { - dnstr0 = (String)obj0; - dnstr1 = (String)obj1; - - int dash0 = dnstr0.lastIndexOf( '#' ); - int dash1 = dnstr1.lastIndexOf( '#' ); - - if ( ( dash0 == -1 ) && ( dash1 == -1 ) ) - { - // no UID part - try - { - return getDn( dnstr0 ).compareTo( getDn ( dnstr1 ) ); - } - catch ( NamingException ne ) - { - return -1; - } - } - else - { + dnstr0 = (String)obj0; + dnstr1 = (String)obj1; + + int dash0 = dnstr0.lastIndexOf( '#' ); + int dash1 = dnstr1.lastIndexOf( '#' ); + + if ( ( dash0 == -1 ) && ( dash1 == -1 ) ) + { + // no UID part + try + { + return getDn( dnstr0 ).compareTo( getDn ( dnstr1 ) ); + } + catch ( NamingException ne ) + { + return -1; + } + } + else + { // Now, check that we don't have another '#' if ( dnstr0.indexOf( '#' ) != dash0 ) { @@ -98,7 +98,7 @@ // escaped. return -1; } - + if ( dnstr1.indexOf( '#' ) != dash0 ) { // Yes, we have one : this is not allowed, it should have been @@ -116,14 +116,14 @@ if ( dash0 > 0 ) { - try - { - dn0 = new LdapDN( dnstr0.substring( 0, dash0 ) ); - } - catch ( NamingException ne ) - { - return -1; - } + try + { + dn0 = new LdapDN( dnstr0.substring( 0, dash0 ) ); + } + catch ( NamingException ne ) + { + return -1; + } } else { @@ -137,14 +137,14 @@ if ( dash1 > 0 ) { - try + try + { + dn1 = new LdapDN( dnstr0.substring( 0, dash1 ) ); + } + catch ( NamingException ne ) { - dn1 = new LdapDN( dnstr0.substring( 0, dash1 ) ); - } - catch ( NamingException ne ) - { - return 1; - } + return 1; + } } else { @@ -155,15 +155,15 @@ if ( dnComp != 0 ) { - return dnComp; + return dnComp; } return uid0.compareTo( uid1 ); - } + } } else { - return -1; + return -1; } } Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java Sat Jun 7 00:48:16 2008 @@ -97,7 +97,7 @@ + " has already been registered!" ); } - String[] names = attributeType.getNames(); + String[] names = attributeType.getNamesRef(); for ( String name : names ) { oidRegistry.register( name, attributeType.getOid() ); @@ -133,7 +133,7 @@ binaries.add( type.getOid() ); // add the lowercased name for the names for the attributeType - String[] names = type.getNames(); + String[] names = type.getNamesRef(); for ( String name : names ) { @@ -256,7 +256,7 @@ MatchingRule matchingRule = type.getEquality(); mapping.remove( type.getOid() ); - String[] aliases = type.getNames(); + String[] aliases = type.getNamesRef(); for ( String aliase : aliases ) { mapping.remove( aliase ); @@ -281,7 +281,7 @@ } mapping.put( type.getOid(), oidNormalizer ); - String[] aliases = type.getNames(); + String[] aliases = type.getNamesRef(); for ( String aliase : aliases ) { mapping.put( aliase, oidNormalizer ); Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java Sat Jun 7 00:48:16 2008 @@ -103,7 +103,8 @@ + " has already been registered!" ); } - String[] names = matchingRule.getNames(); + String[] names = matchingRule.getNamesRef(); + for ( String name : names ) { oidRegistry.register( name, matchingRule.getOid() ); Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java Sat Jun 7 00:48:16 2008 @@ -82,7 +82,7 @@ + " has already been registered!" ); } - if ( objectClass.getNames() != null && objectClass.getNames().length > 0 ) + if ( objectClass.getNamesRef() != null && objectClass.getNamesRef().length > 0 ) { oidRegistry.register( objectClass.getName(), objectClass.getOid() ); } Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java?rev=664295&r1=664294&r2=664295&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java Sat Jun 7 00:48:16 2008 @@ -123,13 +123,13 @@ */ public boolean hasOid( String name ) { - if ( StringTools.isEmpty( name ) ) - { - return false; - } - - String normalized = name.trim().toLowerCase(); - + if ( StringTools.isEmpty( name ) ) + { + return false; + } + + String normalized = name.trim().toLowerCase(); + return byName.containsKey( normalized ); } @@ -216,17 +216,17 @@ { if ( !OID.isOID( oid ) ) { - String message = "Swap the parameter order: the oid " + - "does not start with a digit, or is not an OID!"; - - LOG.debug( message ); + String message = "Swap the parameter order: the oid " + + "does not start with a digit, or is not an OID!"; + + LOG.debug( message ); throw new NamingException( message ); } if ( StringTools.isEmpty( name ) ) { - String message = "The name is empty"; - LOG.error( message ); + String message = "The name is empty"; + LOG.error( message ); throw new NamingException( message ); } @@ -263,11 +263,11 @@ if ( value.contains( lowerCase ) ) { - return; + return; } else { - value.add( lowerCase ); + value.add( lowerCase ); } } @@ -282,16 +282,16 @@ public void unregister( String numericOid ) throws NamingException { - // First, remove the from the byOID map + // First, remove the from the byOID map List names = byOid.remove( numericOid ); // Then remove all the from the byName map if ( names != null ) { - for ( String name:names ) - { - byName.remove( name ); - } + for ( String name:names ) + { + byName.remove( name ); + } } // Last, remove the from the byName map