ARC SDK
Public Types | Public Member Functions | Static Public Member Functions | Data Fields
Arc::Endpoint Class Reference

Represents an endpoint of a service with a given interface type and capabilities. More...

#include <arc/compute/Endpoint.h>

Public Types

enum  CapabilityEnum {
  REGISTRY, COMPUTINGINFO, JOBLIST, JOBSUBMIT,
  JOBCREATION, JOBMANAGEMENT, UNSPECIFIED
}
 Values for classifying capabilities of services. More...
 

Public Member Functions

 Endpoint (const std::string &URLString="", const std::set< std::string > &Capability=std::set< std::string >(), const std::string &InterfaceName="")
 Create a new Endpoint with a list of capability strings. More...
 
 Endpoint (const std::string &URLString, const Endpoint::CapabilityEnum cap, const std::string &InterfaceName="")
 Create a new Endpoint with a single capability specified by the CapabilityEnum. More...
 
 Endpoint (const ExecutionTarget &e, const std::string &rsi="")
 Create new Endpoint from ExecutionTarget object. More...
 
 Endpoint (const ComputingEndpointAttributes &cea, const std::string &rsi="")
 Create new Endpoint from ComputingEndpointAttributes object. More...
 
 Endpoint (const ConfigEndpoint &endpoint)
 Create a new Endpoint from a ConfigEndpoint. More...
 
bool HasCapability (Endpoint::CapabilityEnum cap) const
 Check for capability. More...
 
bool HasCapability (const std::string &cap) const
 Check for capability. More...
 
std::string str () const
 Get string representation of this object. More...
 
std::string getServiceName () const
 Get name of service from URLString attribute. More...
 
bool operator< (const Endpoint &other) const
 Key comparison method. More...
 
Endpointoperator= (const ConfigEndpoint &e)
 Set from a ConfigEndpoint object. More...
 

Static Public Member Functions

static std::string GetStringForCapability (Endpoint::CapabilityEnum cap)
 Get string representation of CapabilityEnum. More...
 
static bool ServiceIDCompare (const Endpoint &a, const Endpoint &b)
 Key comparison function for comparing Endpoint objects. More...
 
static std::pair< EndpointStatusMap::const_iterator, EndpointStatusMap::const_iterator > getServiceEndpoints (const Endpoint &, const EndpointStatusMap &)
 Get bounds in EndpointStatusMap corresponding to Endpoint. More...
 

Data Fields

std::string URLString
 The string representation of the URL of the Endpoint. More...
 
std::string InterfaceName
 The type of the interface (GLUE2 InterfaceName) More...
 
std::string HealthState
 GLUE2 HealthState More...
 
std::string HealthStateInfo
 GLUE2 HealthStateInfo More...
 
std::string QualityLevel
 GLUE2 QualityLevel More...
 
std::set< std::string > Capability
 Set of GLUE2 Capability strings. More...
 
std::string RequestedSubmissionInterfaceName
 A GLUE2 InterfaceName requesting an InterfaceName used for job submission. More...
 
std::string ServiceID
 ID of service this Endpoint belongs to. More...
 

Detailed Description

Represents an endpoint of a service with a given interface type and capabilities.

This class similar in structure to the Endpoint entity in the GLUE2 specification. The type of the interface is described by a string called InterfaceName (from the GLUE2 specification). An Endpoint object must have a URL, and it is quite useless without capabilities (the system has to know if an Endpoint is a service registry or a computing element), but the InterfaceName is optional.

The Endpoint object also contains information about the health state and quality level of the endpoint, and optionally the requested submission interface name, which will be used later if a job will be submitted to a computing element related to this endpoint.

See also
CapabilityEnum where the capabilities are listed.
Since
Added in 2.0.0.

Member Enumeration Documentation

◆ CapabilityEnum

Values for classifying capabilities of services.

Enumerator
REGISTRY 

Service registry capable of returning endpoints.

COMPUTINGINFO 

Local information system of a computing element capable of returning information about the resource.

JOBLIST 

Local information system of a computing element capable of returning the list of jobs on the resource.

JOBSUBMIT 

Interface of a computing element where jobs can be submitted.

JOBCREATION 

Interface of a computing element where jobs can be created.

Since
Added in 3.0.0.
JOBMANAGEMENT 

Interface of a computing element where jobs can be managed.

UNSPECIFIED 

Unspecified capability.

Constructor & Destructor Documentation

◆ Endpoint() [1/5]

Arc::Endpoint::Endpoint ( const std::string &  URLString = "",
const std::set< std::string > &  Capability = std::set<std::string>(),
const std::string &  InterfaceName = "" 
)
inline

Create a new Endpoint with a list of capability strings.

Parameters
[in]URLStringis a string representing the URL of the endpoint
[in]Capabilityis a list of capability strings specifying the capabilities of the service
[in]InterfaceNameis a string specifying the type of the interface of the service

◆ Endpoint() [2/5]

Arc::Endpoint::Endpoint ( const std::string &  URLString,
const Endpoint::CapabilityEnum  cap,
const std::string &  InterfaceName = "" 
)
inline

Create a new Endpoint with a single capability specified by the CapabilityEnum.

Parameters
[in]URLStringis a string representing the URL of the endpoint
[in]capis a CapabilityEnum specifying the single capability of the endpoint
[in]InterfaceNameis an optional string specifying the type of the interface

◆ Endpoint() [3/5]

Arc::Endpoint::Endpoint ( const ExecutionTarget e,
const std::string &  rsi = "" 
)

Create new Endpoint from ExecutionTarget object.

Parameters
eExecutionTarget object to create new Endpoint from.
rsistring specifying the requested submission interface if any. Default value is the empty string.
Since
Added in 3.0.0.

◆ Endpoint() [4/5]

Arc::Endpoint::Endpoint ( const ComputingEndpointAttributes cea,
const std::string &  rsi = "" 
)

Create new Endpoint from ComputingEndpointAttributes object.

Parameters
ceaComputingEndpointAttributes object to create new Endpoint from.
rsistring specifying the requested submission interface if any. Default value is the empty string.
Since
Added in 3.0.0.

◆ Endpoint() [5/5]

Arc::Endpoint::Endpoint ( const ConfigEndpoint endpoint)
inline

Create a new Endpoint from a ConfigEndpoint.

The ConfigEndpoint::URLString, ConfigEndpoint::InterfaceName and the ConfigEndpoint::RequestedSubmissionInterfaceName attributes will be copied from the ConfigEndpoint, and if the type of the ConfigEndpoint is REGISTRY or COMPUTINGINFO, the given capability will be added to the new Endpoint object.

Parameters
[in]endpointis the ConfigEndpoint object which will be converted to an Endpoint

Member Function Documentation

◆ getServiceEndpoints()

static std::pair<EndpointStatusMap::const_iterator, EndpointStatusMap::const_iterator> Arc::Endpoint::getServiceEndpoints ( const Endpoint ,
const EndpointStatusMap  
)
static

Get bounds in EndpointStatusMap corresponding to Endpoint.

Parameters
[in]endpointAn Endpoint object for which the bounds of equivalent Endpoint objects in the EndpointStatusMap should be found.
[in]statusMapSee description above.
Returns
The lower and upper bound of the equivalent to the passed Endpoint object is returned as a pair (lower, upper).

◆ getServiceName()

std::string Arc::Endpoint::getServiceName ( ) const

Get name of service from URLString attribute.

Returns
If URLString contains "://", a URL object will be created from it and if the host part of it is non empty it is returned, otherwise URLString is returned.
Since
Added in 3.0.0.

◆ GetStringForCapability()

static std::string Arc::Endpoint::GetStringForCapability ( Endpoint::CapabilityEnum  cap)
inlinestatic

Get string representation of CapabilityEnum.

Returns
The GLUE2 capability string associated with the passed CapabilityEnum value is returned.

◆ HasCapability() [1/2]

bool Arc::Endpoint::HasCapability ( Endpoint::CapabilityEnum  cap) const

Check for capability.

Checks if the Endpoint has the given capability specified by a CapabilityEnum value.

Parameters
[in]capis the specified CapabilityEnum
Returns
true if the Endpoint has the given capability

◆ HasCapability() [2/2]

bool Arc::Endpoint::HasCapability ( const std::string &  cap) const

Check for capability.

Checks if the Endpoint has the given capability specified by a string.

Parameters
[in]capis a string specifying a capability.
Returns
true if the Endpoint has the given capability.

◆ operator<()

bool Arc::Endpoint::operator< ( const Endpoint other) const

Key comparison method.

Compare passed Endpoint object with this by value returned by str().

Parameters
[in]otherEndpoint object to compare with.
Returns
The result of lexicographically less between this object (lhs) and other (rhs) compared using value returned by str() method, is returned.

◆ operator=()

Endpoint& Arc::Endpoint::operator= ( const ConfigEndpoint e)

Set from a ConfigEndpoint object.

Returns
*this is returned.
Python interface deviation
Method is unavailable in Python interface

◆ ServiceIDCompare()

static bool Arc::Endpoint::ServiceIDCompare ( const Endpoint a,
const Endpoint b 
)
static

Key comparison function for comparing Endpoint objects.

Compare endpoints by ServiceID, URLString and InterfaceName in that order. The attributes are compared lexicographically.

Returns
If the ServiceID attributes are unequal lexicographically less between the ServiceID attributes of a and b is returned. If they equal then same procedure is done with the URLString attribute, if they equal lexicographically less between the InterfaceName attributes of a and b is returned.
Since
Added in 3.0.0.

◆ str()

std::string Arc::Endpoint::str ( ) const

Get string representation of this object.

Returns
String formatted as:
<URLString> (<InterfaceName>[, capabilities: <Capabilities space separated>])
where if InterfaceName is empty, "<empty InterfaceName>" is used.

Field Documentation

◆ Capability

std::set<std::string> Arc::Endpoint::Capability

Set of GLUE2 Capability strings.

◆ HealthState

std::string Arc::Endpoint::HealthState

GLUE2 HealthState

◆ HealthStateInfo

std::string Arc::Endpoint::HealthStateInfo

GLUE2 HealthStateInfo

◆ InterfaceName

std::string Arc::Endpoint::InterfaceName

The type of the interface (GLUE2 InterfaceName)

◆ QualityLevel

std::string Arc::Endpoint::QualityLevel

GLUE2 QualityLevel

◆ RequestedSubmissionInterfaceName

std::string Arc::Endpoint::RequestedSubmissionInterfaceName

A GLUE2 InterfaceName requesting an InterfaceName used for job submission.

If a user specifies an InterfaceName for submitting jobs, that information will be stored here and will be used when collecting information about the computing element. Only those job submission interfaces will be considered which has this requested InterfaceName.

◆ ServiceID

std::string Arc::Endpoint::ServiceID

ID of service this Endpoint belongs to.

Since
Added in 3.0.0.

◆ URLString

std::string Arc::Endpoint::URLString

The string representation of the URL of the Endpoint.


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