当前位置: 首页>>代码示例>>Java>>正文


Java AttributeType.getOid方法代码示例

本文整理汇总了Java中org.apache.directory.api.ldap.model.schema.AttributeType.getOid方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeType.getOid方法的具体用法?Java AttributeType.getOid怎么用?Java AttributeType.getOid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.directory.api.ldap.model.schema.AttributeType的用法示例。


在下文中一共展示了AttributeType.getOid方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUpId

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * Get the UpId if it is null.
 * 
 * @param upId The ID
 */
private String getUpId( String upId, AttributeType attributeType )
{
    String normUpId = Strings.trim( upId );

    if ( attributeType == null )
    {
        if ( Strings.isEmpty( normUpId ) )
        {
            String message = I18n.err( I18n.ERR_04458 );
            LOG.error( message );
            throw new IllegalArgumentException( message );
        }

        return upId;
    }
    else if ( Strings.isEmpty( normUpId ) )
    {
        String id = attributeType.getName();

        if ( Strings.isEmpty( id ) )
        {
            id = attributeType.getOid();
        }

        return id;
    }
    else
    {
        return upId;
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:DefaultEntry.java

示例2: hasDescendants

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean hasDescendants( AttributeType ancestor ) throws LdapException
{
    String oid = ancestor.getOid();
    Set<AttributeType> descendants = oidToDescendantSet.get( oid );
    return ( descendants != null ) && !descendants.isEmpty();
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:11,代码来源:DefaultAttributeTypeRegistry.java

示例3: addMappingFor

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void addMappingFor( AttributeType attributeType ) throws LdapException
{
    MatchingRule equality = attributeType.getEquality();
    OidNormalizer oidNormalizer;
    String oid = attributeType.getOid();

    if ( equality == null )
    {
        LOG.debug( "Attribute {} does not have an EQUALITY MatchingRule : using NoopNormalizer", attributeType
            .getName() );
        oidNormalizer = new OidNormalizer( oid, new NoOpNormalizer( attributeType.getOid() ) );
    }
    else
    {
        oidNormalizer = new OidNormalizer( oid, equality.getNormalizer() );
    }

    oidNormalizerMap.put( oid, oidNormalizer );

    // Also inject the attributeType's short names in the map
    for ( String name : attributeType.getNames() )
    {
        oidNormalizerMap.put( Strings.toLowerCaseAscii( name ), oidNormalizer );
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:30,代码来源:DefaultAttributeTypeRegistry.java

示例4: normalizeByName

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Object normalizeByName( AttributeType attributeType, String value ) throws LdapException
{
    MatchingRule mrule = attributeType.getEquality();
    Normalizer normalizer;
        
    if ( mrule == null )
    {
        return new NoOpNormalizer( attributeType.getOid() );
    }
    else
    {
        normalizer = attributeType.getEquality().getNormalizer();
    }

    if ( attributeType.getSyntax().isHumanReadable() )
    {
        return normalizer.normalize( value );
    }
    else
    {
        String unescaped = unescape( value );

        return normalizer.normalize( unescaped );
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:30,代码来源:ConcreteNameComponentNormalizer.java

示例5: setUpIdInternal

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
private void setUpIdInternal( String upId, String newId, AttributeType attributeType )
{
    if ( attributeType == null )
    {
        if ( this.attributeType == null )
        {
            this.upId = upId;
            this.id = newId;

            // Compute the hashCode
            rehash();

            return;
        }
        else
        {
            if ( areCompatible( newId, this.attributeType ) )
            {
                this.upId = upId;
                this.id = this.attributeType.getOid();

                // Compute the hashCode
                rehash();

                return;
            }
            else
            {
                return;
            }
        }
    }

    if ( Strings.isEmpty( newId ) )
    {
        this.attributeType = attributeType;
        this.upId = attributeType.getName();
        this.id = attributeType.getOid();

        // Compute the hashCode
        rehash();

        return;
    }

    if ( areCompatible( newId, attributeType ) )
    {
        this.upId = upId;
        this.id = attributeType.getOid();
        this.attributeType = attributeType;

        // Compute the hashCode
        rehash();

        return;
    }

    throw new IllegalArgumentException( "ID '" + id + "' and AttributeType '" + attributeType.getName()
        + "' are not compatible " );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:61,代码来源:DefaultAttribute.java

示例6: apply

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException
{
    if ( attributeType == null )
    {
        throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
    }

    this.attributeType = attributeType;
    this.id = attributeType.getOid();

    if ( Strings.isEmpty( this.upId ) )
    {
        this.upId = attributeType.getName();
    }
    else
    {
        if ( !areCompatible( this.upId, attributeType ) )
        {
            this.upId = attributeType.getName();
        }
    }

    if ( values != null )
    {
        Set<Value> newValues = new LinkedHashSet<>( values.size() );

        for ( Value value : values )
        {
            if ( value.isSchemaAware() )
            {
                newValues.add( value );
            }
            else
            {
                if ( value.isHumanReadable() )
                {
                    newValues.add( new Value( attributeType, value.getValue() ) );
                }
                else
                {
                    newValues.add( new Value( attributeType, value.getBytes() ) );
                }
            }
        }

        values = newValues;
    }

    isHR = attributeType.getSyntax().isHumanReadable();

    // Compute the hashCode
    rehash();
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:58,代码来源:DefaultAttribute.java

示例7: getValue

import org.apache.directory.api.ldap.model.schema.AttributeType; //导入方法依赖的package包/类
/**
 * Get the value of the Ava which type is given as an
 * argument.
 *
 * @param type the type of the NameArgument
 * @return the value to be returned, or null if none found.
 * @throws LdapInvalidDnException if the Rdn is invalid
 */
public Object getValue( String type ) throws LdapInvalidDnException
{
    // First, let's normalize the type
    String normalizedType = Strings.lowerCaseAscii( Strings.trim( type ) );

    if ( schemaManager != null )
    {
        AttributeType attributeType = schemaManager.getAttributeType( normalizedType );

        if ( attributeType != null )
        {
            normalizedType = attributeType.getOid();
        }
    }

    switch ( nbAvas )
    {
        case 0:
            return "";

        case 1:
            if ( ava.getNormType().equals( normalizedType ) )
            {
                if ( ava.getValue() != null )
                {
                    return ava.getValue().getValue();
                }
                else
                {
                    return null;
                }
            }

            return "";

        default:
            List<Ava> avaList = avaTypes.get( normalizedType );
            
            if ( avaList != null )
            {
                for ( Ava elem : avaList )
                {
                    if ( elem.getNormType().equals( normalizedType ) )
                    {
                        if ( elem.getValue() != null )
                        {
                            return elem.getValue().getValue();
                        }
                        else
                        {
                            return null;
                        }
                    }
                }

                return null;
            }

            return null;
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:70,代码来源:Rdn.java


注:本文中的org.apache.directory.api.ldap.model.schema.AttributeType.getOid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。