Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ServerAttribute



    @Test
    public void testMatchByOID() throws Exception
    {
        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
       
        // positive test
        assertTrue( evaluator.evaluate( new EqualityNode( "objectClass", new ClientStringValue( "2.5.6.6" ) ), objectClasses ) );

        objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person", "blah" );
View Full Code Here


    @Test
    public void testComplexOrRefinement() throws Exception
    {
        ExprNode refinement = null;
        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
        String refStr = "(|(objectClass=person)(objectClass=organizationalUnit))";
       
        refinement = FilterParser.parse( refStr );

        assertTrue( evaluator.evaluate( refinement, objectClasses ) );
View Full Code Here

    @Test
    public void testComplexAndRefinement() throws Exception
    {
        ExprNode refinement = null;
        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
        objectClasses.add( "organizationalUnit" );
        String refStr = "(&(objectClass=person)(objectClass=organizationalUnit))";
       
        refinement = FilterParser.parse( refStr );

        assertTrue( evaluator.evaluate( refinement, objectClasses ) );
View Full Code Here

    @Test
    public void testComplexNotRefinement() throws Exception
    {
        ExprNode refinement = null;
        ServerAttribute objectClasses = new DefaultServerAttribute( "objectClass", OBJECT_CLASS, "person" );
        String refStr = "(!(objectClass=person))";

        refinement = FilterParser.parse( refStr );

        assertFalse( evaluator.evaluate( refinement, objectClasses ) );
View Full Code Here

        try
        {
            ServerEntry entry = directoryService.getAdminSession().lookup( dn );
            for ( EntryAttribute attr : entry )
            {
                ServerAttribute sa = ( ServerAttribute ) attr;
                String oid = sa.getAttributeType().getOid();
               
                if ( oid.equals( SchemaConstants.OBJECT_CLASS_AT_OID ) )
                {
                    continue;
                }
               
                keys.add( sa.getUpId() );
            }
        }
        catch ( Exception e )
        {
            throw new BackingStoreException( e );
View Full Code Here

    {
        AttributeType at;
        try
        {
            at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
            ServerAttribute attr = new DefaultServerAttribute( at );
            Modification mi = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
            addDelta( mi );
        }
        catch ( NamingException e )
        {
View Full Code Here

    {
        AttributeType at;
        try
        {
            at = directoryService.getSchemaManager().lookupAttributeTypeRegistry( key );
            ServerAttribute attr = new DefaultServerAttribute( at, value );
            Modification mi = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
            addDelta( mi );
        }
        catch ( NamingException e )
        {
View Full Code Here

        // -------------------------------------------------------------------
       
        List<Modification> modItemList = new ArrayList<Modification>(2);
       
        AttributeType modifiersNameAt = atRegistry.lookup( SchemaConstants.MODIFIERS_NAME_AT );
        ServerAttribute attribute = new DefaultServerAttribute(
            SchemaConstants.MODIFIERS_NAME_AT,
            modifiersNameAt,
            getPrincipal().getName());

        Modification modifiers = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
View Full Code Here

        else if ( ! disabled.contains( "TRUE" ) )
        {
            isEnabled = true;
        }

        ServerAttribute dependencies = ServerEntryUtils.getAttribute( mods, dependenciesAT );
       
        if ( dependencies != null )
        {
            checkForDependencies( isEnabled, targetEntry );
        }
View Full Code Here

    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT,
            attributeRegistry.lookup( SchemaConstants.OU_AT_OID ) );
        attrib.add( "Engineering" );
       
        Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib );
       
        mods.add( add );
       
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ServerAttribute

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.