Class DeploymentNode

java.lang.Object

public final class DeploymentNode
extends DeploymentElement

Represents a deployment node, which is something like:

  • Physical infrastructure (e.g. a physical server or device)
  • Virtualised infrastructure (e.g. IaaS, PaaS, a virtual machine)
  • Containerised infrastructure (e.g. a Docker container)
  • Database server
  • Java EE web/application server
  • Microsoft IIS
  • etc
  • Constructor Details

  • Method Details

    • add

      public ContainerInstance add​(Container container)
      Adds a container instance to this deployment node, replicating all of the container-container relationships.
      Parameters:
      container - the Container to add an instance of
      Returns:
      a ContainerInstance object
    • add

      public ContainerInstance add​(Container container, boolean replicateContainerRelationships)
      Adds a container instance to this deployment node, optionally replicating all of the container-container relationships.
      Parameters:
      container - the Container to add an instance of
      replicateContainerRelationships - true if the container-container relationships should be replicated between the container instances, false otherwise
      Returns:
      a ContainerInstance object
    • addDeploymentNode

      public DeploymentNode addDeploymentNode​(java.lang.String name)
      Adds a child deployment node.
      Parameters:
      name - the name of the deployment node
      Returns:
      a DeploymentNode object
    • addDeploymentNode

      public DeploymentNode addDeploymentNode​(java.lang.String name, java.lang.String description, java.lang.String technology)
      Adds a child deployment node.
      Parameters:
      name - the name of the deployment node
      description - a short description
      technology - the technology
      Returns:
      a DeploymentNode object
    • addDeploymentNode

      public DeploymentNode addDeploymentNode​(java.lang.String name, java.lang.String description, java.lang.String technology, int instances)
      Adds a child deployment node.
      Parameters:
      name - the name of the deployment node
      description - a short description
      technology - the technology
      instances - the number of instances
      Returns:
      a DeploymentNode object
    • addDeploymentNode

      public DeploymentNode addDeploymentNode​(java.lang.String name, java.lang.String description, java.lang.String technology, int instances, java.util.Map<java.lang.String,​java.lang.String> properties)
      Adds a child deployment node.
      Parameters:
      name - the name of the deployment node
      description - a short description
      technology - the technology
      instances - the number of instances
      properties - a Map (String,String) describing name=value properties
      Returns:
      a DeploymentNode object
    • getDeploymentNodeWithName

      public DeploymentNode getDeploymentNodeWithName​(java.lang.String name)
      Gets the DeploymentNode with the specified name.
      Parameters:
      name - the name of the deployment node
      Returns:
      the DeploymentNode instance with the specified name (or null if it doesn't exist).
    • getInfrastructureNodeWithName

      public InfrastructureNode getInfrastructureNodeWithName​(java.lang.String name)
      Gets the infrastructure node with the specified name.
      Parameters:
      name - the name of the infrastructure node
      Returns:
      the InfrastructureNode instance with the specified name (or null if it doesn't exist).
    • addInfrastructureNode

      public InfrastructureNode addInfrastructureNode​(java.lang.String name)
      Adds a child infrastructure node.
      Parameters:
      name - the name of the infrastructure node
      Returns:
      an InfrastructureNode object
    • addInfrastructureNode

      public InfrastructureNode addInfrastructureNode​(java.lang.String name, java.lang.String description, java.lang.String technology)
      Adds a child infrastructure node.
      Parameters:
      name - the name of the infrastructure node
      description - a short description
      technology - the technology
      Returns:
      an InfrastructureNode object
    • addInfrastructureNode

      public InfrastructureNode addInfrastructureNode​(java.lang.String name, java.lang.String description, java.lang.String technology, java.util.Map<java.lang.String,​java.lang.String> properties)
      Adds a child infrastructure node.
      Parameters:
      name - the name of the infrastructure node
      description - a short description
      technology - the technology
      properties - a Map (String,String) describing name=value properties
      Returns:
      an InfrastructureNode object
    • uses

      public Relationship uses​(DeploymentNode destination, java.lang.String description, java.lang.String technology)
      Adds a relationship between this and another deployment node.
      Parameters:
      destination - the destination DeploymentNode
      description - a short description of the relationship
      technology - the technology
      Returns:
      a Relationship object
    • uses

      public Relationship uses​(DeploymentNode destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
      Adds a relationship between this and another deployment node.
      Parameters:
      destination - the destination DeploymentNode
      description - a short description of the relationship
      technology - the technology
      interactionStyle - the interaction style (Synchronous vs Asynchronous)
      Returns:
      a Relationship object
    • getChildren

      public java.util.Set<DeploymentNode> getChildren()
      Gets the set of child deployment nodes.
      Returns:
      a Set of DeploymentNode objects
    • getInfrastructureNodes

      public java.util.Set<InfrastructureNode> getInfrastructureNodes()
      Gets the set of child infrastructure nodes.
      Returns:
      a Set of InfrastructureNode objects
    • hasChildren

      public boolean hasChildren()
    • getContainerInstances

      public java.util.Set<ContainerInstance> getContainerInstances()
      Gets the set of container instances associated with this deployment node.
      Returns:
      a Set of ContainerInstance objects
    • getParent

      public Element getParent()
      Gets the parent deployment node.
      Specified by:
      getParent in class Element
      Returns:
      the parent DeploymentNode, or null if there is no parent
    • getTechnology

      public java.lang.String getTechnology()
    • setTechnology

      public void setTechnology​(java.lang.String technology)
    • getInstances

      public int getInstances()
    • setInstances

      public void setInstances​(int instances)
    • getRequiredTags

      protected java.util.Set<java.lang.String> getRequiredTags()
    • getCanonicalName

      public java.lang.String getCanonicalName()
      Specified by:
      getCanonicalName in class Element
    • getId

      public java.lang.String getId()
      Gets the ID of this item in the model.
      Returns:
      the ID, as a String
    • getOriginId

      public java.lang.String getOriginId()
    • getTags

      public java.lang.String getTags()
      Gets the comma separated list of tags.
      Returns:
      a comma separated list of tags, or an empty string if there are no tags
    • getTagsAsSet

      public java.util.Set<java.lang.String> getTagsAsSet()
    • addTags

      public void addTags​(java.lang.String... tags)
    • removeTag

      public boolean removeTag​(java.lang.String tag)
      Removes the given tag.
      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.
    • hasTag

      public boolean hasTag​(java.lang.String tag)
      Determines whether this model item has the given tag.
      Parameters:
      tag - the tag to check for
      Returns:
      true if tag is present as a tag on this item, or if it is one of the required tags defined by the model in getRequiredTags(), false otherwise
    • getProperties

      public java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Gets the collection of name-value property pairs associated with this element, as a Map.
      Returns:
      a Map (String, String) (empty if there are no properties)
    • addProperty

      public void addProperty​(java.lang.String name, java.lang.String value)
      Adds a name-value pair property to this element.
      Parameters:
      name - the name of the property
      value - the value of the property
    • getPerspectives

      public java.util.Set<Perspective> getPerspectives()
      Gets the set of perspectives associated with this model item.
      Returns:
      a Set of Perspective objects (empty if there are none)
    • addPerspective

      public Perspective addPerspective​(java.lang.String name, java.lang.String description)
      Adds a perspective to this model item.
      Parameters:
      name - the name of the perspective (e.g. "Security", must be unique)
      description - a description of the perspective
      Returns:
      a Perspective object
      Throws:
      java.lang.IllegalArgumentException - if perspective details are not specified, or the named perspective exists already