Search in sources :

Example 91 with JsonIgnore

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

the class DefaultAttributeDefinition method resolveAttributeValues.

@JsonIgnore
@Override
public List<Object> resolveAttributeValues(final List<Object> attributeValues, final String scope, final RegisteredService registeredService, final Map<String, List<Object>> attributes) {
    List<Object> currentValues = new ArrayList<>(attributeValues);
    if (StringUtils.isNotBlank(getScript())) {
        currentValues = getScriptedAttributeValue(key, currentValues, registeredService, attributes);
    }
    if (isScoped()) {
        currentValues = formatValuesWithScope(scope, currentValues);
    }
    if (StringUtils.isNotBlank(getPatternFormat())) {
        currentValues = formatValuesWithPattern(currentValues);
    }
    if (isEncrypted()) {
        currentValues = encryptValues(currentValues, registeredService);
    }
    if (StringUtils.isNotBlank(this.canonicalizationMode)) {
        val mode = CaseCanonicalizationMode.valueOf(this.canonicalizationMode.toUpperCase());
        currentValues = currentValues.stream().map(value -> mode.canonicalize(value.toString())).collect(Collectors.toList());
    }
    LOGGER.trace("Resolved values [{}] for attribute definition [{}]", currentValues, this);
    return currentValues;
}
Also used : lombok.val(lombok.val) ArrayList(java.util.ArrayList) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 92 with JsonIgnore

use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore in project topcom-cloud by 545314690.

the class Role method getPermissionNames.

@JsonIgnore
public Set<String> getPermissionNames() {
    Set<String> permissionNames = new HashSet();
    Set<Resource> resources = this.getResources();
    if (resources != null) {
        Iterator var3 = resources.iterator();
        while (var3.hasNext()) {
            Resource resource = (Resource) var3.next();
            permissionNames.add(resource.getName());
        }
    }
    return permissionNames;
}
Also used : Iterator(java.util.Iterator) HashSet(java.util.HashSet) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 93 with JsonIgnore

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

the class TableSetup method getFieldStructure.

@JsonIgnore
public String getFieldStructure(String type, TableSchema schema) {
    StringBuffer sb = new StringBuffer();
    if (schema != null && schema.getFields() != null) {
        for (Field field : schema.getFields()) {
            if (StringUtils.isNotBlank(sb.toString())) {
                sb.append("\n");
            }
            String otherName = "";
            if (type.equalsIgnoreCase("FEED")) {
                otherName = getSourceTargetFieldMap().getOrDefault(field.getName(), "");
            } else {
                otherName = getTargetSourceFieldMap().getOrDefault(field.getName(), "");
            }
            sb.append(field.asFieldStructure(otherName));
        }
    }
    return sb.toString();
}
Also used : DefaultField(com.thinkbiganalytics.discovery.model.DefaultField) MetadataField(com.thinkbiganalytics.metadata.MetadataField) Field(com.thinkbiganalytics.discovery.schema.Field) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 94 with JsonIgnore

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

the class TableSetup method updateFieldPolicyJson.

@JsonIgnore
private void updateFieldPolicyJson() {
    ObjectMapper mapper = new ObjectMapper();
    String json = "[]";
    try {
        simplifyFieldPoliciesForSerialization();
        json = mapper.writeValueAsString(getFieldPolicies());
    } catch (JsonProcessingException e) {
        throw new RuntimeException(e);
    }
    fieldPoliciesJson = json;
}
Also used : JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 95 with JsonIgnore

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

the class TableSetup method updateFieldPolicyNames.

@JsonIgnore
public void updateFieldPolicyNames() {
    if (tableSchema != null && tableSchema.getFields() != null && fieldPolicies != null && fieldPolicies.size() == tableSchema.getFields().size()) {
        if (sourceTargetFieldMap == null) {
            sourceTargetFieldMap = new HashMap<>();
        }
        if (targetSourceFieldMap == null) {
            targetSourceFieldMap = new HashMap<>();
        }
        int idx = 0;
        for (FieldPolicy field : fieldPolicies) {
            field.setFieldName(tableSchema.getFields().get(idx).getName());
            sourceTargetFieldMap.put(field.getFeedFieldName(), field.getFieldName());
            targetSourceFieldMap.put(field.getFieldName(), field.getFeedFieldName());
            idx++;
        }
    }
}
Also used : FieldPolicy(com.thinkbiganalytics.policy.rest.model.FieldPolicy) 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