Soprano  2.9.2
servercore.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _SOPRANO_SERVER_CORE_H_
23 #define _SOPRANO_SERVER_CORE_H_
24 
25 #include <QtCore/QObject>
26 
27 #include "error.h"
28 #include "soprano_export.h"
29 
30 namespace Soprano {
31 
32  class Backend;
33  class Model;
34  class BackendSetting;
35 
36  namespace Server {
37 
38  class ServerCorePrivate;
39 
75  {
76  Q_OBJECT
77 
78  public:
79  ServerCore( QObject* parent = 0 );
80  virtual ~ServerCore();
81 
85  static const quint16 DEFAULT_PORT;
86 
90  void setBackend( const Backend* backend );
91 
95  const Backend* backend() const;
96 
104  void setBackendSettings( const QList<BackendSetting>& settings );
105 
111  QList<BackendSetting> backendSettings() const;
112 
126  void setMaximumConnectionCount( int max );
127 
138  int maximumConnectionCount() const;
139 
148  virtual Model* model( const QString& name );
149 
163  virtual void removeModel( const QString& name );
164 
170  virtual QStringList allModels() const;
171 
183  bool start( const QString& socketPath = QString() );
184 
201  bool listen( quint16 port = DEFAULT_PORT );
202 
209  void stop();
210 
217  quint16 serverPort() const;
218 
232  void registerAsDBusObject( const QString& objectPath = QString() );
233 
234  private Q_SLOTS:
235  void serverConnectionFinished(QObject* obj);
236 
237  protected:
249  // FIXME: 3.0: this method should be const
250  virtual Model* createModel( const QList<BackendSetting>& settings );
251 
252  private:
253  ServerCorePrivate* const d;
254  };
255  }
256 }
257 
258 #endif
Soprano::Backend defines the interface for a Soprano backend plugin.
Definition: backend.h:263
Core class of Soprano&#39;s exception system.
Definition: error.h:234
#define SOPRANO_SERVER_EXPORT
SOPRANO_EXPORT Model * createModel(const BackendSettings &settings=BackendSettings())
SOPRANO_EXPORT QUrl name()
static const quint16 DEFAULT_PORT
Definition: servercore.h:85
Central Soprano server class.
Definition: servercore.h:74
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.
Definition: model.h:94