List of usage examples for io.netty.channel ChannelId asLongText
String asLongText();
From source file:com.caricah.iotracah.server.netty.channelgroup.IotChannelGroup.java
License:Apache License
@Override public Channel find(ChannelId id) { Channel c = nonServerChannels.get(id.asLongText()); if (c != null) { return c; } else {//from w w w.j a v a 2 s . c om return serverChannels.get(id.asLongText()); } }
From source file:net.anyflow.lannister.TestUtil.java
License:Apache License
static public ChannelId newChannelId(String clientId, boolean newChannelId) { return new ChannelId() { private static final long serialVersionUID = 3931333967922160660L; Long idPostfix = Hazelcast.SELF.generator().getIdGenerator("unittest_embeddedchannel").newId(); @Override//from w w w . j a v a2 s. c o m public int compareTo(ChannelId o) { return this.asLongText().equals(o.asLongText()) ? 0 : 1; } @Override public String asShortText() { return asLongText(); } @Override public String asLongText() { if (newChannelId) { return clientId + idPostfix.toString(); } else { return clientId; } } @Override public int hashCode() { if (newChannelId) { return (clientId + idPostfix.toString()).hashCode(); } else { return clientId.hashCode(); } } @Override public String toString() { return asLongText(); } }; }