public static class AccessPolicy.Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
private RequestAction |
action |
private boolean |
fromPolicy |
private Set<String> |
groups |
private String |
identifier |
private String |
resource |
private Set<String> |
users |
| Constructor and Description |
|---|
Builder()
Default constructor for building a new AccessPolicy.
|
Builder(AccessPolicy other)
Initializes the builder with the state of the provided policy.
|
| Modifier and Type | Method and Description |
|---|---|
AccessPolicy.Builder |
action(RequestAction action)
Sets the action for this builder.
|
AccessPolicy.Builder |
addGroup(String group)
Adds the given group to the builder's set of groups.
|
AccessPolicy.Builder |
addGroups(Set<String> groups)
Adds all the groups from the provided set to the builder's set of groups.
|
AccessPolicy.Builder |
addUser(String user)
Adds the given user to the builder's set of users.
|
AccessPolicy.Builder |
addUsers(Set<String> users)
Adds all the users from the provided set to the builder's set of users.
|
AccessPolicy |
build() |
AccessPolicy.Builder |
clearGroups()
Clears the builder's set of groups so that it is non-null and size == 0.
|
AccessPolicy.Builder |
clearUsers()
Clears the builder's set of users so that it is non-null and size == 0.
|
AccessPolicy.Builder |
identifier(String identifier)
Sets the identifier of the builder.
|
AccessPolicy.Builder |
identifierGenerateFromSeed(String seed)
Sets the identifier of the builder with a UUID generated from the specified seed string.
|
AccessPolicy.Builder |
identifierGenerateRandom()
Sets the identifier of the builder to a random UUID.
|
AccessPolicy.Builder |
removeGroup(String group)
Removes the provided groups from the builder's set of groups.
|
AccessPolicy.Builder |
removeGroups(Set<String> groups)
Removes all groups in the provided set from the builder's set of groups.
|
AccessPolicy.Builder |
removeUser(String user)
Removes the provided user from the builder's set of users.
|
AccessPolicy.Builder |
removeUsers(Set<String> users)
Removes all users in the provided set from the builder's set of users.
|
AccessPolicy.Builder |
resource(String resource)
Sets the resource of the builder.
|
private String identifier
private String resource
private RequestAction action
private final boolean fromPolicy
public Builder()
public Builder(AccessPolicy other)
other - the existing access policy to initialize frompublic AccessPolicy.Builder identifier(String identifier)
identifier - the identifier to setIllegalStateException - if this method is called when this builder was constructed from an existing Policypublic AccessPolicy.Builder identifierGenerateRandom()
IllegalStateException - if this method is called when this builder was constructed from an existing Policypublic AccessPolicy.Builder identifierGenerateFromSeed(String seed)
IllegalStateException - if this method is called when this builder was constructed from an existing Policypublic AccessPolicy.Builder resource(String resource)
resource - the resource to setpublic AccessPolicy.Builder addUsers(Set<String> users)
users - the users to addpublic AccessPolicy.Builder addUser(String user)
user - the user to addpublic AccessPolicy.Builder removeUsers(Set<String> users)
users - the users to removepublic AccessPolicy.Builder removeUser(String user)
user - the user to removepublic AccessPolicy.Builder clearUsers()
public AccessPolicy.Builder addGroups(Set<String> groups)
groups - the groups to addpublic AccessPolicy.Builder addGroup(String group)
group - the group to addpublic AccessPolicy.Builder removeGroups(Set<String> groups)
groups - the groups to removepublic AccessPolicy.Builder removeGroup(String group)
group - the group to removepublic AccessPolicy.Builder clearGroups()
public AccessPolicy.Builder action(RequestAction action)
action - the action to setpublic AccessPolicy build()
Copyright © 2023 Apache NiFi Project. All rights reserved.