Establishing a connection
The ODServer class provides methods for connecting to a Content Manager OnDemand server and disconnecting from the server.
Procedure
To establish a connection to a Content Manager OnDemand server, program the following tasks in your ODWEK application:
- Instantiate an ODConfig object with correct property values.
- Instantiate an ODServer object with the ODConfig object.
- Initialize the ODServer object.
- Perform a logon with a valid OnDemand ID.
Example
The following example uses a Content Manager OnDemand library server named
LIBSRVR1
,
the user ID ADMIN
, password PASSWD
,
and port number 1450. The example creates an ODServer object for the Content Manager OnDemand server, connects to it,
works with it (not specified in the example), and then disconnects
from it. odServer = new ODServer( new ODConfig() );
int port = Integer.parseInt(’1450’);
System.out.println( "Logging on to " + "LIBSRVR1" + "..." );
odServer.setPort(port);
odServer.logon( "LIBSRVR1", "ADMIN", "PASSWD" );
.
.
.
odServer.logoff( );
odServer.terminate( );