Package jetbrains.buildServer.web.impl
Class RestApiFacade
- java.lang.Object
-
- jetbrains.buildServer.web.impl.RestApiFacade
-
public class RestApiFacade extends Object
API for executing internal requests to the TeamCity Rest API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestApiFacade.InternalRestApiCallException
-
Constructor Summary
Constructors Constructor Description RestApiFacade(UrlMapping urlMapping, FakeHttpRequestsFactory fakeHttpRequestsFactory, UserModelEx userModel, SecurityContextEx securityContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forgetRestController()
This method should be called when rest plugin is unloaded, so this class would not hold the reference to the controller from the unloaded plugin.String
getJson(String path, String query)
Execute the request under a super user.String
getJson(SUser user, String path, String query, Map<String,Object> requestAttrs)
Execute the request under the specified user.static boolean
isInternal(javax.servlet.ServletRequest request)
Checks whether the request passed originated from this utility: it is an internal request sent within the server and it was not received via HTTP
-
-
-
Constructor Detail
-
RestApiFacade
public RestApiFacade(@NotNull UrlMapping urlMapping, @NotNull FakeHttpRequestsFactory fakeHttpRequestsFactory, @NotNull UserModelEx userModel, @NotNull SecurityContextEx securityContext)
-
-
Method Detail
-
isInternal
public static boolean isInternal(@NotNull javax.servlet.ServletRequest request)
Checks whether the request passed originated from this utility: it is an internal request sent within the server and it was not received via HTTP
-
getJson
@Nullable public String getJson(@NotNull String path, @NotNull String query) throws RestApiFacade.InternalRestApiCallException
Execute the request under a super user.
-
getJson
@Nullable public String getJson(@NotNull SUser user, @NotNull String path, @NotNull String query, @NotNull Map<String,Object> requestAttrs) throws RestApiFacade.InternalRestApiCallException
Execute the request under the specified user.
-
forgetRestController
public void forgetRestController()
This method should be called when rest plugin is unloaded, so this class would not hold the reference to the controller from the unloaded plugin.
-
-