com.evolveum.midpoint.common.validator
Interface EventHandler


public interface EventHandler

Set of callback methods used to convey information from the validator to the "working" code. It is used e.g. to connect validator to the code that executes import. It makes validator quite a generic tool. E.g. it can be used as the base of the import in the system and the same validator can be used in tests to check the validity of samples.

Author:
Radovan Semancik

Method Summary
 void handleGlobalError(OperationResult currentResult)
          Call-back to handle global errors.
<T extends Objectable>
EventResult
postMarshall(PrismObject<T> object, Element objectElement, OperationResult objectResult)
          Call-back called after the object is unmarshalled.
 EventResult preMarshall(Element objectElement, Node postValidationTree, OperationResult objectResult)
          Call-back called after deserializing to DOM and static schema validation but before unmarshall to JAXB.
 

Method Detail

preMarshall

EventResult preMarshall(Element objectElement,
                        Node postValidationTree,
                        OperationResult objectResult)
Call-back called after deserializing to DOM and static schema validation but before unmarshall to JAXB. It can be used for extra DOM-based checks or transformations of the object.

Parameters:
objectElement - DOM tree parsed from file
postValidationTree - post-validation DOM tree
objectResult - Operation result for this object
Returns:
true if the process should continue, false if it should stop

postMarshall

<T extends Objectable> EventResult postMarshall(PrismObject<T> object,
                                                Element objectElement,
                                                OperationResult objectResult)
Call-back called after the object is unmarshalled. The compliance with static schemas should already be checked. This is the "main" call-back as it is expected that this call-back will do the primary part of work such storing the object to repository during import.

Parameters:
object - unmarshalled JAXB object
objectElement - DOM tree parsed from the fil
objectResult - Operation result for this object
Returns:
true if the process should continue, false if it should stop

handleGlobalError

void handleGlobalError(OperationResult currentResult)
Call-back to handle global errors. This callback will be called with any error that cannot be attributed to any particular object.

Parameters:
currentResult - Operation result pointing to the particular error.


Copyright © 2013 evolveum. All Rights Reserved.