Acl is an immutable class representing structured access to DMT ACLs.
Under OMA DM the ACLs are defined as strings with an internal syntax.
The methods of this class taking a principal as parameter accept remote
server IDs (as passed to DmtAdmin.), as well as " * " indicating any
principal.
The syntax for valid remote server IDs:
<server-identifier> ::= All printable characters except
'=', '&', '*', '+' or white-space characters.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ADD
Principals holding this permission can issue ADD commands on the node having this ACL. |
| public static final int | ALL_PERMISSION
Principals holding this permission can issue any command on the node having this ACL. |
| private static final String | |
| public static final int | DELETE
Principals holding this permission can issue DELETE commands on the node having this ACL. |
| public static final int | EXEC
Principals holding this permission can issue EXEC commands on the node having this ACL. |
| public static final int | GET
Principals holding this permission can issue GET command on the node having this ACL. |
| private final int | |
| private static final int[] | |
| private static final String[] | |
| private final TreeMap | |
| public static final int | REPLACE
Principals holding this permission can issue REPLACE commands on the node having this ACL. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| private | Acl(Acl
The ACL that provides all permissions except for permissions
of the given principal. base, String The entity to which permission should be granted. principal, int The set of permissions to be given. The parameter can
be a logical permissions)or of the permission constants defined in
this class.Creates an instance identical to the |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Acl | Returns: a newAcl instanceThe entity to which permissions should be granted, or
"*" to grant permissions to all principals. principal, int The permissions to be given. The parameter can be a
logical permissions)or of more permission constants defined in this
class.Create a new |
| private static String | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| public synchronized Acl | Returns: a newAcl instanceThe entity from which permissions should be revoked, or
"*" to revoke permissions from all principals. principal, int The permissions to be revoked. The parameter can be a
logical permissions)or of more permission constants defined in this
class.Create a new |
| public boolean | Returns: true if the parameter represents the same ACL as this
instancethe object to compare with this obj)Acl instanceOverrides java. Checks whether the given object is equal to this |
| public synchronized int | Returns: The permissions of the given principal. The returnedint
is a bitmask of the permission constants defined in this classThe entity whose permissions to query, or "*"
to query the permissions that are granted globally, to all
principals principal)Get the permissions associated to a given principal. |
| public String[] | Returns: The array of principals having permissions on this node.Get the list of principals who have any kind of permissions on this node. |
| public int | Returns: hash code for this ACLOverrides java. Returns the hash code for this ACL instance. |
| public synchronized boolean | Returns: true if the principal holds all the given permissionsThe entity to check, or "*" to check whether
the given permissions are granted to all principals globally principal, int The permissions to check permissions)Check whether the given permissions are granted to a certain principal. |
| private static int | |
| public synchronized Acl | Returns: a newAcl instanceThe entity to which permissions should be granted, or
"*" to globally grant permissions to all principals. principal, int The set of permissions to be given. The parameter is a
bitmask of the permission constants defined in this class. permissions)Create a new |
| private static void | |
| private static String[] | |
| public synchronized String | Returns: The string representation as defined in OMA DM.Overrides java. Give the canonical string representation of this ACL. |
| private static String | |
| private String |
| ADD | back to summary |
|---|---|
| public static final int ADD Principals holding this permission can issue ADD commands on the node having this ACL. | |
| ALL_PERMISSION | back to summary |
|---|---|
| public static final int ALL_PERMISSION Principals holding this permission can issue any command on the node
having this ACL. This permission is the logical OR of | |
| ALL_PRINCIPALS | back to summary |
|---|---|
| private static final String ALL_PRINCIPALS | |
| DELETE | back to summary |
|---|---|
| public static final int DELETE Principals holding this permission can issue DELETE commands on the node having this ACL. | |
| EXEC | back to summary |
|---|---|
| public static final int EXEC Principals holding this permission can issue EXEC commands on the node having this ACL. | |
| GET | back to summary |
|---|---|
| public static final int GET Principals holding this permission can issue GET command on the node having this ACL. | |
| globalPermissions | back to summary |
|---|---|
| private final int globalPermissions | |
| PERMISSION_CODES | back to summary |
|---|---|
| private static final int[] PERMISSION_CODES | |
| PERMISSION_NAMES | back to summary |
|---|---|
| private static final String[] PERMISSION_NAMES | |
| principalPermissions | back to summary |
|---|---|
| private final TreeMap<String, Integer> principalPermissions | |
| REPLACE | back to summary |
|---|---|
| public static final int REPLACE Principals holding this permission can issue REPLACE commands on the node having this ACL. | |
| Acl | back to summary |
|---|---|
| public Acl(String acl) Create an instance of the ACL from its canonical string representation.
| |
| Acl | back to summary |
|---|---|
| public Acl(String[] principals, int[] permissions) Creates an instance with a specified list of principals and the
permissions they hold. The two arrays run in parallel, that is
A principal name may not appear multiple times in the 'principals' argument. If the "*" principal appears in the array, the corresponding permissions will be granted to all principals (regardless of whether they appear in the array or not).
| |
| Acl | back to summary |
|---|---|
| private Acl(Acl base, String principal, int permissions) Creates an instance identical to the
Assumes that the permissions parameter has been checked. All
modifications of an
| |
| addPermission | back to summary |
|---|---|
| public synchronized Acl addPermission(String principal, int permissions) Create a new
| |
| appendEntry | back to summary |
|---|---|
| private static String appendEntry(String base, char separator, String entry) | |
| checkPermissions | back to summary |
|---|---|
| private static void checkPermissions(int perm) | |
| checkPrincipal | back to summary |
|---|---|
| private static void checkPrincipal(String principal) | |
| checkServerId | back to summary |
|---|---|
| private static void checkServerId(String serverId, String errorText) | |
| deleteFromAll | back to summary |
|---|---|
| private static void deleteFromAll(TreeMap<String, Integer> principalPermissions, int perm) | |
| deletePermission | back to summary |
|---|---|
| public synchronized Acl deletePermission(String principal, int permissions) Create a new Note, that it is not valid to revoke a permission from a specific principal if that permission is granted globally to all principals.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Checks whether the given object is equal to this | |
| getPermissions | back to summary |
|---|---|
| public synchronized int getPermissions(String principal) Get the permissions associated to a given principal.
| |
| getPrincipals | back to summary |
|---|---|
| public String[] getPrincipals() Get the list of principals who have any kind of permissions on this node. The list only includes those principals that have been explicitly assigned permissions (so "*" is never returned), globally set permissions naturally apply to all other principals as well.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code for this ACL instance. If two
| |
| isPermitted | back to summary |
|---|---|
| public synchronized boolean isPermitted(String principal, int permissions) Check whether the given permissions are granted to a certain principal.
The requested permissions are specified as a bitfield, for example
| |
| parseCommand | back to summary |
|---|---|
| private static int parseCommand(String command) | |
| setPermission | back to summary |
|---|---|
| public synchronized Acl setPermission(String principal, int permissions) Create a new Note, that when changing the permissions of a specific principal, it is not allowed to specify a set of permissions stricter than the global set of permissions (that apply to all principals).
| |
| setPrincipalPermission | back to summary |
|---|---|
| private static void setPrincipalPermission(TreeMap<String, Integer> principalPermissions, String principal, int perm) | |
| split | back to summary |
|---|---|
| private static String[] split(String input, char sep, int limit) | |
| toString | back to summary |
|---|---|
| public synchronized String toString() Overrides java. Give the canonical string representation of this ACL. The operations are in the following order: {Add, Delete, Exec, Get, Replace}, principal names are sorted alphabetically. | |
| writeCommands | back to summary |
|---|---|
| private static String writeCommands(int command) | |
| writeEntry | back to summary |
|---|---|
| private String writeEntry(int command, String acl) | |