• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SearchResultEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



SearchResultEntry类属于org.apache.directory.api.ldap.model.message包,在下文中一共展示了SearchResultEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addResponse

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Adds a response.
 *
 * @param response
 *      the response to add
 * @return
 *      true (as per the general contract of the Collection.add method).
 */
public boolean addResponse( DsmlDecorator<? extends Response> response )
{
    if ( response instanceof SearchResultEntry )
    {
        ( ( SearchResponse ) getDecorated() ).addSearchResultEntry(
            ( SearchResultEntryDsml ) response );
    }
    else if ( response instanceof SearchResultReference )
    {
        ( ( SearchResponse ) getDecorated() ).addSearchResultReference(
            ( SearchResultReferenceDsml ) response );
    }
    else if ( response instanceof SearchResultDone )
    {
        ( ( SearchResponse ) getDecorated() ).setSearchResultDone(
            ( SearchResultDoneDsml ) response );
    }
    else
    {
        throw new IllegalArgumentException( "Unidentified search resp type" );
    }

    return responses.add( response );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:33,代码来源:SearchResponseDsml.java


示例2: testResponseWithDnAttribute

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with dn Attribute
 */
@Test
public void testResponseWithDnAttribute()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_dn_attribute.xml" ).openStream(),
            "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResponseDsml searchResponseDsml = ( SearchResponseDsml )
        parser.getBatchResponse().getCurrentResponse();
    SearchResponse response = ( SearchResponse ) searchResponseDsml.getDecorated();
    SearchResultEntry searchResultEntry = response.getSearchResultEntryList().get( 0 );

    assertEquals( "dc=example,dc=com", searchResultEntry.getObjectName().toString() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:29,代码来源:SearchResultEntryTest.java


示例3: testResponseWithRequestId

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a Response with the (optional) requestID attribute
 */
@Test
public void testResponseWithRequestId()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_requestID_attribute.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    assertEquals( 456, searchResultEntry.getMessageId() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:28,代码来源:SearchResultEntryTest.java


示例4: getEntry

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Entry getEntry() throws LdapException
{
    if ( isEntry() )
    {
        return ( ( SearchResultEntry ) response ).getEntry();
    }
    
    if ( isReferral() )
    {
        Referral referral = ( ( SearchResultReference ) response ).getReferral();
        throw new LdapReferralException( referral.getLdapUrls() );
    }

    throw new LdapException();
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:20,代码来源:SearchCursorImpl.java


示例5: removeResponse

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Removes a response.
 *
 * @param response
 *      the response to remove
 * @return
 *      true if this list contained the specified element.
 */
public boolean removeResponse( DsmlDecorator<? extends Response> response )
{
    if ( response instanceof SearchResultEntry )
    {
        ( ( SearchResponse ) getDecorated() ).removeSearchResultEntry(
            ( SearchResultEntryDsml ) response );
    }
    else if ( response instanceof SearchResultReference )
    {
        ( ( SearchResponse ) getDecorated() ).removeSearchResultReference(
            ( SearchResultReferenceDsml ) response );
    }
    else if ( response instanceof SearchResultDone )
    {
        if ( response.equals( ( ( SearchResponse ) getDecorated() ).getSearchResultDone() ) )
        {
            ( ( SearchResponse ) getDecorated() ).setSearchResultDone( null );
        }
    }
    else
    {
        throw new IllegalArgumentException( "Unidentified search resp type" );
    }

    return responses.remove( response );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:35,代码来源:SearchResponseDsml.java


示例6: testResponseWith1Control

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with a (optional) Control element
 */
@Test
public void testResponseWith1Control()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control.xml" ).openStream(),
            "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResponse searchResponse = ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated();
    SearchResultEntry searchResultEntry =
        searchResponse.getCurrentSearchResultEntry();
    Map<String, Control> controls =
        searchResponse.getCurrentSearchResultEntry().getControls();

    assertEquals( 1, searchResultEntry.getControls().size() );

    Control control = controls.get( "1.2.840.113556.1.4.643" );

    assertNotNull( control );
    assertTrue( control.isCritical() );
    assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
    assertEquals( "Some text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue() ) );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:38,代码来源:SearchResultEntryTest.java


示例7: testResponseWith1ControlEmptyValue

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with a (optional) Control element with empty value
 */
@Test
public void testResponseWith1ControlEmptyValue()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_control_empty_value.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResponse searchResponse = ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated();
    SearchResultEntry searchResultEntry =
        searchResponse.getCurrentSearchResultEntry();
    Map<String, Control> controls = searchResultEntry.getControls();

    assertEquals( 1, searchResultEntry.getControls().size() );

    Control control = controls.get( "1.2.840.113556.1.4.643" );

    assertNotNull( control );
    assertTrue( control.isCritical() );
    assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
    assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:SearchResultEntryTest.java


示例8: testResponseWith2Controls

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 2 (optional) Control elements
 */
@Test
public void testResponseWith2Controls()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
            "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResponse searchResponse = ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated();
    SearchResultEntry searchResultEntry =
        searchResponse.getCurrentSearchResultEntry();
    Map<String, Control> controls = searchResultEntry.getControls();

    assertEquals( 2, searchResultEntry.getControls().size() );

    Control control = controls.get( "1.2.840.113556.1.4.789" );

    assertNotNull( control );
    assertFalse( control.isCritical() );
    assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
    assertEquals( "Some other text", Strings.utf8ToString( ( ( DsmlControl<?> ) control ).getValue() ) );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:SearchResultEntryTest.java


示例9: testResponseWith3ControlsWithoutValue

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 3 (optional) Control elements without value
 */
@Test
public void testResponseWith3ControlsWithoutValue()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_3_controls_without_value.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResponse searchResponse = ( SearchResponse )
        parser.getBatchResponse().getCurrentResponse().getDecorated();
    SearchResultEntry searchResultEntry =
        searchResponse.getCurrentSearchResultEntry();
    Map<String, Control> controls = searchResultEntry.getControls();

    assertEquals( 3, searchResultEntry.getControls().size() );

    Control control = controls.get( "1.2.840.113556.1.4.456" );

    assertNotNull( control );
    assertTrue( control.isCritical() );
    assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
    assertFalse( ( ( DsmlControl<?> ) control ).hasValue() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:SearchResultEntryTest.java


示例10: testResponseWith1Attr0Value

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 1 Attr 0 Value
 */
@Test
public void testResponseWith1Attr0Value()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput(
            SearchResultEntryTest.class.getResource( "response_with_1_attr_0_value.xml" ).openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 1, entry.size() );

    Iterator<Attribute> attributeIterator = entry.iterator();
    Attribute attribute = attributeIterator.next();
    assertEquals( "dc", attribute.getUpId() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:33,代码来源:SearchResultEntryTest.java


示例11: testResponseWith1Attr1Value

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 1 Attr 1 Value
 */
@Test
public void testResponseWith1Attr1Value()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput(
            SearchResultEntryTest.class.getResource( "response_with_1_attr_1_value.xml" ).openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 1, entry.size() );

    Iterator<Attribute> attributeIterator = entry.iterator();
    Attribute attribute = attributeIterator.next();
    assertEquals( "dc", attribute.getUpId() );

    Iterator<Value> valueIterator = attribute.iterator();
    assertTrue( valueIterator.hasNext() );
    Value value = valueIterator.next();
    assertEquals( "example", value.getValue() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:38,代码来源:SearchResultEntryTest.java


示例12: testResponseWith1Attr1Base64Value

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 1 Attr 1 Base64 Value
 */
@Test
public void testResponseWith1Attr1Base64Value()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_base64_value.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 1, entry.size() );

    Iterator<Attribute> attributeIterator = entry.iterator();
    Attribute attribute = attributeIterator.next();
    assertEquals( "cn", attribute.getUpId() );
    assertEquals( 1, attribute.size() );

    Iterator<Value> valueIterator = attribute.iterator();
    assertTrue( valueIterator.hasNext() );
    Value value = valueIterator.next();

    String expected = new String( new byte[]
        { 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', 'L', ( byte ) 0xc3, ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n',
            'y' }, StandardCharsets.UTF_8 );
    assertEquals( expected, value.getValue() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:43,代码来源:SearchResultEntryTest.java


示例13: testResponseWith1Attr1EmptyValue

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 1 Attr 1 empty Value
 */
@Test
public void testResponseWith1Attr1EmptyValue()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput( SearchResultEntryTest.class.getResource( "response_with_1_attr_1_empty_value.xml" )
            .openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 1, entry.size() );

    Iterator<Attribute> attributeIterator = entry.iterator();
    Attribute attribute = attributeIterator.next();
    assertEquals( "dc", attribute.getUpId() );
    assertEquals( 1, attribute.size() );

    Iterator<Value> valueIterator = attribute.iterator();
    assertTrue( valueIterator.hasNext() );
    Value value = valueIterator.next();
    assertEquals( "", value.getValue() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:39,代码来源:SearchResultEntryTest.java


示例14: testResponseWith1Attr2Value

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 1 Attr 2 Value
 */
@Test
public void testResponseWith1Attr2Value()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput(
            SearchResultEntryTest.class.getResource( "response_with_1_attr_2_value.xml" ).openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 1, entry.size() );

    Iterator<Attribute> attributeIterator = entry.iterator();
    Attribute attribute = attributeIterator.next();
    assertEquals( "objectclass", attribute.getUpId() );
    assertEquals( 2, attribute.size() );

    Iterator<Value> valueIterator = attribute.iterator();
    assertTrue( valueIterator.hasNext() );
    Value value = valueIterator.next();
    assertEquals( "top", value.getValue() );
    assertTrue( valueIterator.hasNext() );
    value = valueIterator.next();
    assertEquals( "domain", value.getValue() );
    assertFalse( valueIterator.hasNext() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:43,代码来源:SearchResultEntryTest.java


示例15: get

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Entry get() throws CursorException
{
    if ( !searchCursor.available() )
    {
        throw new InvalidCursorPositionException();
    }

    try
    {
        do
        {
            if ( response instanceof SearchResultEntry )
            {
                return ( ( SearchResultEntry ) response ).getEntry();
            }

            if ( response instanceof SearchResultReference )
            {
                throw new LdapReferralException( ( ( SearchResultReference ) response ).getReferral().getLdapUrls() );
            }
        }
        while ( next() && !( response instanceof SearchResultDone ) );
    }
    catch ( LdapReferralException lre )
    {
        throw new CursorLdapReferralException( lre );
    }
    catch ( Exception e )
    {
        throw new CursorException( e );
    }

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


示例16: setSearchHandlers

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Inject the MessageReceived and MessageSent handler into the IoHandler
 * 
 * @param searchRequestHandler The SearchRequest message received handler
 * @param searchResultEntryHandler The SearchResultEntry message sent handler
 * @param searchResultReferenceHandler The SearchResultReference message sent handler
 * @param searchResultDoneHandler The SearchResultDone message sent handler
 */
public void setSearchHandlers( LdapRequestHandler<SearchRequest> searchRequestHandler,
    LdapResponseHandler<SearchResultEntry> searchResultEntryHandler,
    LdapResponseHandler<SearchResultReference> searchResultReferenceHandler,
    LdapResponseHandler<SearchResultDone> searchResultDoneHandler
    )
{
    this.handler.removeReceivedMessageHandler( SearchRequest.class );
    this.searchRequestHandler = searchRequestHandler;
    this.searchRequestHandler.setLdapServer( this );
    this.handler.addReceivedMessageHandler( SearchRequest.class, this.searchRequestHandler );

    this.handler.removeSentMessageHandler( SearchResultEntry.class );
    this.searchResultEntryHandler = searchResultEntryHandler;
    this.searchResultEntryHandler.setLdapServer( this );
    this.handler.addSentMessageHandler( SearchResultEntry.class, this.searchResultEntryHandler );

    this.handler.removeSentMessageHandler( SearchResultReference.class );
    this.searchResultReferenceHandler = searchResultReferenceHandler;
    this.searchResultReferenceHandler.setLdapServer( this );
    this.handler.addSentMessageHandler( SearchResultReference.class, this.searchResultReferenceHandler );

    this.handler.removeSentMessageHandler( SearchResultDone.class );
    this.searchResultDoneHandler = searchResultDoneHandler;
    this.searchResultDoneHandler.setLdapServer( this );
    this.handler.addSentMessageHandler( SearchResultDone.class, this.searchResultDoneHandler );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:35,代码来源:LdapServer.java


示例17: testResponseWith2Attr1Value

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * Test parsing of a response with 2 Attr 1 Value
 */
@Test
public void testResponseWith2Attr1Value()
{
    Dsmlv2ResponseParser parser = null;
    try
    {
        parser = new Dsmlv2ResponseParser( getCodec() );

        parser.setInput(
            SearchResultEntryTest.class.getResource( "response_with_2_attr_1_value.xml" ).openStream(), "UTF-8" );

        parser.parse();
    }
    catch ( Exception e )
    {
        fail( e.getMessage() );
    }

    SearchResultEntry searchResultEntry = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
        .getDecorated() )
        .getCurrentSearchResultEntry();

    Entry entry = searchResultEntry.getEntry();
    assertEquals( 2, entry.size() );

    Attribute objectClassAttribute = entry.get( "objectclass" );
    assertEquals( 1, objectClassAttribute.size() );

    Iterator<Value> valueIterator = objectClassAttribute.iterator();
    assertTrue( valueIterator.hasNext() );
    Value value = valueIterator.next();
    assertEquals( "top", value.getValue() );
    assertFalse( valueIterator.hasNext() );

    Attribute dcAttribute = entry.get( "dc" );
    assertEquals( 1, objectClassAttribute.size() );

    valueIterator = dcAttribute.iterator();
    assertTrue( valueIterator.hasNext() );
    value = valueIterator.next();
    assertEquals( "example", value.getValue() );
    assertFalse( valueIterator.hasNext() );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:47,代码来源:SearchResultEntryTest.java


示例18: next

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean next() throws LdapException, CursorException
{
    if ( !searchCursor.next() )
    {
        return false;
    }

    try
    {
        do
        {
            response = searchCursor.get();

            if ( response == null )
            {
                throw new LdapException( LdapNetworkConnection.TIME_OUT_ERROR );
            }

            messageId = response.getMessageId();

            if ( response instanceof SearchResultEntry )
            {
                return true;
            }

            if ( response instanceof SearchResultReference )
            {
                return true;
            }
        }
        while ( !( response instanceof SearchResultDone ) );

        return false;
    }
    catch ( Exception e )
    {
        LdapException ldapException = new LdapException( LdapNetworkConnection.NO_RESPONSE_ERROR );
        ldapException.initCause( e );

        // close the cursor
        try
        {
            close( ldapException );
        }
        catch ( IOException ioe )
        {
            throw new LdapException( ioe.getMessage(), ioe );
        }

        throw ldapException;
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:57,代码来源:EntryCursorImpl.java


示例19: isEntry

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean isEntry()
{
    return response instanceof SearchResultEntry;
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:9,代码来源:SearchCursorImpl.java


示例20: lookup

import org.apache.directory.api.ldap.model.message.SearchResultEntry; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Entry lookup( Dn dn, Control[] controls, String... attributes ) throws LdapException
{
    Entry entry = null;

    try
    {
        SearchRequest searchRequest = new SearchRequestImpl();

        searchRequest.setBase( dn );
        searchRequest.setFilter( LdapConstants.OBJECT_CLASS_STAR );
        searchRequest.setScope( SearchScope.OBJECT );
        searchRequest.addAttributes( attributes );
        searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS );

        if ( ( controls != null ) && ( controls.length > 0 ) )
        {
            searchRequest.addAllControls( controls );
        }

        Cursor<Response> cursor = search( searchRequest );

        // Read the response
        if ( cursor.next() )
        {
            // cursor will always hold SearchResultEntry objects cause there is no ManageDsaITControl passed with search request
            entry = ( ( SearchResultEntry ) cursor.get() ).getEntry();
        }

        // Pass through the SaerchResultDone, or stop
        // if we have other responses
        cursor.next();

        // And close the cursor
        try
        { 
            cursor.close();
        }
        catch ( IOException ioe )
        {
            throw new LdapException( ioe.getMessage(), ioe );
        }

    }
    catch ( CursorException e )
    {
        throw new LdapException( e );
    }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HasMouseUpHandlers类代码示例发布时间:2022-05-22
下一篇:
Java AclEntryTypeProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap