Class IoContext

  • All Implemented Interfaces:
    Context

    public class IoContext
    extends CoreContext
    The IoContext is used to extend the core context with IO related metadata that is useful during event generation.
    Since:
    2.0.0
    • Constructor Detail

      • IoContext

        public IoContext​(CoreContext ctx,
                         SocketAddress localSocket,
                         SocketAddress remoteSocket,
                         Optional<String> bucket)
        Creates a new IO Context.
        Parameters:
        ctx - the core context as a parent.
        localSocket - the local io socket.
        remoteSocket - the remote io socket.
        bucket - the bucket name, if it makes sense.
    • Method Detail

      • injectExportableParams

        public void injectExportableParams​(Map<String,​Object> input)
        Description copied from class: AbstractContext
        This method needs to be implemented by the actual context implementations to inject the params they need for exporting.
        Overrides:
        injectExportableParams in class CoreContext
        Parameters:
        input - pass exportable params in here.
      • localSocket

        public SocketAddress localSocket()
        Returns the local socket.
      • remoteSocket

        public SocketAddress remoteSocket()
        Returns the remote socket.
      • localHostname

        public String localHostname()
        Returns the local hostname, might be null if not available.
      • localPort

        public int localPort()
        Returns the local port, might be 0 if not available.
      • bucket

        public Optional<String> bucket()
        Returns the bucket name if present.