package org.biomoby.registry.sync.handler;

import org.biomoby.shared.LSIDAccessible;

/**
 * Basic interface for classes to synchronize a specific entry of the mobycentrals (eg MobyServices,
 * MobyDataType etc).<br>
 * 
 * @author groscurt
 * 
 * @param <T>
 *            the type of entry to synchronize
 */
public interface MobyHandler< T extends Comparable & LSIDAccessible > {

	/**
	 * Register a new object to the local moby central.
	 * 
	 * @param object
	 *            the object to register
	 * @return whether the registration was successfull
	 */
	public boolean register( T object );

	/**
	 * Unregister an existing object from the local moby central.
	 * 
	 * @param object
	 *            the object which shall be unregistered
	 * @return whether the unregistration was successfull
	 */
	public boolean unregister( T object );

	/**
	 * Changes the given object in the local repository. First the existing one is unregistered and
	 * then the new one is registered.
	 * 
	 * @param object
	 *            the object to change
	 * @return whether the changing was successfull
	 */
	public boolean change( T object );
}
