Package org.apache.directory.api.ldap.model.name

Examples of org.apache.directory.api.ldap.model.name.Dn



    @Test
    public void testModifyReplace() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );

        Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, SN_AT );

        String attribVal = "Johnny";
        attrib.add( attribVal );
View Full Code Here



    @Test
    public void testModifyRemove() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );

        Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, SN_AT );

        Modification add = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
View Full Code Here


    @Test
    public void testModifyReplaceNonExistingIndexAttribute() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=Tim B,ou=Sales,o=Good Times Co." );
        Entry entry = new DefaultEntry( schemaManager, dn,
            "objectClass: top",
            "objectClass: person",
            "objectClass: organizationalPerson",
            "cn", "Tim B",
View Full Code Here

        store.setPartitionPath( wkdir.toURI() );
        store.setSyncOnWrite( false );
        // do not add ou index this time
        store.addIndex( new JdbmIndex( SchemaConstants.UID_AT_OID, false ) );

        Dn suffixDn = new Dn( schemaManager, "o=Good Times Co." );
        store.setSuffixDn( suffixDn );
        // init the store to call deleteUnusedIndexFiles() method
        store.initialize();

        assertFalse( ouIndexDbFile.exists() );
View Full Code Here

    @Test
    public void testAddEntryNonExistingAT() throws Exception
    {
        LdapConnection connection = getAdminConnection( getLdapServer() );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry();
        personEntry.add( SchemaConstants.OBJECT_CLASS_AT, "person" );
        personEntry.add( SchemaConstants.CN_AT, "Kate Bush" );
        personEntry.add( SchemaConstants.SN_AT, "Bush" );
View Full Code Here

    @Test(expected = LdapOperationException.class)
    public void testAddEntryNonExistingOC() throws Exception
    {
        LdapConnection connection = getAdminConnection( getLdapServer() );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry();
        personEntry.add( SchemaConstants.OBJECT_CLASS_AT, "nonexistingOC" );
        personEntry.add( SchemaConstants.CN_AT, "Kate Bush" );
        personEntry.add( SchemaConstants.SN_AT, "Bush" );
View Full Code Here

            dataBytes[i] = 'A';
        }

        String data = Strings.utf8ToString( dataBytes );

        Dn dn = new Dn( "cn=Kate Bush," + BASE );

        Entry personEntry = new DefaultEntry( "cn=Kate Bush," + BASE,
            "objectClass: top",
            "objectClass: person",
            "cn: Kate Bush",
View Full Code Here

    @Test
    public void testCursorNextPrevWithReset() throws Exception
    {
        try
        {
            Dn base = new Dn( "dc=example,dc=com" );
            SearchScope scope = SearchScope.SUBTREE;
            ExprNode exprNode = FilterParser.parse( getService().getSchemaManager(), "(objectClass=*)" );
            AliasDerefMode aliasDerefMode = AliasDerefMode.DEREF_ALWAYS;
            Cursor<Entry> cursor = getService().getAdminSession()
                .search( base, scope, exprNode, aliasDerefMode );
View Full Code Here

    @Test
    public void testCursorPrevNext() throws Exception
    {
        try
        {
            Dn base = new Dn( "dc=example,dc=com" );
            SearchScope scope = SearchScope.SUBTREE;
            ExprNode exprNode = FilterParser.parse( getService().getSchemaManager(), "(objectClass=*)" );
            AliasDerefMode aliasDerefMode = AliasDerefMode.DEREF_ALWAYS;
            Cursor<Entry> cursor = getService().getAdminSession()
                .search( base, scope, exprNode, aliasDerefMode );
View Full Code Here

        throws Exception
    {
        List<String> nextResults = new ArrayList<String>();

        ExprNode exprNode = FilterParser.parse( getService().getSchemaManager(), filter );
        Cursor<Entry> cursor = getService().getAdminSession().search( new Dn( base ), scope, exprNode,
            aliasDerefMode );
        cursor.beforeFirst();

        while ( cursor.next() )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.name.Dn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.