Below is a list of the services provided by the Atlassian Shared Access Layer. You will find more developer help in the Javadoc.
com.atlassian.sal.apiApplicationPropertiesExposes key application settings such as the base URL, application name, build information and version number.
Example -- Obtaining base url of the application:
1 2public class DefaultStudioInfo { private final ApplicationProperties applicationProperties; public DefaultStudioInfo(final ApplicationProperties applicationProperties) { this.applicationProperties = applicationProperties; } public String getCurrentAppBaseUrl() { return applicationProperties.getBaseUrl(); } }
com.atlassian.sal.api.authAuthenticationControllerAllows the host application to communicate about when authentication should be performed and users allowed to login.
AuthenticationListenerAllows the underlying framework to take some actions on authentication events.
AuthenticatorMarker interface for classes that can authenticate requests.
LoginUriProviderProvides the URI to redirect users to so that they can log in before they can authorise consumer requests to access their data.
com.atlassian.sal.api.componentComponentLocatorGives access to the application's component container instances.
com.atlassian.sal.api.executorThreadLocalDelegateExecutorFactoryFactory to create Executor instances that delegate to a specific Executor and ensure the executed code runs in the same thread local context.
com.atlassian.sal.api.licenseLicenseHandlerHandles setting and retrieving the application's license.
com.atlassian.sal.api.lifecycleLifecycleAwareMarks a class that wants to execute code on certain application-level lifecycle stages.
LifecycleManagerInterface to be used to trigger lifecycle events. Handles lifecycle events by calling LifecycleAware methods on registered beans.
com.atlassian.sal.api.messageI18nResolverResolves an internationalisation key or key/argument pair to its internationalised message.
LocaleResolverUsed to retrieve the user's locale, based on the remote users preferences, or the preferred locale as specified in the request or finally defaulting to the system locale if no preferred locale is set.
MessageEncapsulates a message before it has been resolved via an I18N resolver.
MessageCollectionA collection of messages that have not been resolved.
com.atlassian.sal.api.netRequestRepresents a request to retrieve data. To execute a request call Request#execute(ResponseHandler).
RequestFactoryProvides a factory for making HTTP requests with optional authentication.
Example -- Running remote search:
1 2public class RemoteSearcher { private final String url; private static final String SEARCH_PLUGIN_PATH = "/plugins/servlet/studio/search"; private final RequestFactory<?> requestFactory; public RemoteSearcher(final String url, final RequestFactory<?> requestFactory) { this.url = url; this.requestFactory = requestFactory; } public SearchResults search(final String remoteUser, final String query) { final String fullUrl = url + SEARCH_PLUGIN_PATH + "?query=" + URIUtil.encodeWithinQuery(query); final Request<?> request = requestFactory.createRequest(MethodType.GET, fullUrl); request.addTrustedTokenAuthentication(); // this takes username from ThreadLocal try { // parse the response final String responseString = request.execute(); return (SearchResults) XStreamUtils.fromXML(responseString); } catch (final ResponseException e) { throw new RuntimeException("Search for " + query + " on " + fullUrl + " failed.", e); } } }
ResponseRepresents the response when calling Request#execute(ResponseHandler).
ResponseExceptionException thrown by Request#execute(ResponseHandler) and Request#handle(ResponseHandler).
ResponseHandlerCallback interface used by Request#execute(ResponseHandler) method. Implementation of this interface performs actual handling of the response.
com.atlassian.sal.api.net.authAuthenticatorMarker interface for an authenticator.
com.atlassian.sal.api.pluginsettingsPluginSettingsProvides access to settings globally or per project/space/repository.
Example -- Saving and retrieving custom settings per project:
1 2public class CustomProjectSettings { private final PluginSettingsFactory pluginSettingsFactory; private final String projectKey; public CustomProjectSettings(final PluginSettingsFactory pluginSettingsFactory, final String projectKey) { this.pluginSettingsFactory = pluginSettingsFactory; this.projectKey = projectKey; } public void setValue(final String key, final String value) { final PluginSettings settings = pluginSettingsFactory.createSettingsForKey(projectKey); settings.put(key, value); } public Object getValue(final String key) { final PluginSettings settings = pluginSettingsFactory.createSettingsForKey(projectKey); return settings.get(key); } }
PluginSettingsFactoryOne feature provided by SAL is storage of plugin settings, for global and project-specific settings. You will create a PluginSettings object via a PluginSettingsFactory, which uses the abstract factory pattern. Refer to the developer blog post on Storing plugin settings with the abstract factory pattern.
com.atlassian.sal.api.projectProjectManagerProvides a list of projects. A project may represent different things depending on the application. For example, in Confluence it is a space, in Bamboo it is a build plan, and in JIRA it is a project.
com.atlassian.sal.api.schedulingPluginJobA job to be executed by the PluginScheduler.
PluginSchedulerSchedules plugin jobs programmatically.
com.atlassian.sal.api.searchResourceTypeDefines the more information about the search resource (e.g. JIRA, wiki).
SearchMatchA single match for a query (e.g. an issue, a wiki page, a commit). The match contains a URL, title and possibly an excerpt. The resourceType contains more information about the source of this searchMatch.
SearchProviderExecutes search queries. Allows for simple string based searches in an application.
SearchResultsProvides searchresults for a query.
com.atlassian.sal.api.search.parameterSearchParameterAllows you to specify additional properties for a search as string value pairs. For example this could specify a fixforversion=3.12 in JIRA, or application=crucible in FishEye.
com.atlassian.sal.api.search.querySearchQueryUtility to help with creating a query string.
SearchQueryParserParses a search query.
com.atlassian.sal.api.transactionTransactionCallbackA simple callback that needs to be provided with an action to run in the doInTransaction method. It is assumed that if anything goes wrong, doInTransaction will throw a RuntimeException and the calling transactionTemplate will roll back the transaction.
TransactionTemplate
com.atlassian.sal.api.timezoneTimeZoneManagerAvailable since SAL 2.6.
Provides timezone information about the users and about the application.
com.atlassian.sal.api.upgradePluginUpgradeManagerProvides a plugin upgrade framework that will recognise PluginUpgradeTask tasks and run them on startup.
PluginUpgradeTask
com.atlassian.sal.api.userUserManagerProvides simplified access to users across various applications, and performs user authentication checks.
UserResolutionExceptionThe matrix below shows the services available to each version of the Atlassian applications that support the Shared Access Layer. The applications are listed horizontally across the top and the SAL versions are listed vertically on the left.
com.atlassian.sal.api
| SAL Service | ApplicationProperties |
|---|---|
| JIRA 3.13 | YES |
| (JIRA 4.0) | YES |
| Confluence | YES |
| FishEye/Crucible 1.6.5 | YES |
| FishEye/Crucible 2.0 | YES |
| Crowd 2.0 | YES |
| Bamboo 2.3 | YES |
| RefImpl | YES |
com.atlassian.sal.api.auth
| SAL Service | ApplicationController, ApplicationListener, LoginUriProvider | Authenticator |
|---|---|---|
| JIRA 3.13 | NO | |
| (JIRA 4.0) | NO | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | NO | |
| FishEye/Crucible 2.0 | NO | |
| Crowd 2.0 | NO | |
| Bamboo 2.3 | YES | |
| RefImpl | NO | |
com.atlassian.sal.api.component |
| SAL Service | ComponentLocator |
|---|---|
| JIRA 3.13 | YES |
| (JIRA 4.0) | YES |
| Confluence | YES |
| FishEye/Crucible 1.6.5 | YES |
| FishEye/Crucible 2.0 | YES |
| Crowd 2.0 | YES |
| Bamboo 2.3 | YES |
| RefImpl | YES |
com.atlassian.sal.api.executor
| SAL Service | ThreadLocalDelegateExecutorFactory |
|---|---|
| JIRA 3.13 | YES |
| (JIRA 4.0) | YES |
| Confluence | YES |
| FishEye/Crucible 1.6.5 | YES |
| FishEye/Crucible 2.0 | YES |
| Crowd 2.0 | NO |
| Bamboo 2.3 | YES |
| RefImpl | YES |
com.atlassian.sal.api.license
| SAL Service | LicenseHandler |
|---|---|
| JIRA 3.13 | YES |
| (JIRA 4.0) | YES |
| Confluence | YES |
| FishEye/Crucible 1.6.5 | YES |
| FishEye/Crucible 2.0 | YES |
| Crowd 2.0 | YES |
| Bamboo 2.3 | NO |
| RefImpl | YES |
com.atlassian.sal.api.lifecycle
| SAL Service | LifecycleManager | LifecycleAware |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
com.atlassian.sal.api.message
| SAL Service | I18nResolver, LocaleResolver | Message, MessageCollection |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | ? | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
| SAL Service | RequestFactory | Request, Response, ResponseException, ResponseHandler |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | ? | |
| RefImpl | YES | |
com.atlassian.sal.api.net.auth
| SAL Service | Authenticator |
|---|---|
| JIRA 3.13 | |
| (JIRA 4.0) | |
| Confluence | |
| FishEye/Crucible 1.6.5 | |
| FishEye/Crucible 2.0 | |
| Crowd 2.0 | |
| Bamboo 2.3 | |
| RefImpl | |
com.atlassian.sal.api.pluginsettings |
| SAL Service | PluginSettingsFactory | PluginSettings |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
com.atlassian.sal.api.project
| SAL Service | ProjectManager |
|---|---|
| JIRA 3.13 | YES |
| (JIRA 4.0) | YES |
| Confluence | YES |
| FishEye/Crucible 1.6.5 | YES |
| FishEye/Crucible 2.0 | YES |
| Crowd 2.0 | YES |
| Bamboo 2.3 | YES |
| RefImpl | YES |
com.atlassian.sal.api.scheduling
| SAL Service | PluginScheduler | PluginJob |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
com.atlassian.sal.api.search
| SAL Service | SearchProvider | ResourceType, SearchMatch, SearchResults |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | NO | |
| RefImpl | YES |
com.atlassian.sal.api.search.parameter
| SAL Service | SearchParameter |
|---|---|
| JIRA 3.13 | |
| (JIRA 4.0) | |
| Confluence | |
| FishEye/Crucible 1.6.5 | |
| FishEye/Crucible 2.0 | |
| Crowd 2.0 | |
| Bamboo 2.3 | |
| RefImpl |
com.atlassian.sal.api.search.query
| SAL Service | SearchQueryParser | SearchQuery |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | NO | |
| RefImpl | YES |
com.atlassian.sal.api.transaction
| SAL Service | TransactionTemplate | TransactionCallback |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
com.atlassian.sal.api.upgrade
| SAL Service | PluginUpgradeManager | PluginUpgradeTask |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
com.atlassian.sal.api.user
| SAL Service | UserManager | UserResolutionException |
|---|---|---|
| JIRA 3.13 | YES | |
| (JIRA 4.0) | YES | |
| Confluence | YES | |
| FishEye/Crucible 1.6.5 | YES | |
| FishEye/Crucible 2.0 | YES | |
| Crowd 2.0 | YES | |
| Bamboo 2.3 | YES | |
| RefImpl | YES |
Rate this page: