com.ibm.ram.policy
Class AssetPolicy

java.lang.Object
  extended by com.ibm.ram.policy.Policy
      extended by com.ibm.ram.policy.AssetPolicy
Direct Known Subclasses:
PendingTimerPolicy

public abstract class AssetPolicy
extends Policy

Extends the base Policy class and provides additional access to the asset manifest and artifacts

Since:
7.0.0.1

Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.ram.policy.Policy
Policy.CustomReturnCode
 
Field Summary
static java.lang.String ARTIFACT_ACCESSOR_KEY
          The ARTIFACT_ACCESSOR_KEY can be used to fetch the ArtifactAccessor from the parameter map.
static java.lang.String MANIFEST_ACCESSOR_KEY
          The MANIFEST_ACCESSOR_KEY can be used to fetch the ManifestAccessor from the parameter map.
static java.lang.String POLICY_CONTEXT_KEY
          The POLICY_CONTEXT_KEY can be used to fetch the PolicyContext from the parameter map.
static java.lang.String USER_KEY
          The USER_KEY can be used to fetch the user that triggered the policy to run.
static java.lang.String WHEN_ACCESSOR_KEY
          The WHEN_ACCESSOR_KEY can be used to fetch the event on which the policy is triggered.
 
Constructor Summary
AssetPolicy()
           
 
Method Summary
 ArtifactAccessor getArtifactAccessor()
          Get the accessor to the asset's artifact contents
 int getEvent()
          Get the lifecycle event that triggered this policy
 ManifestAccessor getManifestAccessor()
          Get the accessor to the asset's manifest content
 PolicyContext getPolicyContext()
          Get the PolicyContext containing the com.ibm.ram.internal.jaxb.Asset to be validated with this policy.
 UserInformation getUser()
          Get the user that triggered this policy
 void initialize(java.util.Map<?,?> parameters)
          Initialize the Map of parameters for the policy.
 
Methods inherited from class com.ibm.ram.policy.Policy
getConfigurationDetails, getConfigurationDetails, getCustomReturnCodes, getDescription, getDescription, getID, getName, getName, getParameters, getPolicyGovernor, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLICY_CONTEXT_KEY

public static final java.lang.String POLICY_CONTEXT_KEY
The POLICY_CONTEXT_KEY can be used to fetch the PolicyContext from the parameter map.

Since:
7.2
See Also:
Constant Field Values

MANIFEST_ACCESSOR_KEY

public static final java.lang.String MANIFEST_ACCESSOR_KEY
The MANIFEST_ACCESSOR_KEY can be used to fetch the ManifestAccessor from the parameter map.

Since:
7.1
See Also:
Constant Field Values

ARTIFACT_ACCESSOR_KEY

public static final java.lang.String ARTIFACT_ACCESSOR_KEY
The ARTIFACT_ACCESSOR_KEY can be used to fetch the ArtifactAccessor from the parameter map.

Since:
7.1
See Also:
Constant Field Values

WHEN_ACCESSOR_KEY

public static final java.lang.String WHEN_ACCESSOR_KEY
The WHEN_ACCESSOR_KEY can be used to fetch the event on which the policy is triggered.

Since:
7.1.1
See Also:
Constant Field Values

USER_KEY

public static final java.lang.String USER_KEY
The USER_KEY can be used to fetch the user that triggered the policy to run.

Since:
7.1.1
See Also:
Constant Field Values
Constructor Detail

AssetPolicy

public AssetPolicy()
Method Detail

initialize

public void initialize(java.util.Map<?,?> parameters)
Initialize the Map of parameters for the policy. All classes extending this method should call super.initialize to ensure proper initialization.

Overrides:
initialize in class Policy
Parameters:
parameters - Map of key/value pairs containing configuration details and other runtime parameters.
Since:
7.1

getPolicyContext

public PolicyContext getPolicyContext()
Get the PolicyContext containing the com.ibm.ram.internal.jaxb.Asset to be validated with this policy.

Returns:
The PolicyContext the policy is running against.
Since:
7.2

getArtifactAccessor

public ArtifactAccessor getArtifactAccessor()
Get the accessor to the asset's artifact contents

Returns:
The ArtifactAccessor for the asset
Since:
7.0.0.1

getManifestAccessor

public ManifestAccessor getManifestAccessor()
Get the accessor to the asset's manifest content

Returns:
The ManfiestAccessor for the asset
Since:
7.0.0.1

getEvent

public int getEvent()
Get the lifecycle event that triggered this policy

Returns:
The constant for the lifecycle event As of 7.1.1 constants are found in the ReviewManager
Since:
7.1.1

getUser

public UserInformation getUser()
Get the user that triggered this policy

Returns:
The UserInformation for the user that triggered this policy.
Since:
7.1.1