Search in sources :

Example 1 with AclRuleType

use of io.strimzi.api.kafka.model.AclRuleType in project strimzi-kafka-operator by strimzi.

the class SimpleAclRule method fromAclBinding.

/**
 * Creates SimpleAclRule instance based on Kafka's AclBinding instance containing the resource the rule should apply to.
 *
 * @param aclBinding the AclBinding instance which should be used to create the rule
 * @return the SimpleAclRule instance
 */
public static SimpleAclRule fromAclBinding(AclBinding aclBinding) {
    SimpleAclRuleResource resource = SimpleAclRuleResource.fromKafkaResourcePattern(aclBinding.pattern());
    AclRuleType type = fromKafkaAclPermissionType(aclBinding.entry().permissionType());
    AclOperation operation = fromKafkaAclOperation(aclBinding.entry().operation());
    return new SimpleAclRule(type, resource, aclBinding.entry().host(), operation);
}
Also used : AclRuleType(io.strimzi.api.kafka.model.AclRuleType) AclOperation(io.strimzi.api.kafka.model.AclOperation)

Example 2 with AclRuleType

use of io.strimzi.api.kafka.model.AclRuleType in project strimzi by strimzi.

the class SimpleAclRule method fromAclBinding.

/**
 * Creates SimpleAclRule instance based on Kafka's AclBinding instance containing the resource the rule should apply to.
 *
 * @param aclBinding the AclBinding instance which should be used to create the rule
 * @return the SimpleAclRule instance
 */
public static SimpleAclRule fromAclBinding(AclBinding aclBinding) {
    SimpleAclRuleResource resource = SimpleAclRuleResource.fromKafkaResourcePattern(aclBinding.pattern());
    AclRuleType type = fromKafkaAclPermissionType(aclBinding.entry().permissionType());
    AclOperation operation = fromKafkaAclOperation(aclBinding.entry().operation());
    return new SimpleAclRule(type, resource, aclBinding.entry().host(), operation);
}
Also used : AclRuleType(io.strimzi.api.kafka.model.AclRuleType) AclOperation(io.strimzi.api.kafka.model.AclOperation)

Aggregations

AclOperation (io.strimzi.api.kafka.model.AclOperation)2 AclRuleType (io.strimzi.api.kafka.model.AclRuleType)2