]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6948 rename method Request#getLocalConnector() to localConnector()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 15 Apr 2016 07:15:20 +0000 (09:15 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 15 Apr 2016 07:15:20 +0000 (09:15 +0200)
it/it-plugins/ws-plugin/src/main/java/LocalCallWebService.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/LocalConnector.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/internal/SimpleGetRequest.java
sonar-plugin-api/src/main/java/org/sonar/api/server/ws/internal/ValidatingRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/LocalWsConnector.java
sonar-ws/src/test/java/org/sonarqube/ws/client/WsClientFactoriesTest.java

index b878ef2c47f7d5a993015f37efc4bbd94535a8c1..7a2ca7561aaffeb75c66846ce129268c5ec72cd0 100644 (file)
@@ -49,7 +49,7 @@ public final class LocalCallWebService implements WebService {
   private class ProtobufHandler implements RequestHandler {
     @Override
     public void handle(Request request, Response response) throws Exception {
-      WsClient client = wsClientFactory.newClient(request.getLocalConnector());
+      WsClient client = wsClientFactory.newClient(request.localConnector());
 
       WsCe.TaskTypesWsResponse ceTaskTypes = client.ce().taskTypes();
       response.stream().setStatus(ceTaskTypes.getTaskTypesCount() > 0 ? 200 : 500);
@@ -59,7 +59,7 @@ public final class LocalCallWebService implements WebService {
   private class JsonHandler implements RequestHandler {
     @Override
     public void handle(Request request, Response response) throws Exception {
-      WsClient client = wsClientFactory.newClient(request.getLocalConnector());
+      WsClient client = wsClientFactory.newClient(request.localConnector());
 
       WsResponse jsonResponse = client.wsConnector().call(new GetRequest("api/issues/search"));
       boolean ok = jsonResponse.contentType().equals(MediaTypes.JSON)
@@ -72,7 +72,7 @@ public final class LocalCallWebService implements WebService {
   private class RequirePermissionHandler implements RequestHandler {
     @Override
     public void handle(Request request, Response response) throws Exception {
-      WsClient client = wsClientFactory.newClient(request.getLocalConnector());
+      WsClient client = wsClientFactory.newClient(request.localConnector());
 
       WsResponse jsonResponse = client.wsConnector().call(new GetRequest("api/system/info"));
 
index d4a2fc4440e8e99e7c8c9093472601dc31c7f807..eb93d97957d18a5ec062b5a068cec0610812287b 100644 (file)
@@ -35,7 +35,7 @@ import javax.annotation.CheckForNull;
  * public class MyRequestHandler implements RequestHandler {
  *   {@literal @}Override
  *   public void handle(Request request, Response response) {
- *     WsClient wsClient = WsClientFactories.getLocal().newClient(request.getLocalConnector());
+ *     WsClient wsClient = WsClientFactories.getLocal().newClient(request.localConnector());
  *     SearchWsResponse issues = wsClient.issues().search(new SearchWsRequest());
  *     // ...
  *   }
index d30802cad2aa373db90dbabfadd2ac637c1a3b28..6396ecab761a680d86a555c4f9a01bb44097a009 100644 (file)
@@ -242,5 +242,5 @@ public abstract class Request {
    * @since 5.5
    */
   @Beta
-  public abstract LocalConnector getLocalConnector();
+  public abstract LocalConnector localConnector();
 }
index 99c530f65b6f2c97a42b28e3b5979bf007702dbc..484956d7a6845e172601c6e726adf4d0c47c6d20 100644 (file)
@@ -88,7 +88,7 @@ import static java.lang.String.format;
  * }
  * </pre>
  *
- * Since version 5.5, a web service can call another web service to get some data. See {@link Request#getLocalConnector()}
+ * Since version 5.5, a web service can call another web service to get some data. See {@link Request#localConnector()}
  * provided by {@link RequestHandler#handle(Request, Response)}.
  *
  * @since 4.2
index f08816d5bd7d8cbf1f7231bff81d9039c8d5676c..e9d2c0827d195d3260054cc59a7b34bc3a282262 100644 (file)
@@ -82,7 +82,7 @@ public class SimpleGetRequest extends Request {
   }
 
   @Override
-  public LocalConnector getLocalConnector() {
+  public LocalConnector localConnector() {
     throw new UnsupportedOperationException();
   }
 }
index f38a1bed2e2c241dfd82048e342a1f93523f5540..58615ec636e6dd06bcc71b049d66a2b0da7ce66a 100644 (file)
@@ -53,7 +53,7 @@ public abstract class ValidatingRequest extends Request {
   }
 
   @Override
-  public LocalConnector getLocalConnector() {
+  public LocalConnector localConnector() {
     checkNotNull(localConnector, "Local connector has not been set");
     return localConnector;
   }
index 3b7af43aa8842e6d3ca40638fbe58673780eafba..ca8947e64e74d3bfe0578781bcfde5df4877bc57 100644 (file)
@@ -37,7 +37,7 @@ class LocalWsConnector implements WsConnector {
   }
 
   @VisibleForTesting
-  LocalConnector getLocalConnector() {
+  LocalConnector localConnector() {
     return localConnector;
   }
 
index 351a80dc2956adb603ea9cd3da4db234ee82ac4c..886a1f6d8a4c0bc875c44aac018eec48a82b587c 100644 (file)
@@ -42,6 +42,6 @@ public class WsClientFactoriesTest {
 
     assertThat(client).isInstanceOf(DefaultWsClient.class);
     assertThat(client.wsConnector()).isInstanceOf(LocalWsConnector.class);
-    assertThat(((LocalWsConnector) client.wsConnector()).getLocalConnector()).isSameAs(connector);
+    assertThat(((LocalWsConnector) client.wsConnector()).localConnector()).isSameAs(connector);
   }
 }