Package io.gridgo.connector.file
Class FileConsumer
- java.lang.Object
-
- io.gridgo.framework.AbstractComponentLifecycle
-
- io.gridgo.connector.impl.AbstractConsumer
-
- io.gridgo.connector.file.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.StringgenerateName()byte[]getBuffer()intgetCount()java.lang.StringgetFormat()FileLimitStrategygetLimitStrategy()java.lang.StringgetPath()booleanisHasRotation()protected voidonStart()protected voidonStop()voidpublishMessage(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
-
-
-
-
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:
onStartin classio.gridgo.framework.AbstractComponentLifecycle
-
onStop
protected void onStop()
- Specified by:
onStopin classio.gridgo.framework.AbstractComponentLifecycle
-
generateName
protected java.lang.String generateName()
- Specified by:
generateNamein classio.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()
-
getLimitStrategy
public FileLimitStrategy getLimitStrategy()
-
-