org.apache.activemq.artemis.utils.UUIDGenerator.getZeroPaddedSixBytes()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.apache.activemq.artemis.utils.UUIDGenerator.getZeroPaddedSixBytes()方法的一些代码示例,展示了UUIDGenerator.getZeroPaddedSixBytes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UUIDGenerator.getZeroPaddedSixBytes()方法的具体详情如下:
包路径:org.apache.activemq.artemis.utils.UUIDGenerator
类名称:UUIDGenerator
方法名:getZeroPaddedSixBytes

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);
}

相关文章