Class IdentityUtil

java.lang.Object
dev.getelements.elements.rt.remote.jeromq.IdentityUtil

public class IdentityUtil extends Object
Manipulates the identity frames on an instance of ZMsg.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.zeromq.ZMsg
    copyIdentity(org.zeromq.ZMsg msg)
    Copies the identity portion of the ZMsg.
    static org.zeromq.ZMsg
    popIdentity(org.zeromq.ZMsg msg)
    Removes all frames containing the identity portion from the supplied ZMsg.
    static void
    pushIdentity(org.zeromq.ZMsg msg, org.zeromq.ZMsg identity)
    Prepends all identity frames to the supplied message.

    Methods inherited from class java.lang.Object

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

    • EMPTY_DELIMITER

      public static final byte[] EMPTY_DELIMITER
  • Constructor Details

    • IdentityUtil

      public IdentityUtil()
  • Method Details

    • copyIdentity

      public static org.zeromq.ZMsg copyIdentity(org.zeromq.ZMsg msg)
      Copies the identity portion of the ZMsg.
      Parameters:
      msg - the message from which to copy
      Returns:
      a copy of the identity portion in a new ZMsg
    • popIdentity

      public static org.zeromq.ZMsg popIdentity(org.zeromq.ZMsg msg)
      Removes all frames containing the identity portion from the supplied ZMsg. ALl identity frames are moved to a new instance of ZMsg. The delimiter frame is discarded. When this returns, all identity frames as well as the empty delimiter frame are removed from the target message and moved to a new message which is returned by this method.
      Parameters:
      msg - the message from which to pop the identity
      Returns:
      a new message containing just the identity portion
    • pushIdentity

      public static void pushIdentity(org.zeromq.ZMsg msg, org.zeromq.ZMsg identity)
      Prepends all identity frames to the supplied message. This always inserts a delimiter frame after the identity portion. When this returns the identity ZMsg is empty and all frames moved to the target message.
      Parameters:
      msg - the message to receive the identity frames
      identity - a ZMsg containing all identity frames