parameters: (self, validation, param_name, param_value, caller_id)
docstring: Implements validation rules that require access to internal ROSHandler state.
          @param validation: name of validation rule to use
          @type  validation: str
          @param param_name: name of parameter being validated
          @type  param_name: str
          @param param_value str: value of parameter
          @type  param_value: str
          @param caller_id: value of caller_id parameter to API method
          @type  caller_id: str
          @raise ParameterInvalid: if the parameter does not meet validation
          @return: new value for parameter, after validation
docstring_summary: Implements validation rules that require access to internal ROSHandler state.
docstring_tokens: Implements validation rules that require access to internal ROSHandler state .
function: def _custom_validate(self, validation, param_name, param_value, caller_id):
          """
          Implements validation rules that require access to internal ROSHandler state.
          @param validation: name of validation rule to use
          @type  validation: str
          @param param_name: name of parameter being validated
          @type  param_name: str
          @param param_value str: value of parameter
          @type  param_value: str
          @param caller_id: value of caller_id parameter to API method
          @type  caller_id: str
          @raise ParameterInvalid: if the parameter does not meet validation
          @return: new value for parameter, after validation
          """
          if validation == 'is_publishers_list':
              if not type(param_value) == list:
                  raise ParameterInvalid("ERROR: param [%s] must be a list"%param_name)
              for v in param_value:
                  if not isinstance(v, str):
                      raise ParameterInvalid("ERROR: param [%s] must be a list of strings"%param_name)
                  parsed = urlparse.urlparse(v)
                  if not parsed[0] or not parsed[1]: #protocol and host
                      raise ParameterInvalid("ERROR: param [%s] does not contain valid URLs [%s]"%(param_name, v))
              return param_value
          else:
              raise ParameterInvalid("ERROR: param [%s] has an unknown validation type [%s]"%(param_name, validation))
function_tokens: def _custom_validate ( self , validation , param_name , param_value , caller_id ) : if validation == 'is_publishers_list' : if not type ( param_value ) == list : raise ParameterInvalid ( "ERROR: param [%s] must be a list" % param_name ) for v in param_value : if not isinstance ( v , str ) : raise ParameterInvalid ( "ERROR: param [%s] must be a list of strings" % param_name ) parsed = urlparse . urlparse ( v ) if not parsed [ 0 ] or not parsed [ 1 ] : #protocol and host raise ParameterInvalid ( "ERROR: param [%s] does not contain valid URLs [%s]" % ( param_name , v ) ) return param_value else : raise ParameterInvalid ( "ERROR: param [%s] has an unknown validation type [%s]" % ( param_name , validation ) )