Class LogTailerListener

java.lang.Object
de.iip_ecosphere.platform.services.spring.LogTailerListener
All Implemented Interfaces:
de.iip_ecosphere.platform.support.commons.TailerListener, Closeable, AutoCloseable

class LogTailerListener extends Object implements de.iip_ecosphere.platform.support.commons.TailerListener, Closeable
A log tailer listener connected to a transport converter sender.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private de.iip_ecosphere.platform.services.environment.services.Sender<String>
     
    private de.iip_ecosphere.platform.support.commons.Tailer
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogTailerListener(de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup aas, de.iip_ecosphere.platform.transport.connectors.TransportSetup transport, String path)
    Creates a log tailer listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    attachTailer(de.iip_ecosphere.platform.support.commons.Tailer tailer)
    Attaches the handling tailer.
    void
     
    (package private) int
    Decreases a further use.
    Returns the URI that this sender is connected to.
    void
    handle(String line)
     
    (package private) int
    Indicates a further use and increases the usage count.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.iip_ecosphere.platform.support.commons.TailerListener

    endOfFileReached, fileNotFound, fileRotated
  • Field Details

    • sender

      private de.iip_ecosphere.platform.services.environment.services.Sender<String> sender
    • tailer

      private de.iip_ecosphere.platform.support.commons.Tailer tailer
    • usageCount

      private int usageCount
  • Constructor Details

    • LogTailerListener

      LogTailerListener(de.iip_ecosphere.platform.support.iip_aas.AasPartRegistry.AasSetup aas, de.iip_ecosphere.platform.transport.connectors.TransportSetup transport, String path)
      Creates a log tailer listener.
      Parameters:
      aas - the AAS setup for AAS-based senders
      transport - the transport setup for transport-based senders
      path - within the mechanism to identify the data, may be an id short, an URI sub-path etc.
  • Method Details

    • getURI

      public URI getURI()
      Returns the URI that this sender is connected to.
      Returns:
      the URI connected to (may be null)
    • handle

      public void handle(String line)
      Specified by:
      handle in interface de.iip_ecosphere.platform.support.commons.TailerListener
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • attachTailer

      void attachTailer(de.iip_ecosphere.platform.support.commons.Tailer tailer)
      Attaches the handling tailer.
      Parameters:
      tailer - the tailer
    • increaseUsageCount

      int increaseUsageCount()
      Indicates a further use and increases the usage count.
      Returns:
      the actual usage count
    • decreaseUsageCount

      int decreaseUsageCount()
      Decreases a further use.
      Returns:
      the actual usage count