Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D5B25C837 for ; Thu, 13 Nov 2014 00:54:16 +0000 (UTC) Received: (qmail 17083 invoked by uid 500); 13 Nov 2014 00:54:16 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 17041 invoked by uid 500); 13 Nov 2014 00:54:16 -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 17032 invoked by uid 99); 13 Nov 2014 00:54:16 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2014 00:54:16 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 36141A124E9; Thu, 13 Nov 2014 00:54:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smckinney@apache.org To: commits@directory.apache.org Message-Id: <2f77a140f3594c81b618cd6c4423ef0d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: directory-fortress-core git commit: fix FC-40 merge on schema constants, chg ldapapi to M25 Date: Thu, 13 Nov 2014 00:54:16 +0000 (UTC) Repository: directory-fortress-core Updated Branches: refs/heads/master 2c6df378e -> d60726648 fix FC-40 merge on schema constants, chg ldapapi to M25 Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/d6072664 Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/d6072664 Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/d6072664 Branch: refs/heads/master Commit: d60726648b081871237b01fbd0db5ef052fcff65 Parents: 2c6df37 Author: Shawn McKinney Authored: Wed Nov 12 18:54:00 2014 -0600 Committer: Shawn McKinney Committed: Wed Nov 12 18:54:00 2014 -0600 ---------------------------------------------------------------------- pom.xml | 3 +- .../ldap/container/OrganizationalUnitDAO.java | 180 ------------------- 2 files changed, 2 insertions(+), 181 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d6072664/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index f44a54c..403efd1 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs 1.9.1 2.7.7 2.0.0-M18-SNAPSHOT - 1.0.0-M26-SNAPSHOT + 1.0.0-M25 + 1.7.0 1.8.0 1.2 http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/d6072664/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitDAO.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitDAO.java b/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitDAO.java deleted file mode 100755 index 4d0c012..0000000 --- a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitDAO.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.directory.fortress.core.ldap.container; - - -import org.apache.directory.api.ldap.model.constants.SchemaConstants; -import org.apache.directory.api.ldap.model.cursor.CursorException; -import org.apache.directory.api.ldap.model.entry.DefaultEntry; -import org.apache.directory.api.ldap.model.entry.Entry; -import org.apache.directory.api.ldap.model.exception.LdapException; -import org.apache.directory.fortress.core.CreateException; -import org.apache.directory.fortress.core.RemoveException; -import org.apache.directory.ldap.client.api.LdapConnection; -import org.apache.directory.fortress.core.ldap.ApacheDsDataProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.apache.directory.fortress.core.GlobalErrIds; -import org.apache.directory.fortress.core.GlobalIds; -import org.apache.directory.fortress.core.util.attr.VUtil; - - -/** - * This class provides data access for the standard ldap object class Organizational Unit. This - * entity is used to provide containers in DIT for organization of related nodes.. - * A container node is used to group other related nodes, i.e. 'ou=People' or 'ou'Roles'. - *
The organizational unit object class is 'organizationalUnit'
- *

- * The OrganizationalUnitDAO maintains the following structural object class: - *

- * organizationalUnit Structural Object Class is used to store basic attributes like ou and description. - *

    - *
  • ------------------------------------------ - *
  • objectclass ( 2.5.6.5 NAME 'organizationalUnit' - *
  • DESC 'RFC2256: an organizational unit' - *
  • SUP top STRUCTURAL - *
  • MUST ou - *
  • MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $ - *
  • x121Address $ registeredAddress $ destinationIndicator $ - *
  • preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ - *
  • telephoneNumber $ internationaliSDNNumber $ - *
  • facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ - *
  • postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) ) - *
  • ------------------------------------------ - *
- *

- * This class is thread safe. - * - * @author Shawn McKinney - */ -final class OrganizationalUnitDAO extends ApacheDsDataProvider -{ - private static final String CLS_NM = OrganizationalUnitDAO.class.getName(); - private static final Logger LOG = LoggerFactory.getLogger( CLS_NM ); - private static final String ORGUNIT_CLASS = "organizationalunit"; - private static final String[] ORGUNIT_OBJ_CLASS = - { - ORGUNIT_CLASS - }; - - - /** - * Package private default constructor. - */ - OrganizationalUnitDAO() - { - } - - - private String getSdRoot( String contextId ) - { - return getRootDn( contextId, GlobalIds.SUFFIX ); - } - - - /** - * @param oe - * @throws org.apache.directory.fortress.core.CreateException - */ - final void create( OrganizationalUnit oe ) - throws CreateException - { - LdapConnection ld = null; - String nodeDn = SchemaConstants.OU_AT + "=" + oe.getName() + ","; - - if ( VUtil.isNotNullOrEmpty( oe.getParent() ) ) - { - nodeDn += SchemaConstants.OU_AT + "=" + oe.getParent() + ","; - } - - nodeDn += getRootDn( oe.getContextId() ); - - try - { - LOG.info( "create container dn [{}]", nodeDn ); - - Entry myEntry = new DefaultEntry( nodeDn, -<<<<<<< HEAD - SchemaConstants.OBJECT_CLASS_AT, ORGUNIT_OBJ_CLASS, - SchemaConstants.OU_AT, oe.getName(), -======= - GlobalIds.OBJECT_CLASS, ORGUNIT_CLASS, - GlobalIds.OU, oe.getName(), ->>>>>>> 55358f9c9d15e549e0121cc1b3cddd4a06d1f4ae - GlobalIds.DESC, oe.getDescription() ); - - ld = getAdminConnection(); - add( ld, myEntry ); - } - catch ( LdapException e ) - { - String error = "create container node dn [" + nodeDn + "] caught LDAPException=" - + e.getMessage(); - throw new CreateException( GlobalErrIds.CNTR_CREATE_FAILED, error, e ); - } - finally - { - closeAdminConnection( ld ); - } - } - - - /** - * @param oe - * @throws org.apache.directory.fortress.core.RemoveException - */ - final void remove( OrganizationalUnit oe ) - throws RemoveException - { - LdapConnection ld = null; - String nodeDn = SchemaConstants.OU_AT + "=" + oe.getName() + ","; - - if ( VUtil.isNotNullOrEmpty( oe.getParent() ) ) - { - nodeDn += SchemaConstants.OU_AT + "=" + oe.getParent() + ","; - } - - nodeDn += getRootDn( oe.getContextId(), GlobalIds.SUFFIX ); - - LOG.info( "remove container dn [{}]", nodeDn ); - - try - { - ld = getAdminConnection(); - deleteRecursive( ld, nodeDn ); - } - catch ( CursorException e ) - { - String error = "remove container node dn [" + nodeDn + "] caught CursorException=" - + e.getMessage(); - throw new RemoveException( GlobalErrIds.CNTR_DELETE_FAILED, error, e ); - } - catch ( LdapException e ) - { - String error = "remove container node dn [" + nodeDn + "] caught LDAPException=" - + e.getMessage(); - throw new RemoveException( GlobalErrIds.CNTR_DELETE_FAILED, error, e ); - } - finally - { - closeAdminConnection( ld ); - } - } -} \ No newline at end of file