@Override public int compare(ServiceItem o1, ServiceItem o2) { ServiceID srvID_1 = o1.serviceID; ServiceID srvID_2 = o2.serviceID; // The ordering is intentionally set up so that the UUIDs // can simply be numerically compared as two numbers return (srvID_1.getMostSignificantBits() < srvID_2.getMostSignificantBits() ? -1 : (srvID_1.getMostSignificantBits() > srvID_2.getMostSignificantBits() ? 1 : (srvID_1.getLeastSignificantBits() < srvID_2.getLeastSignificantBits() ? -1 : (srvID_1.getLeastSignificantBits() > srvID_2.getLeastSignificantBits() ? 1 : 0)))); } });
@Override public int compare(ServiceItem o1, ServiceItem o2) { ServiceID srvID_1 = o1.serviceID; ServiceID srvID_2 = o2.serviceID; // The ordering is intentionally set up so that the UUIDs // can simply be numerically compared as two numbers return (srvID_1.getMostSignificantBits() < srvID_2.getMostSignificantBits() ? -1 : (srvID_1.getMostSignificantBits() > srvID_2.getMostSignificantBits() ? 1 : (srvID_1.getLeastSignificantBits() < srvID_2.getLeastSignificantBits() ? -1 : (srvID_1.getLeastSignificantBits() > srvID_2.getLeastSignificantBits() ? 1 : 0)))); } });
/** * Checks if the value of the given service ID to register conforms to the * ServiceID specification, logging a message to the provided logger at the * specified logging level if it doesn't. */ public static void checkRegistrantServiceID(ServiceID serviceID, Logger logger, Level level) { if (logger.isLoggable(level)) { int variant = (int) (serviceID.getLeastSignificantBits() >> 62) & 0x3; if (variant != 2) { logger.log(level, "{0} has invalid variant {1}", new Object[]{ serviceID, Integer.valueOf(variant) }); } int version = (int) (serviceID.getMostSignificantBits() >> 12) & 0xF; if (!(version == 1 || version == 4)) { logger.log(level, "{0} has invalid version {1}", new Object[]{ serviceID, Integer.valueOf(version) }); } } } }
/** * Checks if the value of the given service ID to register conforms to the ServiceID * specification, logging a message to the provided logger at the specified logging level if it * doesn't. */ static void checkRegistrantServiceID(ServiceID serviceID, Logger logger, Level level) { if (logger.isLoggable(level)) { int variant = (int) (serviceID.getLeastSignificantBits() >> 62) & 0x3; if (variant != 2) { logger.log(level, "{0} has invalid variant {1}", new Object[]{serviceID, new Integer(variant)}); } int version = (int) (serviceID.getMostSignificantBits() >> 12) & 0xF; if (!(version == 1 || version == 4)) { logger.log(level, "{0} has invalid version {1}", new Object[]{serviceID, new Integer(version)}); } } } }
@Override public Uuid getReferentUuid() { return UuidFactory.create(registrarID.getMostSignificantBits(), registrarID.getLeastSignificantBits()); }
@Override public Uuid getReferentUuid() { return UuidFactory.create(registrarID.getMostSignificantBits(), registrarID.getLeastSignificantBits()); }
public Uuid getReferentUuid() { return UuidFactory.create(registrarID.getMostSignificantBits(), registrarID.getLeastSignificantBits()); }
public Uuid getReferentUuid() { return UuidFactory.create(registrarID.getMostSignificantBits(), registrarID.getLeastSignificantBits()); }
buf.putInt(nids); for (int i = 0; i < nids; i++) { buf.putLong(ids[i].getMostSignificantBits()); buf.putLong(ids[i].getLeastSignificantBits());
buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());
buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());
buf.putInt(nids); for (int i = 0; i < nids; i++) { buf.putLong(ids[i].getMostSignificantBits()); buf.putLong(ids[i].getLeastSignificantBits());
buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());
for (int i = 0; i < nids; i++) { ServiceID id = ids[i]; buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());
for (int i = 0; i < nids; i++) { ServiceID id = ids[i]; buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());
buf.putLong(id.getMostSignificantBits()); buf.putLong(id.getLeastSignificantBits());