private void validateUniqueness(final OperationContext context, final String roleName, final PathAddress roleAddress, final AuthorizerConfiguration.PrincipalType principalType, final String realm, final String name) throws OperationFailedException { Resource roleResource = context.readResourceFromRoot(roleAddress); ModelNode model = Resource.Tools.readModel(roleResource); int matchesFound = 0; for (Property current : getIncludeExclude(model)) { if (matches(context, current.getValue(), principalType, realm, name)) { if (++matchesFound > 1) { throw DomainManagementLogger.ROOT_LOGGER.duplicateIncludeExclude(roleName, matchType.toString(), principalType.toString(), name, realm != null ? realm : "undefined"); } } } }
private void validateUniqueness(final OperationContext context, final String roleName, final PathAddress roleAddress, final AuthorizerConfiguration.PrincipalType principalType, final String realm, final String name) throws OperationFailedException { Resource roleResource = context.readResourceFromRoot(roleAddress); ModelNode model = Resource.Tools.readModel(roleResource); int matchesFound = 0; for (Property current : getIncludeExclude(model)) { if (matches(context, current.getValue(), principalType, realm, name)) { if (++matchesFound > 1) { throw DomainManagementLogger.ROOT_LOGGER.duplicateIncludeExclude(roleName, matchType.toString(), principalType.toString(), name, realm != null ? realm : "undefined"); } } } }