Search in sources :

Example 1 with TransferTask

use of org.jbei.ice.lib.executor.TransferTask in project ice by JBEI.

the class RemoteEntries method transferEntries.

/**
 * Schedules a task to handle the transfer
 *
 * @param userId    identifier of user making request
 * @param remoteId  local unique identifier for partner to transfer to
 * @param selection context for generating entries to transfer or list of entries
 * @throws PermissionException if user making request is not an administrator
 */
public void transferEntries(String userId, long remoteId, EntrySelection selection) {
    AccountController accountController = new AccountController();
    if (!accountController.isAdministrator(userId))
        throw new PermissionException("Administrative privileges required to transfer entries");
    TransferTask task = new TransferTask(userId, remoteId, selection);
    IceExecutorService.getInstance().runTask(task);
}
Also used : PermissionException(org.jbei.ice.lib.access.PermissionException) TransferTask(org.jbei.ice.lib.executor.TransferTask) AccountController(org.jbei.ice.lib.account.AccountController)

Aggregations

PermissionException (org.jbei.ice.lib.access.PermissionException)1 AccountController (org.jbei.ice.lib.account.AccountController)1 TransferTask (org.jbei.ice.lib.executor.TransferTask)1