Search in sources :

Example 6 with FieldRuleProperty

use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.

the class SchemaDiscoveryRestControllerTest method createMockParserDescriptor.

private SchemaParserDescriptor createMockParserDescriptor() {
    SchemaParserDescriptor descriptor = new SchemaParserDescriptor();
    descriptor.setObjectClassType("com.thinkbiganalytics.discovery.rest.controller.MockSchemaParser2");
    FieldRuleProperty propDetect = new FieldRuleProperty();
    propDetect.setName("Auto Detect?");
    propDetect.setObjectProperty("autoDetect");
    propDetect.setValue("true");
    FieldRuleProperty propHeader = new FieldRuleProperty();
    propHeader.setName("Header?");
    propHeader.setObjectProperty("headerRow");
    propHeader.setValue("false");
    descriptor.setProperties(Arrays.asList(propDetect, propHeader));
    return descriptor;
}
Also used : FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty) SchemaParserDescriptor(com.thinkbiganalytics.discovery.model.SchemaParserDescriptor)

Example 7 with FieldRuleProperty

use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.

the class ServiceLevelAgreementActionConfigTransformer method buildActionConfigurationRegistry.

private synchronized void buildActionConfigurationRegistry() {
    actionConfigurationRegistry = new ArrayList<>();
    List<ServiceLevelAgreementActionUiConfigurationItem> rules = new ArrayList<>();
    Set<Class<?>> items = ReflectionPolicyAnnotationDiscoverer.getTypesAnnotatedWith(ServiceLevelAgreementActionConfig.class);
    for (Class c : items) {
        List<FieldRuleProperty> properties = getUiProperties(c);
        ServiceLevelAgreementActionConfig policy = (ServiceLevelAgreementActionConfig) c.getAnnotation(ServiceLevelAgreementActionConfig.class);
        ServiceLevelAgreementActionUiConfigurationItem configItem = buildUiModel(policy, c, properties);
        rules.add(configItem);
        actionConfigurationRegistry.add(configItem);
    }
}
Also used : ArrayList(java.util.ArrayList) FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty) ServiceLevelAgreementActionConfig(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreementActionConfig)

Example 8 with FieldRuleProperty

use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.

the class IntegrationTestBase method newFieldRuleProperty.

protected FieldRuleProperty newFieldRuleProperty(String name, String objectProperty, String value) {
    FieldRuleProperty list = new FieldRuleProperty();
    list.setName(name);
    list.setObjectProperty(objectProperty);
    list.setValue(value);
    return list;
}
Also used : FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty)

Example 9 with FieldRuleProperty

use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.

the class BasePolicyAnnotationTransformer method toUIModel.

/**
 * Transform a domain policy rule to a user interface object
 *
 * @param policyRule the domain object
 * @return the user interface object
 */
@Override
public U toUIModel(P policyRule) {
    Annotation annotation = policyRule.getClass().getAnnotation(getAnnotationClass());
    List<FieldRuleProperty> properties = getUiProperties(policyRule);
    U rule = buildUiModel((A) annotation, policyRule, properties);
    return rule;
}
Also used : FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty) Annotation(java.lang.annotation.Annotation)

Example 10 with FieldRuleProperty

use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.

the class AvailablePolicies method discoverStandardizationRules.

public static List<FieldStandardizationRule> discoverStandardizationRules() {
    List<FieldStandardizationRule> rules = new ArrayList<>();
    Set<Class<?>> standardizers = ReflectionPolicyAnnotationDiscoverer.getTypesAnnotatedWith(Standardizer.class);
    for (Class c : standardizers) {
        Standardizer standardizer = (Standardizer) c.getAnnotation(Standardizer.class);
        List<FieldRuleProperty> properties = StandardizationAnnotationTransformer.instance().getUiProperties(c);
        rules.add(new FieldStandardizationRuleBuilder(standardizer.name()).description(standardizer.description()).addProperties(properties).objectClassType(c).build());
    }
    return rules;
}
Also used : FieldStandardizationRuleBuilder(com.thinkbiganalytics.policy.rest.model.FieldStandardizationRuleBuilder) ArrayList(java.util.ArrayList) Standardizer(com.thinkbiganalytics.policy.standardization.Standardizer) FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty) FieldStandardizationRule(com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule)

Aggregations

FieldRuleProperty (com.thinkbiganalytics.policy.rest.model.FieldRuleProperty)14 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)3 AnnotatedFieldProperty (com.thinkbiganalytics.annotations.AnnotatedFieldProperty)2 AnnotationFieldNameResolver (com.thinkbiganalytics.annotations.AnnotationFieldNameResolver)2 FeedSummary (com.thinkbiganalytics.feedmgr.rest.model.FeedSummary)2 FieldRulePropertyBuilder (com.thinkbiganalytics.policy.rest.model.FieldRulePropertyBuilder)2 FieldValidationRule (com.thinkbiganalytics.policy.rest.model.FieldValidationRule)2 LabelValue (com.thinkbiganalytics.rest.model.LabelValue)2 Field (java.lang.reflect.Field)2 List (java.util.List)2 SchemaParserDescriptor (com.thinkbiganalytics.discovery.model.SchemaParserDescriptor)1 ServiceLevelAgreementActionConfig (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreementActionConfig)1 ServiceLevelAgreementMetric (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreementMetric)1 FieldStandardizationRule (com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule)1 FieldStandardizationRuleBuilder (com.thinkbiganalytics.policy.rest.model.FieldStandardizationRuleBuilder)1 FieldValidationRuleBuilder (com.thinkbiganalytics.policy.rest.model.FieldValidationRuleBuilder)1 Standardizer (com.thinkbiganalytics.policy.standardization.Standardizer)1 Validator (com.thinkbiganalytics.policy.validation.Validator)1 Annotation (java.lang.annotation.Annotation)1