Class TokenStorageQuery
- java.lang.Object
-
- jetbrains.buildServer.serverSide.oauth.TokenStorageQuery
-
- Direct Known Subclasses:
TokenStorageUserQuery
public class TokenStorageQuery extends Object
Represents a query for retrieving tokens from the OAuth token storage.- Since:
- 2024.07
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTokenStorageQuery.Builder<B extends TokenStorageQuery.Builder<B>>A builder class for creating instances of TokenStorageQuery.static classTokenStorageQuery.ProjectScopeMatchModeDetermines how the token's project scope will be matched against the storage query.static classTokenStorageQuery.UserMatchModeDetermines how the token user will be matched against the storage query.
-
Constructor Summary
Constructors Modifier Constructor Description protectedTokenStorageQuery(TokenStorageQuery.Builder<B> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <B extends TokenStorageQuery.Builder<B>>
TokenStorageQuery.Builder<B>builder(SProject project)Creates a new builder instance to facilite creation of aTokenStorageQuery.booleanequals(Object o)Set<String>getAccessibleEntities()StringgetConnectionId()Predicate<OAuthToken>getCustomFilter()SProjectgetProject()Set<SProject>getProjectScope()Set<String>getProjectScopeExtracted()TokenStorageQuery.ProjectScopeMatchModegetProjectScopeMatchMode()TokenIntentgetTokenIntent()StringgetTokenName()The name to filter tokens by.LonggetUserId()TokenStorageQuery.UserMatchModegetUserMatchMode()inthashCode()booleanisRefreshIfNecessary()StringtoString()
-
-
-
Constructor Detail
-
TokenStorageQuery
protected TokenStorageQuery(@NotNull TokenStorageQuery.Builder<B> builder)
-
-
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
myProjectScopealready transformed into the internal context-key format used in token storage
-
getProjectScopeMatchMode
@NotNull public TokenStorageQuery.ProjectScopeMatchMode getProjectScopeMatchMode()
- Returns:
- how the token's project scope will be matched against the storage query.
-
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.
-
builder
public static <B extends TokenStorageQuery.Builder<B>> TokenStorageQuery.Builder<B> builder(@NotNull SProject project)
Creates a new builder instance to facilite creation of aTokenStorageQuery.- Parameters:
project- The project associated with the query.- Returns:
- A new builder
- Since:
- 2024.07
-
-