Interface TeamCityNodes

  • All Known Implementing Classes:
    TeamCityNodesImpl

    public interface TeamCityNodes
    A service which provides access to TeamCity nodes and allows changing their configuration.
    Since:
    2022.04
    • Method Detail

      • getOnlineNodes

        @NotNull
        List<TeamCityNode> getOnlineNodes()
        Returns all nodes which are currently online. The returned list is never empty. The first node in the list always represents the current server.
        Returns:
        see above
      • getOnlineNodes

        @NotNull
        List<TeamCityNode> getOnlineNodes​(int activityTimeThresholdSeconds)
        Returns all online nodes which have been active within the specified activity threshold in seconds. The returned list always includes the current node. The returned list does not include nodes which are currently stopping even if their activity satisfies the threshold.
        Parameters:
        activityTimeThresholdSeconds - time in seconds since the last node activity, if set to -1 then all the online nodes despite their activity will be returned.
        Returns:
        see above
        Since:
        2022.10
      • getNodes

        @NotNull
        List<TeamCityNode> getNodes()
        Returns:
        all, online and offline nodes
      • getCurrentNode

        @NotNull
        TeamCityNode getCurrentNode()
        Returns:
        current node, same as getOnlineNodes().get(0)
      • findNodeById

        @Nullable
        TeamCityNode findNodeById​(@NotNull
                                  String id)
        Searches for a node with given id (online or offline).
        Parameters:
        id - id of the node
        Returns:
        found node or null
        Since:
        2024.12
      • mainNodeRequiresExclusiveLock

        boolean mainNodeRequiresExclusiveLock()
        Returns:
        true if main server tries to obtain an exclusive lock
      • setResponsibilityProperty

        void setResponsibilityProperty​(@NotNull
                                       TeamCityNode node,
                                       @NotNull
                                       NodeResponsibility responsibility,
                                       @NotNull
                                       String propertyName,
                                       @Nullable
                                       String propertyValue)
        Sets the property of a given responsibility
        Parameters:
        node - TeamCityNode to set property in
        responsibility - NodeResponsibility to set property for
        propertyName - name of the property
        propertyValue - value of the property. Providing null value removes the property
        Since:
        2021.1