Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://angel.cs.msu.su/projects/system/javadoc/server/Core.html
Дата изменения: Tue Dec 21 00:38:44 2004 Дата индексирования: Sat Apr 9 23:51:39 2016 Кодировка: |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHttpServlet
server.Core
Klass Core
predstavlyaet soboj' yadro Sistemy Obrabotki
E'ksperimental'nyx Dannyx, realizovannoe v vide servleta.
Vse zaprosy ot klientov obrabatyvayutsya metodom doPost()
.
doPost(HttpServletRequest req, HttpServletResponse resp)
,
Serialized FormNested Class Summary | |
private class |
Core.DaemonConnection
|
private class |
Core.ReturnNeeded
|
private class |
Core.ServerLogger
|
private class |
Core.TaskScheduler
|
private class |
Core.TaskStarter
|
Field Summary | |
(package private) java.sql.Connection |
con
|
(package private) static java.util.Map |
daemonConnections
|
(package private) static int |
daemonIds
|
(package private) static boolean |
debug
Flag otladki. |
(package private) static java.lang.String |
localImportDir
|
(package private) static java.lang.String |
sysDBDriver
|
(package private) static java.lang.String |
sysDBLocation
|
(package private) static java.lang.String |
sysDBPassword
|
(package private) static java.lang.String |
sysDBUsername
|
(package private) static java.lang.String |
sysNCDir
|
(package private) static java.lang.String |
sysSSHDir
|
(package private) static java.lang.String |
sysWebPage
|
(package private) static java.util.Vector |
taskList
|
Constructor Summary | |
Core()
|
Method Summary | |
void |
connectDB()
Soedinyaemsya s sistemnoj' BD |
java.io.File |
createNewUniqueFile(UserInfo info,
java.io.File directory)
|
void |
doGet(HttpServletRequest req,
HttpServletResponse resp)
Metod doGet() perenapravlyaet brauzer na saj't Sistemy. |
void |
doPost(HttpServletRequest req,
HttpServletResponse resp)
Poluchaet zapros ot klienta, obrabatyvaet ego i vozvrashchaet rezul'tat. |
void |
ensureUserDir(java.io.File userdir)
Proveryaet nalichie pol'zovatel'skoj' poddirektorii v sistemnoj' direktorii sxem netCDF. |
private void |
execAtHost(Task task)
|
private void |
execAtHostHttp(Task task)
|
private void |
execAtHostSsh(Task task)
|
private void |
execAtHostSshSI(Task task)
|
private void |
execCleanup(Task task)
|
private void |
execException(java.lang.String message)
|
void |
extractSchema(java.io.File fin,
java.io.File fout)
Metod extractSchema() vyrezaet sxemu iz faj'la NetCDF
i soxranyaet ego v drugom faj'le.
|
private java.lang.String[] |
fetchHosts()
|
private java.lang.String[] |
fetchMethods(java.lang.String table)
|
private void |
findHost(Task task)
|
private Task[] |
getBackgroundList(UserInfo info,
boolean justCompleted)
Spisok fonovyx processov |
private java.lang.String[] |
getDataList(UserInfo info)
Vozvrashchaet spisok faj'lov v pol'zovatel'skoj' direktorii. |
private void |
getFromHost(Task task)
|
UserInfo |
getUserInfo(java.lang.String username,
java.lang.String password)
Metod getUserInfo() vybiraet iz BD informaciyu
po pol'zovatelyu i osushchestvlyaet avtorizaciyu. |
java.lang.String |
getUserNCDir(UserInfo info)
Vozvrashchaet imya pol'zovatel'skoj' poddirektorii v sistemnoj' direktorii sxem NetCDF. |
void |
init(ServletConfig config)
Metod init() - inicializaciya servleta.
|
void |
log(java.lang.String msg)
Metod log() pishet soobshcheniya v servletnyj' log, no tol'ko
esli ustanovlen flag otladki debug . |
(package private) java.lang.String |
parseErrors(java.sql.SQLException e)
Sostavlyaet soobshchenie ob oshibke po ob~ektu SQLException . |
private void |
processNewData(Task task)
|
private void |
putToHost(Task task)
|
void |
sendResponse(GeneralResponse r,
java.io.ObjectOutputStream out)
Posylaet otvet klientu. |
void |
serveAuthRequest(AuthRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Obrabatyvaet zapros na avtorizaciyu. |
void |
serveAYTRequest(AYTRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Metod serveAYTRequest() obrabatyvaet zapros
"Are You There?" |
private void |
serveCallDaemonRequest(CallDaemonRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveDeleteRequest(DeleteRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Obrabatyvaet zaprosy na udalenie dannyx |
private void |
serveDropDaemonRequest(DropDaemonRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveExecModuleRequest(ExecModuleRequest r,
UserInfo info,
java.io.ObjectOutputStream outStream)
Obrabatyvaet zaprosy na vypolnenie metoda |
void |
serveGetBackgroundListRequest(GetBackgroundListRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Obrabatyvaet zaprosy na spisok fonovyx processov XXX Rename this legacy, there're no backgrounds... |
void |
serveGetDataListRequest(GetDataListRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Vozvrashchaet spisok dostupnyx pol'zovatelyu dannyx. |
void |
serveGetDataRequest(GetDataRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Vozvrashchaet klientu ukazannyj' netCDF-faj'l. |
void |
serveGetHostListRequest(GetHostListRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveGetHostLoadRequest(GetHostLoadRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveGetMethodListRequest(GetMethodListRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Vozvrashchaet klientu spisok dostupnyx emu metodov. |
void |
serveGetSchemaRequest(GetSchemaRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Vozvrashchaet klientu sxemu ukazannogo netCDF-faj'la. |
private void |
serveGiveDaemonDataRequest(GiveDaemonDataRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveImportRequest(ImportRequest r,
UserInfo info,
java.io.ObjectOutputStream outStream)
Obrabatyvaet zaprosy na import faj'lov v Sistemu. |
void |
servePutDataRequest(PutDataRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
Poluchaet ot klienta ukazannyj' netCDF-faj'l. |
void |
serveStartDaemonRequest(StartDaemonRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
private void |
serveSyncAndDeleteDaemonDataRequest(SyncAndDeleteDaemonDataRequest r,
UserInfo info,
java.io.ObjectOutputStream out)
|
void |
serveUnauthRequest(java.lang.String reason,
java.io.ObjectOutputStream out)
Obrabatyvaet zaprosy, ne proshedshie avtorizaciyu. |
void |
serveUnknownRequest(java.io.ObjectOutputStream out)
Obrabatyvaet neizvestnye zaprosy. |
private Core.DaemonConnection |
startDaemonAtHost(java.lang.String cgibin,
java.lang.String daemonProgram)
|
private boolean |
taskIsReadyForStart(Task task)
|
private void |
watchForTaskRunning(Task task)
For Standard Interface tasks only: checks for task status periodically. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final boolean debug
static java.lang.String sysWebPage
static java.lang.String sysDBLocation
static java.lang.String sysDBDriver
static java.lang.String sysDBUsername
static java.lang.String sysDBPassword
static java.lang.String sysNCDir
static java.lang.String sysSSHDir
static java.lang.String localImportDir
static java.util.Vector taskList
static java.util.Map daemonConnections
static int daemonIds
java.sql.Connection con
Constructor Detail |
public Core()
Method Detail |
public void log(java.lang.String msg)
log()
pishet soobshcheniya v servletnyj' log, no tol'ko
esli ustanovlen flag otladki debug
.
public void init(ServletConfig config) throws ServletException
init()
- inicializaciya servleta.
Chitaet argumenty, peredannye servletu.
ServletException
public void connectDB() throws ServletException
ServletException
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void sendResponse(GeneralResponse r, java.io.ObjectOutputStream out) throws java.io.IOException
GeneralResponse
ili ego nasledniki.
r
- Ob~ekt, posylaemyj' kak otvet.
java.io.IOException
- pri vozniknovenii oshibki vvoda/vyvoda.public void serveAYTRequest(AYTRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
serveAYTRequest()
obrabatyvaet zapros
"Are You There?", to est' prosto posylaet podtverzhdenie.
E'tot tip zaprosa vveden dlya otladochnyx celej'.
java.io.IOException
public void serveAuthRequest(AuthRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetDataListRequest(GetDataListRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetSchemaRequest(GetSchemaRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetDataRequest(GetDataRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void servePutDataRequest(PutDataRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetMethodListRequest(GetMethodListRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private java.lang.String[] fetchMethods(java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
private java.lang.String[] fetchHosts() throws java.sql.SQLException
java.sql.SQLException
public void serveImportRequest(ImportRequest r, UserInfo info, java.io.ObjectOutputStream outStream) throws java.io.IOException
java.io.IOException
public void serveExecModuleRequest(ExecModuleRequest r, UserInfo info, java.io.ObjectOutputStream outStream) throws java.io.IOException
java.io.IOException
public void serveStartDaemonRequest(StartDaemonRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void serveCallDaemonRequest(CallDaemonRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void serveDropDaemonRequest(DropDaemonRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private Core.DaemonConnection startDaemonAtHost(java.lang.String cgibin, java.lang.String daemonProgram) throws ExecException
ExecException
private void serveGiveDaemonDataRequest(GiveDaemonDataRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void serveSyncAndDeleteDaemonDataRequest(SyncAndDeleteDaemonDataRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void findHost(Task task) throws java.sql.SQLException, ExecException
java.sql.SQLException
ExecException
private void putToHost(Task task) throws java.io.IOException
java.io.IOException
private void execAtHost(Task task) throws java.io.IOException, ExecException, java.lang.InterruptedException
java.io.IOException
ExecException
java.lang.InterruptedException
private void execAtHostSshSI(Task task) throws java.io.IOException, ExecException, java.lang.InterruptedException
task
-
java.io.IOException
ExecException
java.lang.InterruptedException
private void watchForTaskRunning(Task task) throws java.io.IOException, ExecException, java.lang.InterruptedException
task
-
java.io.IOException
ExecException
java.lang.InterruptedException
private void execAtHostHttp(Task task) throws java.io.IOException, ExecException
java.io.IOException
ExecException
private void execAtHostSsh(Task task) throws java.io.IOException, ExecException
java.io.IOException
ExecException
private void getFromHost(Task task) throws java.io.IOException
java.io.IOException
private void processNewData(Task task) throws java.io.IOException
java.io.IOException
private void execCleanup(Task task) throws java.io.IOException
java.io.IOException
public void serveGetBackgroundListRequest(GetBackgroundListRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private Task[] getBackgroundList(UserInfo info, boolean justCompleted)
justCompleted
- Esli true, vozvrashchayutsya zavershennye zadachi
(oni udalyayutsya iz spiska),
esli false, vse zadachi.public void serveDeleteRequest(DeleteRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetHostListRequest(GetHostListRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveGetHostLoadRequest(GetHostLoadRequest r, UserInfo info, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveUnknownRequest(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public void serveUnauthRequest(java.lang.String reason, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private java.lang.String[] getDataList(UserInfo info) throws java.io.IOException
java.io.IOException
public UserInfo getUserInfo(java.lang.String username, java.lang.String password) throws AuthorizeException
getUserInfo()
vybiraet iz BD informaciyu
po pol'zovatelyu i osushchestvlyaet avtorizaciyu.
AuthorizeException
- esli avtorizaciya ne proj'denapublic void ensureUserDir(java.io.File userdir) throws java.io.IOException
java.io.IOException
- esli direktoriya ne sushchestvuet i ne mozhet
byt' sozdanapublic java.lang.String getUserNCDir(UserInfo info)
public java.io.File createNewUniqueFile(UserInfo info, java.io.File directory) throws java.io.IOException
java.io.IOException
public void extractSchema(java.io.File fin, java.io.File fout) throws java.io.IOException
extractSchema()
vyrezaet sxemu iz faj'la NetCDF
i soxranyaet ego v drugom faj'le.
E'tot metod vyzyvaetsya dlya kazhdogo novogo faj'la i ispol'zuetsya dlya
sozdaniya lokal'nogo spiska dannyx kazhdogo pol'zovatelya. Sxemy
posylayutsya klientam pri zaprose "GetDataSchema".
fin
- isxodnyj' faj'l NetCDFfout
- faj'l, v kotoryj' nuzhno zapisat' sxemu
java.io.IOException
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException
doGet()
perenapravlyaet brauzer na saj't Sistemy.
ServletException
java.io.IOException
java.lang.String parseErrors(java.sql.SQLException e)
SQLException
.
private boolean taskIsReadyForStart(Task task)
private void execException(java.lang.String message) throws ExecException
ExecException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |