package admin;

import java.util.Collection;
import gradebook.ClassGradebook;
import gradebook.ClassData;

/**
 * Derived from Section 2.7 of the requirements.
 */
public abstract class Export {
   /**
    * Setup a server for the currently selected class.
    * @param bookName This String represents the gradebook's name.
    */
    /*@
      ensures
	    //
	    // A server is setup and it contains the data present in the currently
	    // selected class.
	    //
	    server.contains(bookName);
      @*/
   abstract void serverSetup(String bookName);
   
   /**
    * Sync grades for the currently selected class to
    * those grades on the server.
    * @param bookName This String represetns the gradebook's name.
    */
    /*@
      requires
        //
	// A class is open and that class has already has had a server setup
	// for it.
        //
	   server.contains(bookName);
      ensures
        //
	// Currently selected class data syncs to respective classes server.
        //
        \old(server).contains(bookName) != server.contains(bookName);
      @*/
   abstract void postingGrades(String bookName);

   /**
    * Server data for gradebook.
    */
   Collection<Server> server;
}

/**
 * Server for gradebook
 */
abstract class Server {
   /**
    * Name of url for Server.
    */
   String url;
   
   /**
    * Name of gradebook that this Server is setup for.
    */
   String gradebook;
   
   /**
    * Collection of users.
    */
   Collection<UserRecords> users;
}

abstract class UserRecords {
	/**
    * Name of user.
    */
    String user;
	
	/**
    * User's password.
    */
	String password;
}