com.atlassian.connect.spring.ForgeSystemAccessTokenRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atlassian-connect-spring-boot-api Show documentation
Show all versions of atlassian-connect-spring-boot-api Show documentation
Provides the API of Atlassian Connect for Spring Boot
The newest version!
package com.atlassian.connect.spring;
import org.springframework.data.repository.CrudRepository;
import org.springframework.lang.NonNull;
import java.sql.Timestamp;
import java.util.Optional;
/**
* A Spring Data repository for
* storing access tokens parsed from Forge Invocation Token (FIT).
*
* For guidance on configuring persistence for your application, see {@link AtlassianHostRepository}
*
* @since 5.2.0
*/
public interface ForgeSystemAccessTokenRepository extends CrudRepository {
/**
* Find the access token that is not yet expired
*
* @param installationId the installation ID
* @param expirationTime In most cases, specify the timestamp as of the moment this method is called with a bit of leeway
* @return unexpired access token and its meta data
*/
@NonNull
Optional findByInstallationIdAndExpirationTimeAfter(
@NonNull String installationId,
@NonNull Timestamp expirationTime);
/**
* Clean up the stale records
*
* @param expirationTime In most cases, specify the timestamp as of the moment this method is called
* @return the number of affected rows
*/
long deleteAllByExpirationTimeBefore(@NonNull Timestamp expirationTime);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy