Skip to content

Commit

Permalink
Fix batch interceptor bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwu1 committed Oct 4, 2016
1 parent 603e1df commit a823d02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public void modify(Object request) {
Class<?> c = request.getClass();

try {
Method clientRequestIdMethod = c.getMethod("setClientRequestId", new Class[]{String.class});
Method clientRequestIdMethod = c.getMethod("withClientRequestId", new Class[]{String.class});
if (clientRequestIdMethod != null) {
String clientRequestId = UUID.randomUUID().toString();
clientRequestIdMethod.invoke(request, clientRequestId);
}

Method returnClientRequestIdMethod = c.getMethod("setReturnClientRequestId", new Class[]{Boolean.class});
Method returnClientRequestIdMethod = c.getMethod("withReturnClientRequestId", new Class[]{Boolean.class});
if (returnClientRequestIdMethod != null) {
returnClientRequestIdMethod.invoke(request, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void modify(Object request) {
if (detailLevel != null) {
Class<?> c = request.getClass();
try {
Method selectMethod = c.getMethod("setSelect", new Class[]{String.class});
Method selectMethod = c.getMethod("withSelect", new Class[]{String.class});
if (selectMethod != null) {
selectMethod.invoke(request, detailLevel.selectClause());
}
Expand All @@ -31,7 +31,7 @@ public void modify(Object request) {
}

try {
Method filterMethod = c.getMethod("setFilter", new Class[]{String.class});
Method filterMethod = c.getMethod("withFilter", new Class[]{String.class});
if (filterMethod != null) {
filterMethod.invoke(request, detailLevel.filterClause());
}
Expand All @@ -40,7 +40,7 @@ public void modify(Object request) {
}

try {
Method expandMethod = c.getMethod("setExpand", new Class[]{String.class});
Method expandMethod = c.getMethod("withExpand", new Class[]{String.class});
if (expandMethod != null) {
expandMethod.invoke(request, detailLevel.expandClause());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public PageSizeInterceptor(int pageSize) {
public void modify(Object request) {
Class<?> c = request.getClass();
try {
Method maxResultsMethod = c.getMethod("setMaxResults", new Class[]{Integer.class});
Method maxResultsMethod = c.getMethod("withMaxResults", new Class[]{Integer.class});
if (maxResultsMethod != null) {
maxResultsMethod.invoke(request, maxResults);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public ServerTimeoutInterceptor(int timeout) {
public void modify(Object request) {
Class<?> c = request.getClass();
try {
Method timeoutMethod = c.getMethod("setTimeout", new Class[]{Integer.class});
Method timeoutMethod = c.getMethod("withTimeout", new Class[]{Integer.class});
if (timeoutMethod != null) {
timeoutMethod.invoke(request, serverTimeout);
}
Expand Down

0 comments on commit a823d02

Please sign in to comment.