|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gradeview.net.GradeViewSession
GradeViewSession provides the GradeView client applet with a simple set of functions through which client-to-server communication (and vice-versa) can take place.
Field Summary | |
static int |
CONNECTION_CLOSED
|
static int |
CONNECTION_READY
|
static java.lang.String |
PROFESSOR_LOGIN
|
static java.lang.String |
STUDENT_LOGIN
|
static java.lang.String |
TA_LOGIN
|
Method Summary | |
void |
disconnect()
Closes the currently active session. |
boolean |
establish(java.lang.String serverAddress,
java.lang.String username,
java.lang.String password)
Establishes a new session, provided one isn't already set up. |
java.lang.String |
getConnectionType()
Returns what sort of user (student, TA, or professor) is using the system. |
static GradeViewSession |
getCurrentSession()
Retrieves the currently active GradeViewSession object. |
java.lang.String |
getServerAddress()
Returns the URL of the session's server. |
boolean |
isEstablished()
Checks if the session is active. |
static org.w3c.dom.Node |
parseToNode(java.lang.String parseMe)
|
org.w3c.dom.Node |
sendData(org.w3c.dom.Node dataNode)
Sends a block of XML-encoded data to the server, waits for a reply, and then parses it. |
org.w3c.dom.Node |
sendData(java.lang.String dataToSend)
Sends a block of XML-encoded data to the server, waits for a reply, and then parses it. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int CONNECTION_CLOSED
public static final int CONNECTION_READY
public static final java.lang.String STUDENT_LOGIN
public static final java.lang.String TA_LOGIN
public static final java.lang.String PROFESSOR_LOGIN
Method Detail |
public static GradeViewSession getCurrentSession()
public void disconnect()
public boolean establish(java.lang.String serverAddress, java.lang.String username, java.lang.String password)
serverAddress
- The URL to connect to.username
- The username to log in with.password
- The password to log in with.public java.lang.String getServerAddress()
public boolean isEstablished()
public java.lang.String getConnectionType()
GradeViewSession.STUDENT_LOGIN
,
GradeViewSession.TA_LOGIN
, or
GradeViewSession.PROF_LOGIN
. If no connection has been
established, then this will return null.public org.w3c.dom.Node sendData(org.w3c.dom.Node dataNode)
dataNode
- The XML-encoded data to send to the server.public org.w3c.dom.Node sendData(java.lang.String dataToSend)
dataNode
- The XML-encoded data to send to the server, represented
as a String
.public static org.w3c.dom.Node parseToNode(java.lang.String parseMe) throws java.io.IOException, org.xml.sax.SAXException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |