Class StaticStructureElementInstance

All Implemented Interfaces:
PropertyHolder, Comparable<ModelItem>
Direct Known Subclasses:
ContainerInstance, SoftwareSystemInstance

public abstract class StaticStructureElementInstance extends DeploymentElement
Represents a deployment instance of a SoftwareSystem or Container, which can be added to a DeploymentNode.
  • Method Details

    • getElement

      public abstract StaticStructureElement getElement()
    • getDeploymentGroups

      public Set<String> getDeploymentGroups()
      Gets the deployment group of this element instance.
      Returns:
      a deployment group name
    • getInstanceId

      public int getInstanceId()
      Gets the instance ID of this element instance.
      Returns:
      the instance ID, an integer greater than zero
    • getDefaultTags

      public Set<String> getDefaultTags()
      Specified by:
      getDefaultTags in class ModelItem
    • removeTag

      public boolean removeTag(String tag)
      Description copied from class: ModelItem
      Removes the given tag.
      Overrides:
      removeTag in class ModelItem
      Parameters:
      tag - the tag to remove
      Returns:
      true if the tag was removed; will return false if a non-existent tag is passed, or if an attempt is made to remove required tags, which cannot be removed.
    • getName

      public String getName()
      Description copied from class: Element
      Gets the name of this element.
      Overrides:
      getName in class Element
      Returns:
      the name, as a String
    • setName

      public void setName(String name)
    • getHealthChecks

      @Nonnull public Set<HttpHealthCheck> getHealthChecks()
      Gets the set of health checks associated with this element instance.
      Returns:
      a Set of HttpHealthCheck instances
    • addHealthCheck

      @Nonnull public HttpHealthCheck addHealthCheck(String name, String url)
      Adds a new health check, with the default interval (60 seconds) and timeout (0 milliseconds).
      Parameters:
      name - the name of the health check
      url - the URL of the health check
      Returns:
      a HttpHealthCheck instance representing the health check that has been added
      Throws:
      IllegalArgumentException - if the name is empty, or the URL is not a well-formed URL
    • addHealthCheck

      @Nonnull public HttpHealthCheck addHealthCheck(String name, String url, int interval, long timeout)
      Adds a new health check.
      Parameters:
      name - the name of the health check
      url - the URL of the health check
      interval - the polling interval, in seconds
      timeout - the timeout, in milliseconds
      Returns:
      a HttpHealthCheck instance representing the health check that has been added
      Throws:
      IllegalArgumentException - if the name is empty, the URL is not a well-formed URL, or the interval/timeout is not zero/a positive integer
    • uses

      public Relationship uses(InfrastructureNode destination, String description, String technology)
      Adds a relationship between this element instance and an infrastructure node.
      Parameters:
      destination - the destination InfrastructureNode
      description - a short description of the relationship
      technology - the technology
      Returns:
      a Relationship object
    • uses

      public Relationship uses(InfrastructureNode destination, String description, String technology, InteractionStyle interactionStyle)
      Adds a relationship between this element instance and an infrastructure node.
      Parameters:
      destination - the destination InfrastructureNode
      description - a short description of the relationship
      technology - the technology
      interactionStyle - the interaction style (Synchronous vs Asynchronous)
      Returns:
      a Relationship object
    • uses

      public Relationship uses(InfrastructureNode destination, String description, String technology, InteractionStyle interactionStyle, String[] tags)
      Adds a relationship between this element instance and an infrastructure node.
      Parameters:
      destination - the destination InfrastructureNode
      description - a short description of the relationship
      technology - the technology
      interactionStyle - the interaction style (Synchronous vs Asynchronous)
      tags - an array of tags
      Returns:
      a Relationship object