public class ApplicationPermission extends Permission
Application.start() or Application.stop() or
ApplicationInstaller.install(java.io.InputStream) or ApplicationInstaller.uninstall(Application).| Modifier and Type | Field and Description |
|---|---|
static String |
INSTALL_ACTION
Action associated with
ApplicationInstaller.install(java.io.InputStream). |
static String |
START_ACTION
Action associated with
Application.start(). |
static String |
STOP_ACTION
Action associated with
Application.stop(). |
static String |
UNINSTALL_ACTION
Action associated with
ApplicationInstaller.uninstall(Application). |
| Constructor and Description |
|---|
ApplicationPermission(Application application,
String action)
Creates a permission for the given application.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Checks two Permission objects for equality.
|
String |
getActions()
Returns the actions as a String.
|
Application |
getApplication()
Gets the application.
|
int |
hashCode()
Returns the hash code value for this Permission object.
|
boolean |
implies(Permission permission)
Checks if the specified permission's actions are "implied by" this object's actions.
|
getName, toStringpublic static final String INSTALL_ACTION
ApplicationInstaller.install(java.io.InputStream).public static final String START_ACTION
Application.start().public static final String STOP_ACTION
Application.stop().public static final String UNINSTALL_ACTION
ApplicationInstaller.uninstall(Application).public ApplicationPermission(@Nullable Application application, String action)
The action can be one of START_ACTION, STOP_ACTION, INSTALL_ACTION or
UNINSTALL_ACTION.
The application may be null for the install action (the application is not created yet).
application - the application.action - the action realized with the service.public boolean equals(@Nullable Object obj)
Permission
Do not use the equals method for making access control decisions; use the
implies method.
equals in class Permissionobj - the object we are testing for equality with this object.Object.hashCode(),
HashMappublic String getActions()
Permissionperm1 = new FilePermission(p1, "read,write"); perm2 = new FilePermission(p2, "write,read");both return "read,write" when the
getActions method is invoked.getActions in class Permission@Nullable public Application getApplication()
public int hashCode()
Permission
The required hashCode behavior for Permission Objects is the following:
hashCode method must consistently return the same integer.
This integer need not remain consistent from one execution of an application to another execution
of the same application.
equals method, then calling
the hashCode method on each of the two Permission objects must produce the same
integer result.
hashCode in class PermissionObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean implies(@Nullable Permission permission)
PermissionThis must be implemented by subclasses of Permission, as they are the only ones that can impose semantics on a Permission object.
implies in class Permissionpermission - the permission to check against.