Bug 536647 (RHQ-976)

Summary: OperationResult should contain an explicit notion of 'isSuccess'/'isFailure'
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: OperationsAssignee: Joseph Marques <jmarques>
Status: CLOSED NEXTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: high    
Version: 1.1Keywords: Improvement
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-976
Whiteboard:
Fixed In Version: 1.2 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Heiko W. Rupp 2008-10-13 08:00:00 UTC
We have seen a lot of strange effects / displays around returned operation values.
The OperationResult should get an explicit field denoting if the operation resulted in an error or not.
Currently this is done by  throwing an Exception in the plugin.
The 'get*Result()' in OperationResult does not help, as it is free text

Comment 1 Heiko W. Rupp 2009-01-14 15:23:09 UTC
See also https://jira.jboss.org/jira/browse/JOPR-47

Comment 2 John Mazzitelli 2009-01-14 15:32:04 UTC
OperationsResults should add a new "isSuccessful()" method that returns true or false. "setSuccessful(boolean)" will allow the plugin developer to tell the server if this operation failed or succeeded.

The PC now needs to examine isSuccessful() to determine if it needs to call operationSuccess or operationFailure on the server service (the PC's exception handling can remain the same).

The server service impl needs to add a new Configuration results parameter to its operationFailure() method. *This can be null* - if its null, it should be ignored by the server-service impl on the server (this will be null when the failure was detected via an exception being thrown by the plugin or PC).

Comment 3 Joseph Marques 2009-01-14 18:45:40 UTC
rev2631 - provide mechanism to allow plugin developers to provide a specific failure message, as opposed to being forced to throw an exception out of the invokeOperation method; 
this allows them to fill in additional details into the complexResults object, such as capture stdout/stderr at the time of failure or even error/return codes; 

Comment 4 Ian Springer 2009-01-20 20:07:01 UTC
embjopr r113 updates Embedded's OperationServerService impl to conform to the new API.


Comment 5 Corey Welton 2009-02-18 17:24:23 UTC
QA Verified

Comment 6 Red Hat Bugzilla 2009-11-10 21:20:49 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-976