10 settembre 2009

annuncio pubblicitario
Corso di Laurea in
Ingegneria Informatica
Ingegneria delle Telecomunicazioni
Appello di Telematica II
10 settembre 2009
COGNOME:_________________ NOME: __________________ MATR.:_____________ CdL:__________
TEMPO TOTALE A DISPOSIZIONE: 75 minuti
Quesito n. 1 (4 punti)
Si provveda a decifrare le seguenti classi di status code per le risposte FTP evidenziando le rispettive
sottoclassi:
1xx:
2xx:
3xx:
4xx:
5xx:
Quesito n. 2 (4 punti)
Chiarire il significato e la modalità di utilizzo di ciascuno dei seguenti campi tipici di un cookie:
–
Comment:
–
Domain:
–
Path:
–
Secure:
Corso di TELEMATICA II
CdL Ing. Informatica
Ing. delle Telecomunicazioni
Corso di Laurea in
Ingegneria Informatica
Ingegneria delle Telecomunicazioni
Appello di Telematica II
Quesito n. 3 (4 punti)
Si spieghi a cosa fanno riferimento le direttive seguenti e se ne fornisca la corretta interpretazione.
options {
directory "/etc/named";
};
zone "." {
type hint;
file "root.hints";
};
zone "59.216.212.in-addr.arpa" {
type master;
file "pz/212.216.59";
};
Quesito n. 4 (4 punti)
Descrivere in forma schematica la struttura di un file .torrent chiarendo il significato e l’utilità di ciascuna
componente.
Corso di TELEMATICA II
CdL Ing. Informatica
Ing. delle Telecomunicazioni
Corso di Laurea in
Ingegneria Informatica
Ingegneria delle Telecomunicazioni
Appello di Telematica II
Quesito n. 5 (14 punti)
Si realizzi, in linguaggio Java, un metodo che gestisca una connessione POP3 lato server. Il metodo sia
dichiarato come
private void serve(Socket s, Map<String, Mailbox> mail) {
// corpo da implementare
}
i cui parametri hanno il seguente significato:
z s è un socket già correttamente inizializzato e pronto per la comunicazione con il client [si suppone cioè
che la connessione sia stata già stabilita – ad esempio mediante la chiamata al metodo accept di un
oggetto di classe ServerSocket – quando viene chiamato il metodo serve];
z mail è un dizionario (Map) che associa lo username di ciascun utente registrato alla corrispondente
casella di posta, rappresentata da un oggetto di classe it.poliba.sisinflab.Mailbox. Si faccia
riferimento alla documentazione Javadoc riportata sul retro.
Occorrerà sviluppare anche gli eventuali metodi chiamati dal suddetto metodo serve. Non occorre, invece,
sviluppare l'intera classe Java che rappresenta un server POP3 completo.
Il server POP3 dovrà supportare i comandi USER, PASS, STAT, DELE e QUIT. In particolare, occorrerà
rilevare e gestire correttamente i seguenti casi di errore:
z
credenziali non valide;
z
invio di un comando di accesso alla mailbox prima che sia stato effettuato correttamente il login;
z
comando non riconosciuto.
Corso di TELEMATICA II
CdL Ing. Informatica
Ing. delle Telecomunicazioni
Corso di Laurea in
Ingegneria Informatica
Ingegneria delle Telecomunicazioni
Appello di Telematica II
Javadoc
java.lang.Integer
public static int parseInt(String s) throws NumberFormatException
Parses the string argument as a signed decimal integer.
Parameters: s - a String containing the int representation to be parsed
Returns:
the integer value represented by the argument in decimal.
Throws:
NumberFormatException - if the string does not contain a parsable
integer.
java.lang.String
public String substring(int beginIndex)
Returns a new string that is a substring of this string.
java.util.Map<K,V>
public V get(K key)
Returns the value to which this map maps the specified key. Returns null if the map
contains no mapping for this key.
Parameters:
key - key whose associated value is to be returned.
Returns:
the value to which this map maps the specified key, or null if the map
contains no mapping for this key.
java.util.List<E>
public boolean add(E element)
Appends the specified element to the end of this list
Parameters:
element – element to append.
Returns:
true
public boolean contains(Object o)
Returns true if this list contains the specified element.
Parameters:
o – object to look for.
Returns:
true if this list contains the object, otherwise false.
it.poliba.sisinflab.Mailbox
public String getPassword()
Returns the password for the mailbox.
public int getMessageCount()
Returns the number of messages in the mailbox.
public int getTotalLength()
Returns the total length of all the messages in the mailbox.
public void deleteMessage(int index)
Deletes a message from the mailbox
Parameters:
index – the ordinal number assigned to the message within the mailbox.
It must be between 1 and the total number of messages in the mailbox.
Corso di TELEMATICA II
CdL Ing. Informatica
Ing. delle Telecomunicazioni
Scarica