com.atlassian.crowd.plugin.rest.service.controller
public class ApplicationController extends Object
| Constructor and Description |
|---|
ApplicationController(ApplicationManager applicationManager,
DirectoryManager directoryManager,
TrustedProxyManager trustedProxyManager,
AliasManager aliasManager) |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.plugins.rest.common.Link |
addApplication(ApplicationEntity applicationEntity,
URI baseUri)
Adds a new application.
|
com.atlassian.plugins.rest.common.Link |
addApplicationWithRequestAddress(ApplicationEntity applicationEntity,
javax.servlet.http.HttpServletRequest request,
URI baseUri)
Adds a new application with the request address.
|
void |
addRemoteAddress(long applicationId,
RemoteAddressEntity remoteAddressEntity)
Adds a remote address to the list of allowed addresses for the application.
|
void |
deleteAlias(long applicationId,
String username) |
String |
getAlias(long applicationId,
String username) |
Map<Long,String> |
getAliasesForUser(String username) |
ApplicationEntityList |
getAllApplications(URI baseUri)
Finds all applications.
|
ApplicationEntity |
getApplicationById(long id,
URI baseUri)
Finds an application by ID.
|
ApplicationEntity |
getApplicationByName(String name,
URI baseUri)
Finds an application by name.
|
Set<String> |
getRequestAddresses(javax.servlet.http.HttpServletRequest request)
Retrieves the list of request addresses.
|
String |
getUsernameForAlias(long applicationId,
String alias) |
void |
removeApplication(long applicationId)
Removes an application.
|
void |
removeRemoteAddress(long applicationId,
String remoteAddress)
Removes a remote address from the list of allowed addresses for the application.
|
void |
setAlias(long applicationId,
String username,
String alias) |
void |
updateApplication(ApplicationEntity applicationEntity)
Updates an existing application.
|
public ApplicationController(ApplicationManager applicationManager, DirectoryManager directoryManager, TrustedProxyManager trustedProxyManager, AliasManager aliasManager)
public ApplicationEntity getApplicationByName(String name, URI baseUri) throws ApplicationNotFoundException
name - name of the applicationbaseUri - base URI of the REST serviceApplicationNotFoundException - if the application could not be foundpublic ApplicationEntity getApplicationById(long id, URI baseUri) throws ApplicationNotFoundException
id - ID of the applicationbaseUri - baseURI of the applications resourceApplicationNotFoundException - if the application could not be foundpublic ApplicationEntityList getAllApplications(URI baseUri) throws ApplicationNotFoundException
baseUri - base URI of the REST serviceApplicationNotFoundException - if the application could not be foundpublic com.atlassian.plugins.rest.common.Link addApplicationWithRequestAddress(ApplicationEntity applicationEntity, javax.servlet.http.HttpServletRequest request, URI baseUri) throws InvalidCredentialException, DirectoryNotFoundException
applicationEntity - new application to addrequest - HTTP requestbaseUri - base URI of the REST serviceInvalidCredentialException - if the given credentials are not validDirectoryNotFoundException - if the directory being mapped could not be foundpublic com.atlassian.plugins.rest.common.Link addApplication(ApplicationEntity applicationEntity, URI baseUri) throws InvalidCredentialException, DirectoryNotFoundException
applicationEntity - new application to addbaseUri - base URI of the REST serviceInvalidCredentialException - if the given credentials are not validDirectoryNotFoundException - if the directory being mapped could not be foundpublic void removeApplication(long applicationId)
throws ApplicationManagerException
applicationId - ID of the applicationApplicationManagerException - if the remove operation is not permitted on the given applicationpublic void updateApplication(ApplicationEntity applicationEntity) throws ApplicationNotFoundException, ApplicationManagerException, DirectoryNotFoundException
applicationEntity - application entity with the new detailsApplicationNotFoundException - if the application could not be foundApplicationManagerException - if there was an error updating the applicationDirectoryNotFoundException - if a directory referenced by a directory mapping could not be foundpublic void addRemoteAddress(long applicationId,
RemoteAddressEntity remoteAddressEntity)
throws ApplicationNotFoundException
applicationId - ID of the applicationremoteAddressEntity - remote address entity to addApplicationNotFoundException - if the application could not be foundpublic void removeRemoteAddress(long applicationId,
String remoteAddress)
throws ApplicationNotFoundException
applicationId - ID of the applicationremoteAddress - remote address to removeApplicationNotFoundException - if the application could not be foundpublic Set<String> getRequestAddresses(javax.servlet.http.HttpServletRequest request)
request - HTTP requestpublic String getAlias(long applicationId, String username) throws ApplicationNotFoundException, com.sun.jersey.api.NotFoundException
ApplicationNotFoundExceptioncom.sun.jersey.api.NotFoundExceptionpublic void setAlias(long applicationId,
String username,
String alias)
throws ApplicationNotFoundException,
AliasAlreadyInUseException
public void deleteAlias(long applicationId,
String username)
throws ApplicationNotFoundException,
AliasAlreadyInUseException
public String getUsernameForAlias(long applicationId, String alias) throws ApplicationNotFoundException
ApplicationNotFoundExceptionCopyright © 2015 Atlassian. All Rights Reserved.