|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.Policy | +--PkgAgentSystem.PolicyByValue
A policy where the permissions have to be bought. The price is different for agents, according to their identification (certificates, CA-check successful, ...). The price might be infinite (not available at all), negative (always assigned, or 0 if the permission is free but must be acquired).
Field Summary | |
protected AgentSystem |
agentSystem
|
static byte |
CHALLENGE_ERROR
State of challenging for knowledge of the private key: Error during challenging |
static byte |
CHALLENGE_FAILED
State of challenging for knowledge of the private key: Challenge failed |
static byte |
CHALLENGE_SUCCESS
State of challenging for knowledge of the private key: Challenge completed successfully |
static byte |
NOT_CHALLENGED
State of challenging for knowledge of the private key: Not yet challenged |
Constructor Summary | |
protected |
PolicyByValue(AgentSystem agentSystem)
|
Method Summary | |
DynamicPermissions |
getAdditionalPermissions(AgentData data)
Evaluates the global policy and returns a DynamicPermissions object specifying
the set of optional permissions for code from the specified code source. |
DynamicPermissions |
getBasicPermissions(AgentData data)
Evaluates the global policy and returns a DynamicPermissions object specifying
the set of permissions always allowed for code from the specified code source. |
Permission |
getCheapestPermission(AgentData data,
Permission perm)
Returns the cheapest permission for a certain agent. |
PermissionCollection |
getCheapestPermissionSet(AgentData data,
PermissionCollection perms)
Returns the cheapest price of a set of permissions for a certain agent. Is not an optimal solution (NP-complete problem), but will find a solution if one exists. |
double |
getCheapestPrice(AgentData data,
Permission perm)
Returns the cheapest price of a permission for a certain agent. |
double |
getCheapestSetPrice(AgentData data,
PermissionCollection perms)
Returns the cheapest price of a set of permissions for a certain agent. |
abstract int |
getGroup(AgentData data)
Get the group of permissions and agent belongs to. |
PermissionCollection |
getPermissions(CodeSource codesource)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source. Throws a RuntimeException if certain conditions are not met:
The calling method has AllPermission The package, from where it should
be loaded is marked as privileged |
protected double |
getSetPrice(AgentData data,
PermissionCollection set)
Calculates the price of a set of permissions for a certain agent. |
void |
setPermissionsForGroup(int group,
ValuedPermissions perms)
Sets the permissions for a group. |
Methods inherited from class java.security.Policy |
getPolicy, getPolicyNoCheck, isSet, refresh, setPolicy |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final byte NOT_CHALLENGED
public static final byte CHALLENGE_ERROR
public static final byte CHALLENGE_FAILED
public static final byte CHALLENGE_SUCCESS
protected AgentSystem agentSystem
Constructor Detail |
protected PolicyByValue(AgentSystem agentSystem)
Method Detail |
public abstract int getGroup(AgentData data)
data
- the management data of the agent to sort into a grouppublic void setPermissionsForGroup(int group, ValuedPermissions perms)
public DynamicPermissions getBasicPermissions(AgentData data)
DynamicPermissions
object specifying
the set of permissions always allowed for code from the specified code source.data
- the management data of the agent for which these shall be retrievedSecurityException
- if the current thread does not have permission to call
getPermissions
on the policy object.public DynamicPermissions getAdditionalPermissions(AgentData data)
DynamicPermissions
object specifying
the set of optional permissions for code from the specified code source.data
- the management data of the agent for which these shall be retrievedSecurityException
- if the current thread does not have permission to call
getPermissions
on the policy object.public PermissionCollection getPermissions(CodeSource codesource)
RuntimeException
if certain conditions are not met:
AllPermission
getPermissions
in class Policy
codesource
- the CodeSource associated with the caller.SecurityException
- if the current thread does not have permission to call getPermissions
on the policy object.AgentSystem.isPrivilegedSource(CodeSource)
public double getCheapestPrice(AgentData data, Permission perm)
data
- management data of the agent for which the price shall be determinedperm
- the permission for which the price is requestedgetCheapestPermission(AgentData,Permission)
public double getCheapestSetPrice(AgentData data, PermissionCollection perms)
data
- management data of the agent for which the price shall be determinedperms
- the set of permissions for which the price is requestedgetCheapestPermissionSet(AgentData,PermissionCollection)
protected double getSetPrice(AgentData data, PermissionCollection set)
data
- management data of the agent for which the price shall be determinedperms
- the set of permissions for which the price is requestedpublic Permission getCheapestPermission(AgentData data, Permission perm)
data
- management data of the agent for which the price shall be determinedperm
- the permission for which the cheapest permission is requestedgetCheapestPrice(AgentData,Permission)
public PermissionCollection getCheapestPermissionSet(AgentData data, PermissionCollection perms)
data
- management data of the agent for which the price shall be determinedperms
- the set of permissions for which the cheapest subset is requestedgetCheapestSetPrice(AgentData,PermissionCollection)
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |