public class

JiraAppLinksHostApplication

extends AbstractInternalHostApplication
implements Startable
java.lang.Object
   ↳ com.atlassian.applinks.host.spi.AbstractInternalHostApplication
     ↳ com.atlassian.jira.applinks.JiraAppLinksHostApplication

Summary

Constants
long TIMEOUT
[Expand]
Inherited Fields
From class com.atlassian.applinks.host.spi.AbstractInternalHostApplication
Public Constructors
JiraAppLinksHostApplication(PluginAccessor pluginAccessor, ApplicationProperties applicationProperties, JiraLicenseService jiraLicenseService, VelocityRequestContextFactory velocityRequestContextFactory, ProjectManager projectManager, JiraAuthenticationContext jiraAuthenticationContext, OsgiServiceProxyFactory osgiServiceProxyFactory, PermissionManager permissionManager)
Creates a new JiraAppLinksHostApplication instance.
Public Methods
boolean canManageEntityLinksFor(EntityReference entityReference)
void clearSkipPermissionCheck()
boolean doesEntityExist(String key, Class<? extends EntityType> type)
boolean doesEntityExistNoPermissionCheck(String key, Class<? extends EntityType> type)
URI getBaseUrl()
Returns the base URL that is configured for this JIRA instance.
URI getDocumentationBaseUrl()
ApplicationId getId()
Iterable<EntityReference> getLocalEntities()
String getName()
ApplicationType getType()
boolean hasPublicSignup()
void setSkipPermissionCheck(boolean skip)
void start()
The OsgiServiceProxyFactory creates a proxy to the TypeAccessor which is a component of the applinks-plugin.
EntityReference toEntityReference(Object domainObject)
EntityReference toEntityReference(String key, Class<? extends EntityType> type)
[Expand]
Inherited Methods
From class com.atlassian.applinks.host.spi.AbstractInternalHostApplication
From class java.lang.Object
From interface com.atlassian.applinks.host.spi.HostApplication
From interface com.atlassian.applinks.host.spi.InternalHostApplication
From interface com.atlassian.jira.extension.Startable

Constants

public static final long TIMEOUT

Constant Value: 10000 (0x0000000000002710)

Public Constructors

public JiraAppLinksHostApplication (PluginAccessor pluginAccessor, ApplicationProperties applicationProperties, JiraLicenseService jiraLicenseService, VelocityRequestContextFactory velocityRequestContextFactory, ProjectManager projectManager, JiraAuthenticationContext jiraAuthenticationContext, OsgiServiceProxyFactory osgiServiceProxyFactory, PermissionManager permissionManager)

Creates a new JiraAppLinksHostApplication instance.

Public Methods

public boolean canManageEntityLinksFor (EntityReference entityReference)

Parameters
entityReference an com.atlassian.applinks.host.spi.EntityReference representing an entity contained in the local application instance.
Returns
  • true if the current user has permission to link or unlink the specified EntityReference to other entities, false otherwise. User requires to have either the JIRA Administrator or PROJECT ADMIN permission.

public void clearSkipPermissionCheck ()

public boolean doesEntityExist (String key, Class<? extends EntityType> type)

Parameters
key the key of an entity local to this application (e.g. JRA, CONF)
type the class of the com.atlassian.applinks.api.EntityType of the entity (e.g. com.atlassian.applinks.api.application.jira.JiraProjectEntityType)
Returns
  • true, if the specified entity exists, false otherwise. Note, the implementation must perform a permission check and return true if, and only if, the specified entity exists and is visible to the context user (who may be anonymous). User requires to have either the BROWSE project, JIRA Administrator or PROJECT ADMIN permission.

public boolean doesEntityExistNoPermissionCheck (String key, Class<? extends EntityType> type)

Parameters
key the key of an entity local to this application (e.g. JRA, CONF)
type the class of the EntityType of the entity (e.g. JiraProjectEntityType)
Returns

public URI getBaseUrl ()

Returns the base URL that is configured for this JIRA instance.

Returns
  • a String containing the base URL that is configured for this JIRA instance

public URI getDocumentationBaseUrl ()

Returns
  • an absolute URI used as the base for constructing links to help pages. e.g. http://docs.atlassian.com/fisheye/docs-023 or http://confluence.atlassian.com/display/APPLINKS. The returned URI should not have a trailing slash.

public ApplicationId getId ()

public Iterable<EntityReference> getLocalEntities ()

Returns
  • an Iterable containing an EntityReference for every entity in the local instance visible to the currently logged in user. Note, the implementation must perform a permission check and return only entities visible the context user (who may be anonymous). User requires to have either the BROWSE project, JIRA Administrator or PROJECT ADMIN permission.

public String getName ()

Returns
  • the name of this application instance, e.g. "My JIRA Server". If this application type doesn't support customising the name of the instance, implementations should delegate to com.atlassian.applinks.host.util.InstanceNameGenerator to generate a name from the application's base URL.

public ApplicationType getType ()

Returns
  • the ApplicationType for this application instance. Implementations should delegate to the com.atlassian.applinks.spi.util.TypeAccessor to resolve an instance of the desired type.

public boolean hasPublicSignup ()

Returns
  • true if the host application allows public signup, false otherwise.

public void setSkipPermissionCheck (boolean skip)

public void start ()

The OsgiServiceProxyFactory creates a proxy to the TypeAccessor which is a component of the applinks-plugin. The TypeAccessor is not available when the host application starts, but when the plugins framework has finished starting.

Throws
Exception

public EntityReference toEntityReference (Object domainObject)

Parameters
domainObject an entity domain object from the application's API (e.g. com.atlassian.jira.project.Project, com.atlassian.confluence.spaces.Space). Implementations are free to choose which objects supported by this class, but the complete list should be maintained on the com.atlassian.applinks.api.EntityLinkService javadoc.
Returns
  • an EntityReference initialised with the key and type of the supplied domain object. This method need not perform any permission checking. Implementations should delegate to the com.atlassian.applinks.spi.util.TypeAccessor to resolve an instance of the desired EntityType.

public EntityReference toEntityReference (String key, Class<? extends EntityType> type)

Parameters
key the key of a local entity (e.g. "JRA", "FECRUDEV", "CR-BAM")
type the class of the EntityType of the entity (e.g. com.atlassian.applinks.api.application.jira.JiraProjectEntityType)
Returns
  • an EntityReference initialised with the key and type of the supplied domain object. This method need not perform any permission checking. Implementations should delegate to the com.atlassian.applinks.spi.util.TypeAccessor to resolve an instance of the specified EntityType.
Throws
IllegalArgumentException if the specified type is not assignable to JiraProjectEntityType or if no project with the specified key can be found