Class OfflineTeamCityNode
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.OfflineTeamCityNode
-
- All Implemented Interfaces:
TeamCityNode
public class OfflineTeamCityNode extends Object implements TeamCityNode
-
-
Constructor Summary
Constructors Constructor Description OfflineTeamCityNode(String id, String url, boolean secondaryNode, Set<NodeResponsibility> enabledResponsibilities, Map<NodeResponsibility,Map<String,String>> responsibilityProperties, boolean uneditable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAcceptHTTPRequests()
String
getDescription()
Some node description provided by node itselfSet<NodeResponsibility>
getEffectiveResponsibilities()
Set<NodeResponsibility>
getEnabledResponsibilities()
String
getId()
Date
getLastActivityTime()
Returns the node last activity time.String
getResponsibilityProperty(NodeResponsibility responsibility, String propertyName)
Returns value of a single property of a given responsibilityDate
getStartTime()
Set<NodeResponsibility>
getSupportedResponsibilities()
String
getUrl()
boolean
isCurrent()
boolean
isMainNode()
boolean
isOnline()
Returns true if the node is online, i.e.boolean
isSecondaryNode()
boolean
isStopping()
boolean
isUneditableConfiguration()
Returns true if the node responsibilities were passed via command line and should not be edited via UI Restart of this node will bring back the responsibilities if they were changed in runtimeboolean
requiresExclusiveLock()
boolean
responsibilityEnabled(NodeResponsibility responsibility)
String
toString()
-
-
-
Constructor Detail
-
OfflineTeamCityNode
public OfflineTeamCityNode(@NotNull String id, @NotNull String url, boolean secondaryNode, @NotNull Set<NodeResponsibility> enabledResponsibilities, @NotNull Map<NodeResponsibility,Map<String,String>> responsibilityProperties, boolean uneditable)
-
-
Method Detail
-
getSupportedResponsibilities
@NotNull public Set<NodeResponsibility> getSupportedResponsibilities()
- Specified by:
getSupportedResponsibilities
in interfaceTeamCityNode
- Returns:
- list of responsibilities supported by this node
-
getEnabledResponsibilities
@NotNull public Set<NodeResponsibility> getEnabledResponsibilities()
- Specified by:
getEnabledResponsibilities
in interfaceTeamCityNode
- Returns:
- list of all responsibilities enabled for this node
-
getEffectiveResponsibilities
@NotNull public Set<NodeResponsibility> getEffectiveResponsibilities()
- Specified by:
getEffectiveResponsibilities
in interfaceTeamCityNode
- Returns:
- list of responsibilities which are effective on this node (for instance, responsibility may not be enabled, but there still can be some responsibility related tasks running, it means node has effective responsibility)
-
responsibilityEnabled
public boolean responsibilityEnabled(@NotNull NodeResponsibility responsibility)
- Specified by:
responsibilityEnabled
in interfaceTeamCityNode
- Returns:
- true if specified responsibility is both enabled on this node and is supported by it
-
isSecondaryNode
public boolean isSecondaryNode()
- Specified by:
isSecondaryNode
in interfaceTeamCityNode
- Returns:
- true if this node is a secondary one
-
isMainNode
public boolean isMainNode()
- Specified by:
isMainNode
in interfaceTeamCityNode
- Returns:
- true if this node is a main one
-
getStartTime
@NotNull public Date getStartTime() throws IllegalStateException
- Specified by:
getStartTime
in interfaceTeamCityNode
- Returns:
- node start time
- Throws:
IllegalStateException
- if node is not online
-
getLastActivityTime
@NotNull public Date getLastActivityTime() throws IllegalStateException
Description copied from interface:TeamCityNode
Returns the node last activity time. For the current node the last activity time is always the current time. For another node, this is the last time when a corresponding record was updated in the Heartbeat table.- Specified by:
getLastActivityTime
in interfaceTeamCityNode
- Throws:
IllegalStateException
- if node is not online
-
isOnline
public boolean isOnline()
Description copied from interface:TeamCityNode
Returns true if the node is online, i.e. there is a corresponding record for it in the Heartbeat table. Note: given that the record in the Heartbeat can be obsolete we still can consider a node online for some time even if it is crashed. It is advised to check theTeamCityNode.getLastActivityTime()
and if it stops updating for a long time, then chances are the node is crashed.- Specified by:
isOnline
in interfaceTeamCityNode
-
isCurrent
public boolean isCurrent()
- Specified by:
isCurrent
in interfaceTeamCityNode
- Returns:
- true if this node corresponds to server where this code executes
-
requiresExclusiveLock
public boolean requiresExclusiveLock()
- Specified by:
requiresExclusiveLock
in interfaceTeamCityNode
- Returns:
- true if this node tries to obtain exclusive lock, for instance exclusive lock is required to perform upgrade
-
getId
@NotNull public String getId()
- Specified by:
getId
in interfaceTeamCityNode
- Returns:
- this node id (unique among all other nodes)
-
getUrl
@NotNull public String getUrl()
- Specified by:
getUrl
in interfaceTeamCityNode
- Returns:
- url of the node
-
canAcceptHTTPRequests
public boolean canAcceptHTTPRequests()
- Specified by:
canAcceptHTTPRequests
in interfaceTeamCityNode
- Returns:
- true if this node can accept HTTP requests;
if the method returns true, then
TeamCityNode.getUrl()
can be used to obtain a direct URL of the node, otherwiseTeamCityNode.getUrl()
can return "<unknown url>" value.
-
getDescription
@NotNull public String getDescription()
Description copied from interface:TeamCityNode
Some node description provided by node itself- Specified by:
getDescription
in interfaceTeamCityNode
- Returns:
-
getResponsibilityProperty
@Nullable public String getResponsibilityProperty(@NotNull NodeResponsibility responsibility, @NotNull String propertyName)
Description copied from interface:TeamCityNode
Returns value of a single property of a given responsibility- Specified by:
getResponsibilityProperty
in interfaceTeamCityNode
- Parameters:
responsibility
- responsibilitypropertyName
- property name- Returns:
- vlaue of the property if it is set,
null
otherwise
-
isStopping
public boolean isStopping()
- Specified by:
isStopping
in interfaceTeamCityNode
- Returns:
- true if the node is shutting down
-
isUneditableConfiguration
public boolean isUneditableConfiguration()
Description copied from interface:TeamCityNode
Returns true if the node responsibilities were passed via command line and should not be edited via UI Restart of this node will bring back the responsibilities if they were changed in runtime- Specified by:
isUneditableConfiguration
in interfaceTeamCityNode
- Returns:
- see above
-
-