VServer class interface
Keith DeLong
delong at redcort.com
Tue May 6 11:19:13 CDT 2003
Hi Igor,
> We'd like to know your opinion about VServer class interface that we plan to
> include in the client SDK.
This is so very cool...
> So, this is the details:
>
> To construct VServer object you must do the following:
> mServer = new VServer( host, user, password )
Ruslan and I discussed the ability to run multiple vServer based
applications on the same server. He suggested the following solution:
mServer = new VServer( host, port, user, password )
^^^^
> //Properties
> str = VServer.Version; // Returns the version of currently running VServer
> instance
> long = VServer.ActiveConnectionCount; // Returns the number of active
> connections
> bool = VServer.Available; // Test server for availability
A suggestion For completeness and application error checking. I envision
having a server object that is not performing as expected and wanting to
know where/how it is connected:
long = VSever.host // Returns the host of Vserver object
long = VSever.port // Returns the port of Vserver object
str =VSever.user // Returns the port of Vserver object
For security, I don't think we should retain the password as an object
property.
> //Binding methods;
> //Binds existing database to the VServer;
> //this method tries to find the 'inName'.vdb database file at the
> //location pointed by 'SystemCatalog' variable; if the file
> //exists then new entry will be appended to the 'master' database
> //and the database becomes available to the clients;
> VServer.BindDatabase(Name as String)
> VServer.UnbindDatabase(Name as String)
>
> //methods to work with database
> VServer.DatabaseCount; // Returns the count of databases on the server
> VServer.ActiveDatabase(Index as Integer) //Sets or gets active database
> str = VServer.DatabaseName; //Relative to the active database
> str = VServer.DatabasePath; //Relative to the active database
> long = VServer.ConnectedClients; // Returns the number of clients connected to
> the database at the moment
Very nice :-)
> //Administrative methods
> VServer.Restart(); // Restarts VServer; can be used to apply configuration
> changes
> VServer.Shutdown(Type as Integer); // as Type can be specified: 0 - wait for
> all connections closing
> // or 1 shutdown immediately
How about the ini based server variables?
Str = VServer.SystemCatalog //location of vserver database files
long = VServer.CacheSize // the size of database cache in MB.
bool = Vserver.LogToConsole //enables logging to the console.
bool = Vserver.LogToFile //enables logging to the file.
long = Vserver.LogVerbosity // Verbosity of the the error logs
//0 - display error messages only;
//1 - display errors and warnings;
//2 - display errors, warnings and debugging messages;
//3 - display errors, warnings, debugging messages and command level
> // User methods
> VServer.AddUser(UserName as String, Password as String);
> VServer.RemoveUser(UserName as String);
> VServer.ChangeUserPassword(UserName as String, OldPassword as String,
> NewPassword as String);
>
> Any suggestions will be appreciated.
>
> P.S. Keith, thanks for your idea about Server object.
Thank you so much for your work. I am drooling over vServer after
shoehorning Valentina into a pseudo multi-user mode over 2 years .... It's
been the source of many headaches and a number of new grey hairs :-)
Best,
Keith DeLong
More information about the Valentina
mailing list