The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tivoli::AccessManager::Admin::Response

SYNOPSIS

    use Tivoli::AccessManager::Admin;

    $resp = Tivoli::AccessManager::Admin::Response->new;

    $resp->iserror and die $resp->messages;

    $resp->set_isok(0);
    $resp->set_message("Line1", "Line2", "Line3");
    $resp->set_iswarning(1);

    $resp->set_value( "foo" );
    print $resp->value;

DESCRIPTION

Tivoli::AccessManager::Admin::Response is the general purpose object returned by just about every other method. It handles the response structures returned from the TAM API and provides a fair amount of other manipulations.

CONSTRUCTOR

new()

Allocates space for the response structure and does the necessary magic to make it work.

Parameters

None

Returns

A fully blessed Tivoli::AccessManager::Admin::Response object.

METHODS

value

Retrieves the value stored in the Response object. It is, as you may suspect, a read-only method. As every method in the TAM namespace returns an object of this type, you will likely only use isok more often.

Returns

The return should DWYM. It can return a scalar in scalar context, an array in list context and undef otherwise. It tries hard to guess what you meant. If you call it in list context and the response object has an array ref, the right thing happens.

isok

Indicates if the Response object is .. well, okay. If the underlying TAM Response structure has been used, "isok" will return the value of ivadmin_response_isok logically anded with internal isok value. If the structure hasn't been used, "isok" will return the value of its internal isok flag.

I am still not certain that isok = ! error.

Returns

True if the flags are so aligned :)

iserror, iswarning, isinfo

These are read-only methods which return true if the Response object is flagged as an error, warning or informational respectively

Returns

True if the response is an error, a warning or informational.

messages

Returns the messages in the Response object. This is a read-only method.

Returns

If used in scalar context, only the first message in the message array is returned. If used in array context, the full message array will be returned.

codes

Retrieves the error codes associated with the Response object. This is a read-only method.

Returns

If used in scalar context, only the first code in the code array is returned. If used in array context, the full code array will be returned.

set_value( VALUE | VALUE,ARRAYREF | ARRAY )

Sets the returned value, but does it weirdly.

If you just send a single parameter, the value will be returned when the response object is used in scalar context.

If you send a value and an array reference, the value will be returned in scalar context and the list from the array ref will be returned in list context.

If you send more than two parameters, the entire list is stored and will be returned in list context. Scalar context will give you the number of elements.

set_message( STRING[,...] )

Sets the message(s) in the Response object. You can send any number of strings to be included in the message.

Parameters

STRING[,...]

The message you want to store.

Returns

I honestly have no idea what it returns.

set_isok( 0 | 1 )

Sets the isok flag to true or false.

Parameters

0 or 1

Do you want the isok flag to be false or true?

Returns

The new value of the isok flag although you will likely never need to actually test the return value

set_iswarning( 0|1 )

Sets the iswarning flag to false or true.

Parameters

0 or 1

Do you want the iswarning flag to be false or true?

Returns

The new value of the iswarning flag, although you will likely never need to actually test the return value

set_iserror( 0|1 )

Sets the iswarning flag to false or true.

Parameters

0 or 1

Do you want the iserror flag to be false or true?

Returns

The new value of the iserror flag, although you will likely never need to actually test the return value

ACKNOWLEDGEMENTS

See Tivoli::AccessManager::Admin for the list of all the people I am indebted to for their help while writing these modules.

BUGS

None known yet.

AUTHOR

Mik Firestone <mikfire@gmail.com>

COPYRIGHT

Copyright (c) 2004-2011 Mik Firestone. All rights reserved. This program is free software; you can redistibute it and/or modify it under the same terms as Perl itself.

All references to TAM, Tivoli Access Manager, etc are copyrighted by IBM.