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