addAction(actions);
Set<Attribute> environment = new HashSet<Attribute>(1);
try {
if (remoteHost != null) {
environment.add(new Attribute(XACMLConstants.DNSNameEnvironmentURI, null, null,
new DNSNameAttribute(remoteHost)));
}
if (remoteIP != null) {
InetAddress addr = InetAddress.getByName(remoteIP);
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