Class OnlineTeamCityNode

    • Method Detail

      • getId

        @NotNull
        public String getId()
        Specified by:
        getId in interface TeamCityNode
        Returns:
        this node id (unique among all other nodes)
      • getEffectiveResponsibilities

        @NotNull
        public Set<NodeResponsibility> getEffectiveResponsibilities()
        Specified by:
        getEffectiveResponsibilities in interface TeamCityNode
        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 interface TeamCityNode
        Returns:
        true if specified responsibility is both enabled on this node and is supported by it
      • isSecondaryNode

        public boolean isSecondaryNode()
        Specified by:
        isSecondaryNode in interface TeamCityNode
        Returns:
        true if this node is a secondary one
      • isMainNode

        public boolean isMainNode()
        Specified by:
        isMainNode in interface TeamCityNode
        Returns:
        true if this node is a main one
      • getLastActivityTime

        @NotNull
        public Date getLastActivityTime()
        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 interface TeamCityNode
      • 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 the TeamCityNode.getLastActivityTime() and if it stops updating for a long time, then chances are the node is crashed.
        Specified by:
        isOnline in interface TeamCityNode
      • isCurrent

        public boolean isCurrent()
        Specified by:
        isCurrent in interface TeamCityNode
        Returns:
        true if this node corresponds to server where this code executes
      • requiresExclusiveLock

        public boolean requiresExclusiveLock()
        Specified by:
        requiresExclusiveLock in interface TeamCityNode
        Returns:
        true if this node tries to obtain exclusive lock, for instance exclusive lock is required to perform upgrade
      • getBuildNumber

        @NotNull
        public String getBuildNumber()
      • getDisplayVersion

        @NotNull
        public String getDisplayVersion()
      • 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 interface TeamCityNode
        Parameters:
        responsibility - responsibility
        propertyName - property name
        Returns:
        vlaue of the property if it is set, null otherwise
      • isStopping

        public boolean isStopping()
        Specified by:
        isStopping in interface TeamCityNode
        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 interface TeamCityNode
        Returns:
        see above