# # Copyright (c) 2001-2010 NetApp, Inc., All Rights Reserved # Any use, modification, or distribution is prohibited # without prior written consent from NetApp, Inc. # ## @summary Record that defines the attributes of each host picked up by the Realm ## @author madhavs@netapp.com, dl-nacl-dev@netapp.com ## @status shared ## @pod here # NACL::ResourceRecords consists of a number of "Resource Records". # Originally, each "Resource Record" was simply the hostrec for that # resource. However, we can also assign rules (apiset_(must|should)) to # individual hosts based on hints from a number of sources. # (determine_rules() of CommandInterface.pm explains this in detail) # Rather than maintain two lists for each host type (one list of hostrecs, # another list of rules) and then needing to maintain a map between them, # we consider it better for all these details for a host (its hostrec, # apiset_must, apiset_should rules) be encapsulated in a single entity. # That entity is a NACL::ResourceRecord. This means that NACL::ResourceRecords # will internally consist of a number of objects of type NACL::ResourceRecord. # Hence, $resource_records->nodes() will no longer return all Nodes hostrecs, # but instead all "NACL::ResourceRecord" objects for Nodes. package NACL::ResourceRecord; use strict; use warnings; use Class::MethodMaker [ new => [ '-hash', 'new' ], scalar => [ { -type => 'Hostrec' }, 'hostrec', ], hash => 'apiset_must', hash => 'apiset_should', hash => 'cdef_path', scalar => 'timeout', scalar => 'timeout_scaling_factor', scalar => [ { -type => 'NATE::Result::Config' }, '_error' ], scalar => '_name', scalar => 'prefix', scalar => '_cdef_calculation_performed' ]; # This specifies which attributes could be set by reading test parameters sub _settings_read_from_parameters { return ( qw(apiset_must apiset_should cdef_path timeout timeout_scaling_factor) ); } 1;