![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
The ctkXnatSession class reprents a session object associated with a specific XNAT connection. More...
#include <Libs/XNAT/Core/ctkXnatSession.h>
Public Types | |
typedef QMap< QByteArray, QByteArray > | HttpRawHeaders |
typedef QMap< QString, QString > | UrlParameters |
Public Slots | |
void | onProgress (QUuid queryId, double onProgress) |
void | processResult (QUuid queryId, QList< QVariantMap > parameters) |
Public Member Functions | |
Q_SIGNAL void | aboutToTimeOut () |
Signals that the session will time out in one minute. More... | |
void | close () |
Closes this XNAT session. More... | |
ctkXnatSession (const ctkXnatLoginProfile &loginProfile) | |
ctkXnatDataModel * | dataModel () const |
QString | defaultDownloadDir () const |
returns the default download location More... | |
void | download (const QString &fileName, const QString &resource, const UrlParameters ¶meters=UrlParameters(), const HttpRawHeaders &rawHeaders=HttpRawHeaders()) |
bool | exists (const ctkXnatObject *object) |
QDateTime | expirationDate () const |
Get the expiration date for this XNAT session. More... | |
QUuid | httpGet (const QString &resource, const UrlParameters ¶meters=UrlParameters(), const HttpRawHeaders &rawHeaders=HttpRawHeaders()) |
TODO. More... | |
QUuid | httpHead (const QString &resourceUri) |
Sends a http HEAD request to the xnat instance. More... | |
const QMap< QByteArray, QByteArray > | httpHeadSync (const QUuid &uuid) |
Reads the result of a head request. More... | |
QUuid | httpPut (const QString &resource, const UrlParameters ¶meters=UrlParameters(), const HttpRawHeaders &rawHeaders=HttpRawHeaders()) |
TODO. More... | |
QList< ctkXnatObject * > | httpResults (const QUuid &uuid, const QString &schemaType) |
TODO. More... | |
QList< QVariantMap > | httpSync (const QUuid &uuid) |
TODO. More... | |
bool | isOpen () const |
Returns the open state of this XNAT session. More... | |
ctkXnatLoginProfile | loginProfile () const |
Get the current login profile for this session object. More... | |
void | open () |
Open a new XNAT session. More... | |
QString | password () const |
Get the password for this XNAT session. More... | |
Q_SIGNAL void | progress (QUuid, double) |
void | remove (ctkXnatObject *object) |
QDateTime | renew () |
Re-new the XNAT session. More... | |
Q_SIGNAL void | sessionAboutToBeClosed () |
Signals that the session is about to be closed. More... | |
QString | sessionId () const |
Get the sessionId for this XNAT session. More... | |
Q_SIGNAL void | sessionOpened () |
Signals that the session was just opened. More... | |
Q_SIGNAL void | sessionRenewed (const QDateTime &expirationDate) |
Signals that the session was re-newed. More... | |
void | setDefaultDownloadDir (const QString &path) |
Sets the default location where files will be saved after being downloaded. More... | |
void | setHttpNetworkProxy (const QNetworkProxy &proxy) |
Sets a network proxy that will be used to connect with XNAT. More... | |
Q_SIGNAL void | timedOut () |
Signals that the session has timed out. More... | |
void | upload (ctkXnatFile *xnatFile, const UrlParameters ¶meters=UrlParameters(), const HttpRawHeaders &rawHeaders=HttpRawHeaders()) |
QUrl | url () const |
Get XNAT server url. More... | |
QString | userName () const |
Get the user name for this XNAT session. More... | |
QString | version () const |
Get the XNAT server version. More... | |
~ctkXnatSession () | |
Protected Attributes | |
QScopedPointer< ctkXnatSessionPrivate > | d_ptr |
The ctkXnatSession class reprents a session object associated with a specific XNAT connection.
Definition at line 51 of file ctkXnatSession.h.
typedef QMap<QByteArray, QByteArray> ctkXnatSession::HttpRawHeaders |
Definition at line 58 of file ctkXnatSession.h.
typedef QMap<QString, QString> ctkXnatSession::UrlParameters |
Definition at line 57 of file ctkXnatSession.h.
ctkXnatSession::ctkXnatSession | ( | const ctkXnatLoginProfile & | loginProfile | ) |
ctkXnatSession::~ctkXnatSession | ( | ) |
Q_SIGNAL void ctkXnatSession::aboutToTimeOut | ( | ) |
Signals that the session will time out in one minute.
void ctkXnatSession::close | ( | ) |
Closes this XNAT session.
ctkXnatDataModel* ctkXnatSession::dataModel | ( | ) | const |
QString ctkXnatSession::defaultDownloadDir | ( | ) | const |
returns the default download location
void ctkXnatSession::download | ( | const QString & | fileName, |
const QString & | resource, | ||
const UrlParameters & | parameters = UrlParameters() , |
||
const HttpRawHeaders & | rawHeaders = HttpRawHeaders() |
||
) |
Downloads a file from the web service. fileName is the name of the output file. The resource and \parameters are used to compose the URL. rawHeaders can be used to set the raw headers of the request to send. These headers will be set additionally to those defined by the defaultRawHeaders property.
bool ctkXnatSession::exists | ( | const ctkXnatObject * | object | ) |
QDateTime ctkXnatSession::expirationDate | ( | ) | const |
Get the expiration date for this XNAT session.
ctkXnatInvalidSessionException | if the session is closed. |
QUuid ctkXnatSession::httpGet | ( | const QString & | resource, |
const UrlParameters & | parameters = UrlParameters() , |
||
const HttpRawHeaders & | rawHeaders = HttpRawHeaders() |
||
) |
TODO.
resource | |
parameters | |
rawHeaders |
ctkXnatInvalidSessionException | if the session is closed. |
QUuid ctkXnatSession::httpHead | ( | const QString & | resourceUri | ) |
Sends a http HEAD request to the xnat instance.
resourceUri | the URL to the server |
const QMap<QByteArray, QByteArray> ctkXnatSession::httpHeadSync | ( | const QUuid & | uuid | ) |
Reads the result of a head request.
uuid | the uid of the related query |
ctkXnatInvalidSessionException | if the session is closed. |
QUuid ctkXnatSession::httpPut | ( | const QString & | resource, |
const UrlParameters & | parameters = UrlParameters() , |
||
const HttpRawHeaders & | rawHeaders = HttpRawHeaders() |
||
) |
TODO.
uuid | |
parameters |
ctkXnatInvalidSessionException | if the session is closed. |
QList<ctkXnatObject*> ctkXnatSession::httpResults | ( | const QUuid & | uuid, |
const QString & | schemaType | ||
) |
TODO.
uuid | |
schemaType |
ctkXnatInvalidSessionException | if the session is closed. |
QList<QVariantMap> ctkXnatSession::httpSync | ( | const QUuid & | uuid | ) |
TODO.
uuid |
ctkXnatInvalidSessionException | if the session is closed. |
bool ctkXnatSession::isOpen | ( | ) | const |
Returns the open state of this XNAT session.
true
if the session is open, false
otherwise. ctkXnatLoginProfile ctkXnatSession::loginProfile | ( | ) | const |
Get the current login profile for this session object.
|
slot |
void ctkXnatSession::open | ( | ) |
Open a new XNAT session.
This method must be called on all ctkXnatSession objects before any of the methods which communicate with an XNAT server are called.
If the session has already been opened, this method does nothing.
ctkXnatAuthenticationException | if the user credentials are invalid. |
ctkXnatException | (or one of its subclasses) if a network error occurred. |
QString ctkXnatSession::password | ( | ) | const |
Get the password for this XNAT session.
The password is the one specified by the login profile.
|
slot |
Q_SIGNAL void ctkXnatSession::progress | ( | QUuid | , |
double | |||
) |
void ctkXnatSession::remove | ( | ctkXnatObject * | object | ) |
QDateTime ctkXnatSession::renew | ( | ) |
Re-new the XNAT session.
ctkXnatInvalidSessionException | if the session is closed. |
Q_SIGNAL void ctkXnatSession::sessionAboutToBeClosed | ( | ) |
Signals that the session is about to be closed.
QString ctkXnatSession::sessionId | ( | ) | const |
Get the sessionId for this XNAT session.
Q_SIGNAL void ctkXnatSession::sessionOpened | ( | ) |
Signals that the session was just opened.
Q_SIGNAL void ctkXnatSession::sessionRenewed | ( | const QDateTime & | expirationDate | ) |
Signals that the session was re-newed.
expirationDate | The new session expiration date. |
void ctkXnatSession::setDefaultDownloadDir | ( | const QString & | path | ) |
Sets the default location where files will be saved after being downloaded.
Sets the default directory into which file downloads will be saved. By default this value is empty and files will be stored into the current working directory. If the path does not exists a warning will be printed and the path will be set to the current working directory.
path | the path to the download location |
void ctkXnatSession::setHttpNetworkProxy | ( | const QNetworkProxy & | proxy | ) |
Sets a network proxy that will be used to connect with XNAT.
Tells the qRestAPI to use a network proxy for the connection to XNAT
proxy | the network proxy that will be set |
Q_SIGNAL void ctkXnatSession::timedOut | ( | ) |
Signals that the session has timed out.
void ctkXnatSession::upload | ( | ctkXnatFile * | xnatFile, |
const UrlParameters & | parameters = UrlParameters() , |
||
const HttpRawHeaders & | rawHeaders = HttpRawHeaders() |
||
) |
Uploads a file to the server. fileName is the name of the file. The resource and \parameters are used to compose the URL. rawHeaders can be used to set the raw headers of the request to send. These headers will be set additionally to those defined by the defaultRawHeaders property.
QUrl ctkXnatSession::url | ( | ) | const |
Get XNAT server url.
The url is the one specified by the login profile.
QString ctkXnatSession::userName | ( | ) | const |
Get the user name for this XNAT session.
The user name is the one specified by the login profile.
QString ctkXnatSession::version | ( | ) | const |
Get the XNAT server version.
|
protected |
Definition at line 300 of file ctkXnatSession.h.