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 Modifier and Type Method Description boolean
equals(Object o)
AddonAuthenticationType
getAuthentication()
Returns the authentication type to use when communicating with the host products.String
getBaseUrl()
The URL prefix for the Atlassian product instance.String
getClientKey()
The identifying key for the Atlassian product instance that the add-on was installed into.String
getCloudId()
Returns the tenant identifier for use with OAuth 2.0 client credentials flow.String
getCreatedBy()
The key of the Atlassian user that first installed the add-on on the host, if any.Calendar
getCreatedDate()
The time at which the add-on was first installed on the host.String
getDescription()
The host product description.String
getEntitlementId()
Entitlement ID is the add-on license identifier.String
getEntitlementNumber()
Entitlement Number is the add-on license identifier.String
getLastModifiedBy()
The key of the Atlassian user that last modified the add-on installation, if any.Calendar
getLastModifiedDate()
The time at which the add-on installation was last modified.String
getOauthClientId()
Returns the client identifier for use with OAuth 2.0 authentication.String
getProductType()
The identifier of the category of Atlassian product.String
getServiceEntitlementNumber()
The Support Entitlement Number (SEN) is the add-on license identifier.String
getSharedSecret()
The shared secret issued by the Atlassian product instance on installation of the add-on.int
hashCode()
boolean
isAddonInstalled()
Returns true if the add-on is currently installed on the host.void
setAddonInstalled(boolean addonInstalled)
Used by persistence mechanism.void
setAuthentication(AddonAuthenticationType authentication)
Used by persistence mechanism.void
setBaseUrl(String baseUrl)
Used by persistence mechanism.void
setClientKey(String clientKey)
Used by persistence mechanism.void
setCloudId(String cloudId)
Used by persistence mechanism.void
setCreatedBy(String createdBy)
Used by persistence mechanism.void
setCreatedDate(Calendar createdDate)
Used by persistence mechanism.void
setDescription(String description)
Used by persistence mechanism.void
setEntitlementId(String entitlementId)
Used by persistence mechanism.void
setEntitlementNumber(String entitlementNumber)
Used by persistence mechanism.void
setLastModifiedBy(String lastModifiedBy)
Used by persistence mechanism.void
setLastModifiedDate(Calendar lastModifiedDate)
Used by persistence mechanism.void
setOauthClientId(String oauthClientId)
Used by persistence mechanism.void
setProductType(String productType)
Used by persistence mechanism.void
setServiceEntitlementNumber(String serviceEntitlementNumber)
Used by persistence mechanism.void
setSharedSecret(String sharedSecret)
Used by persistence mechanism.String
toString()
-
-
-
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
-
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
-
getAuthentication
public AddonAuthenticationType getAuthentication()
Returns the authentication type to use when communicating with the host products.- Returns:
- AddonAuthenticationType as authentication scheme
-
setAuthentication
public void setAuthentication(AddonAuthenticationType authentication)
Used by persistence mechanism.- Parameters:
authentication
- the authentication type to use when communicating with the host products.
-
getCloudId
public String getCloudId()
Returns the tenant identifier for use with OAuth 2.0 client credentials flow.- Returns:
- cloudId
-
setCloudId
public void setCloudId(String cloudId)
Used by persistence mechanism.- Parameters:
cloudId
- the tenant identifier for use with OAuth 2.0 client credentials flow.
-
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.
jira
orconfluence
-
setProductType
public void setProductType(String productType)
Used by persistence mechanism.- Parameters:
productType
- the host product type, e.g.jira
orconfluence
-
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
-
getEntitlementId
public String getEntitlementId()
Entitlement ID is the add-on license identifier. This attribute will only be included during installation of a paid add-on.- Returns:
- the Entitlement ID
-
setEntitlementId
public void setEntitlementId(String entitlementId)
Used by persistence mechanism.- Parameters:
entitlementId
- the Entitlement ID
-
getEntitlementNumber
public String getEntitlementNumber()
Entitlement Number is the add-on license identifier. This attribute will only be included during installation of a paid add-on.- Returns:
- the Entitlement Number
-
setEntitlementNumber
public void setEntitlementNumber(String entitlementNumber)
Used by persistence mechanism.- Parameters:
entitlementNumber
- the Entitlement Number
-
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
-
-