Changeset 6448


Ignore:
Timestamp:
Apr 16, 2014, 1:29:49 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #1796: Improve support for jobs running on external servers

Added possibility to use a PluginSessionControl with a job but no plug-in. This makes it possible to set the active project to the project for the job and also ensure that change history logging is working as expected (otherwise changes were always listed as made by the root user account).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/SessionControl.java

    r6444 r6448  
    159159    this.dbControlCache = Collections.synchronizedMap(new WeakHashMap<DbControl,String>());
    160160    this.currentContexts = parent.currentContexts;
    161     this.pluginId = plugin.getId();
     161    if (plugin != null) this.pluginId = plugin.getId();
    162162    if (job != null) this.jobId = job.getId();
    163163    LoginInfo li = new LoginInfo(parent.loginInfo);
    164     li.keyring = new Keyring(li.keyring, pluginId, plugin.getUsePermissions());
     164    li.keyring = new Keyring(li.keyring, pluginId, plugin != null && plugin.getUsePermissions());
    165165    this.loginInfo = li;
    166166  }
     
    10241024 
    10251025  /**
     1026    Create a new session control for executing a job. The new session
     1027    control will inherit all settings from this session control.
     1028    @since 3.3
     1029  */
     1030  public PluginSessionControl getJobSessionControl(Job job)
     1031  {
     1032    return Application.newPluginSessionControl(this, null, job);
     1033  }
     1034 
     1035  /**
    10261036    Get the id of the {@link ProjectKey} that can be used to share an item to
    10271037    the active project with full permission, or 0 if no project is active or
Note: See TracChangeset for help on using the changeset viewer.