use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project MantaroBot by Mantaro.
the class DBUser method generateAndApplyPremiumKey.
@JsonIgnore
public PremiumKey generateAndApplyPremiumKey(int days, String owner) {
String premiumId = UUID.randomUUID().toString();
PremiumKey newKey = new PremiumKey(premiumId, TimeUnit.DAYS.toMillis(days), currentTimeMillis() + TimeUnit.DAYS.toMillis(days), PremiumKey.Type.USER, true, owner);
data.setPremiumKey(premiumId);
newKey.saveAsync();
saveAsync();
return newKey;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project cas by apereo.
the class OAuthAccessTokenExpirationPolicy method isAccessTokenExpired.
/**
* Is access token expired ?.
*
* @param ticketState the ticket state
* @return the boolean
*/
@JsonIgnore
protected boolean isAccessTokenExpired(final TicketState ticketState) {
final ZonedDateTime currentSystemTime = ZonedDateTime.now(ZoneOffset.UTC);
final ZonedDateTime creationTime = ticketState.getCreationTime();
// token has been used, check maxTimeToLive (hard window)
ZonedDateTime expirationTime = creationTime.plus(this.maxTimeToLiveInSeconds, ChronoUnit.SECONDS);
if (currentSystemTime.isAfter(expirationTime)) {
LOGGER.debug("Access token is expired because the time since creation is greater than maxTimeToLiveInSeconds");
return true;
}
// token is within hard window, check timeToKill (sliding window)
expirationTime = ticketState.getLastTimeUsed().plus(this.timeToKillInSeconds, ChronoUnit.SECONDS);
if (currentSystemTime.isAfter(expirationTime)) {
LOGGER.debug("Access token is expired because the time since last use is greater than timeToKillInSeconds");
return true;
}
return false;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project chili-core by codingchili.
the class ListenerSettings method getHttpOptions.
/**
* @param context core context.
* @return HttpOptions created from the listeners settings.
*/
@JsonIgnore
public HttpServerOptions getHttpOptions(CoreContext context) {
if (httpOptions == null) {
httpOptions = new HttpServerOptions().setMaxWebsocketFrameSize(maxRequestBytes).setUseAlpn(Environment.isJava9()).setSsl(secure);
if (secure) {
TrustAndKeyProvider provider = security().getKeystore(context, keystore);
httpOptions.setTrustOptions(provider.trustOptions()).setKeyCertOptions(provider.keyCertOptions());
}
}
return httpOptions;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project sql-boot by sql-boot.
the class DbConnection method getDataSource.
@JsonIgnore
public DataSource getDataSource() {
if (dataSource != null) {
return dataSource;
} else {
dataSource = new DataSource();
ofNullable(driverClassName).ifPresent(dataSource::setDriverClassName);
ofNullable(url).ifPresent(dataSource::setUrl);
ofNullable(user).ifPresent(dataSource::setUsername);
ofNullable(password).ifPresent(dataSource::setPassword);
return dataSource;
}
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project halyard by spinnaker.
the class Node method fieldOptions.
@JsonIgnore
public List<String> fieldOptions(ConfigProblemSetBuilder problemSetBuilder, String fieldName) {
if (fieldName == null || fieldName.isEmpty()) {
throw new IllegalArgumentException("Input fieldName may not be empty");
}
log.info("Looking for options for field " + fieldName + " in node " + getNodeName() + " for type " + getClass().getSimpleName());
String fieldOptions = fieldName + "Options";
Method optionsMethod = null;
try {
optionsMethod = this.getClass().getDeclaredMethod(fieldOptions, ConfigProblemSetBuilder.class);
optionsMethod.setAccessible(true);
return (List<String>) optionsMethod.invoke(this, problemSetBuilder);
} catch (IllegalAccessException | InvocationTargetException e) {
log.warn("Failed to call " + fieldOptions + "() on " + this.getClass().getSimpleName());
throw new RuntimeException(e);
} catch (NoSuchMethodException e) {
// It's expected that many fields won't supply options endpoints.
return new ArrayList<>();
} finally {
if (optionsMethod != null) {
optionsMethod.setAccessible(false);
}
}
}
Aggregations