Class TokenStorageQuery.Builder<B extends TokenStorageQuery.Builder<B>>
- java.lang.Object
-
- jetbrains.buildServer.serverSide.oauth.TokenStorageQuery.Builder<B>
-
- Direct Known Subclasses:
TokenStorageUserQuery.Builder
- Enclosing class:
- TokenStorageQuery
public static class TokenStorageQuery.Builder<B extends TokenStorageQuery.Builder<B>> extends Object
A builder class for creating instances of TokenStorageQuery.- Since:
- 2024.07
-
-
Field Summary
Fields Modifier and Type Field Description protected String
myConnectionId
protected Long
myUserId
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenStorageQuery
build()
Builds a TokenStorageQuery with the specified parameters.protected B
self()
B
withAccessibleEntities(Set<String> accessibleEntities)
Specifies the accessible entities for the query.B
withConnectionId(String connectionId)
Specifies the connection ID to filter tokens by.B
withCustomFilter(Predicate<OAuthToken> customFilter)
Sets a custom filter to apply when querying the token storage.B
withProjectScope(Set<SProject> projectScope)
Specifies the project scope for the query.B
withProjectScopeMatchMode(TokenStorageQuery.ProjectScopeMatchMode matchMode)
Specifies how the token's project scope will be matched against the storage query.B
withRefreshIfNecessary(boolean refreshIfNecessary)
Specifies whether found tokens should be refreshed.B
withTokenIntent(TokenIntent tokenIntent)
Specifies the token intent for the query.B
withTokenName(String tokenName)
Sets the token name to filter by.B
withUser(SUser user)
Specifies the user for the query.B
withUserId(long userId)
Specifies the user ID for the query.B
withUserMatchMode(TokenStorageQuery.UserMatchMode matchMode)
Sets the user match mode.
-
-
-
Constructor Detail
-
Builder
protected Builder(@NotNull SProject project)
-
-
Method Detail
-
build
public TokenStorageQuery build()
Builds a TokenStorageQuery with the specified parameters.- Returns:
- a TokenStorageQuery
- Since:
- 2024.03
-
self
protected B self()
-
withConnectionId
public B withConnectionId(@NotNull String connectionId)
Specifies the connection ID to filter tokens by.- Parameters:
connectionId
- connection ID- Returns:
- this builder
- Since:
- 2024.07
-
withUser
public B withUser(@NotNull SUser user)
Specifies the user for the query. SeeTokenStorageQuery.myUserId
- Parameters:
user
- the user to be set- Returns:
- this builder
- Since:
- 2024.03
-
withUserId
public B withUserId(long userId)
Specifies the user ID for the query. SeeTokenStorageQuery.myUserId
- Parameters:
userId
- the user to be set- Returns:
- this builder
- Since:
- 2024.03
-
withRefreshIfNecessary
public B withRefreshIfNecessary(boolean refreshIfNecessary)
Specifies whether found tokens should be refreshed. SeeTokenStorageQuery.myRefreshIfNecessary
- Parameters:
refreshIfNecessary
- true, if refresh is necessary- Returns:
- this builder
- Since:
- 2024.03
-
withTokenIntent
public B withTokenIntent(@NotNull TokenIntent tokenIntent)
Specifies the token intent for the query. SeeTokenStorageQuery.myTokenIntent
- Parameters:
tokenIntent
- the intent to set- Returns:
- this builder
- Since:
- 2024.03
-
withAccessibleEntities
public B withAccessibleEntities(@NotNull Set<String> accessibleEntities)
Specifies the accessible entities for the query. SeeTokenStorageQuery.myAccessibleEntities
- Parameters:
accessibleEntities
- the accessible entities to set- Returns:
- this builder
- Since:
- 2024.03
-
withProjectScope
public B withProjectScope(@NotNull Set<SProject> projectScope)
Specifies the project scope for the query. SeeTokenStorageQuery.myProjectScope
- Parameters:
projectScope
- the project scope to set- Returns:
- this builder
- Since:
- 2024.03
-
withProjectScopeMatchMode
public B withProjectScopeMatchMode(@NotNull TokenStorageQuery.ProjectScopeMatchMode matchMode)
Specifies how the token's project scope will be matched against the storage query.- Parameters:
matchMode
- the match mode to use- Returns:
- this builder
- Since:
- 2024.07
- See Also:
TokenStorageQuery.ProjectScopeMatchMode
-
withTokenName
public B withTokenName(@NotNull String tokenName)
Sets the token name to filter by.- Parameters:
tokenName
- (partial) token name- Returns:
- this builder
- Since:
- 2024.07
- See Also:
TokenStorageQuery.myTokenName
-
withUserMatchMode
public B withUserMatchMode(@NotNull TokenStorageQuery.UserMatchMode matchMode)
Sets the user match mode.- Parameters:
matchMode
- the match mode to use- Returns:
- this builder
- Since:
- 2024.07
- See Also:
TokenStorageQuery.UserMatchMode
-
withCustomFilter
public B withCustomFilter(@NotNull Predicate<OAuthToken> customFilter)
Sets a custom filter to apply when querying the token storage.- Parameters:
customFilter
- the custom filter- Returns:
- this builder
- Since:
- 2024.07
-
-