class AttrBundle

AttrBundle aggregates Attribute objects into bundles of key/value pairs. More...

Definition#include <sysadm/AttrBundle.h>
Inherited byAssociation, Category, ChildAttrAssoc, ClustersAssocWithMachine, ComputedAssoc, ExampleCategory, FileBasedCategory, Item, MachinesAssocWithCluster, Packet, ParentAttrAssoc
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

AttrBundle aggregates Attribute objects into bundles of key/value pairs.

In addition to a number of key/value pairs, an AttrBundle has a type and selector which is used to identify Items and route Packets.

An AttrBundle stores an independent mapping of key names to visibility flags, controlled via the setAttrVisible() method. The visibility mapping is used in the toString() method to prevent invisible Attributes from being part of the String returned. This facility is used to prevent sensitive information such as passwords from appearing in logging or debug output.

 AttrBundle (const String& type, const String& selector)

Construct an AttrBundle with "type" and "selector".

 AttrBundle (const String& stream)

Construct an AttrBundle that was serialized by a previous call to AttrBundle::serialize().

 AttrBundle (const AttrBundle& other)

Copy constructor. The list of listeners is not copied.

AttrBundle ()

[virtual]

Destructor.

AttrBundle*  clone ()

[const virtual]

Create a new AttrBundle which is a copy of this one. The list of listeners is not copied.

String  getType ()

[const virtual]

Get the type of this AttrBundle.

String  getSelector ()

[const virtual]

Get the selector of this AttrBundle.

String  serialize ()

[const virtual]

Turn this AttrBundle into an ascii string representation. This can be turned back into an AttrBundle using the constructor that takes a "stream" argument.

String  toString (int pad = 0)

[const virtual]

Turn this AttrBundle into an ascii string representation suitable for human consumption. "pad" is the number of padding spaces to insert at the left edge of each line.

void  setAttrVisible (const String& key, bool visible)

[virtual]

Control the visibility of an Attribute's value in the String returned by toString(). This is used to prevent passwords from showing up in debugging logs. By default, Attribute values are visible.

bool  getAttrVisible (const String& key)

[const virtual]

Determine whether the value of the Attribute associated with "key" should be visible in log files.

Attribute  getAttr (const String& key)

[const virtual]

Get a named attribute. If the attribute does not exist, Attribute::NUL is returned.

void  setAttr (const Attribute& attr)

[virtual]

Set an Attribute.

CollectionOf<Attribute>  copyAttrList ()

[const virtual]

Get the entire Attribute list. The caller is responsible for deleting all of the Attributes in the list.

bool  equals (const AttrBundle& other)

[const virtual]

Return "true" if "other" is the same as this AttrBundle, "false" if they are the different. Returns "true" if the type, selector, and Attributes of "other" are the same as this AttrBundle. The visibility flags are ignored.

void  adoptAttrListener (AttrListener* listener)

[virtual]

"listener" will get notified when Attributes change.

AttrListener*  orphanAttrListener (AttrListener* listener)

[virtual]

"listener" will no longer get notified when Attributes change.

void  removeAttrListener (AttrListener* listener)

[virtual]

"listener" will no longer get notified when Attributes change. "listener" will be deleted.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.