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));
}
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);
}
}
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;
}
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());
}
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));
}
Aggregations