Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Core Class Reference

#include </tmp/quassel/src/core/core.h>

Collaboration diagram for Core:

Public Slots

void syncStorage ()
 Make storage data persistent.
void setupInternalClientSession (InternalPeer *clientConnection)
QString setupCore (const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData)

Signals

void bufferInfoUpdated (UserId user, const BufferInfo &info)
 Sent when a BufferInfo is updated in storage.
void sessionState (const Protocol::SessionState &sessionState)
 Relay from CoreSession::sessionState(). Used for internal connection only.

Public Member Functions

OidentdConfigGeneratoroidentdConfigGenerator () const

Static Public Member Functions

static Coreinstance ()
static void destroy ()
static void saveState ()
static void restoreState ()
static UserId validateUser (const QString &userName, const QString &password)
 Validate user.
static bool changeUserPassword (UserId userId, const QString &password)
 Change a user's password.
static void setUserSetting (UserId userId, const QString &settingName, const QVariant &data)
 Store a user setting persistently.
static QVariant getUserSetting (UserId userId, const QString &settingName, const QVariant &defaultValue=QVariant())
 Retrieve a persistent user setting.
static IdentityId createIdentity (UserId user, CoreIdentity &identity)
static bool updateIdentity (UserId user, const CoreIdentity &identity)
static void removeIdentity (UserId user, IdentityId identityId)
static QList< CoreIdentityidentities (UserId user)
static bool createNetwork (UserId user, NetworkInfo &info)
 Create a Network in the Storage and store it's Id in the given NetworkInfo.
static bool updateNetwork (UserId user, const NetworkInfo &info)
 Apply the changes to NetworkInfo info to the storage engine.
static bool removeNetwork (UserId user, const NetworkId &networkId)
 Permanently remove a Network and all the data associated with it.
static QList< NetworkInfonetworks (UserId user)
 Returns a list of all NetworkInfos for the given UserId user.
static QList< NetworkIdconnectedNetworks (UserId user)
 Get a list of Networks to restore.
static void setNetworkConnected (UserId user, const NetworkId &networkId, bool isConnected)
 Update the connected state of a network.
static QHash< QString, QString > persistentChannels (UserId user, const NetworkId &networkId)
 Get a hash of channels with their channel keys for a given network.
static void setChannelPersistent (UserId user, const NetworkId &networkId, const QString &channel, bool isJoined)
 Update the connected state of a channel.
static void setPersistentChannelKey (UserId user, const NetworkId &networkId, const QString &channel, const QString &key)
 Update the key of a channel.
static QString awayMessage (UserId user, NetworkId networkId)
 retrieve last known away message for session restore
static void setAwayMessage (UserId user, NetworkId networkId, const QString &awayMsg)
 Make away message persistent for session restore.
static QString userModes (UserId user, NetworkId networkId)
 retrieve last known user mode for session restore
static void setUserModes (UserId user, NetworkId networkId, const QString &userModes)
 Make our user modes persistent for session restore.
static BufferInfo bufferInfo (UserId user, const NetworkId &networkId, BufferInfo::Type type, const QString &buffer="", bool create=true)
 Get the unique BufferInfo for the given combination of network and buffername for a user.
static BufferInfo getBufferInfo (UserId user, const BufferId &bufferId)
 Get the unique BufferInfo for a bufferId.
static bool storeMessage (Message &message)
 Store a Message in the storage backend and set it's unique Id.
static bool storeMessages (MessageList &messages)
 Store a list of Messages in the storage backend and set their unique Id.
static QList< MessagerequestMsgs (UserId user, BufferId bufferId, MsgId first=-1, MsgId last=-1, int limit=-1)
 Request a certain number messages stored in a given buffer.
static QList< MessagerequestAllMsgs (UserId user, MsgId first=-1, MsgId last=-1, int limit=-1)
 Request a certain number of messages across all buffers.
static QList< BufferInforequestBuffers (UserId user)
 Request a list of all buffers known to a user.
static QList< BufferIdrequestBufferIdsForNetwork (UserId user, NetworkId networkId)
 Request a list of BufferIds for a given NetworkId.
static bool removeBuffer (const UserId &user, const BufferId &bufferId)
 Remove permanently a buffer and it's content from the storage backend.
static bool renameBuffer (const UserId &user, const BufferId &bufferId, const QString &newName)
 Rename a Buffer.
static bool mergeBuffersPermanently (const UserId &user, const BufferId &bufferId1, const BufferId &bufferId2)
 Merge the content of two Buffers permanently. This cannot be reversed!
static void setBufferLastSeenMsg (UserId user, const BufferId &bufferId, const MsgId &msgId)
 Update the LastSeenDate for a Buffer.
static QHash< BufferId, MsgIdbufferLastSeenMsgIds (UserId user)
 Get a Hash of all last seen message ids.
static void setBufferMarkerLineMsg (UserId user, const BufferId &bufferId, const MsgId &msgId)
 Update the MarkerLineMsgId for a Buffer.
static QHash< BufferId, MsgIdbufferMarkerLineMsgIds (UserId user)
 Get a Hash of all marker line message ids.
static QDateTime startTime ()
static bool isConfigured ()
static bool sslSupported ()
static QVariantList backendInfo ()
static QString setup (const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData)
static QTimer & syncTimer ()

Static Public Attributes

static const int AddClientEventId = QEvent::registerEventType()

Protected Member Functions

virtual void customEvent (QEvent *event)

Private Slots

bool startListening ()
void stopListening (const QString &msg=QString())
void incomingConnection ()
void clientDisconnected ()
bool initStorage (const QString &backend, const QVariantMap &settings, bool setup=false)
void socketError (QAbstractSocket::SocketError err, const QString &errorString)
void setupClientSession (RemotePeer *, UserId)
void changeUserPass (const QString &username)

Private Member Functions

 Core ()
 ~Core ()
void init ()
SessionThreadsessionForUser (UserId userId, bool restoreState=false)
void addClientHelper (RemotePeer *peer, UserId uid)
QString setupCoreForInternalUsage ()
void registerStorageBackends ()
bool registerStorageBackend (Storage *)
void unregisterStorageBackends ()
void unregisterStorageBackend (Storage *)
bool selectBackend (const QString &backend)
void createUser ()
void saveBackendSettings (const QString &backend, const QVariantMap &settings)
QVariantMap promptForSettings (const Storage *storage)

Static Private Member Functions

static AbstractSqlMigrationReadergetMigrationReader (Storage *storage)
static AbstractSqlMigrationWritergetMigrationWriter (Storage *storage)
static void stdInEcho (bool on)
static void enableStdInEcho ()
static void disableStdInEcho ()

Private Attributes

QSet< CoreAuthHandler * > _connectingClients
QHash< UserId, SessionThread * > _sessions
Storage_storage
QTimer _storageSyncTimer
QTcpServer _server
QTcpServer _v6server
OidentdConfigGenerator_oidentdConfigGenerator
QHash< QString, Storage * > _storageBackends
QDateTime _startTime
bool _configured

Static Private Attributes

static Coreinstanceptr = 0

Detailed Description

Definition at line 53 of file core.h.

Constructor & Destructor Documentation

~Core ( )
private

Definition at line 219 of file core.cpp.

References _connectingClients, _sessions, and _storageBackends.

Member Function Documentation

void destroy ( )
static

Definition at line 77 of file core.cpp.

References instanceptr.

Referenced by CoreApplicationInternal::~CoreApplicationInternal().

void saveState ( )
static
void restoreState ( )
static
static UserId validateUser ( const QString &  userName,
const QString &  password 
)
inlinestatic

Validate user.

Parameters
userNameThe user's login name
passwordThe user's uncrypted password
Returns
The user's ID if valid; 0 otherwise

Definition at line 73 of file core.h.

References _storage, instance(), and Storage::validateUser().

Referenced by CoreSession::changePassword(), and CoreAuthHandler::handle().

bool changeUserPassword ( UserId  userId,
const QString &  password 
)
static

Change a user's password.

Parameters
userIdThe user's ID
passwordThe user's unencrypted new password
Returns
true, if the password change was successful

Definition at line 821 of file core.cpp.

References _storage, instance(), isConfigured(), SignedId::isValid(), and Storage::updateUser().

Referenced by CoreSession::changePassword().

static void setUserSetting ( UserId  userId,
const QString &  settingName,
const QVariant &  data 
)
inlinestatic

Store a user setting persistently.

Parameters
userIdThe users Id
settingNameThe Name of the Setting
dataThe Value

Definition at line 92 of file core.h.

References _storage, instance(), and Storage::setUserSetting().

Referenced by CoreNetworkConfig::save(), CoreAliasManager::save(), CoreIgnoreListManager::save(), and CoreBufferViewManager::saveBufferViews().

static QVariant getUserSetting ( UserId  userId,
const QString &  settingName,
const QVariant &  defaultValue = QVariant() 
)
inlinestatic

Retrieve a persistent user setting.

Parameters
userIdThe users Id
settingNameThe Name of the Setting
defaultValueValue to return in case it's unset.
Returns
the Value of the Setting or the default value if it is unset.

Definition at line 105 of file core.h.

References _storage, Storage::getUserSetting(), and instance().

Referenced by INIT_SYNCABLE_OBJECT().

static IdentityId createIdentity ( UserId  user,
CoreIdentity identity 
)
inlinestatic

Definition at line 112 of file core.h.

References _storage, Storage::createIdentity(), and instance().

static bool updateIdentity ( UserId  user,
const CoreIdentity identity 
)
inlinestatic

Definition at line 118 of file core.h.

References _storage, instance(), and Storage::updateIdentity().

Referenced by CoreSession::updateIdentityBySender().

static void removeIdentity ( UserId  user,
IdentityId  identityId 
)
inlinestatic

Definition at line 124 of file core.h.

References _storage, instance(), and Storage::removeIdentity().

static QList<CoreIdentity> identities ( UserId  user)
inlinestatic

Definition at line 130 of file core.h.

References _storage, Storage::identities(), and instance().

Referenced by CoreSession::loadSettings().

bool createNetwork ( UserId  user,
NetworkInfo info 
)
static

Create a Network in the Storage and store it's Id in the given NetworkInfo.

Note
This method is thredsafe.
Parameters
userThe core user
networkInfoa NetworkInfo definition to store the newly created ID in
Returns
true if successfull.

Definition at line 407 of file core.cpp.

References _storage, Storage::createNetwork(), instance(), SignedId::isValid(), and NetworkInfo::networkId.

Referenced by CoreSession::createNetwork().

static bool updateNetwork ( UserId  user,
const NetworkInfo info 
)
inlinestatic

Apply the changes to NetworkInfo info to the storage engine.

Note
This method is thredsafe.
Parameters
userThe core user
networkInfoThe Updated NetworkInfo
Returns
true if successfull.

Definition at line 152 of file core.h.

References _storage, instance(), and Storage::updateNetwork().

Referenced by CoreSession::loadSettings(), and CoreNetwork::requestSetNetworkInfo().

static bool removeNetwork ( UserId  user,
const NetworkId networkId 
)
inlinestatic

Permanently remove a Network and all the data associated with it.

Note
This method is thredsafe.
Parameters
userThe core user
networkIdThe network to delete
Returns
true if successfull.

Definition at line 165 of file core.h.

References _storage, instance(), and Storage::removeNetwork().

Referenced by CoreSession::destroyNetwork().

static QList<NetworkInfo> networks ( UserId  user)
inlinestatic

Returns a list of all NetworkInfos for the given UserId user.

Note
This method is thredsafe.
Parameters
userThe core user
Returns
QList<NetworkInfo>.

Definition at line 177 of file core.h.

References _storage, instance(), and Storage::networks().

Referenced by CoreSession::loadSettings().

static QList<NetworkId> connectedNetworks ( UserId  user)
inlinestatic

Get a list of Networks to restore.

Return a list of networks the user was connected at the time of core shutdown

Note
This method is threadsafe.
Parameters
userThe User Id in question

Definition at line 189 of file core.h.

References _storage, Storage::connectedNetworks(), and instance().

Referenced by CoreSession::restoreSessionState().

static void setNetworkConnected ( UserId  user,
const NetworkId networkId,
bool  isConnected 
)
inlinestatic

Update the connected state of a network.

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network
isConnectedwhether the network is connected or not

Definition at line 202 of file core.h.

References _storage, instance(), and Storage::setNetworkConnected().

Referenced by CoreNetwork::networkInitialized(), and CoreNetwork::socketDisconnected().

static QHash<QString, QString> persistentChannels ( UserId  user,
const NetworkId networkId 
)
inlinestatic

Get a hash of channels with their channel keys for a given network.

The keys are channel names and values are passwords (possibly empty)

Note
This method is threadsafe
Parameters
userThe id of the networks owner
networkIdThe Id of the network

Definition at line 215 of file core.h.

References _storage, instance(), and Storage::persistentChannels().

static void setChannelPersistent ( UserId  user,
const NetworkId networkId,
const QString &  channel,
bool  isJoined 
)
inlinestatic

Update the connected state of a channel.

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network
channelThe name of the channel
isJoinedwhether the channel is connected or not

Definition at line 229 of file core.h.

References _storage, instance(), and Storage::setChannelPersistent().

Referenced by CoreSession::createNetwork(), CoreNetwork::setChannelJoined(), and CoreNetwork::setChannelParted().

static void setPersistentChannelKey ( UserId  user,
const NetworkId networkId,
const QString &  channel,
const QString &  key 
)
inlinestatic

Update the key of a channel.

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network
channelThe name of the channel
keyThe key of the channel (possibly empty)

Definition at line 243 of file core.h.

References _storage, instance(), and Storage::setPersistentChannelKey().

Referenced by CoreSession::createNetwork(), and CoreNetwork::setChannelJoined().

static QString awayMessage ( UserId  user,
NetworkId  networkId 
)
inlinestatic

retrieve last known away message for session restore

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network

Definition at line 255 of file core.h.

References _storage, Storage::awayMessage(), and instance().

Referenced by CoreNetwork::networkInitialized().

static void setAwayMessage ( UserId  user,
NetworkId  networkId,
const QString &  awayMsg 
)
inlinestatic

Make away message persistent for session restore.

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network
awayMsgThe current away message of own user

Definition at line 268 of file core.h.

References _storage, instance(), and Storage::setAwayMessage().

Referenced by CoreNetwork::disconnectFromIrc().

static QString userModes ( UserId  user,
NetworkId  networkId 
)
inlinestatic

retrieve last known user mode for session restore

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network

Definition at line 280 of file core.h.

References _storage, instance(), and Storage::userModes().

Referenced by CoreNetwork::restoreUserModes(), and CoreNetwork::updatePersistentModes().

static void setUserModes ( UserId  user,
NetworkId  networkId,
const QString &  userModes 
)
inlinestatic

Make our user modes persistent for session restore.

Note
This method is threadsafe
Parameters
userThe Id of the networks owner
networkIdThe Id of the network
userModesThe current user modes of own user

Definition at line 293 of file core.h.

References _storage, instance(), and Storage::setUserModes().

Referenced by CoreNetwork::resetPersistentModes(), and CoreNetwork::updatePersistentModes().

static BufferInfo bufferInfo ( UserId  user,
const NetworkId networkId,
BufferInfo::Type  type,
const QString &  buffer = "",
bool  create = true 
)
inlinestatic

Get the unique BufferInfo for the given combination of network and buffername for a user.

Note
This method is threadsafe.
Parameters
userThe core user who owns this buffername
networkIdThe network id
typeThe type of the buffer (StatusBuffer, Channel, etc.)
bufferThe buffer name (if empty, the net's status buffer is returned)
createWhether or not the buffer should be created if it doesnt exist
Returns
The BufferInfo corresponding to the given network and buffer name, or 0 if not found

Definition at line 309 of file core.h.

References _storage, Storage::bufferInfo(), and instance().

Referenced by CoreSession::createNetwork(), CoreNetwork::networkInitialized(), CoreSession::processMessages(), and CoreSession::renameBuffer().

static BufferInfo getBufferInfo ( UserId  user,
const BufferId bufferId 
)
inlinestatic

Get the unique BufferInfo for a bufferId.

Note
This method is threadsafe
Parameters
userThe core user who owns this buffername
bufferIdThe id of the buffer
Returns
The BufferInfo corresponding to the given buffer id, or an invalid BufferInfo if not found.

Definition at line 321 of file core.h.

References _storage, Storage::getBufferInfo(), and instance().

Referenced by CoreBufferSyncer::mergeBuffersPermanently(), CoreBufferSyncer::removeBuffer(), and CoreBufferSyncer::renameBuffer().

static bool storeMessage ( Message message)
inlinestatic

Store a Message in the storage backend and set it's unique Id.

Note
This method is threadsafe.
Parameters
messageThe message object to be stored
Returns
true on success

Definition at line 333 of file core.h.

References _storage, instance(), and Storage::logMessage().

Referenced by CoreSession::processMessages().

static bool storeMessages ( MessageList messages)
inlinestatic

Store a list of Messages in the storage backend and set their unique Id.

Note
This method is threadsafe.
Parameters
messagesThe list message objects to be stored
Returns
true on success

Definition at line 345 of file core.h.

References _storage, instance(), and Storage::logMessages().

Referenced by CoreSession::processMessages().

static QList<Message> requestMsgs ( UserId  user,
BufferId  bufferId,
MsgId  first = -1,
MsgId  last = -1,
int  limit = -1 
)
inlinestatic

Request a certain number messages stored in a given buffer.

Parameters
bufferThe buffer we request messages from
firstif != -1 return only messages with a MsgId >= first
lastif != -1 return only messages with a MsgId < last
limitif != -1 limit the returned list to a max of entries
Returns
The requested list of messages

Definition at line 358 of file core.h.

References _storage, instance(), and Storage::requestMsgs().

Referenced by CoreBacklogManager::requestBacklog().

static QList<Message> requestAllMsgs ( UserId  user,
MsgId  first = -1,
MsgId  last = -1,
int  limit = -1 
)
inlinestatic

Request a certain number of messages across all buffers.

Parameters
firstif != -1 return only messages with a MsgId >= first
lastif != -1 return only messages with a MsgId < last
limitMax amount of messages
Returns
The requested list of messages

Definition at line 370 of file core.h.

References _storage, instance(), and Storage::requestAllMsgs().

Referenced by CoreBacklogManager::requestBacklogAll().

static QList<BufferInfo> requestBuffers ( UserId  user)
inlinestatic

Request a list of all buffers known to a user.

This method is used to get a list of all buffers we have stored a backlog from.

Note
This method is threadsafe.
Parameters
userThe user whose buffers we request
Returns
A list of the BufferInfos for all buffers as requested

Definition at line 383 of file core.h.

References _storage, instance(), and Storage::requestBuffers().

Referenced by CoreSession::buffers(), and CoreBufferSyncer::purgeBufferIds().

static QList<BufferId> requestBufferIdsForNetwork ( UserId  user,
NetworkId  networkId 
)
inlinestatic

Request a list of BufferIds for a given NetworkId.

Note
This method is threadsafe.
Parameters
userThe user whose buffers we request
networkIdThe NetworkId of the network in question
Returns
List of BufferIds belonging to the Network

Definition at line 396 of file core.h.

References _storage, instance(), and Storage::requestBufferIdsForNetwork().

Referenced by CoreSession::destroyNetwork().

static bool removeBuffer ( const UserId user,
const BufferId bufferId 
)
inlinestatic

Remove permanently a buffer and it's content from the storage backend.

This call cannot be reverted!

Note
This method is threadsafe.
Parameters
userThe user who is the owner of the buffer
bufferIdThe bufferId
Returns
true if successfull

Definition at line 410 of file core.h.

References _storage, instance(), and Storage::removeBuffer().

Referenced by CoreBufferSyncer::removeBuffer().

static bool renameBuffer ( const UserId user,
const BufferId bufferId,
const QString &  newName 
)
inlinestatic

Rename a Buffer.

Note
This method is threadsafe.
Parameters
userThe id of the buffer owner
bufferIdThe bufferId
newNameThe new name of the buffer
Returns
true if successfull

Definition at line 423 of file core.h.

References _storage, instance(), and Storage::renameBuffer().

Referenced by CoreBufferSyncer::renameBuffer().

static bool mergeBuffersPermanently ( const UserId user,
const BufferId bufferId1,
const BufferId bufferId2 
)
inlinestatic

Merge the content of two Buffers permanently. This cannot be reversed!

Note
This method is threadsafe.
Parameters
userThe id of the buffer owner
bufferId1The bufferId of the remaining buffer
bufferId2The buffer that is about to be removed
Returns
true if successfulln

Definition at line 436 of file core.h.

References _storage, instance(), and Storage::mergeBuffersPermanently().

Referenced by CoreBufferSyncer::mergeBuffersPermanently().

static void setBufferLastSeenMsg ( UserId  user,
const BufferId bufferId,
const MsgId msgId 
)
inlinestatic

Update the LastSeenDate for a Buffer.

This Method is used to make the LastSeenDate of a Buffer persistent

Note
This method is threadsafe.
Parameters
userThe Owner of that Buffer
bufferIdThe buffer id
MsgIdThe Message id of the message that has been just seen

Definition at line 450 of file core.h.

References _storage, instance(), and Storage::setBufferLastSeenMsg().

Referenced by CoreBufferSyncer::storeDirtyIds().

static QHash<BufferId, MsgId> bufferLastSeenMsgIds ( UserId  user)
inlinestatic

Get a Hash of all last seen message ids.

This Method is called when the Quassel Core is started to restore the lastSeenMsgIds

Note
This method is threadsafe.
Parameters
userThe Owner of the buffers

Definition at line 462 of file core.h.

References _storage, Storage::bufferLastSeenMsgIds(), and instance().

static void setBufferMarkerLineMsg ( UserId  user,
const BufferId bufferId,
const MsgId msgId 
)
inlinestatic

Update the MarkerLineMsgId for a Buffer.

This Method is used to make the marker line position of a Buffer persistent

Note
This method is threadsafe.
Parameters
userThe Owner of that Buffer
bufferIdThe buffer id
MsgIdThe Message id where the marker line should be placed

Definition at line 476 of file core.h.

References _storage, instance(), and Storage::setBufferMarkerLineMsg().

Referenced by CoreBufferSyncer::storeDirtyIds().

static QHash<BufferId, MsgId> bufferMarkerLineMsgIds ( UserId  user)
inlinestatic

Get a Hash of all marker line message ids.

This Method is called when the Quassel Core is started to restore the MarkerLineMsgIds

Note
This method is threadsafe.
Parameters
userThe Owner of the buffers

Definition at line 488 of file core.h.

References _storage, Storage::bufferMarkerLineMsgIds(), and instance().

static QDateTime startTime ( )
inlinestatic

Definition at line 494 of file core.h.

References _startTime, and instance().

Referenced by CoreCoreInfo::coreData(), and CoreAuthHandler::handle().

static bool isConfigured ( )
inlinestatic

Definition at line 495 of file core.h.

References _configured, and instance().

Referenced by changeUserPassword(), and CoreAuthHandler::handle().

bool sslSupported ( )
static

Definition at line 420 of file core.cpp.

References _server, and instance().

Referenced by CoreAuthHandler::handle(), and CoreAuthHandler::onReadyRead().

QVariantList backendInfo ( )
static
QString setup ( const QString &  adminUser,
const QString &  adminPassword,
const QString &  backend,
const QVariantMap &  setupData 
)
static

Definition at line 277 of file core.cpp.

References instance(), and setupCore().

Referenced by CoreAuthHandler::handle().

static QTimer& syncTimer ( )
inlinestatic

Definition at line 501 of file core.h.

References _storageSyncTimer, and instance().

OidentdConfigGenerator* oidentdConfigGenerator ( ) const
inline

Definition at line 503 of file core.h.

References _oidentdConfigGenerator.

void syncStorage ( )
slot

Make storage data persistent.

Note
This method is threadsafe.

Definition at line 399 of file core.cpp.

References _storage, and Storage::sync().

Referenced by Core().

void setupInternalClientSession ( InternalPeer clientConnection)
slot
QString setupCore ( const QString &  adminUser,
const QString &  adminPassword,
const QString &  backend,
const QVariantMap &  setupData 
)
slot
void bufferInfoUpdated ( UserId  user,
const BufferInfo info 
)
signal

Sent when a BufferInfo is updated in storage.

Referenced by initStorage().

void sessionState ( const Protocol::SessionState sessionState)
signal

Relay from CoreSession::sessionState(). Used for internal connection only.

void customEvent ( QEvent *  event)
protectedvirtual
void stopListening ( const QString &  msg = QString())
privateslot

Definition at line 507 of file core.cpp.

References _server, and _v6server.

Referenced by incomingConnection(), and setupInternalClientSession().

void incomingConnection ( )
privateslot
void clientDisconnected ( )
privateslot

Definition at line 551 of file core.cpp.

References _configured, _connectingClients, AuthHandler::socket(), and startListening().

Referenced by incomingConnection().

bool initStorage ( const QString &  backend,
const QVariantMap &  settings,
bool  setup = false 
)
privateslot
void socketError ( QAbstractSocket::SocketError  err,
const QString &  errorString 
)
privateslot

Definition at line 645 of file core.cpp.

Referenced by incomingConnection().

void setupClientSession ( RemotePeer peer,
UserId  uid 
)
privateslot

Definition at line 570 of file core.cpp.

References _connectingClients, and sessionForUser().

Referenced by incomingConnection().

void changeUserPass ( const QString &  username)
privateslot
SessionThread * sessionForUser ( UserId  userId,
bool  restoreState = false 
)
private

Definition at line 633 of file core.cpp.

References _sessions.

Referenced by addClientHelper(), restoreState(), setupClientSession(), and setupInternalClientSession().

void addClientHelper ( RemotePeer peer,
UserId  uid 
)
private

Definition at line 599 of file core.cpp.

References SessionThread::addClient(), and sessionForUser().

Referenced by customEvent().

QString setupCoreForInternalUsage ( )
private

Definition at line 304 of file core.cpp.

References _storageBackends, and setupCore().

Referenced by setupInternalClientSession().

void registerStorageBackends ( )
private

Definition at line 321 of file core.cpp.

References registerStorageBackend().

Referenced by Core(), and selectBackend().

bool registerStorageBackend ( Storage backend)
private

Definition at line 329 of file core.cpp.

References _storageBackends, Storage::displayName(), and Storage::isAvailable().

Referenced by registerStorageBackends().

void unregisterStorageBackends ( )
private

Definition at line 342 of file core.cpp.

References _storageBackends.

Referenced by initStorage().

void unregisterStorageBackend ( Storage backend)
private

Definition at line 351 of file core.cpp.

References _storageBackends, and Storage::displayName().

void createUser ( )
private
void saveBackendSettings ( const QString &  backend,
const QVariantMap &  settings 
)
private

Definition at line 860 of file core.cpp.

References CoreSettings::setStorageSettings().

Referenced by selectBackend(), and setupCore().

QVariantMap promptForSettings ( const Storage storage)
private

Definition at line 869 of file core.cpp.

References disableStdInEcho(), enableStdInEcho(), Storage::setupDefaults(), and Storage::setupKeys().

Referenced by selectBackend().

AbstractSqlMigrationReader * getMigrationReader ( Storage storage)
staticprivate

Definition at line 830 of file core.cpp.

References AbstractSqlStorage::createMigrationReader().

Referenced by selectBackend().

AbstractSqlMigrationWriter * getMigrationWriter ( Storage storage)
staticprivate

Definition at line 845 of file core.cpp.

References AbstractSqlStorage::createMigrationWriter().

Referenced by selectBackend().

void stdInEcho ( bool  on)
staticprivate

Definition at line 935 of file core.cpp.

Referenced by disableStdInEcho(), and enableStdInEcho().

static void enableStdInEcho ( )
inlinestaticprivate

Definition at line 581 of file core.h.

References stdInEcho().

Referenced by changeUserPass(), createUser(), and promptForSettings().

static void disableStdInEcho ( )
inlinestaticprivate

Definition at line 582 of file core.h.

References stdInEcho().

Referenced by changeUserPass(), createUser(), and promptForSettings().

Member Data Documentation

const int AddClientEventId = QEvent::registerEventType()
static

Definition at line 505 of file core.h.

Referenced by customEvent().

Core * instanceptr = 0
staticprivate

Definition at line 542 of file core.h.

Referenced by destroy(), and instance().

QSet<CoreAuthHandler *> _connectingClients
private

Definition at line 559 of file core.h.

Referenced by clientDisconnected(), incomingConnection(), setupClientSession(), and ~Core().

QHash<UserId, SessionThread *> _sessions
private

Definition at line 560 of file core.h.

Referenced by restoreState(), saveState(), sessionForUser(), and ~Core().

QTimer _storageSyncTimer
private

Definition at line 562 of file core.h.

Referenced by Core(), and syncTimer().

QTcpServer _server
private

Definition at line 567 of file core.h.

Referenced by init(), sslSupported(), startListening(), and stopListening().

QTcpServer _v6server
private

Definition at line 567 of file core.h.

Referenced by init(), startListening(), and stopListening().

OidentdConfigGenerator* _oidentdConfigGenerator
private

Definition at line 570 of file core.h.

Referenced by init(), and oidentdConfigGenerator().

QDateTime _startTime
private

Definition at line 574 of file core.h.

Referenced by Core(), and startTime().


The documentation for this class was generated from the following files: