Search in sources :

Example 41 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project hippo by NHS-digital-website.

the class CyberAlert method getFullAccess.

@JsonIgnore
private Boolean getFullAccess() {
    Boolean fullAccess = true;
    final HstRequestContext context = RequestContextProvider.get();
    if (context != null) {
        HttpServletRequest request = context.getServletRequest();
        String limitedParam = request.getParameter("_limited");
        if (limitedParam != null && limitedParam.equals("true")) {
            fullAccess = false;
        }
    }
    return fullAccess;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HstRequestContext(org.hippoecm.hst.core.request.HstRequestContext) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 42 with JsonIgnore

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

the class TEntityType method getWinerysPropertiesDefinition.

/**
 * This is a special method for Winery. Winery allows to define a property definition by specifying name/type
 * values. Instead of parsing the extensible elements returned TDefinitions, this method is a convenience method to
 * access this information
 *
 * @return a WinerysPropertiesDefinition object, which includes a map of name/type-pairs denoting the associated
 * property definitions. A default element name and namespace is added if it is not defined in the underlying XML.
 * null if no Winery specific KV properties are defined for the given entity type
 */
@XmlTransient
@JsonIgnore
public WinerysPropertiesDefinition getWinerysPropertiesDefinition() {
    if (properties == null || !(properties instanceof WinerysPropertiesDefinition)) {
        return null;
    }
    WinerysPropertiesDefinition res = (WinerysPropertiesDefinition) properties;
    // we put defaults if element name and namespace have not been set
    if (res.getElementName() == null) {
        res.setElementName("Properties");
    }
    if (res.getNamespace() == null) {
        // we use the target namespace of the original element
        String ns = this.getTargetNamespace();
        if (!ns.endsWith("/")) {
            ns += "/";
        }
        ns += NS_SUFFIX_PROPERTIES_DEFINITION_WINERY;
        res.setNamespace(ns);
    }
    return res;
}
Also used : WinerysPropertiesDefinition(org.eclipse.winery.model.tosca.extensions.kvproperties.WinerysPropertiesDefinition) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) XmlTransient(javax.xml.bind.annotation.XmlTransient)

Example 43 with JsonIgnore

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

the class TenantObject method setTrustAnchor.

/**
 * Sets the trusted certificate authority to use for authenticating
 * devices of this tenant.
 * <p>
 * This method removes all existing trust anchors.
 *
 * @param publicKey The CA's public key.
 * @param subjectDn The CA's subject DN.
 * @return This tenant for command chaining.
 * @throws NullPointerException if any of the parameters is {@code null}.
 * @see #addTrustAnchor(PublicKey, X500Principal, Boolean)
 */
@JsonIgnore
public TenantObject setTrustAnchor(final PublicKey publicKey, final X500Principal subjectDn) {
    Objects.requireNonNull(publicKey);
    Objects.requireNonNull(subjectDn);
    setProperty(TenantConstants.FIELD_PAYLOAD_TRUSTED_CA, new JsonArray());
    return addTrustAnchor(publicKey, subjectDn, false);
}
Also used : JsonArray(io.vertx.core.json.JsonArray) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 44 with JsonIgnore

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

the class CredentialsDto method assertSecretIdUniqueness.

@JsonIgnore
private void assertSecretIdUniqueness(final List<? extends CommonCredential> credentials) {
    credentials.stream().map(CommonCredential::getSecrets).forEach(secrets -> {
        final Set<String> secretIds = new HashSet<>();
        final AtomicInteger count = new AtomicInteger(0);
        secrets.stream().forEach(secret -> {
            if (secret.getId() != null) {
                requiresMerging = true;
                secretIds.add(secret.getId());
                count.incrementAndGet();
            }
        });
        if (secretIds.size() < count.get()) {
            throw new ClientErrorException(HttpURLConnection.HTTP_BAD_REQUEST, "secret IDs must be unique within each credentials object");
        }
    });
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ClientErrorException(org.eclipse.hono.client.ClientErrorException) HashSet(java.util.HashSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 45 with JsonIgnore

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

the class BaseEntity method setUpdateInfo.

/**
 * Sets update info.
 *
 * @param user the user
 */
@Transient
@JsonIgnore
public void setUpdateInfo(LoginAuthDto user) {
    if (isNew()) {
        this.creatorId = (this.lastOperatorId = user.getUserId());
        this.creator = user.getUserName();
        this.createdTime = (this.updateTime = new Date());
    }
    this.lastOperatorId = user.getUserId();
    this.lastOperator = user.getUserName() == null ? user.getLoginName() : user.getUserName();
    this.updateTime = new Date();
}
Also used : Date(java.util.Date) 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