
driven-adapter.cognito-token-provider.reactive.cognito-token-response.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.cognito.model;
import com.fasterxml.jackson.annotation.JsonProperty;
{{#lombok}}
import lombok.Data;
@Data
{{/lombok}}
public class CognitoTokenResponse {
public static final int FREE_REFRESH_SECONDS = 60; // 1 minute before expiration
@JsonProperty("access_token")
private String accessToken;
@JsonProperty("expires_in")
private int expiresIn;
@JsonProperty("token_type")
private String tokenType;
public int getCacheTime() {
return getExpiresIn() - FREE_REFRESH_SECONDS;
}
{{^lombok}}
public CognitoTokenResponse() {
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public int getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(int expiresIn) {
this.expiresIn = expiresIn;
}
public String getTokenType() {
return tokenType;
}
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
{{/lombok}}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy