Class IdentityUtil
java.lang.Object
dev.getelements.elements.rt.remote.jeromq.IdentityUtil
Manipulates the identity frames on an instance of
ZMsg
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.zeromq.ZMsg
copyIdentity
(org.zeromq.ZMsg msg) Copies the identity portion of theZMsg
.static org.zeromq.ZMsg
popIdentity
(org.zeromq.ZMsg msg) Removes all frames containing the identity portion from the suppliedZMsg
.static void
pushIdentity
(org.zeromq.ZMsg msg, org.zeromq.ZMsg identity) Prepends all identity frames to the supplied message.
-
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 theZMsg
.- 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 suppliedZMsg
. ALl identity frames are moved to a new instance ofZMsg
. 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 identityZMsg
is empty and all frames moved to the target message.- Parameters:
msg
- the message to receive the identity framesidentity
- aZMsg
containing all identity frames
-