org.rhq.enterprise.server.sync.validators
Class MaxCountValidator<T>

java.lang.Object
  extended by org.rhq.enterprise.server.sync.validators.MaxCountValidator<T>
All Implemented Interfaces:
EntityValidator<T>

public class MaxCountValidator<T>
extends Object
implements EntityValidator<T>

Author:
Lukas Krejci

Constructor Summary
MaxCountValidator(int max)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxCountValidator

public MaxCountValidator(int max)
Method Detail

initialize

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

Specified by:
initialize in interface EntityValidator<T>
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

public void validateExportedEntity(T entity)
                            throws ValidationException
Description copied from interface: EntityValidator
Validates a single entity before it is imported. The supplied entity has one of the types returned by #getValidatedEntityTypes().

Specified by:
validateExportedEntity in interface EntityValidator<T>
Throws:
ValidationException


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