directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1508893 - in /directory/escimo/trunk/ldap: ./ src/main/java/org/apache/directory/scim/ src/main/java/org/apache/directory/scim/ldap/
Date Wed, 31 Jul 2013 14:53:54 GMT
Author: kayyagari
Date: Wed Jul 31 14:53:53 2013
New Revision: 1508893

URL: http://svn.apache.org/r1508893
Log:
more code(yet to see the output)

Modified:
    directory/escimo/trunk/ldap/pom.xml
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/MultiValAttribute.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttribute.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttributeGroup.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/User.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java

Modified: directory/escimo/trunk/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/pom.xml?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/pom.xml (original)
+++ directory/escimo/trunk/ldap/pom.xml Wed Jul 31 14:53:53 2013
@@ -32,6 +32,12 @@
     
     <dependency>
       <groupId>org.apache.directory.api</groupId>
+      <artifactId>api-ldap-extras-aci</artifactId>
+      <version>${ldap.api.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.api</groupId>
       <artifactId>api-ldap-codec-standalone</artifactId>
       <version>${ldap.api.version}</version>
     </dependency>
@@ -41,5 +47,11 @@
       <artifactId>dom4j</artifactId>
       <version>${dom4j.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.2.4</version>
+    </dependency>
   </dependencies>
 </project>

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/MultiValAttribute.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/MultiValAttribute.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/MultiValAttribute.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/MultiValAttribute.java
Wed Jul 31 14:53:53 2013
@@ -58,4 +58,11 @@ public class MultiValAttribute extends A
         
         atGroupList.add( atGroup );
     }
+
+    @Override
+    public String toString()
+    {
+        return "MultiValAttribute [atGroupList=" + atGroupList + "]";
+    }
+    
 }

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttribute.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttribute.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttribute.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttribute.java
Wed Jul 31 14:53:53 2013
@@ -54,4 +54,11 @@ public class SimpleAttribute extends Abs
         this.value = value;
     }
 
+
+    @Override
+    public String toString()
+    {
+        return "SimpleAttribute [name=" + getName() + ", value=" + value + "]";
+    }
+
 }

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttributeGroup.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttributeGroup.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttributeGroup.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/SimpleAttributeGroup.java
Wed Jul 31 14:53:53 2013
@@ -58,4 +58,11 @@ public class SimpleAttributeGroup
         return atList;
     }
 
+
+    @Override
+    public String toString()
+    {
+        return "SimpleAttributeGroup [atList=" + atList + "]";
+    }
+
 }

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/User.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/User.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/User.java (original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/User.java Wed Jul
31 14:53:53 2013
@@ -49,4 +49,12 @@ public class User
         
         atList.add( at );
     }
+
+    @Override
+    public String toString()
+    {
+        return "User [simpleList=" + simpleList + ", complexList=" + complexList + ", uriAtMap="
+ uriAtMap + "]";
+    }
+    
+    
 }

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
Wed Jul 31 14:53:53 2013
@@ -54,6 +54,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.syntaxCheckers.JavaIntegerSyntaxChecker;
 import org.apache.directory.api.ldap.model.schema.syntaxCheckers.JavaLongSyntaxChecker;
 import org.apache.directory.api.ldap.model.schema.syntaxCheckers.JavaShortSyntaxChecker;
+import org.apache.directory.api.ldap.schemaloader.JarLdifSchemaLoader;
 import org.apache.directory.api.util.Base64;
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.ldap.client.api.LdapConnection;
@@ -436,27 +437,34 @@ public class LdapResourceProvider
 
         LdapNetworkConnection c = new LdapNetworkConnection( "localhost", 10389 );
         c.setTimeOut( Long.MAX_VALUE );
-        c.loadSchema();
         c.bind( "uid=admin,ou=system", "secret" );
+        c.loadSchema(new JarLdifSchemaLoader());
 
-        PersistentSearch ps = new PersistentSearchImpl();
-        ps.setChangesOnly( false );
-        ps.setReturnECs( true );
+//        PersistentSearch ps = new PersistentSearchImpl();
+//        ps.setChangesOnly( false );
+//        ps.setReturnECs( true );
 
         SearchRequest searchRequest = new SearchRequestImpl().setBase( new Dn(
-            "ou=system" ) ).setFilter( "(objectclass=*)" ).setScope(
-            SearchScope.SUBTREE ).addControl( ps );
+            "uid=admin,ou=system" ) ).setFilter( "(objectclass=*)" ).setScope(
+            SearchScope.OBJECT );
         searchRequest.addAttributes( "uid" );
 
         SearchCursor cursor = c.search( searchRequest );
 
+        Entry entry = null;
         while ( cursor.next() )
         {
             Response response = cursor.get();
             SearchResultEntry se = ( SearchResultEntry ) response;
-            System.out.println( se.getEntry() );
-            System.out.println( se.getControl( EntryChange.OID ) );
+            entry = se.getEntry();
         }
+        
         cursor.close();
+        
+        LdapResourceProvider lr = new LdapResourceProvider( c );
+        User user = lr.toUser( entry );
+        System.out.println( user );
+        
+        c.close();
     }
 }

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java?rev=1508893&r1=1508892&r2=1508893&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
Wed Jul 31 14:53:53 2013
@@ -96,7 +96,6 @@ public class LdapSchemaMapper implements
     {
         InputStream in = this.getClass().getClassLoader().getResourceAsStream( "escimo-ldap-mapping.xml"
);
         loadMappings( in );
-        System.out.println( groupSchema );
     }
 
 
@@ -136,7 +135,7 @@ public class LdapSchemaMapper implements
 
             userSchema = new UserSchema( baseDn, filter );
             
-            List<Element> lstSchema = elmUser.elements( "schema" );
+            List<Element> lstSchema = root.elements( "schema" );
             List<Element> lstRef = elmUser.elements( "schemaRef" );
             parseResourceSchema( lstRef, lstSchema, userSchema );
             
@@ -270,7 +269,7 @@ public class LdapSchemaMapper implements
 
                 for ( Element elmType : lstElmTypes )
                 {
-                    Element elmTypeAtGroup = elmComplex.element( "at-group" );
+                    Element elmTypeAtGroup = elmType.element( "at-group" );
                     SimpleTypeGroup stg = parseAtGroup( elmTypeAtGroup, uri );
 
                     String show = elmType.attributeValue( "show" );



Mime
View raw message