zmq.io.net.NetProtocol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jeromq Show documentation
Show all versions of jeromq Show documentation
Pure Java implementation of libzmq
package zmq.io.net;
import java.util.Arrays;
import java.util.List;
import zmq.socket.Sockets;
public enum NetProtocol
{
inproc(true),
ipc(true),
tcp(true),
pgm(false, Sockets.PUB, Sockets.SUB, Sockets.XPUB, Sockets.XPUB),
epgm(false, Sockets.PUB, Sockets.SUB, Sockets.XPUB, Sockets.XPUB),
tipc(false),
norm(false);
public final boolean valid;
private List compatibles;
NetProtocol(boolean implemented, Sockets... compatibles)
{
valid = implemented;
this.compatibles = Arrays.asList(compatibles);
}
public static NetProtocol getProtocol(String protocol)
{
for (NetProtocol candidate : values()) {
if (candidate.name().equals(protocol)) {
return candidate;
}
}
return null;
}
public final boolean compatible(int type)
{
return compatibles.isEmpty() || compatibles.contains(Sockets.fromType(type));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy