ANNA Suite  2020b
Multipurpose development suite for Telco applications
Public Member Functions | List of all members
anna::http::wims20::ClientSide Class Reference

#include <ClientSide.hpp>

Inheritance diagram for anna::http::wims20::ClientSide:
Inheritance graph
[legend]
Collaboration diagram for anna::http::wims20::ClientSide:
Collaboration graph
[legend]

Public Member Functions

 ClientSide (const std::string &domain, const std::string &path)
 
 ClientSide (const std::string &domain)
 
 ~ClientSide ()
 
void addOtherLevel (const std::string &otherLevel) noexcept(false)
 
void addOtherLevel (const char *otherLevel) noexcept(false)
 
void setParameter (const char *parameter, const char *value) noexcept(false)
 
void setParameter (const char *parameter, const int value) noexcept(false)
 
void setParameter (const std::string &parameter, const std::string &value) noexcept(false)
 
void setParameter (const std::string &parameter, const int value) noexcept(false)
 
void clearOtherLevels ()
 
void codeOn (http::Request &message) noexcept(false)
 
- Public Member Functions inherited from anna::http::wims20::Abstract
virtual ~Abstract ()
 
const std::string & getDomain () const
 
const std::string * getPath () const
 
const std::string & getServiceID () const
 
const std::string & getGUID () const
 
void setServiceID (const std::string &serviceID)
 
void setGUID (const std::string &guid)
 
bool hasParameters () const
 
bool hasOtherLevels () const
 
virtual void clearParameters ()
 
void clear ()
 
std::string asString () const
 
other_level_iterator other_level_begin ()
 
other_level_iterator other_level_end ()
 
const_other_level_iterator other_level_begin () const
 
const_other_level_iterator other_level_end () const
 
const_parameter_iterator parameter_begin () const
 
const_parameter_iterator parameter_end () const
 

Additional Inherited Members

- Public Types inherited from anna::http::wims20::Abstract
typedef std::vector< std::string * > other_level_container
 
typedef other_level_container::iterator other_level_iterator
 
typedef other_level_container::const_iterator const_other_level_iterator
 
typedef std::pair< std::string *, std::string * > parameter_pkv
 
typedef std::vector< parameter_pkvparameter_container
 
typedef parameter_container::iterator parameter_iterator
 
typedef parameter_container::const_iterator const_parameter_iterator
 
- Static Public Member Functions inherited from anna::http::wims20::Abstract
static std::string * otherLevel (other_level_iterator ii)
 
static const std::string & otherLevel (const_other_level_iterator ii)
 
static const std::string & parameter_name (const_parameter_iterator ii)
 
static const std::string & parameter_value (const_parameter_iterator ii)
 
- Protected Member Functions inherited from anna::http::wims20::Abstract
 Abstract (const char *whatis, const std::string &domain, const std::string &path)
 
 Abstract (const char *whatis, const std::string &domain)
 
const std::string & calculeFixedPart () noexcept(false)
 
const std::string & calculeShortFixedPart () noexcept(false)
 
std::string * createString () noexcept(false)
 
std::string * createString (const char *value) noexcept(false)
 
std::string * createString (const std::string &value) noexcept(false)
 
void destroyString (std::string *str)
 
void other_level_add (const std::string &otherLevel) noexcept(false)
 
void parameter_set (const std::string &name, const std::string &value) noexcept(false)
 
parameter_iterator parameter_begin ()
 
parameter_iterator parameter_end ()
 
- Static Protected Member Functions inherited from anna::http::wims20::Abstract
static std::string * parameter_name (parameter_iterator ii)
 
static std::string * parameter_value (parameter_iterator ii)
 
static void appendWithSlash (std::string &target, const std::string &other)
 
- Protected Attributes inherited from anna::http::wims20::Abstract
other_level_containera_otherLevels
 
parameter_containera_parameters
 

Detailed Description

Permite interpretar una URI según las recomendaciones de WIMS 2.0, lo que facilita el desarrollo de aplicaciones integradas en Web 2.0; estas recomendaciones indican cómo debe formarse la petición ClientSide (REpresentational State Transfer) para permitir el desarrollo de cualquier servicio.

Implementa el interfaz WIMS 2.0 desde el punto de vista del proceso que genera la petición.

El formato general de una URI según la recomendación de WIMS 2.0 es:

http://domain-openapis/path-openapis/serviceID/guid/other_possible_levels?query_parameters

Dónde los campos tienen siguen la siguiente especificación:

Constructor & Destructor Documentation

◆ ClientSide() [1/2]

anna::http::wims20::ClientSide::ClientSide ( const std::string &  domain,
const std::string &  path 
)
inline

Contructor indicando el parámetro opcional path-openapis. Estos dos parámetros se obtendrá como parte de la configuración de nuestro sistema.

Parameters
domainIdentifica el recurso del OpenAPI.
pathParámetro opcional que ajusta la ruta hacia los recusos de éste API.
55  :
56  Abstract("ClientSide", domain, path) {
57  a_strOtherLevels = NULL;
58  }
Abstract(const char *whatis, const std::string &domain, const std::string &path)

◆ ClientSide() [2/2]

anna::http::wims20::ClientSide::ClientSide ( const std::string &  domain)
inlineexplicit

Constructor que no usará el parámetro opcional path-openapis. Este parámetro se obtendrá como parte de la configuración de nuestro sistema.

Parameters
domainIdentifica el recurso del OpenAPI.
65  :
66  Abstract("ClientSide", domain) {
67  a_strOtherLevels = NULL;
68  }
Abstract(const char *whatis, const std::string &domain, const std::string &path)

◆ ~ClientSide()

anna::http::wims20::ClientSide::~ClientSide ( )
inline

Destructor.

73 { Abstract::destroyString(a_strOtherLevels); }
void destroyString(std::string *str)
Definition: Abstract.hpp:274
Here is the call graph for this function:

Member Function Documentation

◆ addOtherLevel() [1/2]

void anna::http::wims20::ClientSide::addOtherLevel ( const std::string &  otherLevel)
noexcept

Amplía el campo other_possible_level con el valor recibido.

Parameters
otherLevelValor con el que ampliar la ruta.

◆ addOtherLevel() [2/2]

void anna::http::wims20::ClientSide::addOtherLevel ( const char *  otherLevel)
inlinenoexcept

Amplía el campo other_possible_level con el valor recibido.

Parameters
otherLevelValor con el que ampliar la ruta.
85  {
86  std::string aux(otherLevel);
87  addOtherLevel(aux);
88  }
void addOtherLevel(const std::string &otherLevel) noexcept(false)
static std::string * otherLevel(other_level_iterator ii)
Definition: Abstract.hpp:164
Here is the call graph for this function:

◆ clearOtherLevels()

void anna::http::wims20::ClientSide::clearOtherLevels ( )
inlinevirtual

Limpia el contenido asociado al parámetro other_possible_level. Sólo debería invocarse a este método en caso de que el servicio destino de la petición haya cambiado.

Reimplemented from anna::http::wims20::Abstract.

137  {
139  Abstract::destroyString(a_strOtherLevels);
140  a_strOtherLevels = NULL;
141  }
void destroyString(std::string *str)
Definition: Abstract.hpp:274
virtual void clearOtherLevels()
Here is the call graph for this function:

◆ codeOn()

void anna::http::wims20::ClientSide::codeOn ( http::Request message)
noexcept

Recopila la información contenida en la petición REST de WIMS2.0 y la codifica sobre la URI de la petición HTTP recibida como parámetro.

Parameters
messageMensaje HTTP sobre el que se establecerá la URI necesaria para realizar la peticion WIMS 2.0.

◆ setParameter() [1/4]

void anna::http::wims20::ClientSide::setParameter ( const char *  parameter,
const char *  value 
)
inlinenoexcept

Establece el valor del parámetro indicado como parámetro. Si el parámetro indicado ya existe en la lista de parámetros registrados su valor se sobreescribe.

Parameters
parameterNombre del parámetro a establecer.
valueValor asociado al parámetro.
96  {
97  std::string p(parameter);
98  std::string v(value);
100  }
void parameter_set(const std::string &name, const std::string &value) noexcept(false)
Here is the call graph for this function:

◆ setParameter() [2/4]

void anna::http::wims20::ClientSide::setParameter ( const char *  parameter,
const int  value 
)
inlinenoexcept

Establece el valor del parámetro indicado como parámetro. Si el parámetro indicado ya existe en la lista de parámetros registrados su valor se sobreescribe.

Parameters
parameterNombre del parámetro a establecer.
valueValor asociado al parámetro.
108  {
109  std::string p(parameter);
111  }
static std::string asString(const int number)
void parameter_set(const std::string &name, const std::string &value) noexcept(false)
Here is the call graph for this function:

◆ setParameter() [3/4]

void anna::http::wims20::ClientSide::setParameter ( const std::string &  parameter,
const std::string &  value 
)
inlinenoexcept

Establece el valor del parámetro indicado como parámetro. Si el parámetro indicado ya existe en la lista de parámetros registrados su valor se sobreescribe.

Parameters
parameterNombre del parámetro a establecer.
valueValor asociado al parámetro.
119  {
120  Abstract::parameter_set(parameter, value);
121  }
void parameter_set(const std::string &name, const std::string &value) noexcept(false)
Here is the call graph for this function:

◆ setParameter() [4/4]

void anna::http::wims20::ClientSide::setParameter ( const std::string &  parameter,
const int  value 
)
inlinenoexcept

Establece el valor del parámetro indicado como parámetro. Si el parámetro indicado ya existe en la lista de parámetros registrados su valor se sobreescribe.

Parameters
parameterNombre del parámetro a establecer.
valueValor asociado al parámetro.
129  {
131  }
static std::string asString(const int number)
void parameter_set(const std::string &name, const std::string &value) noexcept(false)
Here is the call graph for this function:

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