Package org.zeromq

Class ZMQ.Event

  • Enclosing class:
    ZMQ

    public static class ZMQ.Event
    extends java.lang.Object
    Inner class: Event. Monitor socket event class
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String address  
      private int event  
      private java.lang.Object resolvedValue  
      private java.lang.Object value  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Event​(int event, java.lang.Object value, java.lang.Object resolvedValue, java.lang.String address)  
        Event​(int event, java.lang.Object value, java.lang.String address)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAddress()  
      int getEvent()  
      java.lang.Object getValue()  
      boolean isError()
      Used to check if the event is an error.
      boolean isWarn()
      Used to check if the event is a warning.
      static ZMQ.Event recv​(ZMQ.Socket socket)
      Receive an event from a monitor socket.
      static ZMQ.Event recv​(ZMQ.Socket socket, int flags)
      Receive an event from a monitor socket.
      <M> M resolveValue()
      Return the argument as an integer or a Enum of the appropriate type if available.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • event

        private final int event
      • value

        private final java.lang.Object value
      • resolvedValue

        private final java.lang.Object resolvedValue
      • address

        private final java.lang.String address
    • Constructor Detail

      • Event

        public Event​(int event,
                     java.lang.Object value,
                     java.lang.String address)
      • Event

        private Event​(int event,
                      java.lang.Object value,
                      java.lang.Object resolvedValue,
                      java.lang.String address)
    • Method Detail

      • recv

        public static ZMQ.Event recv​(ZMQ.Socket socket,
                                     int flags)
        Receive an event from a monitor socket.
        Parameters:
        socket - the socket
        flags - the flags to apply to the receive operation.
        Returns:
        the received event or null if no message was received.
        Throws:
        ZMQException
      • recv

        public static ZMQ.Event recv​(ZMQ.Socket socket)
        Receive an event from a monitor socket. Does a blocking recv.
        Parameters:
        socket - the socket
        Returns:
        the received event.
        Throws:
        ZMQException
      • getEvent

        public int getEvent()
      • getValue

        public java.lang.Object getValue()
      • getAddress

        public java.lang.String getAddress()
      • isError

        public boolean isError()
        Used to check if the event is an error.

        Generally, any event that define the errno is considered as an error.

        Returns:
        true if the evant was an error
      • isWarn

        public boolean isWarn()
        Used to check if the event is a warning.

        Generally, any event that return an authentication failure is considered as a warning.

        Returns:
      • resolveValue

        public <M> M resolveValue()
        Return the argument as an integer or a Enum of the appropriate type if available. It return objects of type:
        Type Parameters:
        M - The expected type of the returned object
        Returns:
        The resolved value.