Search in sources :

Example 1 with InjectableAttributeImpl

use of ddf.catalog.data.impl.InjectableAttributeImpl in project ddf by codice.

the class ValidationParser method parseInjections.

private List<Callable<Boolean>> parseInjections(Changeset changeset, List<Outer.Injection> injections) {
    BundleContext context = getBundleContext();
    return injections.stream().map(injection -> (Callable<Boolean>) () -> {
        String attribute = injection.attribute;
        InjectableAttribute injectableAttribute = new InjectableAttributeImpl(attribute, injection.metacardTypes);
        ServiceRegistration<InjectableAttribute> injectableAttributeService = context.registerService(InjectableAttribute.class, injectableAttribute, null);
        changeset.injectableAttributeServices.add(injectableAttributeService);
        return true;
    }).collect(toList());
}
Also used : StringUtils(org.apache.commons.lang.StringUtils) MetacardTypeImpl(ddf.catalog.data.impl.MetacardTypeImpl) Date(java.util.Date) BiFunction(java.util.function.BiFunction) LoggerFactory(org.slf4j.LoggerFactory) BigDecimal(java.math.BigDecimal) ISO3CountryCodeValidator(ddf.catalog.validation.impl.validator.ISO3CountryCodeValidator) Map(java.util.Map) AttributeDescriptorImpl(ddf.catalog.data.impl.AttributeDescriptorImpl) Bundle(org.osgi.framework.Bundle) JsonIgnore(org.boon.json.annotations.JsonIgnore) Collectors.toSet(java.util.stream.Collectors.toSet) ArtifactInstaller(org.apache.felix.fileinstall.ArtifactInstaller) AttributeDescriptor(ddf.catalog.data.AttributeDescriptor) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) BundleContext(org.osgi.framework.BundleContext) Sets(com.google.common.collect.Sets) MetacardType(ddf.catalog.data.MetacardType) Serializable(java.io.Serializable) Objects(java.util.Objects) IOUtils(org.apache.commons.io.IOUtils) InjectableAttribute(ddf.catalog.data.InjectableAttribute) List(java.util.List) Optional(java.util.Optional) BasicTypes(ddf.catalog.data.impl.BasicTypes) Dictionary(java.util.Dictionary) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings) EnumerationValidator(ddf.catalog.validation.impl.validator.EnumerationValidator) SizeValidator(ddf.catalog.validation.impl.validator.SizeValidator) HashMap(java.util.HashMap) Callable(java.util.concurrent.Callable) AttributeValidatorRegistry(ddf.catalog.validation.AttributeValidatorRegistry) AttributeRegistry(ddf.catalog.data.AttributeRegistry) DefaultAttributeValueRegistry(ddf.catalog.data.DefaultAttributeValueRegistry) InjectableAttributeImpl(ddf.catalog.data.impl.InjectableAttributeImpl) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) CollectionUtils(org.apache.commons.collections.CollectionUtils) PatternValidator(ddf.catalog.validation.impl.validator.PatternValidator) FutureDateValidator(ddf.catalog.validation.impl.validator.FutureDateValidator) Hashtable(java.util.Hashtable) Nullable(javax.annotation.Nullable) ServiceRegistration(org.osgi.framework.ServiceRegistration) PastDateValidator(ddf.catalog.validation.impl.validator.PastDateValidator) Logger(org.slf4j.Logger) MetacardValidator(ddf.catalog.validation.MetacardValidator) JsonFactory(org.boon.json.JsonFactory) FileInputStream(java.io.FileInputStream) File(java.io.File) AttributeValidator(ddf.catalog.validation.AttributeValidator) Collectors.toList(java.util.stream.Collectors.toList) RequiredAttributesMetacardValidator(ddf.catalog.validation.impl.validator.RequiredAttributesMetacardValidator) DateTimeFormatter(java.time.format.DateTimeFormatter) RangeValidator(ddf.catalog.validation.impl.validator.RangeValidator) FrameworkUtil(org.osgi.framework.FrameworkUtil) InputStream(java.io.InputStream) InjectableAttribute(ddf.catalog.data.InjectableAttribute) InjectableAttributeImpl(ddf.catalog.data.impl.InjectableAttributeImpl) Callable(java.util.concurrent.Callable) BundleContext(org.osgi.framework.BundleContext)

Aggregations

Sets (com.google.common.collect.Sets)1 AttributeDescriptor (ddf.catalog.data.AttributeDescriptor)1 AttributeRegistry (ddf.catalog.data.AttributeRegistry)1 DefaultAttributeValueRegistry (ddf.catalog.data.DefaultAttributeValueRegistry)1 InjectableAttribute (ddf.catalog.data.InjectableAttribute)1 MetacardType (ddf.catalog.data.MetacardType)1 AttributeDescriptorImpl (ddf.catalog.data.impl.AttributeDescriptorImpl)1 BasicTypes (ddf.catalog.data.impl.BasicTypes)1 InjectableAttributeImpl (ddf.catalog.data.impl.InjectableAttributeImpl)1 MetacardTypeImpl (ddf.catalog.data.impl.MetacardTypeImpl)1 AttributeValidator (ddf.catalog.validation.AttributeValidator)1 AttributeValidatorRegistry (ddf.catalog.validation.AttributeValidatorRegistry)1 MetacardValidator (ddf.catalog.validation.MetacardValidator)1 EnumerationValidator (ddf.catalog.validation.impl.validator.EnumerationValidator)1 FutureDateValidator (ddf.catalog.validation.impl.validator.FutureDateValidator)1 ISO3CountryCodeValidator (ddf.catalog.validation.impl.validator.ISO3CountryCodeValidator)1 PastDateValidator (ddf.catalog.validation.impl.validator.PastDateValidator)1 PatternValidator (ddf.catalog.validation.impl.validator.PatternValidator)1 RangeValidator (ddf.catalog.validation.impl.validator.RangeValidator)1 RequiredAttributesMetacardValidator (ddf.catalog.validation.impl.validator.RequiredAttributesMetacardValidator)1