RequestTask

mod:

RequestTask


synopsis:

request processing task

request processing task to be used inside ProcessTask created in RequesteExecutingAgent

class DIRAC.RequestManagementSystem.private.RequestTask.RequestTask(requestJSON, handlersDict, csPath, agentName, standalone=False, requestClient=None, rmsMonitoring=False)

Bases: object

class RequestTask

request’s processing task

__init__(requestJSON, handlersDict, csPath, agentName, standalone=False, requestClient=None, rmsMonitoring=False)

c’tor

Parameters:
  • self – self reference

  • requestJSON (str) – request serialized to JSON

  • opHandlers (dict) – operation handlers

getHandler(operation)
return instance of a handler for a given operation type on demand

all created handlers are kept in self.handlers dict for further use

Parameters:

operation (Operation) – Operation instance

static getPluginName(pluginPath)

return plugin name

loadHandler(pluginPath)

Create an instance of requested plugin class, loading and importing it when needed. This function could raise ImportError when plugin cannot be find or TypeError when loaded class object isn’t inherited from BaseOperation class.

Parameters:

pluginName (str) – dotted path to plugin, specified as in import statement, i.e. “DIRAC.CheesShopSystem.private.Cheddar” or alternatively in ‘normal’ path format “DIRAC/CheesShopSystem/private/Cheddar”

Returns:

object instance

This function try to load and instantiate an object from given path. It is assumed that:

  • pluginPath is pointing to module directory “importable” by python interpreter, i.e.: it’s package’s top level directory is in $PYTHONPATH env variable,

  • the module should consist a class definition following module name,

  • the class itself is inherited from DIRAC.RequestManagementSystem.private.BaseOperation.BaseOperation

If above conditions aren’t meet, function is throwing exceptions:

Raises:
  • ImportError – when class cannot be imported

  • TypeError – when class isn’t inherited from OperationHandlerBase

setupProxy()

download and dump request owner proxy to file and env

Returns:

S_OK with name of newly created owner proxy file and shifter name if any

updateRequest()

put back request to the RequestDB