Class TokenStorageQuery

  • Direct Known Subclasses:
    TokenStorageUserQuery

    public class TokenStorageQuery
    extends Object
    Represents a query for retrieving tokens from the OAuth token storage.
    Since:
    2024.07
    • Method Detail

      • getProject

        @NotNull
        public SProject getProject()
        Returns:
        the project determines the context of the connection
      • getConnectionId

        @Nullable
        public String getConnectionId()
        Returns:
        the connection that was used to issue the queried token
      • getUserId

        @Nullable
        public Long getUserId()
        Returns:
        TeamCity user ID to whom the queried tokens are issued
      • isRefreshIfNecessary

        public boolean isRefreshIfNecessary()
        Returns:
        true, if refreshing of expired tokens was requested
      • getTokenIntent

        @NotNull
        public TokenIntent getTokenIntent()
        Returns:
        the intended token usage, to correlate against OAuth scopes
      • getAccessibleEntities

        @Nullable
        public Set<String> getAccessibleEntities()
        Returns:
        the accessible entities the tokens should match against, if not null
      • getProjectScope

        @Nullable
        public Set<SProject> getProjectScope()
        Returns:
        the project scope of the queried tokens, if not null
      • getProjectScopeExtracted

        @Nullable
        public Set<String> getProjectScopeExtracted()
        Returns:
        a representation of myProjectScope already transformed into the internal context-key format used in token storage
      • getTokenName

        @Nullable
        public String getTokenName()
        The name to filter tokens by.
        Returns:
        (partial) token name, or null if no filtering is desired.
        Since:
        2024.07
        See Also:
        myTokenName
      • getUserMatchMode

        @NotNull
        public TokenStorageQuery.UserMatchMode getUserMatchMode()
        Returns:
        how the token's user ID will be matched against the storage query.
      • getCustomFilter

        @NotNull
        public Predicate<OAuthToken> getCustomFilter()
        Returns:
        the custom filter to apply to tokens.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object