Package org.apache.directory.shared.ldap.entry.client

Examples of org.apache.directory.shared.ldap.entry.client.ClientStringValue


     * @return the LdapServer instance without a DirectoryService
     * @throws Exception
     */
    public LdapServer getLdapServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue( "ads-ldapServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
View Full Code Here


    }


    public KdcServer getKdcServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue(
            "ads-kerberosServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
View Full Code Here

    }


    public DnsServer getDnsServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue( "ads-dnsServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
View Full Code Here


    //TODO making this method invisible cause there is no DhcpServer exists as of now
    private DhcpService getDhcpServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue( "ads-dhcpServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
View Full Code Here

    }


    public NtpServer getNtpServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue( "ads-ntpServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
View Full Code Here

    }


    public HttpServer getHttpServer() throws Exception
    {
        EqualityNode<String> filter = new EqualityNode<String>( "objectClass", new ClientStringValue( "ads-httpServer" ) );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        IndexCursor<Long, ServerEntry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
View Full Code Here

                {
                    node = new EqualityNode<byte[]>( attr.getID(), new ClientBinaryValue( ( byte[] ) value ) );
                }
                else
                {
                    node = new EqualityNode<String>( attr.getID(), new ClientStringValue( ( String ) value ) );
                }

                AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
                try
                {
                    EntryFilteringCursor cursor = doSearchOperation( target, aliasDerefMode, node, ctls );
                    return new NamingEnumerationAdapter ( cursor );
                }
                catch ( Exception e )
                {
                    JndiUtils.wrap( e );
                    return null; // shut compiler up
                }
            }
        }

        /*
         * Go through the set of attributes using each attribute value pair as
         * an attribute value assertion within one big AND filter expression.
         */
        Attribute attr;
        SimpleNode node;
        BranchNode filter = new AndNode();
        NamingEnumeration<? extends Attribute> list = matchingAttributes.getAll();

        // Loop through each attribute value pair
        while ( list.hasMore() )
        {
            attr = list.next();

            /*
             * According to JNDI if an attribute in the matchingAttributes
             * list does not have any values then we match for just the presence
             * of the attribute in the entry
             */
            if ( attr.size() == 0 )
            {
                filter.addNode( new PresenceNode( attr.getID() ) );
                continue;
            }

            /*
             * With 1 or more value we build a set of simple nodes and add them
             * to the AND node - each attribute value pair is a simple AVA node.
             */
            for ( int ii = 0; ii < attr.size(); ii++ )
            {
                Object val = attr.get( ii );

                // Add simpel AVA node if its value is a String
                if ( val instanceof String )
                {
                    node = new EqualityNode<String>( attr.getID(), new ClientStringValue( ( String ) val ) );
                    filter.addNode( node );
                }
            }
        }

View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.client.ClientStringValue

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.