|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.ram.policy.Result
public class Result
Indicates the success or failure of a policy test method. A policy test method should not throw an exception. This object contains a return code and a set of ResultEntries. The return code must be one of the following values: ERROR, WARNING, or SUCCESS. Those constant values are defined in the Result class. You can set the values while adding messages or by using the setReturnCode() method. The default value for the new ValidationStatus object is SUCCESS. The return code is set to the level of the highest valued messages. For example, if an entry with an error is set to the ERROR status, a subsequent entry that has a warning will also have an ERROR status. To restore the return code to a lower level, use the setReturnCode() method. You can add entries by invoking the addEntry() method. This method adds entries to an ordered list of diagnostic information that can be made available to the application or user that is invoking the operation. The added entry must have a return code value and a diagnostic message, which might contain links. It might be useful to return policy diagnostic information for the results of any policy test, whether it is a failure or a success.
| Field Summary | |
|---|---|
static int |
ERROR
Policy compliance error |
static int |
PENDING
Policy result pending |
static int |
SUCCESS
Policy compliance success |
static int |
SUCCESS_FORCE_APPROVE
Policy result success force approve. |
static int |
WARNING
Policy compliance warning |
| Constructor Summary | |
|---|---|
Result()
Subclasses will need to include a default constructor (no arguments) |
|
Result(Policy policy)
|
|
| Method Summary | |
|---|---|
void |
addDetail(ResultDetail detail)
Add a ResultDetail to the overall ResultDetail list for this Result |
void |
deserialize(java.lang.String metadata)
Subclasses should override this to hydrate any saved data |
Policy.CustomReturnCode |
getCustomReturnCode()
Get the customReturnCode of this Result. |
ResultDetail[] |
getDetails()
Get a list of the ResultDetail objects for this Result |
java.lang.String |
getMessage()
The descriptive message |
PendingPolicyExecutionInterval |
getPendingExecutionInterval()
|
Policy |
getPolicy()
Get the Policy that this Result references |
int |
getReturnCode()
Get the return code of this Result |
java.lang.String |
serialize()
Subclasses should override this to store any metadata Return any metadata needed for subclasses of Result as a String RAM will call deserialize with this String when hydrating this Result object |
void |
setCustomReturnCode(Policy.CustomReturnCode customReturnCode)
Set the customReturnCode of this Result. |
void |
setMessage(java.lang.String message)
The descriptive message |
void |
setPendingExecutionInterval(PendingPolicyExecutionInterval pendingExecutionInterval)
User can configure the pending execution interval as to when to run the policy. |
void |
setPolicy(Policy policy)
Set the Policy that this Result references |
void |
setReturnCode(int returnCode)
Set the return code for this Result |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SUCCESS_FORCE_APPROVE
Will bypass review process if all other policies are at least WARNING or better.
public static final int SUCCESS
public static final int WARNING
public static final int ERROR
public static final int PENDING
| Constructor Detail |
|---|
public Result(Policy policy)
policy - The Policy this Result referencespublic Result()
| Method Detail |
|---|
public Policy.CustomReturnCode getCustomReturnCode()
The custom return code can be used to configure actions to take based on the outcome of a policy.
public void setCustomReturnCode(Policy.CustomReturnCode customReturnCode)
The custom return code can be used to configure actions to take based on the outcome of a policy.
customReturnCode - The custom return code for this Resultpublic int getReturnCode()
public void setReturnCode(int returnCode)
returnCode - The return code for this Resultpublic Policy getPolicy()
public void setPolicy(Policy policy)
policy - The Policy this Result referencespublic void addDetail(ResultDetail detail)
detail - ResultDetail to add to this Resultpublic ResultDetail[] getDetails()
public java.lang.String getMessage()
public void setMessage(java.lang.String message)
message - The message for the Resultpublic java.lang.String serialize()
public void deserialize(java.lang.String metadata)
metadata - Previously serialized metadata to set for this Resultpublic PendingPolicyExecutionInterval getPendingExecutionInterval()
public void setPendingExecutionInterval(PendingPolicyExecutionInterval pendingExecutionInterval)
pendingExecutionInterval - The pendingExecutionInterval to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||