* @see xregistry.auth.GroupManager#addGrouptoGroup(java.lang.String, java.lang.String)
*/
public void addGrouptoGroup(String groupName, String grouptoAddedName) throws XregistryException {
Group group = getGroup(groupName);
if(group == null){
throw new XregistryException("No such Group "+ groupName);
}
Group grouptoAdd = getGroup(groupName);
if(grouptoAdd == null){
throw new XregistryException("No such Group "+ groupName);
}
if(group.hasGroup(grouptoAddedName)){
throw new XregistryException("Group"+ grouptoAddedName + " already exisits in group "+ groupName);
}
Connection connection = context.createConnection();
try {
PreparedStatement statement = connection.prepareStatement(ADD_GROUP_TO_GROUP_SQL);
statement.setString(1, groupName);
statement.setString(2,grouptoAddedName );
statement.executeUpdate();
group.addGroup(grouptoAdd);
log.info("Add Group "+ groupName + " to "+ grouptoAddedName);
} catch (SQLException e) {
throw new XregistryException(e);
}finally{
context.closeConnection(connection);
}