Repository navigation
Service Deployment
There is a console client application to deploy services on the Mobilis server. The following documentation first describes how to set up the console client and then describes procedures to install and update a service.
To use the console client, you first have to specify login information for your XMPP server.
Open the project MobilisServer_ConsoleClient
Look for the file Settings.properties.template in the project root.
Rename the template file to Settings.properties and modify it to your needs. You need to specify an XMPP username and password for the XMPP server as well as a resource to be used like "deploy@xmpp-server.org/consoleclient".
You also need the user name of the Mobilis server which is e.g. "mobilis" if you created a user named "mobilis" on the XMPP server as described in the documentation on Server Setup.
Now to start the console client, right click on the project MobilisServer_ConsoleClient and select "Run as Java Application". Now you are able to type in commands in the Console window (it should show "Type command:-").
If you want to install a new service on the Mobilis Server hack the following commands into the ConsoleClient:
send {single|multi} path/service.jar
This will upload the JAR file to the server, install it, configure it as single or multi service and register it. The namespace and version number will be fetched from the MSDL contained in the JAR. This is the recommended way of installing a service. If there is already a service with the same namespace and version installed on the server it gets uninstalled and overwritten by the new version automatically. All instances of the old service will be closed!
Alternatively you can do the installation manually:
send path/to/service.jar
install <filename returned by the send command>
configure <namespace returned by the install command / contained in the MSDL> <version number returned by the install command / contained in the MSDL> single|multi
register <namespace returned by the install command / contained in the MSDL> <version number returned by the install command / contained in the MSDL>
If you want to update a running service on a productive server you need to issue the following command sequence. The command sequence is shown for an example where a service with version 2 is updated to version 3. You need to replace file names and version numbers for your use case.
send path/to/service_v3.jar
update service_v3.jar <service namespace> 2
register <service namespace> 3
As you can see, we specify the old version in the second step. We do not need to issue the configure command as the old service is already configured to be a single or multi instance service. If you use this sequence, all clients connected to version 2 may safely finish their sessions. For new clients, only version 3 is shown in the service discovery step.
Besides the two standard procedurces described above, the ConsoleClient supports a number of commands which will be described in the following. For a list of parameters for each command please issue help on the command line.
- configure - configures an already installed service. You have to specify namespace and version of the service. The only configuration option available right now is if the service runs as a single instance or multiple instances.
- connect - connects the admin client to the XMPP server. Connection settings should be set up first using the "set" command. Otherwise it uses the information in the properties file as described above. On startup of the ConsoleClient, connect is automatically issued before the command line is shown.
- discover - discovers all services running on the Mobilis Server. You should see the 3 system services Admin, Coordinator and Deployment as well as a number of user-installed services. For multi instance services you also see the number of instances currently running at the server. You can also discover all running instances of a specific service if you issue the namespace as a parameter. If you set the query msdl parameter to true, the MSDL of the service is downloaded.
- exit - closes the connection to the XMPP server. You can reconnect using the "connect" command.
- help - shows all commands and their parameters
- install - installs a service. You need to specify the jar file to install.
- register - registers a service with its namespace and version. Only works on services already installed and configured.
- send - sends a service file (jar archive) so the server. If you additionally set the single/multi parameter the service is also installed, configured and registered for you.
- set - changes attributes (see help for a list of attributes)
- startsvc - starts a service instance (service needs to be already registered)
- stopsvc - stops a service instance (specify service JID)
- uninstall - de-installs a service (namespace, version). The services gets deleted on the server.
- unregister - unregisters a service (namespace, version). After "unregister" the service is in state Installed.
- update - updates an existing service (archive, namespace, version)
- xmppinfo - shows the state of the connection to the XMPP server as well as settings that may be changed using the set command.
Up: Mobilis Server