本文整理了Java中org.apache.activemq.artemis.utils.UUIDGenerator.getZeroPaddedSixBytes()
方法的一些代码示例,展示了UUIDGenerator.getZeroPaddedSixBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UUIDGenerator.getZeroPaddedSixBytes()
方法的具体详情如下:
包路径:org.apache.activemq.artemis.utils.UUIDGenerator
类名称:UUIDGenerator
方法名:getZeroPaddedSixBytes
暂无
代码示例来源:origin: wildfly/wildfly
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: apache/activemq-artemis
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: org.apache.activemq/artemis-commons
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: apache/activemq-artemis
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: apache/activemq-artemis
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public byte[] call() throws Exception {
boolean up = networkInterface.isUp();
boolean loopback = networkInterface.isLoopback();
boolean virtual = networkInterface.isVirtual();
if (loopback || virtual || !up) {
throw new Exception("not suitable interface");
}
byte[] address = networkInterface.getHardwareAddress();
if (address != null) {
byte[] paddedAddress = UUIDGenerator.getZeroPaddedSixBytes(address);
if (UUIDGenerator.isBlackList(address)) {
throw new Exception("black listed address");
}
if (paddedAddress != null) {
return paddedAddress;
}
}
throw new Exception("invalid network interface");
}
});
代码示例来源:origin: apache/activemq-artemis
@Test
public void testZeroPaddedBytes() throws Exception {
Assert.assertNull(UUIDGenerator.getZeroPaddedSixBytes(null));
Assert.assertNull(UUIDGenerator.getZeroPaddedSixBytes(new byte[0]));
Assert.assertNull(UUIDGenerator.getZeroPaddedSixBytes(new byte[7]));
byte[] fiveBytes = new byte[]{1, 2, 3, 4, 5};
byte[] zeroPaddedFiveBytes = UUIDGenerator.getZeroPaddedSixBytes(fiveBytes);
ActiveMQTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 5, 0}, zeroPaddedFiveBytes);
byte[] fourBytes = new byte[]{1, 2, 3, 4};
byte[] zeroPaddedFourBytes = UUIDGenerator.getZeroPaddedSixBytes(fourBytes);
ActiveMQTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 4, 0, 0}, zeroPaddedFourBytes);
byte[] threeBytes = new byte[]{1, 2, 3};
byte[] zeroPaddedThreeBytes = UUIDGenerator.getZeroPaddedSixBytes(threeBytes);
ActiveMQTestBase.assertEqualsByteArrays(new byte[]{1, 2, 3, 0, 0, 0}, zeroPaddedThreeBytes);
}
内容来源于网络,如有侵权,请联系作者删除!