1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db;
\r
14 import org.simantics.db.exception.DatabaseException;
\r
16 public interface ServerI {
\r
21 * @throws DatabaseException
\r
23 void start() throws DatabaseException;
\r
26 * Ask server to stop. Server has no obligation to stop.
\r
27 * After this server is either running or not.
\r
28 * You can not and should not make any assumptions on server behavior.
\r
29 * Remember that server lifetime is not under our control.
\r
31 * @throws DatabaseException if server did not receive our plead or had trouble responding.
\r
33 void stop() throws DatabaseException;
\r
36 * Verify if the server is in active and usable state.
\r
38 * @return true if the server is alive and responsive.
\r
40 boolean isActive() throws DatabaseException;
\r
43 * Get the server address. Can be used with {@link Driver#getSession()} and {@link Driver#getServer()} methods.
\r
45 * @return address of the server as canonical string.
\r
47 public String getAddress() throws DatabaseException;
\r
51 // * @throws DatabaseException
\r
52 // * @deprecated Was used for getting server address.
\r
53 // * Changed to string to remove dependency to ServerAddress structure.
\r
54 // * Use Use the {@link #getAddress()} method instead.
\r
56 // public ServerAddress getServerAddress() throws DatabaseException;
\r
59 * Execute server command.
\r
61 * @return command output.
\r
64 public String execute(String command) throws DatabaseException;
\r
67 * Execute server command and disconnect after command has been executed.
\r
69 * @return command output.
\r
71 public String executeAndDisconnect(String command) throws DatabaseException;
\r