From a823d0217e8151f06b38b09f035e79eab010e242 Mon Sep 17 00:00:00 2001 From: xingwu1 Date: Tue, 4 Oct 2016 12:07:30 -0700 Subject: [PATCH] Fix batch interceptor bugs. --- .../azure/batch/interceptor/ClientRequestIdInterceptor.java | 4 ++-- .../azure/batch/interceptor/DetailLevelInterceptor.java | 6 +++--- .../azure/batch/interceptor/PageSizeInterceptor.java | 2 +- .../azure/batch/interceptor/ServerTimeoutInterceptor.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ClientRequestIdInterceptor.java b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ClientRequestIdInterceptor.java index 9c994cdab007..61355ceb6893 100644 --- a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ClientRequestIdInterceptor.java +++ b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ClientRequestIdInterceptor.java @@ -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); } diff --git a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/DetailLevelInterceptor.java b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/DetailLevelInterceptor.java index 9faaac578679..3683bde0359d 100644 --- a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/DetailLevelInterceptor.java +++ b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/DetailLevelInterceptor.java @@ -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()); } @@ -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()); } @@ -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()); } diff --git a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/PageSizeInterceptor.java b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/PageSizeInterceptor.java index 85b758eb4f03..6d6b7762b22f 100644 --- a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/PageSizeInterceptor.java +++ b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/PageSizeInterceptor.java @@ -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); } diff --git a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ServerTimeoutInterceptor.java b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ServerTimeoutInterceptor.java index ae9692589129..b2276593e8b1 100644 --- a/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ServerTimeoutInterceptor.java +++ b/azure-batch/src/main/java/com/microsoft/azure/batch/interceptor/ServerTimeoutInterceptor.java @@ -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); }