The ctkXnatSession class reprents a session object associated with a specific XNAT connection.
More...
#include <Libs/XNAT/Core/ctkXnatSession.h>
|
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 | 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 () |
|
|
QScopedPointer< ctkXnatSessionPrivate > | d_ptr |
|
The ctkXnatSession class reprents a session object associated with a specific XNAT connection.
Definition at line 50 of file ctkXnatSession.h.
◆ HttpRawHeaders
◆ UrlParameters
◆ ctkXnatSession()
◆ ~ctkXnatSession()
ctkXnatSession::~ctkXnatSession |
( |
| ) |
|
◆ close()
void ctkXnatSession::close |
( |
| ) |
|
Closes this XNAT session.
◆ dataModel()
◆ defaultDownloadDir()
QString ctkXnatSession::defaultDownloadDir |
( |
| ) |
const |
returns the default download location
- Returns
- the default download directory as string
◆ download()
Downloads a file from the web service. fileName is the name of the output file. The resource and 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.
◆ exists()
◆ expirationDate()
QDateTime ctkXnatSession::expirationDate |
( |
| ) |
const |
Get the expiration date for this XNAT session.
- See also
- renew()
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
- The session expiration date.
◆ httpGet()
TODO.
- Parameters
-
resource | |
parameters | |
rawHeaders | |
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
◆ httpHead()
QUuid ctkXnatSession::httpHead |
( |
const QString & |
resourceUri | ) |
|
Sends a http HEAD request to the xnat instance.
- Parameters
-
resourceUri | the URL to the server |
- Returns
- the query uid
◆ httpHeadSync()
const QMap<QByteArray, QByteArray> ctkXnatSession::httpHeadSync |
( |
const QUuid & |
uuid | ) |
|
Reads the result of a head request.
- Parameters
-
uuid | the uid of the related query |
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
- a QMap containing the retrieved header information
◆ httpPut()
TODO.
- Parameters
-
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
◆ httpResults()
QList<ctkXnatObject*> ctkXnatSession::httpResults |
( |
const QUuid & |
uuid, |
|
|
const QString & |
schemaType |
|
) |
| |
TODO.
- Parameters
-
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
◆ httpSync()
QList<QVariantMap> ctkXnatSession::httpSync |
( |
const QUuid & |
uuid | ) |
|
TODO.
- Parameters
-
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
◆ isOpen()
bool ctkXnatSession::isOpen |
( |
| ) |
const |
Returns the open state of this XNAT session.
- Returns
true
if the session is open, false
otherwise.
◆ loginProfile()
Get the current login profile for this session object.
- Returns
- A copy of the currently used login profile.
◆ onProgress
void ctkXnatSession::onProgress |
( |
QUuid |
queryId, |
|
|
double |
onProgress |
|
) |
| |
|
slot |
◆ open()
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.
- Exceptions
-
ctkXnatAuthenticationException | if the user credentials are invalid. |
ctkXnatException | (or one of its subclasses) if a network error occurred. |
◆ password()
QString ctkXnatSession::password |
( |
| ) |
const |
Get the password for this XNAT session.
The password is the one specified by the login profile.
- Returns
- The XNAT session password.
◆ processResult
void ctkXnatSession::processResult |
( |
QUuid |
queryId, |
|
|
QList< QVariantMap > |
parameters |
|
) |
| |
|
slot |
◆ progress()
Q_SIGNAL void ctkXnatSession::progress |
( |
QUuid |
, |
|
|
double |
|
|
) |
| |
◆ remove()
◆ renew()
QDateTime ctkXnatSession::renew |
( |
| ) |
|
Re-new the XNAT session.
- Exceptions
-
ctkXnatInvalidSessionException | if the session is closed. |
- Returns
- The new session expiration data.
◆ sessionAboutToBeClosed()
Q_SIGNAL void ctkXnatSession::sessionAboutToBeClosed |
( |
| ) |
|
Signals that the session is about to be closed.
◆ sessionId()
QString ctkXnatSession::sessionId |
( |
| ) |
const |
Get the sessionId for this XNAT session.
- Returns
- The XNAT sessionId.
◆ sessionOpened()
Q_SIGNAL void ctkXnatSession::sessionOpened |
( |
| ) |
|
Signals that the session was just opened.
◆ sessionRenewed()
Q_SIGNAL void ctkXnatSession::sessionRenewed |
( |
const QDateTime & |
expirationDate | ) |
|
Signals that the session was re-newed.
- Parameters
-
expirationDate | The new session expiration date. |
◆ setDefaultDownloadDir()
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.
- Parameters
-
path | the path to the download location |
◆ upload()
Uploads a file to the server. fileName is the name of the file. The resource and 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.
◆ url()
QUrl ctkXnatSession::url |
( |
| ) |
const |
Get XNAT server url.
The url is the one specified by the login profile.
- Returns
- The XNAT server url.
◆ userName()
QString ctkXnatSession::userName |
( |
| ) |
const |
Get the user name for this XNAT session.
The user name is the one specified by the login profile.
- Returns
- The XNAT session user name.
◆ version()
QString ctkXnatSession::version |
( |
| ) |
const |
Get the XNAT server version.
- Returns
- The XNAT version running on the remote server. Returns a null string if the session is not open.
◆ d_ptr
QScopedPointer<ctkXnatSessionPrivate> ctkXnatSession::d_ptr |
|
protected |
The documentation for this class was generated from the following file: