public class GravitinoAdminClient extends GravitinoClientBase implements SupportsMetalakes
Normal users should use GravitinoClient
to connect with the Gravitino server.
Modifier and Type | Class and Description |
---|---|
static class |
GravitinoAdminClient.AdminClientBuilder
Builder class for constructing a GravitinoAdminClient.
|
GravitinoClientBase.Builder<T>
API_METALAKES_IDENTIFIER_PATH, API_METALAKES_LIST_PATH, restClient
Modifier and Type | Method and Description |
---|---|
Group |
addGroup(java.lang.String metalake,
java.lang.String group)
Adds a new Group.
|
User |
addMetalakeAdmin(java.lang.String user)
Adds a new metalake admin.
|
User |
addUser(java.lang.String metalake,
java.lang.String user)
Adds a new User.
|
GravitinoMetalake |
alterMetalake(NameIdentifier ident,
MetalakeChange... changes)
Alters a specific Metalake using the Gravitino API.
|
static GravitinoAdminClient.AdminClientBuilder |
builder(java.lang.String uri)
Creates a new builder for constructing a GravitinoClient.
|
GravitinoMetalake |
createMetalake(NameIdentifier ident,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new Metalake using the Gravitino API.
|
Role |
createRole(java.lang.String metalake,
java.lang.String role,
java.util.Map<java.lang.String,java.lang.String> properties,
SecurableObject securableObject,
java.util.List<Privilege> privileges)
Creates a new Role.
|
boolean |
deleteRole(java.lang.String metalake,
java.lang.String role)
Deletes a Role.
|
boolean |
dropMetalake(NameIdentifier ident)
Drops a specific Metalake using the Gravitino API.
|
Group |
getGroup(java.lang.String metalake,
java.lang.String group)
Gets a Group.
|
Role |
getRole(java.lang.String metalake,
java.lang.String role)
Gets a Role.
|
User |
getUser(java.lang.String metalake,
java.lang.String user)
Gets a User.
|
Group |
grantRolesToGroup(java.lang.String metalake,
java.util.List<java.lang.String> roles,
java.lang.String group)
Grant roles to a group.
|
User |
grantRolesToUser(java.lang.String metalake,
java.util.List<java.lang.String> roles,
java.lang.String user)
Grant roles to a user.
|
GravitinoMetalake[] |
listMetalakes()
Retrieves a list of Metalakes from the Gravitino API.
|
boolean |
removeGroup(java.lang.String metalake,
java.lang.String group)
Removes a Group.
|
boolean |
removeMetalakeAdmin(java.lang.String user)
Removes a metalake admin.
|
boolean |
removeUser(java.lang.String metalake,
java.lang.String user)
Removes a User.
|
Group |
revokeRolesFromGroup(java.lang.String metalake,
java.util.List<java.lang.String> roles,
java.lang.String group)
Revoke roles from a group.
|
User |
revokeRolesFromUser(java.lang.String metalake,
java.util.List<java.lang.String> roles,
java.lang.String user)
Revoke roles from a user.
|
checkVersion, clientVersion, close, getVersion, loadMetalake, serverVersion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
loadMetalake, metalakeExists
public GravitinoMetalake[] listMetalakes()
listMetalakes
in interface SupportsMetalakes
public GravitinoMetalake createMetalake(NameIdentifier ident, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws MetalakeAlreadyExistsException
createMetalake
in interface SupportsMetalakes
ident
- The identifier of the new Metalake.comment
- The comment for the new Metalake.properties
- The properties of the new Metalake.MetalakeAlreadyExistsException
- If a Metalake with the specified identifier already
exists.public GravitinoMetalake alterMetalake(NameIdentifier ident, MetalakeChange... changes) throws NoSuchMetalakeException, java.lang.IllegalArgumentException
alterMetalake
in interface SupportsMetalakes
ident
- The identifier of the Metalake to be altered.changes
- The changes to be applied to the Metalake.NoSuchMetalakeException
- If the specified Metalake does not exist.java.lang.IllegalArgumentException
- If the provided changes are invalid or not applicable.public boolean dropMetalake(NameIdentifier ident)
dropMetalake
in interface SupportsMetalakes
ident
- The identifier of the Metalake to be dropped.public User addUser(java.lang.String metalake, java.lang.String user) throws UserAlreadyExistsException, NoSuchMetalakeException
metalake
- The Metalake of the User.user
- The name of the User.UserAlreadyExistsException
- If a User with the same name already exists.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If adding the User encounters storage issues.public boolean removeUser(java.lang.String metalake, java.lang.String user) throws NoSuchMetalakeException
metalake
- The Metalake of the User.user
- The name of the User.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If removing the User encounters storage issues.public User getUser(java.lang.String metalake, java.lang.String user) throws NoSuchUserException, NoSuchMetalakeException
metalake
- The Metalake of the User.user
- The name of the User.NoSuchUserException
- If the User with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If getting the User encounters storage issues.public Group addGroup(java.lang.String metalake, java.lang.String group) throws GroupAlreadyExistsException, NoSuchMetalakeException
metalake
- The Metalake of the Group.group
- The name of the Group.GroupAlreadyExistsException
- If a Group with the same name already exists.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If adding the Group encounters storage issues.public boolean removeGroup(java.lang.String metalake, java.lang.String group) throws NoSuchMetalakeException
metalake
- The Metalake of the Group.group
- THe name of the Group.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If removing the Group encounters storage issues.public Group getGroup(java.lang.String metalake, java.lang.String group) throws NoSuchGroupException, NoSuchMetalakeException
metalake
- The Metalake of the Group.group
- The name of the Group.NoSuchGroupException
- If the Group with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If getting the Group encounters storage issues.public User addMetalakeAdmin(java.lang.String user) throws UserAlreadyExistsException
user
- The name of the User.UserAlreadyExistsException
- If a metalake admin with the same name already exists.java.lang.RuntimeException
- If adding the User encounters storage issues.public boolean removeMetalakeAdmin(java.lang.String user)
user
- The name of the User.java.lang.RuntimeException
- If removing the User encounters storage issues.public Role getRole(java.lang.String metalake, java.lang.String role) throws NoSuchRoleException, NoSuchMetalakeException
metalake
- The Metalake of the Role.role
- The name of the Role.NoSuchRoleException
- If the Role with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If getting the Role encounters storage issues.public boolean deleteRole(java.lang.String metalake, java.lang.String role) throws NoSuchMetalakeException
metalake
- The Metalake of the Role.role
- The name of the Role.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If deleting the Role encounters storage issues.public Role createRole(java.lang.String metalake, java.lang.String role, java.util.Map<java.lang.String,java.lang.String> properties, SecurableObject securableObject, java.util.List<Privilege> privileges) throws RoleAlreadyExistsException, NoSuchMetalakeException
metalake
- The Metalake of the Role.role
- The name of the Role.properties
- The properties of the Role.securableObject
- The securable object of the Role.privileges
- The privileges of the Role.RoleAlreadyExistsException
- If a Role with the same name already exists.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If creating the Role encounters storage issues.public User grantRolesToUser(java.lang.String metalake, java.util.List<java.lang.String> roles, java.lang.String user) throws NoSuchUserException, NoSuchRoleException, NoSuchMetalakeException
metalake
- The metalake of the User.user
- The name of the User.roles
- The names of the Role.NoSuchUserException
- If the User with the given name does not exist.NoSuchRoleException
- If the Role with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If granting roles to a user encounters storage issues.public Group grantRolesToGroup(java.lang.String metalake, java.util.List<java.lang.String> roles, java.lang.String group) throws NoSuchGroupException, NoSuchRoleException, NoSuchMetalakeException
metalake
- The metalake of the Group.group
- The name of the Group.roles
- The names of the Role.NoSuchGroupException
- If the Group with the given name does not exist.NoSuchRoleException
- If the Role with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If granting roles to a group encounters storage issues.public User revokeRolesFromUser(java.lang.String metalake, java.util.List<java.lang.String> roles, java.lang.String user) throws NoSuchUserException, NoSuchRoleException, NoSuchMetalakeException
metalake
- The metalake of the User.user
- The name of the User.roles
- The names of the Role.NoSuchUserException
- If the User with the given name does not exist.NoSuchRoleException
- If the Role with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If revoking roles from a user encounters storage issues.public Group revokeRolesFromGroup(java.lang.String metalake, java.util.List<java.lang.String> roles, java.lang.String group) throws NoSuchGroupException, NoSuchRoleException, NoSuchMetalakeException
metalake
- The metalake of the Group.group
- The name of the Group.roles
- The names of the Role.NoSuchGroupException
- If the Group with the given name does not exist.NoSuchRoleException
- If the Role with the given name does not exist.NoSuchMetalakeException
- If the Metalake with the given name does not exist.java.lang.RuntimeException
- If revoking roles from a group encounters storage issues.public static GravitinoAdminClient.AdminClientBuilder builder(java.lang.String uri)
uri
- The base URI for the Gravitino API.