Skip to content

Commit

Permalink
Move ARequestQueue.markAsServiced() to RequestQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Apr 23, 2021
1 parent 48dc1ba commit 5203e26
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ public void set(String name, String val) {
}

public void accept(IRequest destreq) {
try {
acceptImpl(destreq);
} catch (Exception e) {
throw new RuntimeException(e);
}
}

public void acceptImpl(IRequest destreq) throws Exception {

logger.debug("dest " + mDest.getId() + " done with " + destreq.getRequestId());

CAEngine engine = CAEngine.getInstance();
Expand Down
16 changes: 2 additions & 14 deletions base/server/src/com/netscape/cmscore/request/ARequestQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,21 +288,9 @@ public IRequest cloneAndMarkPending(IRequest r)
*
* Caller must lock request and release request.
*
* @param r request
* @param request request
*/
public final void markAsServiced(IRequest r) {
r.setRequestStatus(RequestStatus.COMPLETE);
try {
updateRequest(r);
} catch (EBaseException e) {
throw new RuntimeException(e);
}

if (mNotify != null)
mNotify.notify(r);

return;
}
public abstract void markAsServiced(IRequest request) throws EBaseException;

/**
* Returns an enumerator that lists all RequestIds in the
Expand Down
11 changes: 11 additions & 0 deletions base/server/src/com/netscape/cmscore/request/RequestQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ public void approveRequest(IRequest request) throws EBaseException {
stateEngine(request);
}

public void markAsServiced(IRequest request) throws EBaseException {

request.setRequestStatus(RequestStatus.COMPLETE);

updateRequest(request);

if (mNotify != null) {
mNotify.notify(request);
}
}

public RequestId findRequestBySourceId(String id) {
IRequestList irl = findRequestsBySourceId(id);

Expand Down

0 comments on commit 5203e26

Please sign in to comment.