use of org.apache.kafka.common.resource.ResourcePattern in project kafka by apache.
the class DeleteAclsResponse method aclBinding.
public static AclBinding aclBinding(DeleteAclsMatchingAcl matchingAcl) {
ResourcePattern resourcePattern = new ResourcePattern(ResourceType.fromCode(matchingAcl.resourceType()), matchingAcl.resourceName(), PatternType.fromCode(matchingAcl.patternType()));
AccessControlEntry accessControlEntry = new AccessControlEntry(matchingAcl.principal(), matchingAcl.host(), AclOperation.fromCode(matchingAcl.operation()), AclPermissionType.fromCode(matchingAcl.permissionType()));
return new AclBinding(resourcePattern, accessControlEntry);
}
use of org.apache.kafka.common.resource.ResourcePattern in project kafka by apache.
the class DescribeAclsResponse method aclBindings.
private static Stream<AclBinding> aclBindings(DescribeAclsResource resource) {
return resource.acls().stream().map(acl -> {
ResourcePattern pattern = new ResourcePattern(ResourceType.fromCode(resource.resourceType()), resource.resourceName(), PatternType.fromCode(resource.patternType()));
AccessControlEntry entry = new AccessControlEntry(acl.principal(), acl.host(), AclOperation.fromCode(acl.operation()), AclPermissionType.fromCode(acl.permissionType()));
return new AclBinding(pattern, entry);
});
}
Aggregations