Class AtlassianHost


  • public class AtlassianHost
    extends Object
    An Atlassian host in which the add-on is or has been installed. Hosts are stored in AtlassianHostRepository.

    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 Detail

      • AtlassianHost

        public AtlassianHost()
        Creates a new empty Atlassian host (used by persistence mechanism).
    • 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 or confluence
      • setProductType

        public void setProductType​(String productType)
        Used by persistence mechanism.
        Parameters:
        productType - the host product type, e.g. jira or confluence
      • 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 to false.
        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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object