UpdateRequest Class Reference

UpdateRequest contains the API that is used to set up and customer a RETS UPDATE transaciton. More...

#include <librets/UpdateRequest.h>

Inheritance diagram for UpdateRequest:

RetsHttpRequest RetsObject

List of all members.

Public Types

enum  Method { GET, POST }

Public Member Functions

 UpdateRequest (std::string resourceName, std::string className)
 Create a new update request.
std::string ConstructRecord ()
 Format the Record request.
void ConstructRequest ()
 Construct the update request.
std::string ConstructWarningResponse ()
 Format the WarningResponse request.
const std::string GetDelimiter ()
 Returns the current value of the delimiter for the current request.
void SetDelimiter (std::string delimiter)
 Sets the value of the delimiter for the current request.
const StringVector GetAllFields ()
 Returns a string vector containing the names of all fields.
const std::string GetField (std::string key)
 Returns the value for the given field.
void SetField (std::string key, std::string value)
 Set the name of a field and its value.
const std::string GetUpdateType ()
 Returns the current value of the update parameter for the request.
void SetUpdateType (std::string updateType)
 Set the value of the update type parameter for the current request.
const int GetValidateFlag ()
 Returns the current value of the validation flag for the current request.
void SetValidateFlag (int flag)
 Sets the validation flag for the current request.
const StringVector GetAllWarnings ()
 Returns a string vector containing the warning numbers.
const std::string GetWarningResponse (int warningNumber)
 Returns a string containing the user response for the given warning number.
const std::string GetWarningResponse (std::string warningNumber)
 Returns a string containing the user response for the given warning number.
void SetWarningResponse (int warningNumber, std::string userResponse)
 Set the warning number and response.
void SetWarningResponse (std::string warningNumber, std::string userResponse)
 Set the warning number and response.
virtual Method GetMethod () const
virtual void SetMethod (Method method)
virtual std::string GetUrl () const
virtual void SetUrl (std::string url)
virtual void SetHeader (std::string name, std::string value)
virtual void ClearHeader (std::string name)
StringMap GetHeaderMap () const
virtual void SetQueryParameter (std::string, std::string value)
virtual void SetQueryParameter (std::string, int value)
virtual std::string GetQueryString () const
bool GetLogging ()
void SetNoLogging ()
void SetLogging ()
virtual std::ostream & Print (std::ostream &outputStream) const
std::string ToString () const
virtual bool Equals (const RetsObject *object) const

Static Public Attributes

static const int UPDATE_OK = 0
 This requests the server update the record if there are no errors.
static const int AUTO_POPULATE = 1
 Validation will happen on the host.
static const int VALIDATE_ONLY = 2
 The server validates the record and returns any errors found.


Detailed Description

UpdateRequest contains the API that is used to set up and customer a RETS UPDATE transaciton.

Member Enumeration Documentation

enum Method [inherited]

Enumerator:
GET 
POST 


Constructor & Destructor Documentation

UpdateRequest ( std::string  resourceName,
std::string  className 
)

Create a new update request.

Parameters:
resourceName RETS resource name
className RETS class name


Member Function Documentation

virtual void ClearHeader ( std::string  name  )  [virtual, inherited]

std::string ConstructRecord (  ) 

Format the Record request.

This is an internal method, primarily used by the tests.

void ConstructRequest (  ) 

Construct the update request.

This is an internal method that will format the "Record" and "WarningResponse" elements of the request and set them into the query.

std::string ConstructWarningResponse (  ) 

Format the WarningResponse request.

This is an internal method, primarily used by the tests.

virtual bool Equals ( const RetsObject object  )  const [virtual, inherited]

const StringVector GetAllFields (  ) 

Returns a string vector containing the names of all fields.

Returns:
A StringVector containing the names of all fields.

const StringVector GetAllWarnings (  ) 

Returns a string vector containing the warning numbers.

Returns:
A StringVector containing the warning numbers represented as strings.

const std::string GetDelimiter (  ) 

Returns the current value of the delimiter for the current request.

Returns:
A string containing the delimiter.

const std::string GetField ( std::string  key  ) 

Returns the value for the given field.

Parameters:
key A string containing the field name.
Returns:
A string containing the field value.

StringMap GetHeaderMap (  )  const [inherited]

bool GetLogging (  )  [inherited]

virtual Method GetMethod (  )  const [virtual, inherited]

virtual std::string GetQueryString (  )  const [virtual, inherited]

const std::string GetUpdateType (  ) 

Returns the current value of the update parameter for the request.

Returns:
A string containing the value of the update type.

virtual std::string GetUrl (  )  const [virtual, inherited]

const int GetValidateFlag (  ) 

Returns the current value of the validation flag for the current request.

Returns:
An integer representing the value of the validation flag.

const std::string GetWarningResponse ( std::string  warningNumber  ) 

Returns a string containing the user response for the given warning number.

Parameters:
warningNumber A string containing the warning number.
Returns:
A string containing the user response for the given warning number.

const std::string GetWarningResponse ( int  warningNumber  ) 

Returns a string containing the user response for the given warning number.

Parameters:
warningNumber An integer containing the warning number.
Returns:
A string containing the user response for the given warning number.

virtual std::ostream& Print ( std::ostream &  outputStream  )  const [virtual, inherited]

void SetDelimiter ( std::string  delimiter  ) 

Sets the value of the delimiter for the current request.

Parameters:
delimiter A string containing the delimiter value.

void SetField ( std::string  key,
std::string  value 
)

Set the name of a field and its value.

Parameters:
key A string containing the name of the field.
value A string containing the value for the field.

virtual void SetHeader ( std::string  name,
std::string  value 
) [virtual, inherited]

void SetLogging (  )  [inherited]

virtual void SetMethod ( Method  method  )  [virtual, inherited]

void SetNoLogging (  )  [inherited]

virtual void SetQueryParameter ( std::string  ,
int  value 
) [virtual, inherited]

virtual void SetQueryParameter ( std::string  ,
std::string  value 
) [virtual, inherited]

void SetUpdateType ( std::string  updateType  ) 

Set the value of the update type parameter for the current request.

Parameters:
updateType A string containing the value of the update type.

virtual void SetUrl ( std::string  url  )  [virtual, inherited]

void SetValidateFlag ( int  flag  ) 

Sets the validation flag for the current request.

Parameters:
flag One of UPDATE_OK, AUTO_POPULATE or VALIDATE_ONLY.

void SetWarningResponse ( std::string  warningNumber,
std::string  userResponse 
)

Set the warning number and response.

Parameters:
warningNumber A string containing the warning number.
userResponse A string containing the user response.

void SetWarningResponse ( int  warningNumber,
std::string  userResponse 
)

Set the warning number and response.

Parameters:
warningNumber An integer containing the warning number.
userResponse A string containing the user response.

std::string ToString (  )  const [inherited]


Member Data Documentation

const int AUTO_POPULATE = 1 [static]

Validation will happen on the host.

Any fields with the "Autopop" attribute will have their values set by the server and returned to the client. The record in the database is not updated. This gives the client the opportunity to get server populated data inserted into the record and returned to the client without updating the database.

const int UPDATE_OK = 0 [static]

This requests the server update the record if there are no errors.

const int VALIDATE_ONLY = 2 [static]

The server validates the record and returns any errors found.

It does not update the database if there are no errors found.


Generated by  doxygen