44 wiersze
1 KiB
Java
44 wiersze
1 KiB
Java
package clavardage;
|
|
import java.beans.PropertyChangeListener;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
|
|
import data.Message;
|
|
|
|
public abstract class SessionClavardage {
|
|
private String idSource = null;
|
|
private String idDestination = null;
|
|
private boolean remote = false;
|
|
|
|
public SessionClavardage(String idSource, String idDestination) {
|
|
this.idSource = idSource;
|
|
this.idDestination = idDestination;
|
|
}
|
|
|
|
public abstract ArrayList <Message> getNewMessages ();
|
|
|
|
public abstract void sendObject(Message message) throws IOException;
|
|
|
|
public abstract void stop();
|
|
|
|
public abstract void addPropertyChangeListener(PropertyChangeListener p);
|
|
public abstract void removePropertyChangeListener(PropertyChangeListener p);
|
|
|
|
|
|
public String toString() {
|
|
return "Session entre " + "this.idSource" + " et " + this.idDestination + System.lineSeparator();
|
|
}
|
|
|
|
public String getIdSource() {
|
|
return this.idSource;
|
|
}
|
|
|
|
public String getIdDestination() {
|
|
return this.idDestination;
|
|
}
|
|
|
|
public boolean isRemote() {
|
|
return this.remote;
|
|
}
|
|
|
|
}
|