Package com.structurizr.model
Class StaticStructureElementInstance
java.lang.Object
com.structurizr.model.ModelItem
com.structurizr.model.Element
com.structurizr.model.DeploymentElement
com.structurizr.model.StaticStructureElementInstance
- 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
.-
Field Summary
Fields inherited from class com.structurizr.model.DeploymentElement
DEFAULT_DEPLOYMENT_ENVIRONMENT, DEFAULT_DEPLOYMENT_GROUP
-
Method Summary
Modifier and Type Method Description HttpHealthCheck
addHealthCheck(java.lang.String name, java.lang.String url)
Adds a new health check, with the default interval (60 seconds) and timeout (0 milliseconds).HttpHealthCheck
addHealthCheck(java.lang.String name, java.lang.String url, int interval, long timeout)
Adds a new health check.java.util.Set<java.lang.String>
getDeploymentGroups()
Gets the deployment group of this element instance.abstract StaticStructureElement
getElement()
java.util.Set<HttpHealthCheck>
getHealthChecks()
Gets the set of health checks associated with this element instance.int
getInstanceId()
Gets the instance ID of this element instance.java.lang.String
getName()
Gets the name of this element.protected java.util.Set<java.lang.String>
getRequiredTags()
boolean
removeTag(java.lang.String tag)
Removes the given tag.void
setName(java.lang.String name)
Relationship
uses(InfrastructureNode destination, java.lang.String description, java.lang.String technology)
Adds a relationship between this element instance and an infrastructure node.Relationship
uses(InfrastructureNode destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)
Adds a relationship between this element instance and an infrastructure node.Relationship
uses(InfrastructureNode destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle, java.lang.String[] tags)
Adds a relationship between this element instance and an infrastructure node.Methods inherited from class com.structurizr.model.Element
getDescription, getEfferentRelationshipsWith, getEfferentRelationshipWith, getEfferentRelationshipWith, getModel, getRelationships, hasAfferentRelationships, hasEfferentRelationshipWith, hasEfferentRelationshipWith, setDescription, setModel, toString, uses, uses, uses
Methods inherited from class com.structurizr.model.ModelItem
addPerspective, addProperty, addTags, getCanonicalName, getId, getOriginId, getPerspectives, getProperties, getTags, getTagsAsSet, getUrl, hasTag, setUrl
-
Method Details
-
getElement
-
getDeploymentGroups
public java.util.Set<java.lang.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
-
getRequiredTags
protected java.util.Set<java.lang.String> getRequiredTags()- Specified by:
getRequiredTags
in classModelItem
-
removeTag
public boolean removeTag(java.lang.String tag)Description copied from class:ModelItem
Removes the given tag. -
getName
public java.lang.String getName()Description copied from class:Element
Gets the name of this element. -
setName
public void setName(java.lang.String name) -
getHealthChecks
Gets the set of health checks associated with this element instance.- Returns:
- a Set of HttpHealthCheck instances
-
addHealthCheck
Adds a new health check, with the default interval (60 seconds) and timeout (0 milliseconds).- Parameters:
name
- the name of the health checkurl
- the URL of the health check- Returns:
- a HttpHealthCheck instance representing the health check that has been added
- Throws:
java.lang.IllegalArgumentException
- if the name is empty, or the URL is not a well-formed URL
-
addHealthCheck
@Nonnull public HttpHealthCheck addHealthCheck(java.lang.String name, java.lang.String url, int interval, long timeout)Adds a new health check.- Parameters:
name
- the name of the health checkurl
- the URL of the health checkinterval
- the polling interval, in secondstimeout
- the timeout, in milliseconds- Returns:
- a HttpHealthCheck instance representing the health check that has been added
- Throws:
java.lang.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, java.lang.String description, java.lang.String technology)Adds a relationship between this element instance and an infrastructure node.- Parameters:
destination
- the destination InfrastructureNodedescription
- a short description of the relationshiptechnology
- the technology- Returns:
- a Relationship object
-
uses
public Relationship uses(InfrastructureNode destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle)Adds a relationship between this element instance and an infrastructure node.- Parameters:
destination
- the destination InfrastructureNodedescription
- a short description of the relationshiptechnology
- the technologyinteractionStyle
- the interaction style (Synchronous vs Asynchronous)- Returns:
- a Relationship object
-
uses
public Relationship uses(InfrastructureNode destination, java.lang.String description, java.lang.String technology, InteractionStyle interactionStyle, java.lang.String[] tags)Adds a relationship between this element instance and an infrastructure node.- Parameters:
destination
- the destination InfrastructureNodedescription
- a short description of the relationshiptechnology
- the technologyinteractionStyle
- the interaction style (Synchronous vs Asynchronous)tags
- an array of tags- Returns:
- a Relationship object
-