Class DatagramOutputTarget

All Implemented Interfaces:
ErrorAware, LogTarget, Closeable

public class DatagramOutputTarget extends AbstractOutputTarget
A datagram output target. Useful for writing using custom protocols or writing to syslog daemons.
Author:
Avalon Development Team, Peter Donald
  • Field Details

  • Constructor Details

    • DatagramOutputTarget

      public DatagramOutputTarget(InetAddress address, int port, Formatter formatter, String encoding) throws IOException
      Create a output target with end point specified by address and port.
      Parameters:
      address - the address endpoint
      port - the address port
      formatter - the message formatter
      encoding - the encoding to use when encoding string
      Throws:
      IOException - if an error occurs
    • DatagramOutputTarget

      public DatagramOutputTarget(InetAddress address, int port, Formatter formatter) throws IOException
      Create a output target with end point specified by address and port.
      Parameters:
      address - the address endpoint
      port - the address port
      formatter - the message formatter
      Throws:
      IOException - if an error occurs
    • DatagramOutputTarget

      public DatagramOutputTarget(InetAddress address, int port) throws IOException
      Create a output target with end point specified by address and port.
      Parameters:
      address - the address endpoint
      port - the address port
      Throws:
      IOException - if an error occurs
  • Method Details

    • write

      protected void write(String stringData)
      Method to write output to datagram.
      Overrides:
      write in class AbstractOutputTarget
      Parameters:
      stringData - the data to be output
    • close

      public void close()
      Shutdown target. Attempting to write to target after close() will cause errors to be logged.
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractOutputTarget