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

Examples of org.apache.directory.shared.ldap.entry.StringValue


    private byte[] findClassInDIT( List<DN> searchContexts, String name ) throws ClassNotFoundException
    {
        // Set up the search filter
        BranchNode filter = new AndNode( );
        filter.addNode( new EqualityNode<String>( "fullyQualifiedJavaClassName",
            new StringValue( name ) ) );
        filter.addNode( new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
            new StringValue( ApacheSchemaConstants.JAVA_CLASS_OC ) ) );
       
        try
        {
            for ( DN base : searchContexts )
            {
View Full Code Here


            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( attribute );

            if ( attributeType.getSyntax().isHumanReadable() )
            {
                normalized = new StringValue(
                    (String) ncn.normalizeByName( attribute, value.getString() ) );
            }
            else
            {
                normalized = (Value<?>)ncn.normalizeByName( attribute, value.getBytes() );
View Full Code Here

        Value<?> normInitial = null;

        if ( node.getInitial() != null )
        {
            normInitial = normalizeValue( node.getAttribute(), new StringValue( node.getInitial() ) );

            if ( normInitial == null )
            {
                return null;
            }
        }

        List<String> normAnys = null;

        if ( ( node.getAny() != null ) && ( node.getAny().size() != 0 ) )
        {
            normAnys = new ArrayList<String>( node.getAny().size() );

            for ( String any : node.getAny() )
            {
                Value<?> normAny = normalizeValue( node.getAttribute(), new StringValue( any ) );

                if ( normAny != null )
                {
                    normAnys.add( normAny.getString() );
                }
            }

            if ( normAnys.size() == 0 )
            {
                return null;
            }
        }

        Value<?> normFinal = null;

        if ( node.getFinal() != null )
        {
            normFinal = normalizeValue( node.getAttribute(), new StringValue( node.getFinal() ) );

            if ( normFinal == null )
            {
                return null;
            }
View Full Code Here

        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
        String spUnitName = StoredProcUtils.extractStoredProcUnitName( fullSPName );
       
        AttributeType at = session.getDirectoryService()
            .getSchemaManager().lookupAttributeTypeRegistry( "storedProcUnitName" );
        ExprNode filter = new EqualityNode<String>( "storedProcUnitName", new StringValue( at, spUnitName ) );
        DN dn = new DN( storedProcContainer );
        EntryFilteringCursor results = session.search( dn, SearchScope.SUBTREE, filter,
            AliasDerefMode.DEREF_ALWAYS, EMPTY_ATTRIBS );
        if ( results.first() )
        {
View Full Code Here

        // make sure we add the request controls to operation
        if ( attributeType.getSyntax().isHumanReadable() )
        {
            if ( value instanceof String )
            {
                val = new StringValue( attributeType, (String)value );
            }
            else if ( value instanceof byte[] )
            {
                val = new StringValue( attributeType, StringTools.utf8ToString( (byte[])value ) );
            }
            else
            {
                throw new NamingException( I18n.err( I18n.ERR_309, oid ) );
            }
View Full Code Here

        {
            if ( value instanceof byte[] )
            {
                try
                {
                    return new StringValue( new String( ( byte[] ) value, "UTF-8" ) );
                }
                catch ( UnsupportedEncodingException uee )
                {
                    String message = I18n.err( I18n.ERR_47 );
                    LOG.error( message );
View Full Code Here

        // make sure we add the request controls to operation
        if ( attributeType.getSyntax().isHumanReadable() )
        {
            if ( value instanceof String )
            {
                val = new StringValue( attributeType, (String)value );
            }
            else if ( value instanceof byte[] )
            {
                val = new StringValue( attributeType, StringTools.utf8ToString( (byte[])value ) );
            }
            else
            {
                throw new LdapException( I18n.err( I18n.ERR_309, oid ) );
            }
View Full Code Here

        for ( String suffix:suffixes )
        {
            DN baseDn = parseNormalized( session.getDirectoryService().getSchemaManager(), suffix );
            ExprNode filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
                new StringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
            SearchControls ctls = new SearchControls();
            ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
           
            SearchOperationContext searchOperationContext = new SearchOperationContext( session,
                baseDn, filter, ctls );
View Full Code Here

     * {@inheritDoc}
     */
    public void init( DirectoryService directoryService, String... suffixes ) throws Exception
    {
        ExprNode referralFilter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
            new StringValue( SchemaConstants.REFERRAL_OC ) );

        // Lookup for each entry with the ObjectClass = Referral value
        SearchControls searchControl = new SearchControls();
        searchControl.setReturningObjFlag( false );
        searchControl.setSearchScope( SearchControls.SUBTREE_SCOPE );
View Full Code Here

     * {@inheritDoc}
     */
    public void remove( DirectoryService directoryService, DN suffix ) throws Exception
    {
        ExprNode referralFilter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
            new StringValue( SchemaConstants.REFERRAL_OC ) );

        // Lookup for each entry with the ObjectClass = Referral value
        SearchControls searchControl = new SearchControls();
        searchControl.setReturningObjFlag( false );
        searchControl.setSearchScope( SearchControls.SUBTREE_SCOPE );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.StringValue

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.