package com.gitplex.server.manager;

import javax.annotation.Nullable;

import com.gitplex.server.model.Group;
import com.gitplex.server.persistence.dao.EntityManager;

public interface GroupManager extends EntityManager<Group> {
	/**
	 * Save specified group
	 * 
	 * @param group
	 * 			group to save
	 * @param oldName
	 * 			in case of rename, this parameter should hold the original name 
	 * 			when above group object is initially loaded to ensure database 
	 * 			integrity. Use <tt>null</tt> if original name does not exist, 
	 * 			or the name is not changed
	 */
	void save(Group group, @Nullable String oldName);
	
	@Nullable
	Group find(String name);
}
