Class API

  • All Implemented Interfaces:
    CustomPropertiesEntity

    public class API
    extends Object
    implements CustomPropertiesEntity
    This class defines all common properties on an API and how each property should be treated during replication. APIManagerAPI and APIImportDefintion are both an instance of this class.

    Annotations for each property are used by the APIChangeState to decide: - Is it a breaking change? - Can the change be applied to the existing API? - Which Change-Handler should finally do the required actions to replicate the change into the APIManager

    When adding new properties, please make sure to create Getter and Setter as Jackson is used to create the Instances.

    Perhaps a way to simplify the code is to use for many of the properties is to use a SimplePropertyHandler as many properties are handled in the same way.

    Author:
    cwiechmann@axway.com
    • Constructor Detail

      • API

        public API()
    • Method Detail

      • setApiDefinition

        public void setApiDefinition​(APISpecification apiDefinition)
      • setSecurityProfiles

        public void setSecurityProfiles​(List<SecurityProfile> securityProfiles)
      • setCorsProfiles

        public void setCorsProfiles​(List<CorsProfile> corsProfiles)
      • getVhost

        public String getVhost()
      • setVhost

        public void setVhost​(String vhost)
      • getTags

        public TagMap getTags()
      • setState

        public void setState​(String state)
      • getState

        public String getState()
        The tool handles deprecation as an additional state (might not be best choice), but the API-Manager internally doesn't. In API-Manager deprecation is just a true/false toggle. To make Desired and Actual API comparable this method is encapsulating the difference.
        Returns:
        the state of the API (unpublished, deprecated, etc.)
        See Also:
        getState()
      • getVersion

        public String getVersion()
      • setVersion

        public void setVersion​(String version)
      • getSummary

        public String getSummary()
      • setSummary

        public void setSummary​(String summary)
      • getImage

        public Image getImage()
      • setImage

        public void setImage​(Image image)
      • getName

        public String getName()
      • setName

        public void setName​(String name)
      • getOrganizationId

        public String getOrganizationId()
      • setOrganization

        public void setOrganization​(Organization organization)
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
      • setId

        public void setId​(String id)
      • getApiId

        public String getApiId()
      • setApiId

        public void setApiId​(String apiId)
      • getDeprecated

        public String getDeprecated()
      • setDeprecated

        public void setDeprecated​(String deprecated)
      • getRetirementDate

        public Long getRetirementDate()
      • setRetirementDate

        public void setRetirementDate​(Long retirementDate)
      • getDescriptionType

        public String getDescriptionType()
      • setDescriptionType

        public void setDescriptionType​(String descriptionType)
      • getDescriptionManual

        public String getDescriptionManual()
      • setDescriptionManual

        public void setDescriptionManual​(String descriptionManual)
      • getDescriptionMarkdown

        public String getDescriptionMarkdown()
      • setDescriptionMarkdown

        public void setDescriptionMarkdown​(String descriptionMarkdown)
      • getDescriptionUrl

        public String getDescriptionUrl()
      • setDescriptionUrl

        public void setDescriptionUrl​(String descriptionUrl)
      • getMarkdownLocal

        public List<String> getMarkdownLocal()
      • setMarkdownLocal

        public void setMarkdownLocal​(List<String> markdownLocal)
      • setCaCerts

        public void setCaCerts​(List<CaCert> caCerts)
      • getApplicationQuota

        public APIQuota getApplicationQuota()
      • setApplicationQuota

        public void setApplicationQuota​(APIQuota applicationQuota)
      • getSystemQuota

        public APIQuota getSystemQuota()
      • setSystemQuota

        public void setSystemQuota​(APIQuota systemQuota)
      • setTags

        public void setTags​(TagMap tags)
      • setClientOrganizations

        public void setClientOrganizations​(List<Organization> clientOrganizations)
      • getApiRoutingKey

        public String getApiRoutingKey()
      • setApiRoutingKey

        public void setApiRoutingKey​(String apiRoutingKey)
      • setApiMethods

        public void setApiMethods​(List<APIMethod> apiMethods)
      • toStringHuman

        public String toStringHuman()
      • getApiDefinitionImport

        public String getApiDefinitionImport()
      • getApiConfiguration

        public com.fasterxml.jackson.databind.JsonNode getApiConfiguration()
      • setApiConfiguration

        public void setApiConfiguration​(com.fasterxml.jackson.databind.JsonNode apiConfiguration)
      • getCreatedOn

        public Long getCreatedOn()
      • setCreatedOn

        public void setCreatedOn​(Long createdOn)
      • getCreatedBy

        public String getCreatedBy()
      • setCreatedBy

        public void setCreatedBy​(String createdBy)
      • getRemotehost

        public RemoteHost getRemotehost()
      • setRemotehost

        public void setRemotehost​(RemoteHost remotehost)
      • getResourcePath

        public String getResourcePath()
        Returns:
        path of the resource registered for the belonging backend API or null if not set
      • setBackendResourcePath

        public void setBackendResourcePath​(String resourcePath)
        Parameters:
        resourcePath - is the path of the resource registered for the belonging backend API
      • isRequestForAllOrgs

        public boolean isRequestForAllOrgs()
        requestForAllOrgs is used to decide if an API should grant access to ALL organizations. That means, when an API-Developer is defining ALL as the organization name this flag is set to true and it becomes the desired state.
        Returns:
        true, if the developer wants to have permissions to this API for all Orgs.
      • setRequestForAllOrgs

        public void setRequestForAllOrgs​(boolean requestForAllOrgs)
        requestForAllOrgs is used to decide if an API should grant access to ALL organizations. That means, when an API-Developer is defining ALL as the organization name this flag is set to true and it becomes the desired state. This method is used during creation of APIImportDefinition in APIImportConfig#handleAllOrganizations()
        Parameters:
        requestForAllOrgs - when set to true, the APIs will be granted to ALL organizations.
      • getBackendImportedUrl

        public String getBackendImportedUrl()
      • setBackendImportedUrl

        public void setBackendImportedUrl​(String backendImportedUrl)