Interface TeamCityNode

    • Method Detail

      • getId

        @NotNull
        String getId()
        Returns:
        this node id (unique among all other nodes)
      • getUrl

        @NotNull
        String getUrl()
        Returns:
        url of the node
      • canAcceptHTTPRequests

        boolean canAcceptHTTPRequests()
        Returns:
        true if this node can accept HTTP requests; if the method returns true, then getUrl() can be used to obtain a direct URL of the node, otherwise getUrl() can return "<unknown url>" value.
        Since:
        2022.08
      • getDescription

        @NotNull
        String getDescription()
        Some node description provided by node itself
        Returns:
      • getSupportedResponsibilities

        @NotNull
        Set<NodeResponsibility> getSupportedResponsibilities()
        Returns:
        list of responsibilities supported by this node
      • getEnabledResponsibilities

        @NotNull
        Set<NodeResponsibility> getEnabledResponsibilities()
        Returns:
        list of all responsibilities enabled for this node
      • getEffectiveResponsibilities

        @NotNull
        Set<NodeResponsibility> getEffectiveResponsibilities()
        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

        boolean responsibilityEnabled​(@NotNull
                                      NodeResponsibility responsibility)
        Parameters:
        responsibility -
        Returns:
        true if specified responsibility is both enabled on this node and is supported by it
      • isSecondaryNode

        boolean isSecondaryNode()
        Returns:
        true if this node is a secondary one
      • isMainNode

        boolean isMainNode()
        Returns:
        true if this node is a main one
      • getLastActivityTime

        @NotNull
        Date getLastActivityTime()
                          throws IllegalStateException
        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.
        Throws:
        IllegalStateException - if node is not online
      • isOnline

        boolean isOnline()
        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 getLastActivityTime() and if it stops updating for a long time, then chances are the node is crashed.
      • isCurrent

        boolean isCurrent()
        Returns:
        true if this node corresponds to server where this code executes
      • requiresExclusiveLock

        boolean requiresExclusiveLock()
        Returns:
        true if this node tries to obtain exclusive lock, for instance exclusive lock is required to perform upgrade
        Since:
        2019.1
      • getResponsibilityProperty

        @Nullable
        String getResponsibilityProperty​(@NotNull
                                         NodeResponsibility responsibility,
                                         @NotNull
                                         String propertyName)
        Returns value of a single property of a given responsibility
        Parameters:
        responsibility - responsibility
        propertyName - property name
        Returns:
        vlaue of the property if it is set, null otherwise
        Since:
        2021.1
      • isStopping

        boolean isStopping()
        Returns:
        true if the node is shutting down
      • isUneditableConfiguration

        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 runtime
        Returns:
        see above
        Since:
        2023.07