use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageListItemImpl method getTeaserResource.
@Override
@JsonIgnore
public Resource getTeaserResource() {
if (teaserResource == null && component != null) {
String delegateResourceType = component.getProperties().get(PN_TEASER_DELEGATE, String.class);
if (StringUtils.isEmpty(delegateResourceType)) {
LOGGER.error("In order for list rendering delegation to work correctly you need to set up the teaserDelegate property on" + " the {} component; its value has to point to the resource type of a teaser component.", component.getPath());
} else {
Resource resourceToBeWrapped = ComponentUtils.getFeaturedImage(page);
if (resourceToBeWrapped != null) {
// use the page featured image and inherit properties from the page item
overriddenProperties.put(JcrConstants.JCR_TITLE, this.getTitle());
if (showDescription) {
overriddenProperties.put(JcrConstants.JCR_DESCRIPTION, this.getDescription());
}
if (linkItems) {
overriddenProperties.put(ImageResource.PN_LINK_URL, this.getPath());
}
} else {
// use the page content node and inherit properties from the page item
resourceToBeWrapped = page.getContentResource();
if (resourceToBeWrapped == null) {
return null;
}
if (!showDescription) {
hiddenProperties.add(JcrConstants.JCR_DESCRIPTION);
}
if (linkItems) {
overriddenProperties.put(ImageResource.PN_LINK_URL, this.getPath());
}
}
teaserResource = new CoreResourceWrapper(resourceToBeWrapped, delegateResourceType, hiddenProperties, overriddenProperties);
}
}
return teaserResource;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project hono by eclipse.
the class TenantObject method addTrustAnchor.
/**
* Adds a trusted certificate authority to use for authenticating devices of this tenant.
*
* @param publicKey The CA's public key in encoded form.
* @param publicKeyAlgorithm The algorithm of the public key.
* @param subjectDn The CA's subject DN.
* @param authIdTemplate The template to generate the authentication identifier.
* @param autoProvisioningEnabled A flag indicating whether this CA may be used for automatic provisioning.
* @return This tenant for command chaining.
* @throws NullPointerException if the public key, algorithm or subjectDN parameters is {@code null}.
*/
@JsonIgnore
public TenantObject addTrustAnchor(final byte[] publicKey, final String publicKeyAlgorithm, final X500Principal subjectDn, final String authIdTemplate, final Boolean autoProvisioningEnabled) {
Objects.requireNonNull(publicKey);
Objects.requireNonNull(publicKeyAlgorithm);
Objects.requireNonNull(subjectDn);
final JsonObject trustedCa = new JsonObject();
trustedCa.put(TenantConstants.FIELD_PAYLOAD_SUBJECT_DN, subjectDn.getName(X500Principal.RFC2253));
trustedCa.put(TenantConstants.FIELD_PAYLOAD_PUBLIC_KEY, publicKey);
trustedCa.put(TenantConstants.FIELD_PAYLOAD_KEY_ALGORITHM, publicKeyAlgorithm);
trustedCa.put(TenantConstants.FIELD_AUTO_PROVISIONING_ENABLED, autoProvisioningEnabled);
Optional.ofNullable(authIdTemplate).ifPresent(t -> trustedCa.put(TenantConstants.FIELD_PAYLOAD_AUTH_ID_TEMPLATE, t));
final JsonArray cas = getProperty(TenantConstants.FIELD_PAYLOAD_TRUSTED_CA, JsonArray.class, new JsonArray());
trustAnchors = null;
return setProperty(TenantConstants.FIELD_PAYLOAD_TRUSTED_CA, cas.add(trustedCa));
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project hono by eclipse.
the class TenantObject method getTrustAnchorForPublicKey.
@JsonIgnore
private TrustAnchor getTrustAnchorForPublicKey(final JsonObject keyProps) {
if (keyProps == null) {
return null;
} else {
final String subjectDn = getProperty(keyProps, RequestResponseApiConstants.FIELD_PAYLOAD_SUBJECT_DN, String.class);
if (subjectDn == null) {
LOG.debug("trust anchor definition does not contain required property {}", RequestResponseApiConstants.FIELD_PAYLOAD_SUBJECT_DN);
return null;
}
final byte[] encodedKey = getProperty(keyProps, TenantConstants.FIELD_PAYLOAD_PUBLIC_KEY, byte[].class);
if (encodedKey == null) {
LOG.debug("trust anchor definition does not contain required property {}", TenantConstants.FIELD_PAYLOAD_PUBLIC_KEY);
return null;
}
try {
final String type = getProperty(keyProps, TenantConstants.FIELD_PAYLOAD_KEY_ALGORITHM, String.class, "RSA");
final X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedKey);
final KeyFactory factory = KeyFactory.getInstance(type);
final PublicKey publicKey = factory.generatePublic(keySpec);
return new TrustAnchor(subjectDn, publicKey, null);
} catch (final GeneralSecurityException e) {
LOG.debug("failed to instantiate trust anchor's public key", e);
return null;
}
}
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project hono by eclipse.
the class CredentialsObject method getSecrets.
/**
* Gets this credentials' secret(s).
* <p>
* The elements of the returned list are of type {@code JsonObject}.
*
* @return The (potentially empty) list of secrets.
*/
@JsonIgnore
public JsonArray getSecrets() {
return Optional.ofNullable(getProperty(CredentialsConstants.FIELD_SECRETS, JsonArray.class)).orElseGet(() -> {
final JsonArray result = new JsonArray();
setProperty(CredentialsConstants.FIELD_SECRETS, result);
return result;
});
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project ambrose by twitter.
the class PigJob method setJobStats.
@JsonIgnore
public void setJobStats(JobStats stats) {
this.inputInfoList = inputInfoList(stats.getInputs());
this.outputInfoList = outputInfoList(stats.getOutputs());
// job metrics
Map<String, Number> metrics = Maps.newHashMap();
metrics.put("hdfsBytesRead", stats.getHdfsBytesRead());
metrics.put("hdfsBytesWritten", stats.getHdfsBytesWritten());
metrics.put("bytesWritten", stats.getBytesWritten());
metrics.put("recordWritten", stats.getRecordWrittern());
if (stats instanceof MRJobStats) {
MRJobStats mrStats = (MRJobStats) stats;
setCounterGroupMap(CounterGroup.counterGroupsByName(mrStats.getHadoopCounters()));
metrics.put("avgMapTime", mrStats.getAvgMapTime());
// internal pig seems to have fixed typo in OSS pig method name; avoid NoSuchMethodException
// TODO: Remove this once internal pig is replaced w/ OSS pig
Number avgReduceTime = null;
try {
Method method = mrStats.getClass().getMethod("getAvgReduceTime");
avgReduceTime = (Number) method.invoke(mrStats);
} catch (NoSuchMethodException e) {
// assume we're dealing with OSS pig; ignore
} catch (InvocationTargetException e) {
throw new RuntimeException("Failed to invoke MRJobStats.getAvgReduceTime", e);
} catch (IllegalAccessException e) {
throw new RuntimeException("Failed to invoke MRJobStats.getAvgReduceTime", e);
}
if (avgReduceTime == null) {
avgReduceTime = mrStats.getAvgREduceTime();
}
metrics.put("avgReduceTime", avgReduceTime);
metrics.put("mapInputRecords", mrStats.getMapInputRecords());
metrics.put("mapOutputRecords", mrStats.getMapOutputRecords());
metrics.put("maxMapTime", mrStats.getMaxMapTime());
metrics.put("maxReduceTime", mrStats.getMaxReduceTime());
metrics.put("minMapTime", mrStats.getMinMapTime());
metrics.put("minReduceTime", mrStats.getMinReduceTime());
metrics.put("numberMaps", mrStats.getNumberMaps());
metrics.put("numberReduces", mrStats.getNumberReduces());
metrics.put("proactiveSpillCountObjects", mrStats.getProactiveSpillCountObjects());
metrics.put("proactiveSpillCountRecs", mrStats.getProactiveSpillCountRecs());
metrics.put("reduceInputRecords", mrStats.getReduceInputRecords());
metrics.put("reduceOutputRecords", mrStats.getReduceOutputRecords());
metrics.put("SMMSpillCount", mrStats.getSMMSpillCount());
}
setMetrics(metrics);
}
Aggregations