@Component(value="cuba_AccessGroupDefinitionBuilder")
@Scope(value="prototype")
public class AccessGroupDefinitionBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected AccessConstraintsBuilder |
accessConstraintsBuilder |
protected java.lang.String |
name |
static java.lang.String |
NAME |
protected java.util.Map<java.lang.String,java.io.Serializable> |
sessionAttributes |
Constructor and Description |
---|
AccessGroupDefinitionBuilder() |
Modifier and Type | Method and Description |
---|---|
AccessGroupDefinition |
build()
Returns the built access group definition
|
static AccessGroupDefinitionBuilder |
create() |
protected void |
init() |
AccessGroupDefinitionBuilder |
withConstraints(java.util.function.Consumer<AccessConstraintsBuilder> constraintsConsumer)
Adds access constraints to the group definition using
AccessConstraintsBuilder |
AccessGroupDefinitionBuilder |
withCustomGroovyConstraint(java.lang.Class<? extends Entity> target,
java.lang.String constraintCode,
java.lang.String groovyScript)
Adds in-memory groovy custom constraint to the group definition
|
AccessGroupDefinitionBuilder |
withCustomInMemoryConstraint(java.lang.Class<? extends Entity> target,
java.lang.String constraintCode,
ConstraintPredicate<? extends Entity> predicate)
Adds in-memory custom constraint to the group definition
|
AccessGroupDefinitionBuilder |
withCustomJpqlConstraint(java.lang.Class<? extends Entity> target,
java.lang.String constraintCode,
java.lang.String where,
java.lang.String join)
Adds JPQL custom constraint to the group definition
|
AccessGroupDefinitionBuilder |
withGroovyConstraint(java.lang.Class<? extends Entity> target,
EntityOp operation,
java.lang.String groovyScript)
Adds in-memory groovy constraint to the group definition
|
AccessGroupDefinitionBuilder |
withInMemoryConstraint(java.lang.Class<? extends Entity> target,
EntityOp operation,
ConstraintPredicate<? extends Entity> predicate)
Adds in-memory constraint to the group definition
|
AccessGroupDefinitionBuilder |
withJpqlConstraint(java.lang.Class<? extends Entity> target,
java.lang.String where)
Adds JPQL READ constraint to the group definition
|
AccessGroupDefinitionBuilder |
withJpqlConstraint(java.lang.Class<? extends Entity> target,
java.lang.String where,
java.lang.String join)
Adds JPQL READ constraint to the group definition
|
AccessGroupDefinitionBuilder |
withName(java.lang.String name)
Specifies the group name type.
|
AccessGroupDefinitionBuilder |
withSessionAttribute(java.lang.String key,
java.io.Serializable value)
Adds new session attribute to the group definition
|
AccessGroupDefinitionBuilder |
withSessionAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)
Adds new session attributes to the group definition
|
public static final java.lang.String NAME
protected AccessConstraintsBuilder accessConstraintsBuilder
protected java.lang.String name
protected java.util.Map<java.lang.String,java.io.Serializable> sessionAttributes
public static AccessGroupDefinitionBuilder create()
@PostConstruct protected void init()
public AccessGroupDefinitionBuilder withName(java.lang.String name)
public AccessGroupDefinitionBuilder withJpqlConstraint(java.lang.Class<? extends Entity> target, java.lang.String where, java.lang.String join)
target
- entity classwhere
- JPQL where clausejoin
- JPQL join clausepublic AccessGroupDefinitionBuilder withJpqlConstraint(java.lang.Class<? extends Entity> target, java.lang.String where)
target
- entity classwhere
- JPQL where clausepublic AccessGroupDefinitionBuilder withCustomJpqlConstraint(java.lang.Class<? extends Entity> target, java.lang.String constraintCode, java.lang.String where, java.lang.String join)
target
- entity classconstraintCode
- custom constraint codewhere
- JPQL where clausejoin
- JPQL join clausepublic AccessGroupDefinitionBuilder withInMemoryConstraint(java.lang.Class<? extends Entity> target, EntityOp operation, ConstraintPredicate<? extends Entity> predicate)
target
- entity classoperation
- CRUD operationpredicate
- in-memory predicate, returns true if entity is allowed by access constraintpublic AccessGroupDefinitionBuilder withCustomInMemoryConstraint(java.lang.Class<? extends Entity> target, java.lang.String constraintCode, ConstraintPredicate<? extends Entity> predicate)
target
- entity classconstraintCode
- custom constraint codepredicate
- in-memory predicate, returns true if entity is allowed by access constraintpublic AccessGroupDefinitionBuilder withGroovyConstraint(java.lang.Class<? extends Entity> target, EntityOp operation, java.lang.String groovyScript)
target
- entity classoperation
- CRUD operationgroovyScript
- groovy scriptpublic AccessGroupDefinitionBuilder withCustomGroovyConstraint(java.lang.Class<? extends Entity> target, java.lang.String constraintCode, java.lang.String groovyScript)
target
- entity classconstraintCode
- custom constraint codegroovyScript
- groovy scriptpublic AccessGroupDefinitionBuilder withConstraints(java.util.function.Consumer<AccessConstraintsBuilder> constraintsConsumer)
AccessConstraintsBuilder
public AccessGroupDefinitionBuilder withSessionAttribute(java.lang.String key, java.io.Serializable value)
key
- session attribute keyvalue
- session attribute valuepublic AccessGroupDefinitionBuilder withSessionAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)
attributes
- map of session attributespublic AccessGroupDefinition build()