Class JASN1Reader

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.jasn1.JASN1Reader
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.controller.ControllerService, RecordReaderFactory

@Tags({"asn","ans1","jasn.1","jasn1","record","reader","parser"}) @CapabilityDescription("Reads ASN.1 content and creates NiFi records. NOTE: ASN.1 schema preparation requires the JDK at runtime for model compilation.") public class JASN1Reader extends org.apache.nifi.components.AbstractConfigurableComponent implements RecordReaderFactory
  • Field Details

    • ROOT_MODEL_NAME

      private static final org.apache.nifi.components.PropertyDescriptor ROOT_MODEL_NAME
    • ROOT_CLASS_NAME

      private static final org.apache.nifi.components.PropertyDescriptor ROOT_CLASS_NAME
    • RECORD_FIELD

      private static final org.apache.nifi.components.PropertyDescriptor RECORD_FIELD
      Not included! To make this service as simple as possible, records are to be expected to correspond to a concrete ASN type. Not removing though, should it be required in the future.
    • ASN_FILES

      static final org.apache.nifi.components.PropertyDescriptor ASN_FILES
    • ITERATOR_PROVIDER_CLASS_NAME

      private static final org.apache.nifi.components.PropertyDescriptor ITERATOR_PROVIDER_CLASS_NAME
      Not included! To make this service as simple as possible, classpath modification is not supported currently as it's benefit would be questionable. Not removing though, should it be required in the future.
    • DEFAULT

      private static final org.apache.nifi.components.AllowableValue DEFAULT
    • ADDITIONAL_PREPROCESSING

      private static final org.apache.nifi.components.AllowableValue ADDITIONAL_PREPROCESSING
    • SCHEMA_PREPARATION_STRATEGY

      private static final org.apache.nifi.components.PropertyDescriptor SCHEMA_PREPARATION_STRATEGY
    • SCHEMA_PREPARATION_DIRECTORY

      private static final org.apache.nifi.components.PropertyDescriptor SCHEMA_PREPARATION_DIRECTORY
    • propertyDescriptors

      private final List<org.apache.nifi.components.PropertyDescriptor> propertyDescriptors
    • identifier

      private String identifier
    • logger

      org.apache.nifi.logging.ComponentLog logger
    • schemaProvider

      private final RecordSchemaProvider schemaProvider
    • asnOutDir

      volatile Path asnOutDir
    • rootModelNameProperty

      private volatile org.apache.nifi.components.PropertyValue rootModelNameProperty
    • rootClassNameProperty

      private volatile org.apache.nifi.components.PropertyValue rootClassNameProperty
    • recordFieldProperty

      private volatile org.apache.nifi.components.PropertyValue recordFieldProperty
    • iteratorProviderProperty

      private volatile org.apache.nifi.components.PropertyValue iteratorProviderProperty
    • customClassLoader

      volatile ClassLoader customClassLoader
  • Constructor Details

    • JASN1Reader

      public JASN1Reader()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • initialize

      public void initialize(org.apache.nifi.controller.ControllerServiceInitializationContext context)
      Specified by:
      initialize in interface org.apache.nifi.controller.ControllerService
    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext)
      Overrides:
      customValidate in class org.apache.nifi.components.AbstractConfigurableComponent
    • onEnabled

      @OnEnabled public void onEnabled(org.apache.nifi.controller.ConfigurationContext context)
    • migrateProperties

      public void migrateProperties(org.apache.nifi.migration.PropertyConfiguration config)
      Specified by:
      migrateProperties in interface org.apache.nifi.controller.ControllerService
    • compileAsnToClass

      private void compileAsnToClass(String... asnFilePaths)
    • onDisabled

      @OnDisabled public void onDisabled()
    • deleteAsnOutDir

      void deleteAsnOutDir()
    • getIdentifier

      public String getIdentifier()
      Specified by:
      getIdentifier in interface org.apache.nifi.components.ConfigurableComponent
    • createRecordReader

      public RecordReader createRecordReader(Map<String,String> variables, InputStream in, long inputLength, org.apache.nifi.logging.ComponentLog logger)
      Specified by:
      createRecordReader in interface RecordReaderFactory
    • getJavaModelFromAsn1File

      com.beanit.asn1bean.compiler.model.AsnModel getJavaModelFromAsn1File(String inputFileName) throws FileNotFoundException, antlr.TokenStreamException, antlr.RecognitionException
      Throws:
      FileNotFoundException
      antlr.TokenStreamException
      antlr.RecognitionException
    • guessRootClassName

      String guessRootClassName(String rootModelName)