Search in sources :

Example 86 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project ambrose by twitter.

the class CascadingJob method setJobStats.

@JsonIgnore
public void setJobStats(HadoopStepStats stats) {
    Counters counters = new Counters();
    for (String groupName : stats.getCounterGroups()) {
        for (String counterName : stats.getCountersFor(groupName)) {
            Long counterValue = stats.getCounterValue(groupName, counterName);
            counters.findCounter(groupName, counterName).setValue(counterValue);
        }
    }
    setCounterGroupMap(CounterGroup.counterGroupsByName(counters));
}
Also used : Counters(org.apache.hadoop.mapred.Counters) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 87 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project alfresco-remote-api by Alfresco.

the class LockInfoImpl method setTimeoutSeconds.

/**
 * Sets the expiry date/time to lockTimeout seconds into the future. Provide
 * a lockTimeout of WebDAV.TIMEOUT_INFINITY for never expires.
 *
 * @param lockTimeoutSecs int
 */
@Override
@JsonIgnore
public void setTimeoutSeconds(int lockTimeoutSecs) {
    if (lockTimeoutSecs == WebDAV.TIMEOUT_INFINITY) {
        setExpires(null);
    } else {
        int timeoutMillis = (lockTimeoutSecs * 1000);
        Date now = dateNow();
        Date nextExpiry = new Date(now.getTime() + timeoutMillis);
        setExpires(nextExpiry);
    }
}
Also used : Date(java.util.Date) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 88 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project entando-core by entando.

the class Filter method getEntitySearchFilter.

@JsonIgnore
@SuppressWarnings("rawtypes")
public EntitySearchFilter getEntitySearchFilter() {
    EntitySearchFilter filter;
    boolean isAttributeFilter = (StringUtils.isBlank(this.getAttributeName()));
    String key = isAttributeFilter ? this.getEntityAttr() : this.getAttributeName();
    Object objectValue = this.extractFilterValue();
    if (FilterOperator.GREATER.getValue().equalsIgnoreCase(this.getOperator())) {
        filter = new EntitySearchFilter(key, isAttributeFilter, objectValue, null);
    } else if (FilterOperator.LOWER.getValue().equalsIgnoreCase(this.getOperator())) {
        filter = new EntitySearchFilter(key, isAttributeFilter, null, objectValue);
    } else if (FilterOperator.NOT_EQUAL.getValue().equalsIgnoreCase(this.getOperator())) {
        filter = new EntitySearchFilter(key, isAttributeFilter, objectValue, false);
        filter.setNotOption(true);
    } else {
        filter = new EntitySearchFilter(key, isAttributeFilter, objectValue, FilterOperator.LIKE.getValue().equalsIgnoreCase(this.getOperator()), LikeOptionType.COMPLETE);
    }
    filter.setOrder(this.getOrder());
    return filter;
}
Also used : EntitySearchFilter(com.agiletec.aps.system.common.entity.model.EntitySearchFilter) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 89 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project mica2 by obiba.

the class Authorization method setDate.

@JsonIgnore
public void setDate(LocalDate date) {
    this.date = new Date();
    this.date.setTime(date.toEpochDay());
}
Also used : Date(java.util.Date) LocalDate(java.time.LocalDate) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 90 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project MantaroBot by Mantaro.

the class DBGuild method isPremium.

@JsonIgnore
public boolean isPremium() {
    PremiumKey key = MantaroData.db().getPremiumKey(data.getPremiumKey());
    // Key validation check (is it still active? delete otherwise)
    if (key != null) {
        boolean isKeyActive = currentTimeMillis() < key.getExpiration();
        if (!isKeyActive && LocalDate.now(ZoneId.of("America/Chicago")).getDayOfMonth() > 5) {
            DBUser owner = MantaroData.db().getUser(key.getOwner());
            UserData ownerData = owner.getData();
            ownerData.getKeysClaimed().remove(getId());
            owner.save();
            removePremiumKey(key.getOwner(), key.getId());
            key.delete();
            return false;
        }
        // Link key to owner if key == owner and key holder is on patreon.
        // Sadly gotta skip of holder isn't patron here bc there are some bought keys (paypal) which I can't convert without invalidating
        Pair<Boolean, String> pledgeInfo = APIUtils.getPledgeInformation(key.getOwner());
        if (pledgeInfo != null && pledgeInfo.getLeft()) {
            key.getData().setLinkedTo(key.getOwner());
            // doesn't matter if it doesn't save immediately, will do later anyway (key is usually immutable in db)
            key.save();
        }
        // If the receipt is not the owner, account them to the keys the owner has claimed.
        // This has usage later when seeing how many keys can they take. The second/third check is kind of redundant, but necessary anyway to see if it works.
        String keyLinkedTo = key.getData().getLinkedTo();
        if (keyLinkedTo != null) {
            DBUser owner = MantaroData.db().getUser(keyLinkedTo);
            UserData ownerData = owner.getData();
            if (!ownerData.getKeysClaimed().containsKey(getId())) {
                ownerData.getKeysClaimed().put(getId(), key.getId());
                owner.save();
            }
        }
    }
    // Patreon bot link check.
    String linkedTo = getData().getMpLinkedTo();
    if (config.isPremiumBot() && linkedTo != null && key == null) {
        // Key should always be null in MP anyway.
        Pair<Boolean, String> pledgeInfo = APIUtils.getPledgeInformation(linkedTo);
        // The API returned an exception, return true anyway. (Pledge = false, amount = 100000 is basically impossible)
        if (pledgeInfo != null && !pledgeInfo.getLeft() && pledgeInfo.getRight().equals("100000")) {
            return true;
        }
        if (pledgeInfo != null && pledgeInfo.getLeft() && Double.parseDouble(pledgeInfo.getRight()) >= 4) {
            // Subscribed to MP properly, return true.
            return true;
        }
    }
    // MP uses the old premium system for some guilds: keep it here.
    return currentTimeMillis() < premiumUntil || (key != null && currentTimeMillis() < key.getExpiration() && key.getParsedType().equals(PremiumKey.Type.GUILD));
}
Also used : UserData(net.kodehawa.mantarobot.db.entities.helpers.UserData) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)113 lombok.val (lombok.val)14 ArrayList (java.util.ArrayList)12 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