| | |
| | | // or PHASE_APPLY. |
| | | private boolean _isAcceptable; |
| | | |
| | | // Indicates whether administrative action is required or not. Used when |
| | | // _configPhase is PHASE_APPLY. |
| | | private boolean _isAdminActionRequired; |
| | | |
| | | /** |
| | | * Create an error handler. |
| | | * |
| | |
| | | ArrayList<Message> errorMessages |
| | | ) |
| | | { |
| | | _configPhase = configPhase; |
| | | _unacceptableReasons = unacceptableReasons; |
| | | _errorMessages = errorMessages; |
| | | _resultCode = ResultCode.SUCCESS; |
| | | _isAcceptable = true; |
| | | _configPhase = configPhase; |
| | | _unacceptableReasons = unacceptableReasons; |
| | | _errorMessages = errorMessages; |
| | | _resultCode = ResultCode.SUCCESS; |
| | | _isAcceptable = true; |
| | | _isAdminActionRequired = false; |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | case PHASE_INIT: |
| | | { |
| | | _errorMessages.add (error); |
| | | _isAcceptable = isAcceptable; |
| | | break; |
| | | } |
| | | case PHASE_ACCEPTABLE: |
| | | { |
| | | _unacceptableReasons.add (error); |
| | | _isAcceptable = isAcceptable; |
| | | break; |
| | | } |
| | | case PHASE_APPLY: |
| | | { |
| | | _errorMessages.add (error); |
| | | _isAcceptable = isAcceptable; |
| | | if (_resultCode == ResultCode.SUCCESS) |
| | | { |
| | | _resultCode = resultCode; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Report an error. |
| | | * |
| | | * @param error the error to report |
| | | * @param isAcceptable <code>true</code> if the configuration is acceptable |
| | | * @param resultCode the change result for the current configuration |
| | | * @param isAdminActionRequired <code>true</code> if administrative action |
| | | * is required or <code>false</code> otherwise |
| | | */ |
| | | public void reportError( |
| | | Message error, |
| | | boolean isAcceptable, |
| | | ResultCode resultCode, |
| | | boolean isAdminActionRequired |
| | | ) |
| | | { |
| | | switch (_configPhase) |
| | | { |
| | | case PHASE_INIT: |
| | | { |
| | | logError (error); |
| | | break; |
| | | } |
| | |
| | | { |
| | | _resultCode = resultCode; |
| | | } |
| | | _isAdminActionRequired = isAdminActionRequired; |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | return _configPhase; |
| | | } |
| | | |
| | | /** |
| | | * Get the current isAdminActionRequired flag as determined after apply |
| | | * action has been taken on a given configuration. |
| | | * |
| | | * @return the isAdminActionRequired flag |
| | | */ |
| | | public boolean getIsAdminActionRequired() |
| | | { |
| | | return _isAdminActionRequired; |
| | | } |
| | | } // ConfigErrorHandler |
| | | |
| | | |