TextProtocol.java
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:6k
- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- VideoServer application
- $Id: TextProtocol.java,v 1.16 1999/03/01 03:01:10 andrew Exp $
- */
- package edu.sunysb.cs.ecsl.videoserver;
- /** defines arrays of 3 fields: keyword, shord description, long description
- */
- public interface TextProtocol {
- int KEY = 0;
- int SHDESC = 1;
- int LDESC = 2;
- /** protocol words.
- From server:
- */
- String[] _prompt_ = { ">>>" };
- String[] _shutdown_ = { "#!shutdown" };
- String[] _disconnect_ = { "#!disconnect" };
- /** From client:
- */
- String[] _kill_server_ = { "kill", "kill session" };
- String[] _superuser_ = { "superuser", "change mode to superuser" };
- String[] _debug_level_ = { "debug", "debug [level]" };
- String[] _help_ = { "help", "help" };
- /** ask current or set the database name
- */
- String[] _database_name_ = { "database", "get or set database name" };
- String[] _list_movies_ = { "listmovies", "list all movies" };
- String[] _list_mov_files_ = { "listmovfiles",
- "list files in movie with specified id" };
- String[] _list_captions_ = { "listcaptions",
- "list captions in movie with specified id" };
- String[] _play_movie_ =
- { "playmovie", "play movie with specified id",
- "command accepts 3 parameters, each on separate line: " +
- "movie id, time, destination IP-addr" };
- String[] _list_channels_ =
- { "listchannels", "get the list of available channels",
- "returns the number of channels to list and then 4 lines per channel: " +
- "Id number, port, description and status (active/inactive)" };
-
- /** protected commands
- */
- String[] _add_new_movie_ =
- { "addnewmovie", "add movie to database",
- "command accepts 3 parameters, each on separate line: " +
- "name of the movie, start time, stop time" };
- String[] _add_movie_file_ =
- { "addmoviefile",
- "add new movie file to the movie with specified id",
- "command accepts 4 parameters, each on separate line: " +
- "id, name of mpeg file, start time, stop time" };
- String[] _add_caption_ =
- { "addcaption",
- "add caption text to the movie with specified id",
- "command accepts 3 parameters, each on separate line: " +
- "id, time, text" };
- String[] _add_caption_noid_ =
- { "addcaptionnoid",
- "add caption text to the movie. Movie Id for this acquisition server " +
- "is known by database server. ",
- "command accepts 2 parameters, each on separate line: " +
- "time, text" };
- String[] _save_properties_ =
- { "saveproperties", "save properties",
- "save properties of server to the file and continue the session. " +
- "This command does not have any arguments" };
- String[] _list_properties_ =
- { "listproperties", "list properties", "returns number of properties " +
- "N and a list of N*3 key, value and help strings" };
- String[] _set_property_ =
- { "setproperty", "set property", "set just single property to new value. " +
- "Accept two lines: key and value. Don't save to file" };
- // String[] _setup_acquisition_stream_ =
- // { "setacqstream", "setup acquisition stream", "connect to acquisition " +
- // "server, 2 arguments: push server IP and port number" };
- String[] _start_recording_ =
- { "startrecording", "start recording", "client tell that this channel " +
- "should be recorded. Single parameter on a separate line: channel id" };
- String[] _stop_recording_ =
- { "stoprecording", "stop recording", "client tell that this channel " +
- "should be not recorded anymore. Single parameter on a separate line: " +
- "channel id" };
- /** commands from acquisition server
- */
- String[] _register_acquisition_server_ =
- { "registeracquisitionserver", "register acquisition server",
- "No parameters, just tell that this client is not player, but the " +
- "acquisition server" };
- String[] _set_channel_description_ =
- { "setchanneldescription", "set channel description", "First line is the " +
- "number of lines in description, then actual text" };
- String[] _request_broadcast_parameters_ =
- { "requestbroadcastparameters", "request broadcast parameters",
- "Acquisition server tell that it wants to know where to broadcast data. " +
- "Reply the number of push servers to connect and for each push server " +
- "send 4 lines: ID, the address, the control UDP port number and the " +
- "broadcst TCP port number. " +
- "Acquisition server should: 1. send the command to control port to " +
- "wait for the connection, 2. open the TCP connection to " +
- "post MPEG data, 3. on failure: report and go to step 1 after timeout" };
- String[] _push_server_ok_ =
- { "pushserverok", "push server ok", "tell database server that this push " +
- "server operates fine. 1 argument: push server id" };
- String[] _push_server_bad_ =
- { "pushserverbad", "push server bad", "tell database server that this " +
- "push server have problem. 2 arguments: push server id and problem " +
- "description" };
- /** commands to push server
- */
- String[] push__set_filename_ =
- { "setfilename", "set filename", "push server must store what it have on " +
- "the input to this file" };
- String[] push__stop_recording_ =
- { "stoprecording", "stop recording", "this push server continue to operate, "
- + "but don't store files on disk" };
- // String[] push__accept_stream_ =
- // { "acceptstream", "accept broadcast stream", "database video server " +
- // "informs the push server that it should accept broadcast TCP data from " +
- // "acquisition server. 1 Parameter: port number." };
- String[] push__add_broadcast_destination_ =
- { "addbroadcastdestination", "add broadcast destination", "Just after the " +
- "_accept_stream_ command, database video server tell the push server " +
- "where to broacast this channel. If more than 1 broadcast addresses - " +
- "make several calls. Parameters: IP addr, port" };
- }