Package com.atlassian.jira.applinks
Class JiraAppLinksHostApplication
java.lang.Object
com.atlassian.applinks.host.spi.AbstractInternalHostApplication
com.atlassian.jira.applinks.JiraAppLinksHostApplication
- All Implemented Interfaces:
com.atlassian.applinks.host.spi.HostApplication,com.atlassian.applinks.host.spi.InternalHostApplication,Startable
public class JiraAppLinksHostApplication
extends com.atlassian.applinks.host.spi.AbstractInternalHostApplication
implements Startable
- Since:
- v4.3
-
Field Summary
FieldsFields inherited from class com.atlassian.applinks.host.spi.AbstractInternalHostApplication
pluginAccessor -
Constructor Summary
ConstructorsConstructorDescriptionJiraAppLinksHostApplication(com.atlassian.plugin.PluginAccessor pluginAccessor, ApplicationProperties applicationProperties, JiraLicenseService jiraLicenseService, VelocityRequestContextFactory velocityRequestContextFactory, ProjectManager projectManager, JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.applinks.host.OsgiServiceProxyFactory osgiServiceProxyFactory, PermissionManager permissionManager) Creates a new JiraAppLinksHostApplication instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanManageEntityLinksFor(com.atlassian.applinks.host.spi.EntityReference entityReference) voidbooleandoesEntityExist(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) booleandoesEntityExistNoPermissionCheck(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) Returns the base URL that is configured for this JIRA instance.com.atlassian.applinks.api.ApplicationIdgetId()Iterable<com.atlassian.applinks.host.spi.EntityReference>getName()com.atlassian.applinks.api.ApplicationTypegetType()booleanvoidsetSkipPermissionCheck(boolean skip) voidstart()The OsgiServiceProxyFactory creates a proxy to the TypeAccessor which is a component of the applinks-plugin.com.atlassian.applinks.host.spi.EntityReferencetoEntityReference(Object domainObject) com.atlassian.applinks.host.spi.EntityReferencetoEntityReference(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) Methods inherited from class com.atlassian.applinks.host.spi.AbstractInternalHostApplication
getSupportedInboundAuthenticationTypes, getSupportedOutboundAuthenticationTypes
-
Field Details
-
TIMEOUT
public static final long TIMEOUT- See Also:
-
-
Constructor Details
-
JiraAppLinksHostApplication
public JiraAppLinksHostApplication(com.atlassian.plugin.PluginAccessor pluginAccessor, ApplicationProperties applicationProperties, JiraLicenseService jiraLicenseService, VelocityRequestContextFactory velocityRequestContextFactory, ProjectManager projectManager, JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.applinks.host.OsgiServiceProxyFactory osgiServiceProxyFactory, PermissionManager permissionManager) Creates a new JiraAppLinksHostApplication instance.
-
-
Method Details
-
getDocumentationBaseUrl
- Specified by:
getDocumentationBaseUrlin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Returns:
- an absolute
URIused as the base for constructing links to help pages. e.g.http://docs.atlassian.com/fisheye/docs-023orhttp://confluence.atlassian.com/display/APPLINKS. The returnedURIshould not have a trailing slash.
-
getName
- Specified by:
getNamein interfacecom.atlassian.applinks.host.spi.InternalHostApplication- 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
InstanceNameGeneratorto generate a name from the application's base URL.
-
getType
public com.atlassian.applinks.api.ApplicationType getType()- Specified by:
getTypein interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Returns:
- the
ApplicationTypefor this application instance. Implementations should delegate to theTypeAccessorto resolve an instance of the desired type.
-
getLocalEntities
- Specified by:
getLocalEntitiesin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Returns:
- an
Iterablecontaining anEntityReferencefor 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.
-
doesEntityExist
public boolean doesEntityExist(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) - Specified by:
doesEntityExistin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Parameters:
key- the key of an entity local to this application (e.g. JRA, CONF)type- the class of theEntityTypeof the entity (e.g.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.
-
doesEntityExistNoPermissionCheck
public boolean doesEntityExistNoPermissionCheck(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) - Specified by:
doesEntityExistNoPermissionCheckin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Parameters:
key- the key of an entity local to this application (e.g. JRA, CONF)type- the class of theEntityTypeof the entity (e.g.JiraProjectEntityType)- Returns:
- true, if the specified entity exists, false otherwise. For a variant on this method with permission
checking, use
doesEntityExist(String, Class). - Since:
- 3.6
-
toEntityReference
- Specified by:
toEntityReferencein interfacecom.atlassian.applinks.host.spi.InternalHostApplication- 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 theEntityLinkServicejavadoc.- Returns:
- an
EntityReferenceinitialised with the key and type of the supplied domain object. This method need not perform any permission checking. Implementations should delegate to theTypeAccessorto resolve an instance of the desiredEntityType.
-
toEntityReference
public com.atlassian.applinks.host.spi.EntityReference toEntityReference(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) - Specified by:
toEntityReferencein interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Parameters:
key- the key of a local entity (e.g. "JRA", "FECRUDEV", "CR-BAM")type- the class of theEntityTypeof the entity (e.g.JiraProjectEntityType)- Returns:
- an
EntityReferenceinitialised with the key and type of the supplied domain object. This method need not perform any permission checking. Implementations should delegate to theTypeAccessorto resolve an instance of the specifiedEntityType. - Throws:
IllegalArgumentException- if the specified type is not assignable toJiraProjectEntityTypeor if no project with the specified key can be found
-
canManageEntityLinksFor
public boolean canManageEntityLinksFor(com.atlassian.applinks.host.spi.EntityReference entityReference) - Specified by:
canManageEntityLinksForin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Parameters:
entityReference- anEntityReferencerepresenting an entity contained in the local application instance.- Returns:
trueif the current user has permission to link or unlink the specifiedEntityReferenceto other entities,falseotherwise. User requires to have either the JIRA Administrator or PROJECT ADMIN permission.
-
setSkipPermissionCheck
public void setSkipPermissionCheck(boolean skip) -
clearSkipPermissionCheck
public void clearSkipPermissionCheck() -
hasPublicSignup
public boolean hasPublicSignup()- Specified by:
hasPublicSignupin interfacecom.atlassian.applinks.host.spi.InternalHostApplication- Returns:
trueif the host application allows public signup,falseotherwise.
-
getId
public com.atlassian.applinks.api.ApplicationId getId()- Specified by:
getIdin interfacecom.atlassian.applinks.host.spi.HostApplication
-
getBaseUrl
Returns the base URL that is configured for this JIRA instance.- Specified by:
getBaseUrlin interfacecom.atlassian.applinks.host.spi.HostApplication- Returns:
- a String containing the base URL that is configured for this JIRA instance
-
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.
-