Class WsMan::ClientOption
In: rwsman_xmlattr.c
Parent: Object

Client options are used to control how actions are processed by the client. It represents client_opt_t from openwsman.

Methods

Constants

NONE = INT2FIX(FLAG_NONE)
ENUMERATION_COUNT_ESTIMATION = INT2FIX(FLAG_ENUMERATION_COUNT_ESTIMATION)
ENUMERATION_OPTIMIZATION = INT2FIX(FLAG_ENUMERATION_OPTIMIZATION)
ENUMERATION_ENUM_EPR = INT2FIX(FLAG_ENUMERATION_ENUM_EPR)
ENUMERATION_ENUM_OBJ_AND_EPR = INT2FIX(FLAG_ENUMERATION_ENUM_OBJ_AND_EPR)
DUMP_REQUEST = INT2FIX(FLAG_DUMP_REQUEST)
IncludeSubClassProperties = INT2FIX(FLAG_IncludeSubClassProperties)
ExcludeSubClassProperties = INT2FIX(FLAG_ExcludeSubClassProperties)
POLYMORPHISM_NONE = INT2FIX(FLAG_POLYMORPHISM_NONE)
MUND_MAX_ESIZE = INT2FIX(FLAG_MUND_MAX_ESIZE)
MUND_LOCALE = INT2FIX(FLAG_MUND_LOCALE)
MUND_OPTIONSET = INT2FIX(FLAG_MUND_OPTIONSET)
MUND_FRAGMENT = INT2FIX(FLAG_MUND_FRAGMENT)
CIM_EXTENSIONS = INT2FIX(FLAG_CIM_EXTENSIONS)
CIM_REFERENCES = INT2FIX(FLAG_CIM_REFERENCES)
CIM_ASSOCIATORS = INT2FIX(FLAG_CIM_ASSOCIATORS)

Public Instance methods

Return client option CIM namespace

[Source]

/*
 * call-seq:
 *      ClientOption.cim_ns -> string
 *
 * Return client option CIM namespace
 */
static VALUE
clientoption_cim_ns( VALUE self )
{
    char *cim_ns = rwsman_clientoption_unpack( self )->cim_ns;
    if (cim_ns) return rb_str_new2( cim_ns );
    return Qnil;
}

Set client option CIM namespace

[Source]

/*
 * call-seq:
 *      ClientOption.cim_ns = "..."
 *
 * Set client option CIM namespace
 */
static VALUE
clientoption_cim_ns_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    if (options->cim_ns) free( options->cim_ns );
    options->cim_ns = strdup( StringValuePtr( val ) );
    return val;
}

Return client option dialect

[Source]

/*
 * call-seq:
 *      ClientOption.dialect -> string
 *
 * Return client option +dialect+
 */
static VALUE
clientoption_dialect( VALUE self )
{
    char *dialect = rwsman_clientoption_unpack( self )->dialect;
    if (dialect) return rb_str_new2( dialect );
    return Qnil;
}

Set client option dialect

[Source]

/*
 * call-seq:
 *      ClientOption.dialect = "..."
 *
 * Set client option +dialect+
 */
static VALUE
clientoption_dialect_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    if (options->dialect) free( options->dialect );
    options->dialect = strdup( StringValuePtr( val ) );
    return val;
}

Return client option filter

[Source]

/*
 * call-seq:
 *      ClientOption.filter -> string
 *
 * Return client option filter
 */
static VALUE
clientoption_filter( VALUE self )
{
    char *filter = rwsman_clientoption_unpack( self )->filter;
    if (filter) return rb_str_new2( filter );
    return Qnil;
}

Set client option filter

[Source]

/*
 * call-seq:
 *      ClientOption.filter = "..."
 *
 * Set client option filter
 */
static VALUE
clientoption_filter_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    if (options->filter) free( options->filter );
    options->filter = strdup( StringValuePtr( val ) );
    return val;
}

Return client option flags as integer value

[Source]

/*
 * call-seq:
 *      ClientOption.flags -> integer
 *
 * Return client option flags as integer value
 */
static VALUE
clientoption_flags( VALUE self )
{
    return INT2FIX( rwsman_clientoption_unpack( self )->flags );
}

Set client option flags from value

[Source]

/*
 * call-seq:
 *      ClientOption.flags = ClientOption::DUMP_REQUEST
 *
 * Set client option flags from value
 */
static VALUE
clientoption_flags_set( VALUE self, VALUE val )
{
    rwsman_clientoption_unpack( self )->flags = FIX2INT( val );
    return val;
}

Return client option fragment

[Source]

/*
 * call-seq:
 *      ClientOption.fragment -> string
 *
 * Return client option +fragment+
 */
static VALUE
clientoption_fragment( VALUE self )
{
    char *fragment = rwsman_clientoption_unpack( self )->fragment;
    if (fragment) return rb_str_new2( fragment );
    return Qnil;
}

Set client option fragment

[Source]

/*
 * call-seq:
 *      ClientOption.fragment = "..."
 *
 * Set client option +fragment+
 */
static VALUE
clientoption_fragment_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    if (options->fragment) free( options->fragment );
    options->fragment = strdup( StringValuePtr( val ) );
    return val;
}

Return client option maximum elements

[Source]

/*
 * call-seq:
 *      ClientOption.max_elements -> integer
 *
 * Return client option maximum elements
 */
static VALUE
clientoption_max_elements( VALUE self )
{
    return INT2FIX( rwsman_clientoption_unpack( self )->max_elements );
}

Set client option maximum elements

[Source]

/*
 * call-seq:
 *      ClientOption.max_elements = 42
 *
 * Set client option maximum elements
 */
static VALUE
clientoption_max_elements_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    options->max_elements = FIX2INT( val );
    return val;
}

Return client option maximum envelope size.

[Source]

/*
 * call-seq:
 *      ClientOption.max_envelope_size -> integer
 *
 * Return client option maximum envelope size.
 */
static VALUE
clientoption_max_envelope_size( VALUE self )
{
    return INT2FIX( rwsman_clientoption_unpack( self )->max_envelope_size );
}

Set client option maximum envelope size.

[Source]

/*
 * call-seq:
 *      ClientOption.max_envelope_size = 8192
 *
 * Set client option maximum envelope size.
 */
static VALUE
clientoption_max_envelope_size_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    options->max_envelope_size = FIX2INT( val );
    return val;
}

Return client option properties

[Source]

/*
 * call-seq:
 *      ClientOption.properties -> hash
 *
 * Return client option +properties+
 */
static VALUE
clientoption_properties( VALUE self )
{
    return hash2value( rwsman_clientoption_unpack( self )->properties );
}

Set client option properties Either strings or symbols are allowed for key and value within the hash

[Source]

/*
 * call-seq:
 *      ClientOption.properties = { "foo" => "bar", :one => :two, ... }
 *
 * Set client option +properties+
 * Either strings or symbols are allowed for key and value within the hash
 */
static VALUE
clientoption_properties_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    options->properties = value2hash( NULL, val );
    return val;
}

Add a single client option property Either strings or symbols are allowed for key and value

[Source]

/*
 * call-seq:
 *      ClientOption.property_add ( :key, "value" )
 *
 * Add a single client option property
 * Either strings or symbols are allowed for key and value
 */
static VALUE
clientoption_property_add( VALUE self, VALUE name, VALUE value )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    wsmc_add_property( options, as_string( name ), as_string( value ) );
    return self;
}

Add a single client option selector Either strings or symbols are allowed for key and value

[Source]

/*
 * call-seq:
 *      ClientOption.selector_add ( :key, "value" )
 *
 * Add a single client option selector
 * Either strings or symbols are allowed for key and value
 */
static VALUE
clientoption_selector_add( VALUE self, VALUE name, VALUE value )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    wsmc_add_selector( options, as_string( name ), as_string( value ) );
    return self;
}

Return client option selectors

[Source]

/*
 * call-seq:
 *      ClientOption.selectors -> hash
 *
 * Return client option selectors
 */
static VALUE
clientoption_selectors( VALUE self )
{
    return hash2value( rwsman_clientoption_unpack( self )->selectors );
}

Set client option selectors Either strings or symbols are allowed for key and value within the hash

[Source]

/*
 * call-seq:
 *      ClientOption.selectors = { "foo" => "bar", :one => :two, ... }
 *
 * Set client option +selectors+
 * Either strings or symbols are allowed for key and value within the hash
 */
static VALUE
clientoption_selectors_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    options->selectors = value2hash( NULL, val );
    return val;
}

Return client option timeout (in msec) This is the timeout value for the operation, not for the transport. See Client.timeout for the transport level timeout value.

[Source]

/*
 * call-seq:
 *      ClientOption.timeout -> integer
 *
 * Return client option +timeout+ (in msec)
 * This is the timeout value for the operation, *not* for the transport.
 * See Client.timeout for the transport level timeout value.
 */
static VALUE
clientoption_timeout( VALUE self )
{
    return INT2FIX( rwsman_clientoption_unpack( self )->timeout );
}

Set client option timeout (in msec) This is the timeout value for the operation, not for the transport. See Client.timeout for the transport level timeout value.

[Source]

/*
 * call-seq:
 *      ClientOption.timeout = 60
 *
 * Set client option +timeout+ (in msec)
 * This is the timeout value for the operation, *not* for the transport.
 * See Client.timeout for the transport level timeout value.
 */
static VALUE
clientoption_timeout_set( VALUE self, VALUE val )
{
    client_opt_t *options = rwsman_clientoption_unpack( self );
    options->timeout = FIX2INT( val );
    return val;
}

[Validate]