directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r519984 - in /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations: PrincipalObjectFactory.java PrincipalStateFactory.java
Date Mon, 19 Mar 2007 16:09:31 GMT
Author: elecharny
Date: Mon Mar 19 09:09:30 2007
New Revision: 519984

URL: http://svn.apache.org/viewvc?view=rev&rev=519984
Log:
Some more constant migration from code to ShemaConstants

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java?view=diff&rev=519984&r1=519983&r2=519984
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
Mon Mar 19 09:09:30 2007
@@ -53,7 +53,7 @@
 
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
 
-        modifier.setUserId( ( String ) attrs.get( "uid" ).get() );
+        modifier.setUserId( ( String ) attrs.get( SchemaConstants.UID_AT ).get() );
         modifier.setCommonName( ( String ) attrs.get( SchemaConstants.CN_AT ).get() );
 
         KerberosPrincipal principal = new KerberosPrincipal( ( String ) attrs.get( KerberosAttribute.PRINCIPAL
).get() );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java?view=diff&rev=519984&r1=519983&r2=519984
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
Mon Mar 19 09:09:30 2007
@@ -36,6 +36,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -71,19 +72,20 @@
                 outAttrs.put( oc );
             }
 
-            if ( !oc.contains( SchemaConstants.TOP_OC ) )
+            if ( !AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.TOP_OC ) )
             {
                 oc.add( SchemaConstants.TOP_OC );
             }
 
             PrincipalStoreEntry p = ( PrincipalStoreEntry ) obj;
 
-            if ( !oc.contains( "uidObject" ) )
+            if ( !AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.UID_OBJECT_AT
) )
             {
-                oc.add( "uidObject" );
+                oc.add( SchemaConstants.UID_OBJECT_AT );
+                
                 if ( p.getUserId() != null )
                 {
-                    outAttrs.put( "uid", p.getUserId() );
+                    outAttrs.put( SchemaConstants.UID_AT, p.getUserId() );
                 }
                 else
                 {
@@ -91,29 +93,32 @@
                 }
             }
 
-            if ( !oc.contains( SchemaConstants.EXTENSIBLE_OBJECT_OC ) )
+            if ( !AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.EXTENSIBLE_OBJECT_OC
) )
             {
                 oc.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
                 outAttrs.put( "apacheSamType", "7" );
             }
 
-            if ( !oc.contains( "person" ) )
+            if ( ! ( AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.PERSON_OC
) ||
+                     oc.contains( SchemaConstants.PERSON_OC_OID ) ) )
             {
-                oc.add( "person" );
+                oc.add( SchemaConstants.PERSON_OC );
 
                 // TODO - look into adding sn, gn, and cn to ServerProfiles
-                outAttrs.put( "sn", p.getUserId() );
+                outAttrs.put( SchemaConstants.SN_AT, p.getUserId() );
                 outAttrs.put( SchemaConstants.CN_AT, p.getCommonName() );
             }
 
-            if ( !oc.contains( "organizationalPerson" ) )
+            if ( ! ( AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.ORGANIZATIONAL_PERSON_OC
) ||
+                oc.contains( SchemaConstants.ORGANIZATIONAL_PERSON_OC_OID ) ) )
             {
-                oc.add( "organizationalPerson" );
+                oc.add( SchemaConstants.ORGANIZATIONAL_PERSON_OC );
             }
 
-            if ( !oc.contains( "inetOrgPerson" ) )
+            if ( ! ( AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.INET_ORG_PERSON_OC
) ||
+                oc.contains( SchemaConstants.INET_ORG_PERSON_OC_OID ) ) )
             {
-                oc.add( "inetOrgPerson" );
+                oc.add( SchemaConstants.INET_ORG_PERSON_OC );
             }
 
             if ( !oc.contains( "krb5Principal" ) )



Mime
View raw message