11 #ifndef GI_POLICY_SPACE_HPP
12 #define GI_POLICY_SPACE_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/gbpe/L24Classifier.hpp"
24 #include "modelgbp/gbp/AllowDenyAction.hpp"
28 #include "modelgbp/gbp/Contract.hpp"
32 #include "modelgbp/gbp/EpGroup.hpp"
36 #include "modelgbp/gbp/BridgeDomain.hpp"
40 #include "modelgbp/gbp/FloodDomain.hpp"
44 #include "modelgbp/gbp/RoutingDomain.hpp"
48 #include "modelgbp/gbp/Subnets.hpp"
52 #include "modelgbp/gbp/SecGroup.hpp"
58 :
public opflex::modb::mointernal::MO
65 static const opflex::modb::class_id_t
CLASS_ID = 224;
73 return getObjectInstance().isSet(7340033ul, opflex::modb::PropertyInfo::STRING);
80 boost::optional<const std::string&>
getName()
83 return getObjectInstance().getString(7340033ul);
92 const std::string&
getName(
const std::string& defaultValue)
94 return getName().get_value_or(defaultValue);
107 getTLMutator().modify(getClassId(), getURI())->setString(7340033ul, newValue);
119 getTLMutator().modify(getClassId(), getURI())->unset(7340033ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
134 static boost::optional<OF_SHARED_PTR<modelgbp::policy::Space> >
resolve(
135 opflex::ofcore::OFFramework& framework,
136 const opflex::modb::URI& uri)
138 return opflex::modb::mointernal::MO::resolve<modelgbp::policy::Space>(framework,
CLASS_ID, uri);
152 static boost::optional<OF_SHARED_PTR<modelgbp::policy::Space> >
resolve(
153 const opflex::modb::URI& uri)
155 return opflex::modb::mointernal::MO::resolve<modelgbp::policy::Space>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
174 static boost::optional<OF_SHARED_PTR<modelgbp::policy::Space> >
resolve(
175 opflex::ofcore::OFFramework& framework,
176 const std::string& policySpaceName)
178 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).build());
196 static boost::optional<OF_SHARED_PTR<modelgbp::policy::Space> >
resolve(
197 const std::string& policySpaceName)
199 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName);
214 const std::string& gbpeL24ClassifierName)
232 const std::string& gbpeL24ClassifierName)
234 OF_SHARED_PTR<modelgbp::gbpe::L24Classifier> result = addChild<modelgbp::gbpe::L24Classifier>(
235 CLASS_ID, getURI(), 2154823722ul, 42,
236 opflex::modb::URIBuilder(getURI()).addElement(
"GbpeL24Classifier").addElement(gbpeL24ClassifierName).build()
238 result->setName(gbpeL24ClassifierName);
258 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbpe::L24Classifier>(
259 getFramework(),
CLASS_ID, getURI(), 2154823722ul, 42, out);
274 const std::string& gbpAllowDenyActionName)
292 const std::string& gbpAllowDenyActionName)
294 OF_SHARED_PTR<modelgbp::gbp::AllowDenyAction> result = addChild<modelgbp::gbp::AllowDenyAction>(
295 CLASS_ID, getURI(), 2154823821ul, 141,
296 opflex::modb::URIBuilder(getURI()).addElement(
"GbpAllowDenyAction").addElement(gbpAllowDenyActionName).build()
298 result->setName(gbpAllowDenyActionName);
318 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::AllowDenyAction>(
319 getFramework(),
CLASS_ID, getURI(), 2154823821ul, 141, out);
334 const std::string& gbpContractName)
352 const std::string& gbpContractName)
354 OF_SHARED_PTR<modelgbp::gbp::Contract> result = addChild<modelgbp::gbp::Contract>(
355 CLASS_ID, getURI(), 2154823823ul, 143,
356 opflex::modb::URIBuilder(getURI()).addElement(
"GbpContract").addElement(gbpContractName).build()
358 result->setName(gbpContractName);
378 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::Contract>(
379 getFramework(),
CLASS_ID, getURI(), 2154823823ul, 143, out);
394 const std::string& gbpEpGroupName)
396 return modelgbp::gbp::EpGroup::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroup").addElement(gbpEpGroupName).build());
412 const std::string& gbpEpGroupName)
414 OF_SHARED_PTR<modelgbp::gbp::EpGroup> result = addChild<modelgbp::gbp::EpGroup>(
415 CLASS_ID, getURI(), 2154823832ul, 152,
416 opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroup").addElement(gbpEpGroupName).build()
418 result->setName(gbpEpGroupName);
438 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::EpGroup>(
439 getFramework(),
CLASS_ID, getURI(), 2154823832ul, 152, out);
454 const std::string& gbpBridgeDomainName)
472 const std::string& gbpBridgeDomainName)
474 OF_SHARED_PTR<modelgbp::gbp::BridgeDomain> result = addChild<modelgbp::gbp::BridgeDomain>(
475 CLASS_ID, getURI(), 2154823861ul, 181,
476 opflex::modb::URIBuilder(getURI()).addElement(
"GbpBridgeDomain").addElement(gbpBridgeDomainName).build()
478 result->setName(gbpBridgeDomainName);
498 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::BridgeDomain>(
499 getFramework(),
CLASS_ID, getURI(), 2154823861ul, 181, out);
514 const std::string& gbpFloodDomainName)
532 const std::string& gbpFloodDomainName)
534 OF_SHARED_PTR<modelgbp::gbp::FloodDomain> result = addChild<modelgbp::gbp::FloodDomain>(
535 CLASS_ID, getURI(), 2154823865ul, 185,
536 opflex::modb::URIBuilder(getURI()).addElement(
"GbpFloodDomain").addElement(gbpFloodDomainName).build()
538 result->setName(gbpFloodDomainName);
558 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::FloodDomain>(
559 getFramework(),
CLASS_ID, getURI(), 2154823865ul, 185, out);
574 const std::string& gbpRoutingDomainName)
592 const std::string& gbpRoutingDomainName)
594 OF_SHARED_PTR<modelgbp::gbp::RoutingDomain> result = addChild<modelgbp::gbp::RoutingDomain>(
595 CLASS_ID, getURI(), 2154823870ul, 190,
596 opflex::modb::URIBuilder(getURI()).addElement(
"GbpRoutingDomain").addElement(gbpRoutingDomainName).build()
598 result->setName(gbpRoutingDomainName);
618 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::RoutingDomain>(
619 getFramework(),
CLASS_ID, getURI(), 2154823870ul, 190, out);
634 const std::string& gbpSubnetsName)
636 return modelgbp::gbp::Subnets::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpSubnets").addElement(gbpSubnetsName).build());
652 const std::string& gbpSubnetsName)
654 OF_SHARED_PTR<modelgbp::gbp::Subnets> result = addChild<modelgbp::gbp::Subnets>(
655 CLASS_ID, getURI(), 2154823876ul, 196,
656 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSubnets").addElement(gbpSubnetsName).build()
658 result->setName(gbpSubnetsName);
678 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::Subnets>(
679 getFramework(),
CLASS_ID, getURI(), 2154823876ul, 196, out);
694 const std::string& gbpSecGroupName)
712 const std::string& gbpSecGroupName)
714 OF_SHARED_PTR<modelgbp::gbp::SecGroup> result = addChild<modelgbp::gbp::SecGroup>(
715 CLASS_ID, getURI(), 2154823883ul, 203,
716 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).build()
718 result->setName(gbpSecGroupName);
738 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::SecGroup>(
739 getFramework(),
CLASS_ID, getURI(), 2154823883ul, 203, out);
752 getTLMutator().remove(
CLASS_ID, getURI());
765 static void remove(opflex::ofcore::OFFramework& framework,
766 const opflex::modb::URI& uri)
768 MO::remove(framework,
CLASS_ID, uri);
781 static void remove(
const opflex::modb::URI& uri)
783 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
801 opflex::ofcore::OFFramework& framework,
802 const std::string& policySpaceName)
804 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).build());
822 const std::string& policySpaceName)
824 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName);
839 opflex::ofcore::OFFramework& framework,
840 opflex::modb::ObjectListener* listener)
842 opflex::modb::mointernal
843 ::MO::registerListener(framework, listener,
CLASS_ID);
858 opflex::modb::ObjectListener* listener)
870 opflex::ofcore::OFFramework& framework,
871 opflex::modb::ObjectListener* listener)
873 opflex::modb::mointernal
874 ::MO::unregisterListener(framework, listener,
CLASS_ID);
884 opflex::modb::ObjectListener* listener)
894 opflex::ofcore::OFFramework& framework,
895 const opflex::modb::URI& uri,
896 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
897 : MO(framework,
CLASS_ID, uri, oi) { }
902 #endif // GI_POLICY_SPACE_HPP
OF_SHARED_PTR< modelgbp::gbp::Contract > addGbpContract(const std::string &gbpContractName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:351
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Space.
Definition: Space.hpp:65
modelgbp::policy::Space & unsetName()
Unset name in the currently-active mutator.
Definition: Space.hpp:117
void resolveGbpSubnets(std::vector< OF_SHARED_PTR< modelgbp::gbp::Subnets > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::Subnets.
Definition: Space.hpp:676
static boost::optional< OF_SHARED_PTR< modelgbp::gbpe::L24Classifier > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L24Classifier from the managed object store.
Definition: L24Classifier.hpp:774
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroup > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroup from the managed object store.
Definition: EpGroup.hpp:210
boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolveGbpContract(const std::string &gbpContractName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:333
void resolveGbpAllowDenyAction(std::vector< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::AllowDenyAction.
Definition: Space.hpp:316
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: Space.hpp:883
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of AllowDenyAction from the managed object store.
Definition: AllowDenyAction.hpp:214
boost::optional< OF_SHARED_PTR< modelgbp::gbp::FloodDomain > > resolveGbpFloodDomain(const std::string &gbpFloodDomainName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:513
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: Space.hpp:869
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnets > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Subnets from the managed object store.
Definition: Subnets.hpp:118
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::RoutingDomain > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RoutingDomain from the managed object store.
Definition: RoutingDomain.hpp:242
void resolveGbpFloodDomain(std::vector< OF_SHARED_PTR< modelgbp::gbp::FloodDomain > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::FloodDomain.
Definition: Space.hpp:556
void resolveGbpSecGroup(std::vector< OF_SHARED_PTR< modelgbp::gbp::SecGroup > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::SecGroup.
Definition: Space.hpp:736
boost::optional< OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > > resolveGbpAllowDenyAction(const std::string &gbpAllowDenyActionName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:273
void resolveGbpeL24Classifier(std::vector< OF_SHARED_PTR< modelgbp::gbpe::L24Classifier > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbpe::L24Classifier.
Definition: Space.hpp:256
boost::optional< OF_SHARED_PTR< modelgbp::gbpe::L24Classifier > > resolveGbpeL24Classifier(const std::string &gbpeL24ClassifierName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:213
OF_SHARED_PTR< modelgbp::gbp::EpGroup > addGbpEpGroup(const std::string &gbpEpGroupName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:411
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Contract from the managed object store.
Definition: Contract.hpp:122
static boost::optional< OF_SHARED_PTR< modelgbp::policy::Space > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Space from the managed object store using the default framework instance...
Definition: Space.hpp:152
OF_SHARED_PTR< modelgbp::gbp::SecGroup > addGbpSecGroup(const std::string &gbpSecGroupName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:711
static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: Space.hpp:838
void resolveGbpRoutingDomain(std::vector< OF_SHARED_PTR< modelgbp::gbp::RoutingDomain > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::RoutingDomain.
Definition: Space.hpp:616
OF_SHARED_PTR< modelgbp::gbpe::L24Classifier > addGbpeL24Classifier(const std::string &gbpeL24ClassifierName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:231
OF_SHARED_PTR< modelgbp::gbp::RoutingDomain > addGbpRoutingDomain(const std::string &gbpRoutingDomainName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:591
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroup > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroup from the managed object store.
Definition: SecGroup.hpp:110
static boost::optional< OF_SHARED_PTR< modelgbp::policy::Space > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Space from the managed object store.
Definition: Space.hpp:134
boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnets > > resolveGbpSubnets(const std::string &gbpSubnetsName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:633
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::BridgeDomain > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of BridgeDomain from the managed object store.
Definition: BridgeDomain.hpp:174
boost::optional< OF_SHARED_PTR< modelgbp::gbp::BridgeDomain > > resolveGbpBridgeDomain(const std::string &gbpBridgeDomainName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:453
void resolveGbpContract(std::vector< OF_SHARED_PTR< modelgbp::gbp::Contract > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::Contract.
Definition: Space.hpp:376
modelgbp::policy::Space & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: Space.hpp:105
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: Space.hpp:857
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::FloodDomain > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of FloodDomain from the managed object store.
Definition: FloodDomain.hpp:338
boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroup > > resolveGbpSecGroup(const std::string &gbpSecGroupName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:693
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: Space.hpp:92
static boost::optional< OF_SHARED_PTR< modelgbp::policy::Space > > resolve(const std::string &policySpaceName)
Retrieve an instance of Space from the default managed object store by constructing its URI from the ...
Definition: Space.hpp:196
Space(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Space.
Definition: Space.hpp:893
OF_SHARED_PTR< modelgbp::gbp::BridgeDomain > addGbpBridgeDomain(const std::string &gbpBridgeDomainName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:471
static boost::optional< OF_SHARED_PTR< modelgbp::policy::Space > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName)
Retrieve an instance of Space from the managed object store by constructing its URI from the path ele...
Definition: Space.hpp:174
OF_SHARED_PTR< modelgbp::gbp::AllowDenyAction > addGbpAllowDenyAction(const std::string &gbpAllowDenyActionName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:291
OF_SHARED_PTR< modelgbp::gbp::FloodDomain > addGbpFloodDomain(const std::string &gbpFloodDomainName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:531
void resolveGbpEpGroup(std::vector< OF_SHARED_PTR< modelgbp::gbp::EpGroup > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::EpGroup.
Definition: Space.hpp:436
void resolveGbpBridgeDomain(std::vector< OF_SHARED_PTR< modelgbp::gbp::BridgeDomain > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::BridgeDomain.
Definition: Space.hpp:496
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: Space.hpp:80
boost::optional< OF_SHARED_PTR< modelgbp::gbp::RoutingDomain > > resolveGbpRoutingDomain(const std::string &gbpRoutingDomainName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:573
bool isNameSet()
Check whether name has been set.
Definition: Space.hpp:71
OF_SHARED_PTR< modelgbp::gbp::Subnets > addGbpSubnets(const std::string &gbpSubnetsName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Space.hpp:651
boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroup > > resolveGbpEpGroup(const std::string &gbpEpGroupName)
Retrieve the child object with the specified naming properties.
Definition: Space.hpp:393