Package zmq.io.mechanism
Class Mechanism
- java.lang.Object
-
- zmq.io.mechanism.Mechanism
-
- Direct Known Subclasses:
CurveClientMechanism,CurveServerMechanism,GssapiClientMechanism,GssapiServerMechanism,NullMechanism,PlainClientMechanism,PlainServerMechanism
public abstract class Mechanism extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMechanism.Status
-
Field Summary
Fields Modifier and Type Field Description private Blobidentityprotected Optionsoptionsprivate AddresspeerAddressprotected SessionBasesessionprotected java.lang.StringstatusCodeprivate BlobuserIdMetadatazapPropertiesMetadatazmtpProperties
-
Constructor Summary
Constructors Modifier Constructor Description protectedMechanism(SessionBase session, Address peerAddress, Options options)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddProperty(java.nio.ByteBuffer buf, java.lang.String name, byte[] value)protected voidaddProperty(java.nio.ByteBuffer buf, java.lang.String name, java.lang.String value)protected voidaddProperty(Msg msg, java.lang.String name, byte[] value)protected voidaddProperty(Msg msg, java.lang.String name, java.lang.String value)protected booleancompare(java.nio.ByteBuffer a1, byte[] b, int offset, int length)protected booleancompare(Msg msg, java.lang.String data, boolean includeLength)Msgdecode(Msg msg)voiddestroy()Msgencode(Msg msg)BlobgetUserId()protected inthandleErrorReason(java.lang.String reason)abstract intnextHandshakeCommand(Msg msg)protected intparseErrorMessage(Msg msg)protected intparseMetadata(java.nio.ByteBuffer msg, int offset, boolean zapFlag)protected intparseMetadata(Msg msg, int offset, boolean zapFlag)MsgpeerIdentity()abstract intprocessHandshakeCommand(Msg msg)protected intproperty(java.lang.String name, byte[] value)protected intreceiveAndProcessZapReply()protected voidsendZapRequest(Mechanisms mechanism, boolean more)private voidsetPeerIdentity(byte[] data)private voidsetUserId(byte[] data)protected java.lang.StringsocketType()abstract Mechanism.Statusstatus()abstract intzapMsgAvailable()
-
-
-
Field Detail
-
options
protected final Options options
-
identity
private Blob identity
-
userId
private Blob userId
-
zapProperties
public final Metadata zapProperties
-
zmtpProperties
public final Metadata zmtpProperties
-
session
protected final SessionBase session
-
peerAddress
private final Address peerAddress
-
statusCode
protected java.lang.String statusCode
-
-
Constructor Detail
-
Mechanism
protected Mechanism(SessionBase session, Address peerAddress, Options options)
-
-
Method Detail
-
status
public abstract Mechanism.Status status()
-
setPeerIdentity
private void setPeerIdentity(byte[] data)
-
peerIdentity
public final Msg peerIdentity()
-
setUserId
private void setUserId(byte[] data)
-
getUserId
public final Blob getUserId()
-
addProperty
protected final void addProperty(java.nio.ByteBuffer buf, java.lang.String name, java.lang.String value)
-
addProperty
protected final void addProperty(Msg msg, java.lang.String name, java.lang.String value)
-
addProperty
protected final void addProperty(java.nio.ByteBuffer buf, java.lang.String name, byte[] value)
-
addProperty
protected final void addProperty(Msg msg, java.lang.String name, byte[] value)
-
parseMetadata
protected final int parseMetadata(Msg msg, int offset, boolean zapFlag)
-
parseMetadata
protected final int parseMetadata(java.nio.ByteBuffer msg, int offset, boolean zapFlag)
-
property
protected int property(java.lang.String name, byte[] value)
-
socketType
protected final java.lang.String socketType()
-
compare
protected boolean compare(Msg msg, java.lang.String data, boolean includeLength)
-
compare
protected boolean compare(java.nio.ByteBuffer a1, byte[] b, int offset, int length)
-
zapMsgAvailable
public abstract int zapMsgAvailable()
-
processHandshakeCommand
public abstract int processHandshakeCommand(Msg msg)
-
nextHandshakeCommand
public abstract int nextHandshakeCommand(Msg msg)
-
parseErrorMessage
protected int parseErrorMessage(Msg msg)
-
handleErrorReason
protected int handleErrorReason(java.lang.String reason)
-
sendZapRequest
protected final void sendZapRequest(Mechanisms mechanism, boolean more)
-
receiveAndProcessZapReply
protected final int receiveAndProcessZapReply()
-
destroy
public void destroy()
-
-