All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ioc.commons.integration.dataaccess.dao.SubscriptionChangeHandler Maven / Gradle / Ivy

Go to download

This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.

There is a newer version: 1.2.1
Show newest version
package org.ioc.commons.integration.dataaccess.dao;

/**
 * Handler for a subscripted change performed on an entity
 * 
 * @author Jesús Lunar Pérez
 * 
 * @param 
 */
public interface SubscriptionChangeHandler {
	/**
	 * Type of subscriptable changes on an entity
	 * 
	 * @author Jesús Lunar Pérez
	 * 
	 */
	public enum ChangeType {
		/**
		 * Notifies when an entity has been persisted
		 */
		PERSISTED,
		/**
		 * Notifies when an entity has been updated
		 */
		UPDATED,
		/**
		 * Notifies when an entity has been deleted
		 */
		DELETED
	}

	/**
	 * Method which will be called when a subscribed change has occurred.
	 * 
	 * @param sender
	 *            Sender for the change
	 * @param id
	 *            Unique identifier of the entity which has been changed.
	 * @param changeType
	 *            Type of change occurred.
	 */
	void handleSubscription(Object sender, I id, ChangeType changeType);

}