Class FileConsumer

  • All Implemented Interfaces:
    io.gridgo.connector.Consumer, io.gridgo.framework.ComponentLifecycle, io.gridgo.utils.helper.Loggable, io.gridgo.utils.helper.Startable

    public class FileConsumer
    extends io.gridgo.connector.impl.AbstractConsumer
    • Constructor Summary

      Constructors 
      Constructor Description
      FileConsumer​(io.gridgo.connector.support.config.ConnectorContext context, java.lang.String path, java.lang.String format, int bufferSize, boolean lengthPrepend, FileLimitStrategy limitStrategy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String generateName()  
      byte[] getBuffer()  
      int getCount()  
      java.lang.String getFormat()  
      FileLimitStrategy getLimitStrategy()  
      java.lang.String getPath()  
      boolean isHasRotation()  
      protected void onStart()  
      protected void onStop()  
      void publishMessage​(io.gridgo.framework.support.Message msg)  
      • Methods inherited from class io.gridgo.connector.impl.AbstractConsumer

        clearSubscribers, createMessage, createMessage, createMessage, ensurePayloadId, ensurePayloadId, getContext, parseMessage, parseMessage, parseMessage, parseMessage, publish, subscribe
      • Methods inherited from class io.gridgo.framework.AbstractComponentLifecycle

        getName, isStarted, start, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.gridgo.framework.ComponentLifecycle

        getName, start, stop
      • Methods inherited from interface io.gridgo.connector.Consumer

        subscribe
      • Methods inherited from interface io.gridgo.utils.helper.Loggable

        getLogger, getLogger
    • Constructor Detail

      • FileConsumer

        public FileConsumer​(io.gridgo.connector.support.config.ConnectorContext context,
                            java.lang.String path,
                            java.lang.String format,
                            int bufferSize,
                            boolean lengthPrepend,
                            FileLimitStrategy limitStrategy)
    • Method Detail

      • onStart

        protected void onStart()
        Specified by:
        onStart in class io.gridgo.framework.AbstractComponentLifecycle
      • onStop

        protected void onStop()
        Specified by:
        onStop in class io.gridgo.framework.AbstractComponentLifecycle
      • generateName

        protected java.lang.String generateName()
        Specified by:
        generateName in class io.gridgo.framework.AbstractComponentLifecycle
      • publishMessage

        public void publishMessage​(io.gridgo.framework.support.Message msg)
      • getPath

        public java.lang.String getPath()
      • getFormat

        public java.lang.String getFormat()
      • getBuffer

        public byte[] getBuffer()
      • isHasRotation

        public boolean isHasRotation()
      • getCount

        public int getCount()