Class Adapter

  • All Implemented Interfaces:
    java.io.Serializable

    public class Adapter
    extends java.lang.Object
    implements java.io.Serializable
    Adapter
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MODE_DIRECT
      Direct mode
      static java.lang.String MODE_INDIRECT
      Indirect mode
    • Constructor Summary

      Constructors 
      Constructor Description
      Adapter()
      Default constructor
    • Method Summary

      Modifier and Type Method Description
      char applyAdapter​(java.lang.String adapter, Grant grant, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.Object> params, java.lang.String trackId, java.lang.String origin)
      Load the input flow thru one adapter:
      1) case AWK: incoming data are read from "stdin",
      output data are send to the "stdout",
      rejected data are send to the "stderr",
      log output is not supported with awk.
      java.lang.String getClassName()
      Adapter Java class, e.g.
      java.io.File getErrors()
      Get the error result
      java.lang.String getId()
      Get adapter ID
      java.io.File getLogs()
      Get the logs
      java.lang.String getModuleId()
      Adapter Java module ID
      java.lang.String getModuleName()
      Adapter Java module Name
      java.lang.String getName()
      Get adapter name
      java.io.File getOutput()
      Get the adapter output XML
      java.lang.String getScript()
      Get adapter script
      java.lang.String getScriptId()
      Get adapter script document ID
      java.util.List<SharedScript> getSharedScripts​(Grant g)
      Get all shared scripts
      java.lang.String getType()
      Get adapter type
      boolean isAtomic()
      Is generated XML atomic
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODE_INDIRECT

        public static final java.lang.String MODE_INDIRECT
        Indirect mode
        See Also:
        Constant Field Values
      • MODE_DIRECT

        public static final java.lang.String MODE_DIRECT
        Direct mode
        See Also:
        Constant Field Values
    • Constructor Detail

      • Adapter

        public Adapter()
        Default constructor
    • Method Detail

      • getId

        public java.lang.String getId()
        Get adapter ID
        Returns:
        Adapter ID
      • getName

        public java.lang.String getName()
        Get adapter name
        Returns:
        Adapter name
      • getType

        public java.lang.String getType()
        Get adapter type
        Returns:
        Adapter type
      • getScriptId

        public java.lang.String getScriptId()
        Get adapter script document ID
      • getScript

        public java.lang.String getScript()
        Get adapter script
      • getClassName

        public java.lang.String getClassName()
        Adapter Java class, e.g. com.simplicite.adapters.MODULE_NAME.ADAPTER_NAME
      • getModuleId

        public java.lang.String getModuleId()
        Adapter Java module ID
      • getModuleName

        public java.lang.String getModuleName()
        Adapter Java module Name
      • getSharedScripts

        public java.util.List<SharedScript> getSharedScripts​(Grant g)
        Get all shared scripts
        Returns:
        all shared scripts
      • isAtomic

        public boolean isAtomic()
        Is generated XML atomic
        Returns:
        is Atomic ?
      • getOutput

        public java.io.File getOutput()
        Get the adapter output XML
        Returns:
        output
      • getErrors

        public java.io.File getErrors()
        Get the error result
        Returns:
        error
      • getLogs

        public java.io.File getLogs()
        Get the logs
        Returns:
        Logs
      • applyAdapter

        public char applyAdapter​(java.lang.String adapter,
                                 Grant grant,
                                 java.io.InputStream input,
                                 java.util.Map<java.lang.String,​java.lang.Object> params,
                                 java.lang.String trackId,
                                 java.lang.String origin)
        Load the input flow thru one adapter:
        1) case AWK: incoming data are read from "stdin",
        output data are send to the "stdout",
        rejected data are send to the "stderr",
        log output is not supported with awk.
        2) case JAVA: a specific Java adapter method (or script function) is call dynamically.
        see the Adaptor method: process(inStream, outStream, errStream, logStream)
        Parameters:
        adapter - Adapter name
        grant - User rights
        input - Incoming data
        params - Adapter parameters (ex: Object name in CSV import)
        trackId - Tracking ID
        origin - Origin of data
        Returns:
        Import status from XMLSupervisor