if (addr instanceof Inet4Address)
environment.add(new Attribute(XACMLConstants.IPAddressEnvironmentURI, null, null,
new IPv4AddressAttribute(addr)));
if (addr instanceof Inet6Address) {
environment.add(new Attribute(XACMLConstants.IPAddressEnvironmentURI, null, null,
new IPv6AddressAttribute(addr)));
}
}
} catch (Exception ex) {
throw new RuntimeException(ex); // should not happen
}