Search in sources :

Example 6 with JsonIgnore

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;
}
Also used : ToString(lombok.ToString) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 7 with JsonIgnore

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;
}
Also used : ZonedDateTime(java.time.ZonedDateTime) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 8 with JsonIgnore

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;
}
Also used : TrustAndKeyProvider(com.codingchili.core.security.TrustAndKeyProvider) HttpServerOptions(io.vertx.core.http.HttpServerOptions) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 9 with JsonIgnore

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;
    }
}
Also used : DataSource(org.apache.tomcat.jdbc.pool.DataSource) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 10 with JsonIgnore

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);
        }
    }
}
Also used : ConfigProblemSetBuilder(com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemSetBuilder) ArrayList(java.util.ArrayList) List(java.util.List) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)111 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)8 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 Date (java.util.Date)5 Field (com.hortonworks.registries.common.Schema.Field)4 Set (java.util.Set)4 Schema (com.hortonworks.registries.common.Schema)3 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)3 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 JsonArray (io.vertx.core.json.JsonArray)3 List (java.util.List)3 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)2 TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2