com.atlassian.applinks.host.spi
Interface InternalHostApplication
- All Superinterfaces:
- HostApplication
- All Known Implementing Classes:
- AbstractInternalHostApplication
public interface InternalHostApplication
- extends HostApplication
Injectable component interface that is implemented by the host application
and contains the application specific logic to determine the application's
capabilities.
This component is injected into each applinks-core module that requires
knowledge of the host application (such as the manifest publisher).
Custom (non-Atlassian) host applications must publish a public component
that implements this interface.
TODO: compute and use a user db hash? See https://studio.atlassian.com/browse/APL-259
- Since:
- 3.0
getDocumentationBaseUrl
java.net.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.
getName
java.lang.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
InstanceNameGenerator
to
generate a name from the application's base URL.
getType
ApplicationType getType()
- Returns:
- the
ApplicationType
for this application instance. Implementations should delegate to the
TypeAccessor
to resolve an instance of the desired type.
getSupportedInboundAuthenticationTypes
java.lang.Iterable<java.lang.Class<? extends AuthenticationProvider>> getSupportedInboundAuthenticationTypes()
- Returns:
- an
Iterable
of AuthenticationProvider
classes enumerating the inbound
authentication methods supported by this application (used to authenticate requests made to this application
instance).
getSupportedOutboundAuthenticationTypes
java.lang.Iterable<java.lang.Class<? extends AuthenticationProvider>> getSupportedOutboundAuthenticationTypes()
- Returns:
- an
Iterable
of AuthenticationProvider
classes enumerating the outbound
authentication methods supported by this application (used to authenticate requests made by this application
instance to remote applications).
getLocalEntities
java.lang.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).
doesEntityExist
boolean doesEntityExist(java.lang.String key,
java.lang.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:
- 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).
toEntityReference
EntityReference toEntityReference(java.lang.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 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 TypeAccessor
to
resolve an instance of the desired EntityType
.
toEntityReference
EntityReference toEntityReference(java.lang.String key,
java.lang.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. 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 TypeAccessor
to
resolve an instance of the specified EntityType
.
canManageEntityLinksFor
boolean canManageEntityLinksFor(EntityReference entityReference)
- Parameters:
entityReference
- an 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. Typically this method will return true if the current user is a
global administrator, or a 'project administrator' for the specified entity.
hasPublicSignup
boolean hasPublicSignup()
- Returns:
true
if the host application allows public signup,
false
otherwise.
Copyright © 2011 Atlassian. All Rights Reserved.