org.rhq.enterprise.server.sync.validators
Interface EntityValidator<T>

All Known Implementing Classes:
MaxCountValidator, SystemSettingsValidator, UniquenessValidator

public interface EntityValidator<T>

Entity validators are declared by importers to validate the entities in the export file before it gets imported.

Author:
Lukas Krejci

Method Summary
 void initialize(org.rhq.core.domain.auth.Subject subject, javax.persistence.EntityManager entityManager)
          Initializes the validator with the current authentication info and access to database.
 void validateExportedEntity(T entity)
          Validates a single entity before it is imported.
 

Method Detail

initialize

void initialize(org.rhq.core.domain.auth.Subject subject,
                javax.persistence.EntityManager entityManager)
Initializes the validator with the current authentication info and access to database. This method is only called during import.

Parameters:
subject - the currently authenticated user
entityManager - the entity manager that can be used to access the database if the validator needs to do so.

validateExportedEntity

void validateExportedEntity(T entity)
                            throws ValidationException
Validates a single entity before it is imported. The supplied entity has one of the types returned by #getValidatedEntityTypes().

Parameters:
entity -
Throws:
ValidationException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.