xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdCl::PostMaster Class Reference

A hub for dispatching and receiving messages. More...

#include <XrdClPostMaster.hh>

Public Member Functions

 PostMaster ()
 Constructor.
 
virtual ~PostMaster ()
 Destructor.
 
bool Initialize ()
 Initializer.
 
bool Finalize ()
 Finalizer.
 
bool Start ()
 Start the post master.
 
bool Stop ()
 Stop the postmaster.
 
bool Reinitialize ()
 Reinitialize after fork.
 
XRootDStatus Send (const URL &url, Message *msg, MsgHandler *handler, bool stateful, time_t expires)
 
Status Redirect (const URL &url, Message *msg, MsgHandler *handler)
 
Status QueryTransport (const URL &url, uint16_t query, AnyObject &result)
 
Status RegisterEventHandler (const URL &url, ChannelEventHandler *handler)
 Register channel event handler.
 
Status RemoveEventHandler (const URL &url, ChannelEventHandler *handler)
 Remove a channel event handler.
 
TaskManagerGetTaskManager ()
 Get the task manager object user by the post master.
 
JobManagerGetJobManager ()
 Get the job manager object user by the post master.
 
Status ForceDisconnect (const URL &url)
 Shut down a channel.
 
Status ForceReconnect (const URL &url)
 Reconnect the channel.
 
uint16_t NbConnectedStrm (const URL &url)
 Get the number of connected data streams.
 
void SetOnDataConnectHandler (const URL &url, std::shared_ptr< Job > onConnJob)
 Set the on-connect handler for data streams.
 
void SetOnConnectHandler (std::unique_ptr< Job > onConnJob)
 Set the global connection error handler.
 
void SetConnectionErrorHandler (std::function< void(const URL &, const XRootDStatus &)> handler)
 Set the global on-error on-connect handler for control streams.
 
void NotifyConnectHandler (const URL &url)
 Notify the global on-connect handler.
 
void NotifyConnErrHandler (const URL &url, const XRootDStatus &status)
 Notify the global error connection handler.
 
void CollapseRedirect (const URL &oldurl, const URL &newURL)
 Collapse channel URL - replace the URL of the channel.
 
void DecFileInstCnt (const URL &url)
 Decrement file object instance count bound to this channel.
 
bool IsRunning ()
 

Private Member Functions

ChannelGetChannel (const URL &url)
 

Private Attributes

std::unique_ptr< PostMasterImpl > pImpl
 

Detailed Description

A hub for dispatching and receiving messages.

Constructor & Destructor Documentation

◆ PostMaster()

XrdCl::PostMaster::PostMaster ( )

Constructor.

◆ ~PostMaster()

virtual XrdCl::PostMaster::~PostMaster ( )
virtual

Destructor.

Member Function Documentation

◆ CollapseRedirect()

void XrdCl::PostMaster::CollapseRedirect ( const URL oldurl,
const URL newURL 
)

Collapse channel URL - replace the URL of the channel.

◆ DecFileInstCnt()

void XrdCl::PostMaster::DecFileInstCnt ( const URL url)

Decrement file object instance count bound to this channel.

◆ Finalize()

bool XrdCl::PostMaster::Finalize ( )

Finalizer.

◆ ForceDisconnect()

Status XrdCl::PostMaster::ForceDisconnect ( const URL url)

Shut down a channel.

◆ ForceReconnect()

Status XrdCl::PostMaster::ForceReconnect ( const URL url)

Reconnect the channel.

◆ GetChannel()

Channel * XrdCl::PostMaster::GetChannel ( const URL url)
private

◆ GetJobManager()

JobManager * XrdCl::PostMaster::GetJobManager ( )

◆ GetTaskManager()

TaskManager * XrdCl::PostMaster::GetTaskManager ( )

Get the task manager object user by the post master.

◆ Initialize()

bool XrdCl::PostMaster::Initialize ( )

Initializer.

◆ IsRunning()

bool XrdCl::PostMaster::IsRunning ( )
Returns
: true if underlying threads are running, false otherwise

◆ NbConnectedStrm()

uint16_t XrdCl::PostMaster::NbConnectedStrm ( const URL url)

Get the number of connected data streams.

◆ NotifyConnectHandler()

void XrdCl::PostMaster::NotifyConnectHandler ( const URL url)

Notify the global on-connect handler.

◆ NotifyConnErrHandler()

void XrdCl::PostMaster::NotifyConnErrHandler ( const URL url,
const XRootDStatus status 
)

Notify the global error connection handler.

◆ QueryTransport()

Status XrdCl::PostMaster::QueryTransport ( const URL url,
uint16_t  query,
AnyObject result 
)

Query the transport handler for a given URL

Parameters
urlthe channel to be queried
querythe query as defined in the TransportQuery struct or others that may be recognized by the protocol transport
resultthe result of the query
Returns
status of the query

◆ Redirect()

Status XrdCl::PostMaster::Redirect ( const URL url,
Message msg,
MsgHandler handler 
)

◆ RegisterEventHandler()

Status XrdCl::PostMaster::RegisterEventHandler ( const URL url,
ChannelEventHandler handler 
)

Register channel event handler.

◆ Reinitialize()

bool XrdCl::PostMaster::Reinitialize ( )

Reinitialize after fork.

◆ RemoveEventHandler()

Status XrdCl::PostMaster::RemoveEventHandler ( const URL url,
ChannelEventHandler handler 
)

Remove a channel event handler.

◆ Send()

XRootDStatus XrdCl::PostMaster::Send ( const URL url,
Message msg,
MsgHandler handler,
bool  stateful,
time_t  expires 
)

Send the message asynchronously - the message is inserted into the send queue and a listener is called when the message is succesfsully pushed through the wire or when the timeout elapses

DEADLOCK WARNING: no lock should be taken while calling this method that are used in the callback as well.

Parameters
urlrecipient of the message
msgmessage to be sent
expiresunix timestamp after which a failure is reported to the handler
handlerhandler will be notified about the status
statefulphysical stream disconnection causes an error
Returns
success if the message was successfully inserted into the send queues, failure otherwise

◆ SetConnectionErrorHandler()

void XrdCl::PostMaster::SetConnectionErrorHandler ( std::function< void(const URL &, const XRootDStatus &)>  handler)

Set the global on-error on-connect handler for control streams.

◆ SetOnConnectHandler()

void XrdCl::PostMaster::SetOnConnectHandler ( std::unique_ptr< Job onConnJob)

Set the global connection error handler.

◆ SetOnDataConnectHandler()

void XrdCl::PostMaster::SetOnDataConnectHandler ( const URL url,
std::shared_ptr< Job onConnJob 
)

Set the on-connect handler for data streams.

◆ Start()

bool XrdCl::PostMaster::Start ( )

Start the post master.

◆ Stop()

bool XrdCl::PostMaster::Stop ( )

Stop the postmaster.

Member Data Documentation

◆ pImpl

std::unique_ptr<PostMasterImpl> XrdCl::PostMaster::pImpl
private

The documentation for this class was generated from the following file: