| | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.ConnectionFactory; |
| | | import org.forgerock.opendj.ldap.Entry; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.ResultHandler; |
| | | import org.forgerock.opendj.ldap.requests.AddRequest; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Promise<?, ErrorResultException> performOperation(Connection connection, DataSource[] dataSources, |
| | | public Promise<?, LdapException> performOperation(Connection connection, DataSource[] dataSources, |
| | | long currentTime) { |
| | | if (needsDelete(currentTime)) { |
| | | DeleteRequest dr = Requests.newDeleteRequest(getDNEntryToRemove()); |
| | |
| | | } |
| | | } |
| | | |
| | | private Promise<Result, ErrorResultException> performAddOperation(Connection connection, long currentTime) { |
| | | private Promise<Result, LdapException> performAddOperation(Connection connection, long currentTime) { |
| | | try { |
| | | Entry entry; |
| | | synchronized (generator) { |
| | |
| | | } catch (IOException e) { |
| | | // faking an error result by notifying the Handler |
| | | UpdateStatsResultHandler<Result> resHandler = new UpdateStatsResultHandler<Result>(currentTime); |
| | | resHandler.handleError(ErrorResultException.newErrorResult(ResultCode.OTHER, e)); |
| | | resHandler.handleError(LdapException.newErrorResult(ResultCode.OTHER, e)); |
| | | return null; |
| | | } |
| | | } |