public static interface OperationService.Setup
persist() is called.
The following example could be used for setting up four operations:
operationService
.setup("sample-create")
.add("Monitor") // adds not only Monitor, but all roles that "include" Monitor
.commit()
.setup("sample-read")
.add("Maintainer") // adds a role with the name "Maintainer" and all roles that include it
.commit()
.setup("sample-delete")
.add(superUser) // using a Role instance
.add(auditor) // using a Role instance
.commit()
.setup("sample-update")
.add(maintainer, superUser, auditor) // using multiple Role instances at once
.commit();
| Modifier and Type | Method and Description |
|---|---|
OperationService.Setup |
add(Role... roles)
Adds new roles for the current operation with identical semantics as
add(Role). |
OperationService.Setup |
add(Role role)
Adds a new role for the current operation
|
OperationService.Setup |
add(Role role1,
Role role2)
Adds new roles for the current operation with identical semantics as
add(Role). |
OperationService.Setup |
add(Role role1,
Role role2,
Role role3)
Adds new roles for the current operation with identical semantics as
add(Role). |
OperationService.Setup |
add(String roleName)
Adds a new role for the current operation.
|
OperationService.Setup |
clear()
Removes all current roles from the operation.
|
Operation |
make()
Instructs the builder that the setup has finished.
|
OperationService |
persist()
Instructs the builder that the setup has finished and changes are effectively applied.
|
OperationService.Setup add(Role role)
role - the role to add, cannot be nullIllegalArgumentException - if the role is nullOperationService.Setup add(String roleName)
roleName - the role name to be retrieved and to added to the operationIllegalArgumentException - if a role with the given name is not foundOperationService.Setup add(Role role1, Role role2)
add(Role).role1 - the first role to addrole2 - the second role to addadd(Role)OperationService.Setup add(Role role1, Role role2, Role role3)
add(Role).role1 - the first role to addrole2 - the second role to addrole3 - the third role to addadd(Role)OperationService.Setup add(Role... roles)
add(Role).roles - the roles to addadd(Role)OperationService.Setup clear()
OperationService persist()
Operation make()
Copyright © 2015 Red Hat, Inc.. All rights reserved.