Class CloudStateHolder.InstanceState
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase<CloudStateHolder.InstanceStateKey>
-
- jetbrains.buildServer.clouds.server.impl.CloudStateHolder.InstanceState
-
- All Implemented Interfaces:
CloudErrorProvider
,CloudInstance
- Enclosing class:
- CloudStateHolder
public static class CloudStateHolder.InstanceState extends CloudStateHolder.StateBase<CloudStateHolder.InstanceStateKey> implements CloudInstance
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase
myAddtionalData, myKey
-
-
Constructor Summary
Constructors Constructor Description InstanceState(String projectId, String profileId, String imageId, String instanceId, String name, String statusString, long startedTime, String networkIdentity, boolean isExpired, int agentId, String additionalDataJson)
InstanceState(String projectId, String profileId, String imageId, String instanceId, String name, String statusString, Timestamp startedTime, String networkIdentity, boolean isExpired, int agentId, String additionalDataJson)
InstanceState(String instanceId, String name, CloudStateHolder.ImageState image, Date startedTime, String networkIdentity, InstanceStatus status, CloudErrorInfo errorInfo, boolean isExpired, int agentId)
InstanceState(CloudInstance instance, CloudStateHolder.ImageState imageState, int agentId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsAgent(AgentDescription agentDescription)
Checks is the agent is running under this instanceboolean
equals(Object o)
int
getAgentId()
CloudImage
getImage()
Returns the reference to the handle of the image this instance started from.String
getImageId()
Returns the image identifierString
getInstanceId()
Returns the instance identifier.String
getName()
Name of the instance.String
getNetworkIdentity()
Returns the instance's DNS name (if one exists) or IPv4 address (if no DNS names).Date
getStartedTime()
Returns the instance started time.InstanceStatus
getStatus()
current status of the instanceint
hashCode()
boolean
isExpired()
void
setAgentId(int agentId)
void
setExpired()
String
toString()
boolean
updateIfNecessary(CloudInstance instance, int agentId)
returns true if instance was updated and false otherwise-
Methods inherited from class jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase
getAdditionalDataJson, getAddtionalData, getErrorInfo, getKey, setAddtionalData, setErrorInfo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.clouds.CloudInstance
getErrorInfo, getInstanceType
-
-
-
-
Constructor Detail
-
InstanceState
public InstanceState(@NotNull CloudInstance instance, @NotNull CloudStateHolder.ImageState imageState, int agentId)
-
InstanceState
public InstanceState(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId, @NotNull String instanceId, @NotNull String name, @NotNull String statusString, @NotNull Timestamp startedTime, @Nullable String networkIdentity, boolean isExpired, int agentId, @Nullable String additionalDataJson)
-
InstanceState
public InstanceState(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId, @NotNull String instanceId, @NotNull String name, @NotNull String statusString, long startedTime, @Nullable String networkIdentity, boolean isExpired, int agentId, @Nullable String additionalDataJson)
-
InstanceState
public InstanceState(@NotNull String instanceId, @NotNull String name, @NotNull CloudStateHolder.ImageState image, @NotNull Date startedTime, @Nullable String networkIdentity, @NotNull InstanceStatus status, @Nullable CloudErrorInfo errorInfo, boolean isExpired, int agentId)
-
-
Method Detail
-
getInstanceId
@NotNull public String getInstanceId()
Description copied from interface:CloudInstance
Returns the instance identifier.
Must be unique within the profile.- Specified by:
getInstanceId
in interfaceCloudInstance
- Returns:
- instance identifier.
-
getName
@NotNull public String getName()
Description copied from interface:CloudInstance
Name of the instance. Name may change in the time.- Specified by:
getName
in interfaceCloudInstance
- Returns:
- name
-
getImageId
@NotNull public String getImageId()
Description copied from interface:CloudInstance
Returns the image identifier- Specified by:
getImageId
in interfaceCloudInstance
- Returns:
- image identifier.
- See Also:
CloudImage.getId()
-
getImage
@NotNull public CloudImage getImage()
Description copied from interface:CloudInstance
Returns the reference to the handle of the image this instance started from.- Specified by:
getImage
in interfaceCloudInstance
- Returns:
- reference to the image descriptor (all instances started from one image returns a reference to the same java object).
-
getStartedTime
@NotNull public Date getStartedTime()
Description copied from interface:CloudInstance
Returns the instance started time.- Specified by:
getStartedTime
in interfaceCloudInstance
- Returns:
- started time.
-
getNetworkIdentity
@Nullable public String getNetworkIdentity()
Description copied from interface:CloudInstance
Returns the instance's DNS name (if one exists) or IPv4 address (if no DNS names).- Specified by:
getNetworkIdentity
in interfaceCloudInstance
- Returns:
- DNS name (in form "host.domain.com") or IPv4 address (in form "12.34.56.78"), or null if the identity is unknown at this moment. Never returns empty strings.
-
setExpired
public void setExpired()
-
getStatus
@NotNull public InstanceStatus getStatus()
Description copied from interface:CloudInstance
current status of the instance- Specified by:
getStatus
in interfaceCloudInstance
- Returns:
- status
-
isExpired
public boolean isExpired()
-
getAgentId
public int getAgentId()
-
setAgentId
public void setAgentId(int agentId)
-
containsAgent
public boolean containsAgent(@NotNull AgentDescription agentDescription)
Description copied from interface:CloudInstance
Checks is the agent is running under this instance- Specified by:
containsAgent
in interfaceCloudInstance
- Parameters:
agentDescription
- agent to check- Returns:
- true is agent is running under the instance
-
updateIfNecessary
public boolean updateIfNecessary(@NotNull CloudInstance instance, int agentId)
returns true if instance was updated and false otherwise
-
-