# saga::sd::service_description Class Reference

`#include <service_description.hpp>`

Inheritance diagram for saga::sd::service_description:

[legend]

List of all members.

## Public Member Functions
| service_description (saga::url loc)
| service_description (saga::object const &o)
| ~service_description (void) SAGA_THROW_SPEC() throw ()
service_description & | operator= (saga::object const &o) SAGA_THROW_SPEC() throw ()
std::string | get_url () SAGA_THROW_SPEC() throw ()
std::vector < saga::sd::service_description > | get_related_services () SAGA_THROW_SPEC() throw (saga::authorization_failed, saga::authentication_failed, saga::timeout, saga::no_success)
saga::sd::service_data & | get_data () SAGA_THROW_SPEC() throw ()
## Protected Member Functions
| service_description (saga::impl::service_description *impl)
void | set_session (boost::shared_ptr< saga::session > sess)
void | set_data (std::string data_key, std::string data_value)

## Detailed Description

Read access to the top level data of the service and a means to navigate to related services. This class implements the attributes interface and offers getter methods to obtain details of that service. The attributes are based on those found in GLUE. They are:

`Url`
  url to contact the service. The get_url method obtains the same information.
`Type`
  type of service. This field is not an empty string.
`Uid`
  unique identifier of service. This field is not an empty string.
`Site`
  name of site. This field is not an empty string.
`Name`
  name of service - not necessarily unique. This field is not an empty string.
`implementor`
  name of the organisation providing the implementation of the service. This field is not an empty string.
`Related_Services`
  uids of related services. This returns the uids of the related services. This is unlike the method get_related_services which returns a vector of service_description objects.

## Constructor & Destructor Documentation

saga::sd::service_description::service_description | ( | saga::impl::service_description * | impl | ) | `[explicit, protected]`

saga::sd::service_description::service_description | ( | saga::url | loc | ) |

Default constructor

References saga::url::get_url(), saga::sd::attributes::service_description_capability, saga::sd::attributes::service_description_implementation_version, saga::sd::attributes::service_description_implementor, saga::sd::attributes::service_description_information_provider_url, saga::sd::attributes::service_description_interface_version, saga::sd::attributes::service_description_name, saga::sd::attributes::service_description_relatedservices, saga::sd::attributes::service_description_site, saga::sd::attributes::service_description_type, saga::sd::attributes::service_description_uid, saga::sd::attributes::service_description_url, saga::sd::attributes::service_description_vo, and saga::detail::attribute< Derived >::set_attribute().

saga::sd::service_description::service_description | ( | saga::object const & | o | ) | `[explicit]`

References saga::BadParameter, saga::object::get_type(), and saga::object::ServiceDescription.

saga::sd::service_description::~service_description | ( | void |  | ) | throw ()

Destructor

## Member Function Documentation

void saga::sd::service_description::set_session | ( | boost::shared_ptr< saga::session > | sess | ) | `[protected]`

void saga::sd::service_description::set_data | ( | std::string | data_key,
|  | std::string | data_value |
| ) |  |  | `[protected]`

service_description & saga::sd::service_description::operator= | ( | saga::object const & | o | ) | throw ()

std::string saga::sd::service_description::get_url | ( |  | ) | throw ()

Returns the `URL` to contact the service. The `URL` may also be obtained using the `saga::attributes` interface.

Returns:
  a string containing the URL to contact this service

References saga::detail::attribute< Derived >::attribute_exists(), saga::BadParameter, saga::detail::attribute< Derived >::get_attribute(), and saga::sd::attributes::service_description_url.

std::vector< saga::sd::service_description > saga::sd::service_description::get_related_services | ( |  | ) | throw (saga::authorization_failed, saga::authentication_failed, saga::timeout, saga::no_success)

Returns a vector of related services. Alternatively, the `saga::attributes` interface may be used to get the uids of the related services.

Returns:
  a set of related services. This may be an empty set.

Exceptions:

  | authorization_failed | if none of the available contexts of the used session could be used for successful authorization. That error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
  | authentication_failed | if none of the available session contexts could successfully be used for authentication
  | timeout | if a remote operation did not complete successfully because the network communication or the remote service timed out
  | no_success | if no result can be returned because of information system or other internal problems

References saga::detail::attribute< Derived >::attribute_exists(), saga::detail::attribute< Derived >::get_attribute(), saga::object::get_session(), saga::detail::attribute< Derived >::get_vector_attribute(), saga::sd::discoverer::list_services(), saga::sd::attributes::service_description_information_provider_url, and saga::sd::attributes::service_description_relatedservices.

saga::sd::service_data & saga::sd::service_description::get_data | ( |  | ) | throw ()

Returns a `service_data` object with the service data key/value pairs.

Returns:
  the service data for this service. This may be empty, i.e.has no attributes at all.

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

- service_description.hpp
- service_description.cpp