/** * Checks for equality by using the underlying LdapResult objects of this * SearchResponseDone stub. * * @param obj * the object to be tested for equality * @return true if obj is equivalent to this SearchResponseDone impl */ @Override public boolean equals( Object obj ) { // quickly return if the obj is this object if ( obj == this ) { return true; } if ( !super.equals( obj ) ) { return false; } LdapResult result = ( ( SearchResultDone ) obj ).getLdapResult(); return getLdapResult().equals( result ); }
/** * Send an error response to he consue r: it has to send a SYNC_REFRESH request first. */ private void sendESyncRefreshRequired( LdapSession session, SearchRequest req ) throws Exception { SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse(); searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.E_SYNC_REFRESH_REQUIRED ); SyncDoneValue syncDone = new SyncDoneValueDecorator( ldapServer.getDirectoryService().getLdapCodecService() ); searchDoneResp.addControl( syncDone ); session.getIoSession().write( searchDoneResp ); }
private ResultCodeEnum handleSearchResultDone( SearchResultDone searchDone ) { CONSUMER_LOG.debug( "///////////////// handleSearchDone //////////////////" ); SyncDoneValue ctrl = ( SyncDoneValue ) searchDone.getControls().get( SyncDoneValue.OID ); if ( ( ctrl != null ) && ( ctrl.getCookie() != null ) ) { syncCookie = ctrl.getCookie(); CONSUMER_LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString( syncCookie ) ); storeCookie(); } CONSUMER_LOG.debug( "//////////////// END handleSearchDone//////////////////////" ); reload = false; return searchDone.getLdapResult().getResultCode(); }
if (done.getLdapResult().getResultCode() != ResultCodeEnum.UNWILLING_TO_PERFORM) { PagedResults ctrl = (PagedResults) done.getControl(PagedResults.OID); if (ctrl != null) { cookie = ctrl.getCookie();
/** * Gets the response controls. * * @return the response controls, may be null * * @throws NamingException the naming exception */ public Control[] getResponseControls() throws NamingException { if ( searchResultDone != null ) { Map<String, org.apache.directory.api.ldap.model.message.Control> controlsMap = searchResultDone .getControls(); if ( ( controlsMap != null ) && ( controlsMap.size() > 0 ) ) { return convertControls( controlsMap.values() ); } } return new Control[0]; }
/** * {@inheritDoc} */ public void handle( LdapSession session, SearchResultDone searchResultDone ) throws Exception { LOG.debug( "Message Sent : {}", searchResultDone ); SearchRequestContainer searchRequestContainer = session.getSearchRequest( searchResultDone.getMessageId() ); if ( searchRequestContainer != null ) { // Unregister the request from the session session.unregisterSearchRequest( searchRequestContainer.getSearchRequest() ); } } }
/** * Checks for equality by using the underlying LdapResult objects of this * SearchResponseDone stub. * * @param obj * the object to be tested for equality * @return true if obj is equivalent to this SearchResponseDone impl */ @Override public boolean equals( Object obj ) { // quickly return if the obj is this object if ( obj == this ) { return true; } if ( !super.equals( obj ) ) { return false; } LdapResult result = ( ( SearchResultDone ) obj ).getLdapResult(); return getLdapResult().equals( result ); }
searchDoneResp.getLdapResult().setResultCode( re ); while ( itr.hasNext() ) searchDoneResp.addControl( itr.next() );
/** * Checks for equality by using the underlying LdapResult objects of this * SearchResponseDone stub. * * @param obj * the object to be tested for equality * @return true if obj is equivalent to this SearchResponseDone impl */ @Override public boolean equals( Object obj ) { // quickly return if the obj is this object if ( obj == this ) { return true; } if ( !super.equals( obj ) ) { return false; } LdapResult result = ( ( SearchResultDone ) obj ).getLdapResult(); return getLdapResult().equals( result ); }
searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS ); SyncDoneValue syncDone = new SyncDoneValueDecorator( ldapServer.getDirectoryService().getLdapCodecService() ); syncDone.setCookie( cookie ); searchDoneResp.addControl( syncDone );
@Override public boolean hasNext() throws org.ldaptive.LdapException { if (cursor == null || response != null) { return false; } boolean more = false; try { more = cursor.next(); if (!more) { final SearchResultDone done = cursor.getSearchResultDone(); logger.trace("reading search result done: {}", done); throwOperationException(request, done); final LdapResult ldapResult = done.getLdapResult(); response = createResponse(request, null, done); } } catch (LdapOperationException e) { processLdapOperationException(e); } catch (org.apache.directory.api.ldap.model.exception.LdapException e) { processLdapException(e); } catch (LdapException | RuntimeException e) { throw e; } catch (Exception e) { throw new org.ldaptive.LdapException(e); } return more; }
if ( searchDoneResp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS ) ldapServer.getDirectoryService().getLdapCodecService() ); syncDone.setCookie( cookie ); searchDoneResp.addControl( syncDone ); PROVIDER_LOG.info( "Sending the searchResultDone response to consumer {}, {}", replicaLog, searchDoneResp ); PROVIDER_LOG.warn( "initial content refresh didn't succeed due to {}", searchDoneResp.getLdapResult() .getResultCode() ); replicaLog.stop();
LdapResult ldapResult = searchDoneResp.getLdapResult();
/** * {@inheritDoc} */ @Override public Element toDsml( Element root ) { Element element; if ( root != null ) { element = root.addElement( SEARCH_RESULT_DONE_TAG ); } else { element = new DefaultElement( SEARCH_RESULT_DONE_TAG ); } LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), getDecorated().getLdapResult(), getDecorated() ); ldapResultDsml.toDsml( element ); return element; } }
return temporaryMap.entrySet().iterator().next(); } else if(searchResponse != null && searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_DONE){ LdapResult result = ((SearchResultDone)searchResponse).getLdapResult(); if(result.getResultCode() != ResultCodeEnum.SUCCESS) { throw new LscServiceCommunicationException(result.getDiagnosticMessage(), null);
if ( searchResultDone.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
if ( searchResultDone.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
if ( searchResultDone.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
resultCode = srDone.getLdapResult().getResultCode();
if ( done.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )