Soprano  2.9.4
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 
112 
126  void setMaximumConnectionCount( int max );
127 
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::Server::ServerCore::model
virtual Model * model(const QString &name)
Soprano::Server::ServerCore::createModel
virtual Model * createModel(const QList< BackendSetting > &settings)
soprano_export.h
SOPRANO_SERVER_EXPORT
#define SOPRANO_SERVER_EXPORT
Definition: soprano_export.h:50
Soprano::Server::ServerCore::setMaximumConnectionCount
void setMaximumConnectionCount(int max)
Soprano::Server::ServerCore::DEFAULT_PORT
static const quint16 DEFAULT_PORT
Definition: servercore.h:85
Soprano::Server::ServerCore::backend
const Backend * backend() const
Soprano::Server::ServerCore::~ServerCore
virtual ~ServerCore()
Soprano::Error::ErrorCache
Core class of Soprano's exception system.
Definition: error.h:235
QList
Soprano::Server::ServerCore::setBackendSettings
void setBackendSettings(const QList< BackendSetting > &settings)
Soprano::Server::ServerCore::stop
void stop()
Soprano::Server::ServerCore::serverPort
quint16 serverPort() const
QObject
Soprano::Server::ServerCore
Central Soprano server class.
Definition: servercore.h:75
Soprano::Server::ServerCore::backendSettings
QList< BackendSetting > backendSettings() const
error.h
Soprano::Server::ServerCore::start
bool start(const QString &socketPath=QString())
Soprano::Server::ServerCore::removeModel
virtual void removeModel(const QString &name)
Soprano::Server::ServerCore::ServerCore
ServerCore(QObject *parent=0)
Soprano::Model
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
Soprano::Vocabulary::Xesam::name
SOPRANO_EXPORT QUrl name()
Soprano::Server::ServerCore::listen
bool listen(quint16 port=DEFAULT_PORT)
Soprano
Definition: backend.h:36
Soprano::Backend
Soprano::Backend defines the interface for a Soprano backend plugin.
Definition: backend.h:264
Soprano::Server::ServerCore::registerAsDBusObject
void registerAsDBusObject(const QString &objectPath=QString())
Soprano::Server::ServerCore::maximumConnectionCount
int maximumConnectionCount() const
Soprano::Server::ServerCore::allModels
virtual QStringList allModels() const
QString
Soprano::Server::ServerCore::setBackend
void setBackend(const Backend *backend)
QStringList