UnityMol  0.9.6-875
UnityMol viewer / In developement
BackendManager Class Reference
+ Inheritance diagram for BackendManager:
+ Collaboration diagram for BackendManager:

Public Member Functions

delegate void RequestResponseDelegate (ResponseType responseType, JSONNode jsonResponse, string callee)
 
void PerformRequest (string command, Dictionary< string, object > fields=null, RequestResponseDelegate onResponse=null, string authToken="")
 
void PerformFormRequest (string command, WWWForm wwwForm, string filename, string fileData, RequestResponseDelegate onResponse=null, string authToken="")
 
Session[] getSessions ()
 
void populateSessions (JSONNode responseData)
 
IEnumerator downloadSessionFile (string sessionSlug)
 
delegate void LoggedIn ()
 
delegate void Connecting ()
 
delegate void LoginFailed (string errorMsg)
 
delegate void SessionSuccess ()
 
delegate void RetrievingSession ()
 
delegate void SessionFailed (string errorMsg)
 
delegate void SubmissionSuccess ()
 
delegate void Submitting ()
 
delegate void SubmissionFailed (string errorMsg)
 
bool logged ()
 
void Login (string username, string password)
 
void Logout ()
 
void SubmitPDB (string sessionSlug)
 
void RetrieveSessions ()
 

Public Attributes

bool UseProduction = true
 
string ProductionUrl = "https://hirerna.galaxy.ibpc.fr/api/"
 
string DevelopmentUrl = "http://localhost:8000/api/"
 
LoggedIn OnLoggedIn
 
Connecting OnConnection
 
LoginFailed OnLoginFailed
 
SessionSuccess OnSessionSuccess
 
RetrievingSession OnSession
 
SessionFailed OnSessionFailed
 
SubmissionSuccess OnSubmissionSuccess
 
Submitting OnSubmission
 
SubmissionFailed OnSubmissionFailed
 

Static Public Attributes

static string progress = ""
 

Properties

string hostUrl [get]
 

Private Member Functions

IEnumerator HandleResponse (HttpWebResponse response, RequestResponseDelegate onResponse, string callee)
 
IEnumerator HandleRequest (WWW request, RequestResponseDelegate onResponse, string callee)
 
void OnLoginResponse (ResponseType responseType, JSONNode responseData, string callee)
 
void OnLogoutResponse (ResponseType responseType, JSONNode responseData, string callee)
 
void OnSubmittedPDB (ResponseType responseType, JSONNode responseData, string callee)
 
void OnRetrievedSessions (ResponseType responseType, JSONNode responseData, string callee)
 

Private Attributes

List< Sessionsessions = new List<Session>()
 
string authenticationToken = ""
 

Detailed Description

Definition at line 29 of file BackendManager.cs.

Member Function Documentation

delegate void BackendManager.Connecting ( )
IEnumerator BackendManager.downloadSessionFile ( string  sessionSlug)

Definition at line 48 of file HiRERNABackend.cs.

References Molecule3D.clearScene(), File, and UI.UIData.loadHireRNA.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Session [] BackendManager.getSessions ( )

Definition at line 27 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the caller graph for this function:

IEnumerator BackendManager.HandleRequest ( WWW  request,
RequestResponseDelegate  onResponse,
string  callee 
)
private

Definition at line 181 of file BackendManager.cs.

References SimpleJSON.JSON.Parse().

Referenced by PerformRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

IEnumerator BackendManager.HandleResponse ( HttpWebResponse  response,
RequestResponseDelegate  onResponse,
string  callee 
)
private

Definition at line 130 of file BackendManager.cs.

References SimpleJSON.JSON.Parse().

Referenced by PerformFormRequest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BackendManager.logged ( )

Definition at line 105 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the caller graph for this function:

delegate void BackendManager.LoggedIn ( )
void BackendManager.Login ( string  username,
string  password 
)

Definition at line 110 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the caller graph for this function:

delegate void BackendManager.LoginFailed ( string  errorMsg)
void BackendManager.Logout ( )

Definition at line 150 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the caller graph for this function:

void BackendManager.OnLoginResponse ( ResponseType  responseType,
JSONNode  responseData,
string  callee 
)
private

Definition at line 120 of file HiRERNABackend.cs.

void BackendManager.OnLogoutResponse ( ResponseType  responseType,
JSONNode  responseData,
string  callee 
)
private

Definition at line 155 of file HiRERNABackend.cs.

void BackendManager.OnRetrievedSessions ( ResponseType  responseType,
JSONNode  responseData,
string  callee 
)
private

Definition at line 202 of file HiRERNABackend.cs.

void BackendManager.OnSubmittedPDB ( ResponseType  responseType,
JSONNode  responseData,
string  callee 
)
private

Definition at line 178 of file HiRERNABackend.cs.

void BackendManager.PerformFormRequest ( string  command,
WWWForm  wwwForm,
string  filename,
string  fileData,
RequestResponseDelegate  onResponse = null,
string  authToken = "" 
)

Performs a request to the backend.

Parameters
commandCommand that is pasted after the url to backend. For example: "localhost:8000/api/" + command
wwwFormA WWWForm to send with the request
onResponseA callback which will be called when we retrieve the response
authTokenAn optional authToken which, when set will be put in the Authorization header

Definition at line 96 of file BackendManager.cs.

References UnityMolMain.getVersionString(), HandleResponse(), and hostUrl.

+ Here is the call graph for this function:

void BackendManager.PerformRequest ( string  command,
Dictionary< string, object >  fields = null,
RequestResponseDelegate  onResponse = null,
string  authToken = "" 
)

Performs a request to the backend.

Parameters
commandCommand that is pasted after the url to backend. For example: "localhost:8000/api/" + command
fieldsA list of fields that are send as parameters to the backend
onResponseA callback which will be called when we retrieve the response
authTokenAn optional authToken which, when set will be put in the Authorization header

Definition at line 63 of file BackendManager.cs.

References HandleRequest(), and hostUrl.

+ Here is the call graph for this function:

void BackendManager.populateSessions ( JSONNode  responseData)

Populates the sessions list with received JSON data passed as argument.

Definition at line 33 of file HiRERNABackend.cs.

References SimpleJSON.JSONNode.AsInt, SimpleJSON.JSONNode.Count, Session.id, Session.name, Session.slug, and SimpleJSON.JSONNode.ToString().

+ Here is the call graph for this function:

delegate void BackendManager.RequestResponseDelegate ( ResponseType  responseType,
JSONNode  jsonResponse,
string  callee 
)

The response delegate

Parameters
responseType
jsonResponsethe json object of the response, this can be null when no content is returned(eg. HTTP 204)
calleethe name of the method doing the request(used for testing)
void BackendManager.RetrieveSessions ( )

Definition at line 193 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu(), and HiRERNAContestOldGUI.OnLoggedIn().

+ Here is the caller graph for this function:

delegate void BackendManager.RetrievingSession ( )
delegate void BackendManager.SessionFailed ( string  errorMsg)
delegate void BackendManager.SessionSuccess ( )
delegate void BackendManager.SubmissionFailed ( string  errorMsg)
delegate void BackendManager.SubmissionSuccess ( )
void BackendManager.SubmitPDB ( string  sessionSlug)

Definition at line 162 of file HiRERNABackend.cs.

References SnapshotManager.generateSnapshot(), and HiRERNAContestOldGUI.username.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

delegate void BackendManager.Submitting ( )

Member Data Documentation

string BackendManager.authenticationToken = ""
private

Definition at line 104 of file HiRERNABackend.cs.

string BackendManager.DevelopmentUrl = "http://localhost:8000/api/"

Definition at line 46 of file BackendManager.cs.

Connecting BackendManager.OnConnection

Definition at line 84 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

LoggedIn BackendManager.OnLoggedIn

Definition at line 83 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

LoginFailed BackendManager.OnLoginFailed

Definition at line 85 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

RetrievingSession BackendManager.OnSession

Definition at line 94 of file HiRERNABackend.cs.

SessionFailed BackendManager.OnSessionFailed

Definition at line 95 of file HiRERNABackend.cs.

SessionSuccess BackendManager.OnSessionSuccess

Definition at line 93 of file HiRERNABackend.cs.

Submitting BackendManager.OnSubmission

Definition at line 101 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

SubmissionFailed BackendManager.OnSubmissionFailed

Definition at line 102 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

SubmissionSuccess BackendManager.OnSubmissionSuccess

Definition at line 100 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

string BackendManager.ProductionUrl = "https://hirerna.galaxy.ibpc.fr/api/"

Definition at line 44 of file BackendManager.cs.

string BackendManager.progress = ""
static

Definition at line 25 of file HiRERNABackend.cs.

Referenced by HiRERNAContestOldGUI.HiRERNAContestMenu().

List<Session> BackendManager.sessions = new List<Session>()
private

Definition at line 24 of file HiRERNABackend.cs.

bool BackendManager.UseProduction = true

Definition at line 42 of file BackendManager.cs.

Property Documentation

string BackendManager.hostUrl
getprivate

Definition at line 50 of file BackendManager.cs.

Referenced by PerformFormRequest(), and PerformRequest().


The documentation for this class was generated from the following files: