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 TypeMethodDescriptionboolean
canManageEntityLinksFor
(com.atlassian.applinks.host.spi.EntityReference entityReference) void
boolean
doesEntityExist
(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) boolean
doesEntityExistNoPermissionCheck
(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.ApplicationId
getId()
Iterable<com.atlassian.applinks.host.spi.EntityReference>
getName()
com.atlassian.applinks.api.ApplicationType
getType()
boolean
void
setSkipPermissionCheck
(boolean skip) void
start()
The OsgiServiceProxyFactory creates a proxy to the TypeAccessor which is a component of the applinks-plugin.com.atlassian.applinks.host.spi.EntityReference
toEntityReference
(Object domainObject) com.atlassian.applinks.host.spi.EntityReference
toEntityReference
(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:
getDocumentationBaseUrl
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Returns:
- an absolute
URI
used as the base for constructing links to help pages. e.g.http://docs.atlassian.com/fisheye/docs-023
orhttp://confluence.atlassian.com/display/APPLINKS
. The returnedURI
should not have a trailing slash.
-
getName
- Specified by:
getName
in 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
InstanceNameGenerator
to generate a name from the application's base URL.
-
getType
public com.atlassian.applinks.api.ApplicationType getType()- Specified by:
getType
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Returns:
- the
ApplicationType
for this application instance. Implementations should delegate to theTypeAccessor
to resolve an instance of the desired type.
-
getLocalEntities
- Specified by:
getLocalEntities
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Returns:
- an
Iterable
containing anEntityReference
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.
-
doesEntityExist
public boolean doesEntityExist(String key, Class<? extends com.atlassian.applinks.api.EntityType> type) - Specified by:
doesEntityExist
in 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 theEntityType
of 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:
doesEntityExistNoPermissionCheck
in 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 theEntityType
of 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:
toEntityReference
in 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 theEntityLinkService
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 theTypeAccessor
to 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:
toEntityReference
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Parameters:
key
- the key of a local entity (e.g. "JRA", "FECRUDEV", "CR-BAM")type
- the class of theEntityType
of the entity (e.g.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 theTypeAccessor
to resolve an instance of the specifiedEntityType
. - Throws:
IllegalArgumentException
- if the specified type is not assignable toJiraProjectEntityType
or if no project with the specified key can be found
-
canManageEntityLinksFor
public boolean canManageEntityLinksFor(com.atlassian.applinks.host.spi.EntityReference entityReference) - Specified by:
canManageEntityLinksFor
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Parameters:
entityReference
- anEntityReference
representing an entity contained in the local application instance.- Returns:
true
if the current user has permission to link or unlink the specifiedEntityReference
to other entities,false
otherwise. 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:
hasPublicSignup
in interfacecom.atlassian.applinks.host.spi.InternalHostApplication
- Returns:
true
if the host application allows public signup,false
otherwise.
-
getId
public com.atlassian.applinks.api.ApplicationId getId()- Specified by:
getId
in interfacecom.atlassian.applinks.host.spi.HostApplication
-
getBaseUrl
Returns the base URL that is configured for this JIRA instance.- Specified by:
getBaseUrl
in 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.
-