| | |
| | | |
| | | import java.net.InetAddress; |
| | | import java.security.cert.Certificate; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * <p> |
| | | * JNR: I find the implementation in this method dubious. |
| | | * |
| | | * @see EnumRight#hasRights(int, int) |
| | | */ |
| | | @Override |
| | | public boolean hasRights(int rights) { |
| | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * <p> |
| | | * JNR: I find the implementation in this method dubious. |
| | | * |
| | | * @see EnumRight#getEnumRight(int) |
| | | */ |
| | | @Override |
| | | public String rightToString() { |
| | |
| | | if (attributeType != null) |
| | | { |
| | | appendSeparatorIfNeeded(sb); |
| | | sb.append(attributeType); |
| | | sb.append("attributeType: ").append(attributeType.getNameOrOID()); |
| | | if (attributeValue != null) |
| | | { |
| | | sb.append(":").append(attributeType); |
| | | sb.append(":").append(attributeValue); |
| | | } |
| | | } |
| | | if (allowList != null) |
| | | { |
| | | appendSeparatorIfNeeded(sb); |
| | | sb.append(allowList.size()).append(" allow ACIs"); |
| | | } |
| | | if (denyList != null) |
| | | { |
| | | appendSeparatorIfNeeded(sb); |
| | | sb.append(denyList.size()).append(" deny ACIs"); |
| | | } |
| | | appendSeparatorIfNeeded(sb); |
| | | sb.append(size(allowList)).append(" allow ACIs"); |
| | | appendSeparatorIfNeeded(sb); |
| | | sb.append(size(denyList)).append(" deny ACIs"); |
| | | if (evalReason != null) |
| | | { |
| | | appendSeparatorIfNeeded(sb); |
| | |
| | | sb.append(", "); |
| | | } |
| | | } |
| | | |
| | | private int size(Collection<?> col) |
| | | { |
| | | if (col != null) |
| | | { |
| | | return col.size(); |
| | | } |
| | | return 0; |
| | | } |
| | | } |