Class ApplicationResource
java.lang.Object
com.atlassian.crowd.plugin.rest.service.resource.application.ApplicationResource
@Path("application")
@Consumes({"application/xml","application/json"})
@Produces({"application/xml","application/json"})
public class ApplicationResource
extends Object
Represents an Application resource.
- Since:
- 2.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected javax.servlet.http.HttpServletRequest
protected javax.ws.rs.core.UriInfo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
addApplication
(boolean includeRequestAddress, ApplicationEntity applicationEntity) Adds a new application.javax.ws.rs.core.Response
addRemoteAddress
(long applicationId, RemoteAddressEntity remoteAddressEntity) Adds the remote address to the specified application.javax.ws.rs.core.Response
getApplicationById
(long applicationId) Returns the specified application.javax.ws.rs.core.Response
getApplications
(String applicationName) Returns all the applications or a specific application by namejavax.ws.rs.core.Response
getRemoteAddresses
(long applicationId) Returns the remote addresses of the specified application.javax.ws.rs.core.Response
removeApplication
(long applicationId) Removes the specified application.javax.ws.rs.core.Response
removeRemoteAddress
(long applicationId, String remoteAddress) Removes the remote address of the specified application.javax.ws.rs.core.Response
updateApplication
(long applicationId, ApplicationEntity applicationEntity) Updates the specified application.
-
Field Details
-
APPLICATION_NAME_QUERY_PARAM
- See Also:
-
uriInfo
@Context protected javax.ws.rs.core.UriInfo uriInfo -
request
@Context protected javax.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
ApplicationResource
-
-
Method Details
-
getApplications
@GET public javax.ws.rs.core.Response getApplications(@QueryParam("name") String applicationName) throws ApplicationNotFoundException Returns all the applications or a specific application by name- Throws:
ApplicationNotFoundException
-
getApplicationById
@GET @Path("{applicationId}") public javax.ws.rs.core.Response getApplicationById(@PathParam("applicationId") long applicationId) throws ApplicationNotFoundException Returns the specified application.- Parameters:
applicationId
- ID of the application- Throws:
ApplicationNotFoundException
-
addApplication
@POST public javax.ws.rs.core.Response addApplication(@DefaultValue("false") @QueryParam("include-request-address") boolean includeRequestAddress, ApplicationEntity applicationEntity) throws DirectoryNotFoundException, InvalidCredentialException, ApplicationAlreadyExistsException Adds a new application.- Parameters:
applicationEntity
- new application entity- Throws:
DirectoryNotFoundException
InvalidCredentialException
ApplicationAlreadyExistsException
-
removeApplication
@DELETE @Path("{applicationId}") public javax.ws.rs.core.Response removeApplication(@PathParam("applicationId") long applicationId) throws ApplicationManagerException Removes the specified application.- Parameters:
applicationId
- ID of the application- Throws:
ApplicationManagerException
-
updateApplication
@PUT @Path("{applicationId}") public javax.ws.rs.core.Response updateApplication(@PathParam("applicationId") long applicationId, ApplicationEntity applicationEntity) throws ApplicationNotFoundException, DirectoryNotFoundException, ApplicationManagerException Updates the specified application.- Parameters:
applicationId
- ID of the application- Throws:
ApplicationNotFoundException
DirectoryNotFoundException
ApplicationManagerException
-
getRemoteAddresses
@GET @Path("{applicationId}/remote_address") public javax.ws.rs.core.Response getRemoteAddresses(@PathParam("applicationId") long applicationId) throws ApplicationNotFoundException Returns the remote addresses of the specified application.- Parameters:
applicationId
- ID of the application- Throws:
ApplicationNotFoundException
-
addRemoteAddress
@POST @Path("{applicationId}/remote_address") public javax.ws.rs.core.Response addRemoteAddress(@PathParam("applicationId") long applicationId, RemoteAddressEntity remoteAddressEntity) throws ApplicationNotFoundException, DirectoryNotFoundException, ApplicationManagerException Adds the remote address to the specified application.- Parameters:
applicationId
- ID of the applicationremoteAddressEntity
- remote address entity- Throws:
ApplicationNotFoundException
DirectoryNotFoundException
ApplicationManagerException
-
removeRemoteAddress
@DELETE @Path("{applicationId}/remote_address") public javax.ws.rs.core.Response removeRemoteAddress(@PathParam("applicationId") long applicationId, @QueryParam("address") String remoteAddress) throws ApplicationNotFoundException, DirectoryNotFoundException, ApplicationManagerException Removes the remote address of the specified application.- Parameters:
applicationId
- ID of the applicationremoteAddress
- remote address to remove- Throws:
ApplicationNotFoundException
DirectoryNotFoundException
ApplicationManagerException
-