Beispiel #1
0
func getFormat(a httpRequestArgs) (Format, errors.Error) {
	var format Format

	format_field, err := a.getString(FORMAT, "JSON")
	if err == nil && format_field != "" {
		format = newFormat(format_field)
		if format == UNDEFINED_FORMAT {
			err = errors.NewServiceErrorUnrecognizedValue(FORMAT, format_field)
		}
	}
	return format, err
}
Beispiel #2
0
func getEncoding(a httpRequestArgs) (Encoding, errors.Error) {
	var encoding Encoding

	encoding_field, err := a.getString(ENCODING, "UTF-8")
	if err == nil && encoding_field != "" {
		encoding = newEncoding(encoding_field)
		if encoding == UNDEFINED_ENCODING {
			err = errors.NewServiceErrorUnrecognizedValue(ENCODING, encoding_field)
		}
	}
	return encoding, err
}
Beispiel #3
0
func getCompression(a httpRequestArgs) (Compression, errors.Error) {
	var compression Compression

	compression_field, err := a.getString(COMPRESSION, "NONE")
	if err == nil && compression_field != "" {
		compression = newCompression(compression_field)
		if compression == UNDEFINED_COMPRESSION {
			err = errors.NewServiceErrorUnrecognizedValue(COMPRESSION, compression_field)
		}
	}
	return compression, err
}
Beispiel #4
0
func getScanConfiguration(a httpRequestArgs) (*scanConfigImpl, errors.Error) {
	var sc scanConfigImpl

	scan_consistency_field, err := a.getString(SCAN_CONSISTENCY, "NOT_BOUNDED")
	if err == nil {
		sc.scan_level = newScanConsistency(scan_consistency_field)
		if sc.scan_level == server.UNDEFINED_CONSISTENCY {
			err = errors.NewServiceErrorUnrecognizedValue(SCAN_CONSISTENCY, scan_consistency_field)
		}
	}
	if err == nil {
		sc.scan_wait, err = a.getDuration(SCAN_WAIT)
	}
	if err == nil {
		sc.scan_vector, err = a.getScanVector()
	}
	if err == nil && sc.scan_level == server.AT_PLUS && sc.scan_vector == nil {
		err = errors.NewServiceErrorMissingValue(SCAN_VECTOR)
	}
	return &sc, err
}