/* ======================================================================
   Parts Copyright 2006 University of Leeds, Oxford University, University of the Highlands and Islands.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

====================================================================== */

package org.bodington.server.userimport;
import java.util.Collection;


/** Creates and saves groups and their resources, and will also find existing
groups. It is up to the individual information resource packages to implement
this interface, as the rules will be different depending on the incoming data.
<p>
This may take a number of properties from a Properties instance, check the
documentation for your specific implementation for information on what
properties it wants.</p>
<p>
<br/>$HeadURL: https://svn.oucs.ox.ac.uk/sysdev/src/u/usrgrpgen/tags/2.0-3/uk/ac/ox/usrgrpgen/GroupManager.java $
<br/>$LastChangedRevision: 3381 $
<br/>$LastChangedDate: 2004-04-02 16:43:20 +0100 (Fri, 02 Apr 2004) $
<br/>$LastChangedBy: mats $
</p>
@author	Mats Henrikson
@version $LastChangedRevision: 3381 $
*/
public interface GroupManager {


	/** Creates and saves all necessary groups and resources for the user.
	@param	user	The user to create groups for.
	@throws	GroupCreationException	Throws a GCE if something goes wrong.
	*/
	public void createAllGroups(GeneratedUser user)
			throws GroupCreationException;

	/** Puts a User in all the groups they should be in.
	@param	u	The User who should be put in their groups.
	@throws	NotInitialisedException	Throws a NIE if the user has not been
			initialised properly.
	*/
	public void putInGroups(GeneratedUser u) throws NotInitialisedException;


	/** Returns the number of new groups that have been created.
	@return	The number of new groups created.
	*/
	public int getCreatedGroups();


	/** Returns the number of new resources that have been created.
	@return	The number of new resources created.
	*/
	public int getCreatedResources();
}
