PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoUserAssignment.class ) );
database.setPermissions( PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoPermission.class ) );
database.setOperations( PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoOperation.class ) );
database.setResources( PlexusJdoUtils.getAllObjectsDetached( getPersistenceManager(), JdoResource.class ) );
RbacJdoModelStaxWriter writer = new RbacJdoModelStaxWriter();
FileWriter fileWriter = new FileWriter( new File( backupDirectory, RBAC_XML_NAME ) );
try
{
writer.write( fileWriter, database );
}
finally
{
IOUtil.close( fileWriter );
}