Package org.apache.ldap.common.name

Examples of org.apache.ldap.common.name.LdapName


     * @see javax.naming.directory.DirContext#rebind(java.lang.String,
     *      java.lang.Object, javax.naming.directory.Attributes)
     */
    public void rebind( String name, Object obj, Attributes attrs ) throws NamingException
    {
        rebind( new LdapName( name ), obj, attrs );
    }
View Full Code Here


     * @see javax.naming.directory.DirContext#createSubcontext(java.lang.String,
     *      javax.naming.directory.Attributes)
     */
    public DirContext createSubcontext( String name, Attributes attrs ) throws NamingException
    {
        return createSubcontext( new LdapName( name ), attrs );
    }
View Full Code Here

        if ( null == attrs )
        {
            return ( DirContext ) super.createSubcontext( name );
        }

        LdapName target = buildTarget( name );

        String rdn = name.get( name.size() - 1 );

        String rdnAttribute = NamespaceTools.getRdnAttribute( rdn );

        String rdnValue = NamespaceTools.getRdnValue( rdn );

        // Clone the attributes and add the Rdn attributes
        Attributes attributes = ( Attributes ) attrs.clone();

        boolean doRdnPut = attributes.get( rdnAttribute ) == null;

        doRdnPut = doRdnPut || attributes.get( rdnAttribute ).size() == 0;

        doRdnPut = doRdnPut || ! attributes.get( rdnAttribute ).contains( rdnValue );

        if ( doRdnPut )
        {
            attributes.put( rdnAttribute, rdnValue );
        }

        // Add the new context to the server which as a side effect adds
        getNexusProxy().add( target.toString(), target, attributes );

        // Initialize the new context
        ServerLdapContext ctx = new ServerLdapContext( getPrincipal(), getNexusProxy(), getEnvironment(), target );

        Control [] controls = ( ( ServerLdapContext ) this ).getRequestControls();
View Full Code Here

     *      javax.naming.directory.Attributes)
     */
    public NamingEnumeration search( String name, Attributes matchingAttributes )
            throws NamingException
    {
        return search( new LdapName( name ), matchingAttributes, null );
    }
View Full Code Here

     * @see javax.naming.directory.DirContext#search(java.lang.String,
     *      javax.naming.directory.Attributes, java.lang.String[])
     */
    public NamingEnumeration search( String name, Attributes matchingAttributes, String[] attributesToReturn ) throws NamingException
    {
        return search( new LdapName( name ), matchingAttributes, attributesToReturn );
    }
View Full Code Here

     */
    public NamingEnumeration search( Name name, Attributes matchingAttributes, String[] attributesToReturn ) throws NamingException
    {
        SearchControls ctls = new SearchControls();

        LdapName target = buildTarget( name );

        // If we need to return specific attributes add em to the SearchControls
        if ( null != attributesToReturn )
        {
            ctls.setReturningAttributes( attributesToReturn );
View Full Code Here

     *      java.lang.String, javax.naming.directory.SearchControls)
     */
    public NamingEnumeration search( String name, String filter, SearchControls cons )
            throws NamingException
    {
        return search( new LdapName( name ), filter, cons );
    }
View Full Code Here

    public NamingEnumeration search( Name name, String filter, SearchControls cons )
            throws NamingException
    {
        ExprNode filterNode = null;

        LdapName target = buildTarget( name );

        if ( filter == null && getEnvironment().containsKey( "__filter__" ) )
        {
            filterNode = ( ExprNode ) getEnvironment().get( "__filter__" );
        }
View Full Code Here

     *      javax.naming.directory.SearchControls)
     */
    public NamingEnumeration search( String name, String filterExpr,
        Object[] filterArgs, SearchControls cons ) throws NamingException
    {
        return search( new LdapName( name ), filterExpr, filterArgs, cons );
    }
View Full Code Here

                String ldif = ( String ) iterator.next();

                parser.parse( attributes, ldif );

                Name dn = new LdapName( ( String ) attributes.remove( "dn" ).get() );

                dn.remove( 0 );

                ctx.createSubcontext( dn, attributes );
            }
        }
        catch ( Exception e )
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.name.LdapName

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.