Search in sources :

Example 1 with GetStatusRemoteOperation

use of com.owncloud.android.lib.resources.users.GetStatusRemoteOperation in project android by nextcloud.

the class RetrieveStatusAsyncTask method doInBackground.

@Override
protected com.owncloud.android.lib.resources.users.Status doInBackground(Void... voids) {
    try {
        NextcloudClient client = clientFactory.createNextcloudClient(user);
        RemoteOperationResult<com.owncloud.android.lib.resources.users.Status> result = new GetStatusRemoteOperation().execute(client);
        if (result.isSuccess()) {
            return result.getResultData();
        } else {
            return new com.owncloud.android.lib.resources.users.Status(StatusType.OFFLINE, "", "", -1);
        }
    } catch (ClientFactory.CreationException | NullPointerException e) {
        return new com.owncloud.android.lib.resources.users.Status(StatusType.OFFLINE, "", "", -1);
    }
}
Also used : Status(com.owncloud.android.lib.resources.users.Status) GetStatusRemoteOperation(com.owncloud.android.lib.resources.users.GetStatusRemoteOperation) NextcloudClient(com.nextcloud.common.NextcloudClient) Status(com.owncloud.android.lib.resources.users.Status)

Aggregations

NextcloudClient (com.nextcloud.common.NextcloudClient)1 GetStatusRemoteOperation (com.owncloud.android.lib.resources.users.GetStatusRemoteOperation)1 Status (com.owncloud.android.lib.resources.users.Status)1