Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 49370 invoked from network); 21 Aug 2007 14:53:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 14:53:34 -0000 Received: (qmail 32791 invoked by uid 500); 21 Aug 2007 14:53:31 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 32758 invoked by uid 500); 21 Aug 2007 14:53:31 -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 32747 invoked by uid 99); 21 Aug 2007 14:53:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 07:53:31 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 14:54:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8911D1A981D; Tue, 21 Aug 2007 07:53:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r568152 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java Date: Tue, 21 Aug 2007 14:53:10 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070821145310.8911D1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pamarcelot Date: Tue Aug 21 07:53:09 2007 New Revision: 568152 URL: http://svn.apache.org/viewvc?rev=568152&view=rev Log: Added implementation for the getAttributeType, getObjectClass, getSyntax and getMatchingRule methods. Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java?rev=568152&r1=568151&r2=568152&view=diff ============================================================================== --- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java (original) +++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java Tue Aug 21 07:53:09 2007 @@ -101,7 +101,25 @@ */ public AttributeTypeImpl getAttributeType( String id ) { - // TODO Auto-generated method stub + for ( AttributeTypeImpl at : attributeTypes ) + { + String[] aliases = at.getNames(); + if ( aliases != null ) + { + for ( String alias : aliases ) + { + if ( alias.equalsIgnoreCase( id ) ) + { + return at; + } + } + } + if ( at.getOid().equalsIgnoreCase( id ) ) + { + return at; + } + } + return null; } @@ -120,7 +138,25 @@ */ public MatchingRuleImpl getMatchingRule( String id ) { - // TODO Auto-generated method stub + for ( MatchingRuleImpl mr : matchingRules ) + { + String[] aliases = mr.getNames(); + if ( aliases != null ) + { + for ( String alias : aliases ) + { + if ( alias.equalsIgnoreCase( id ) ) + { + return mr; + } + } + } + if ( mr.getOid().equalsIgnoreCase( id ) ) + { + return mr; + } + } + return null; } @@ -148,7 +184,25 @@ */ public ObjectClassImpl getObjectClass( String id ) { - // TODO Auto-generated method stub + for ( ObjectClassImpl oc : objectClasses ) + { + String[] aliases = oc.getNames(); + if ( aliases != null ) + { + for ( String alias : aliases ) + { + if ( alias.equalsIgnoreCase( id ) ) + { + return oc; + } + } + } + if ( oc.getOid().equalsIgnoreCase( id ) ) + { + return oc; + } + } + return null; } @@ -167,7 +221,25 @@ */ public SyntaxImpl getSyntax( String id ) { - // TODO Auto-generated method stub + for ( SyntaxImpl syntax : syntaxes ) + { + String[] aliases = syntax.getNames(); + if ( aliases != null ) + { + for ( String alias : aliases ) + { + if ( alias.equalsIgnoreCase( id ) ) + { + return syntax; + } + } + } + if ( syntax.getOid().equalsIgnoreCase( id ) ) + { + return syntax; + } + } + return null; }