Package com.atlassian.connect.spring
Class AtlassianHost
- java.lang.Object
-
- com.atlassian.connect.spring.AtlassianHost
-
public class AtlassianHost extends Object
An Atlassian host in which the add-on is or has been installed. Hosts are stored inAtlassianHostRepository.During processing of a request from an Atlassian host, the details of the host and of the user at the browser can be obtained from the
AtlassianHostUser.- Since:
- 1.0.0
- See Also:
AtlassianHostRepository
-
-
Constructor Summary
Constructors Constructor Description AtlassianHost()Creates a new empty Atlassian host (used by persistence mechanism).
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object o)StringgetBaseUrl()The URL prefix for the Atlassian product instance.StringgetClientKey()The identifying key for the Atlassian product instance that the add-on was installed into.StringgetCreatedBy()The key of the Atlassian user that first installed the add-on on the host, if any.CalendargetCreatedDate()The time at which the add-on was first installed on the host.StringgetDescription()The host product description.StringgetLastModifiedBy()The key of the Atlassian user that last modified the add-on installation, if any.CalendargetLastModifiedDate()The time at which the add-on installation was last modified.StringgetOauthClientId()Returns the client identifier for use with OAuth 2.0 authentication.StringgetProductType()The identifier of the category of Atlassian product.StringgetPublicKey()Deprecated.No replacement.StringgetServiceEntitlementNumber()The Support Entitlement Number (SEN) is the add-on license identifier.StringgetSharedSecret()The shared secret issued by the Atlassian product instance on installation of the add-on.inthashCode()booleanisAddonInstalled()Returns true if the add-on is currently installed on the host.voidsetAddonInstalled(boolean addonInstalled)Used by persistence mechanism.voidsetBaseUrl(String baseUrl)Used by persistence mechanism.voidsetClientKey(String clientKey)Used by persistence mechanism.voidsetCreatedBy(String createdBy)Used by persistence mechanism.voidsetCreatedDate(Calendar createdDate)Used by persistence mechanism.voidsetDescription(String description)Used by persistence mechanism.voidsetLastModifiedBy(String lastModifiedBy)Used by persistence mechanism.voidsetLastModifiedDate(Calendar lastModifiedDate)Used by persistence mechanism.voidsetOauthClientId(String oauthClientId)Used by persistence mechanism.voidsetProductType(String productType)Used by persistence mechanism.voidsetPublicKey(String publicKey)Used by persistence mechanism.voidsetServiceEntitlementNumber(String serviceEntitlementNumber)Used by persistence mechanism.voidsetSharedSecret(String sharedSecret)Used by persistence mechanism.StringtoString()
-
-
-
Method Detail
-
getClientKey
public String getClientKey()
The identifying key for the Atlassian product instance that the add-on was installed into. This will never change for a given instance, and is unique across all Atlassian product tenants. This value should be used to key tenant details in your add-on.- Returns:
- the client key of the host
-
setClientKey
public void setClientKey(String clientKey)
Used by persistence mechanism.- Parameters:
clientKey- the client key of the host
-
getPublicKey
@Deprecated public String getPublicKey()
Deprecated.No replacement.The public key of the Atlassian product instance.- Returns:
- the public key of the host
-
setPublicKey
public void setPublicKey(String publicKey)
Used by persistence mechanism.- Parameters:
publicKey- the public key of the host
-
getOauthClientId
public String getOauthClientId()
Returns the client identifier for use with OAuth 2.0 authentication.- Returns:
- the OAuth 2.0 client ID
-
setOauthClientId
public void setOauthClientId(String oauthClientId)
Used by persistence mechanism.- Parameters:
oauthClientId- the OAuth 2.0 client ID
-
getSharedSecret
public String getSharedSecret()
The shared secret issued by the Atlassian product instance on installation of the add-on. This string is used to validate incoming JWT tokens and to sign outgoing JWT tokens.- Returns:
- the shared secret of the installation
-
setSharedSecret
public void setSharedSecret(String sharedSecret)
Used by persistence mechanism.- Parameters:
sharedSecret- the shared secret of the installation
-
getBaseUrl
public String getBaseUrl()
The URL prefix for the Atlassian product instance. All of its REST endpoints begin with this URL.- Returns:
- the base URL of the host
-
setBaseUrl
public void setBaseUrl(String baseUrl)
Used by persistence mechanism.- Parameters:
baseUrl- the base URL of the host
-
getProductType
public String getProductType()
The identifier of the category of Atlassian product.- Returns:
- the host product type, e.g.
jiraorconfluence
-
setProductType
public void setProductType(String productType)
Used by persistence mechanism.- Parameters:
productType- the host product type, e.g.jiraorconfluence
-
getDescription
public String getDescription()
The host product description. This string is customisable by an instance administrator.- Returns:
- the description of the host
-
setDescription
public void setDescription(String description)
Used by persistence mechanism.- Parameters:
description- the description of the host
-
getServiceEntitlementNumber
public String getServiceEntitlementNumber()
The Support Entitlement Number (SEN) is the add-on license identifier. This attribute will only be included during installation of a paid add-on.- Returns:
- the SEN
-
setServiceEntitlementNumber
public void setServiceEntitlementNumber(String serviceEntitlementNumber)
Used by persistence mechanism.- Parameters:
serviceEntitlementNumber- the SEN
-
isAddonInstalled
public boolean isAddonInstalled()
Returns true if the add-on is currently installed on the host. Upon uninstallation, the value of this flag will be set tofalse.- Returns:
- true if the add-on is installed
-
setAddonInstalled
public void setAddonInstalled(boolean addonInstalled)
Used by persistence mechanism.- Parameters:
addonInstalled- true if the add-on is installed
-
getCreatedDate
public Calendar getCreatedDate()
The time at which the add-on was first installed on the host.- Returns:
- the creation time
-
setCreatedDate
public void setCreatedDate(Calendar createdDate)
Used by persistence mechanism.- Parameters:
createdDate- the creation time
-
getLastModifiedDate
public Calendar getLastModifiedDate()
The time at which the add-on installation was last modified.- Returns:
- the last modification time
-
setLastModifiedDate
public void setLastModifiedDate(Calendar lastModifiedDate)
Used by persistence mechanism.- Parameters:
lastModifiedDate- the last modification time
-
getCreatedBy
public String getCreatedBy()
The key of the Atlassian user that first installed the add-on on the host, if any.- Returns:
- the user key of the creator
-
setCreatedBy
public void setCreatedBy(String createdBy)
Used by persistence mechanism.- Parameters:
createdBy- the user key of the creator
-
getLastModifiedBy
public String getLastModifiedBy()
The key of the Atlassian user that last modified the add-on installation, if any.- Returns:
- the user key of the last modifier
-
setLastModifiedBy
public void setLastModifiedBy(String lastModifiedBy)
Used by persistence mechanism.- Parameters:
lastModifiedBy- the user key of the last modifier
-
-