11 #ifndef GI_GBP_SECGROUP_HPP
12 #define GI_GBP_SECGROUP_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/epdr/EndPointFromSecGroupRTgt.hpp"
24 #include "modelgbp/gbp/SecGroupSubject.hpp"
30 :
public opflex::modb::mointernal::MO
37 static const opflex::modb::class_id_t
CLASS_ID = 159;
45 return getObjectInstance().isSet(5210113ul, opflex::modb::PropertyInfo::STRING);
52 boost::optional<const std::string&>
getName()
55 return getObjectInstance().getString(5210113ul);
64 const std::string&
getName(
const std::string& defaultValue)
66 return getName().get_value_or(defaultValue);
79 getTLMutator().modify(getClassId(), getURI())->setString(5210113ul, newValue);
91 getTLMutator().modify(getClassId(), getURI())->unset(5210113ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
106 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> >
resolve(
107 opflex::ofcore::OFFramework& framework,
108 const opflex::modb::URI& uri)
110 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroup>(framework,
CLASS_ID, uri);
124 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> >
resolve(
125 const opflex::modb::URI& uri)
127 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroup>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
148 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> >
resolve(
149 opflex::ofcore::OFFramework& framework,
150 const std::string& policySpaceName,
151 const std::string& gbpSecGroupName)
153 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).build());
173 static boost::optional<boost::shared_ptr<modelgbp::gbp::SecGroup> >
resolve(
174 const std::string& policySpaceName,
175 const std::string& gbpSecGroupName)
177 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName);
192 const std::string& epdrEndPointFromSecGroupRTgtSource)
210 const std::string& epdrEndPointFromSecGroupRTgtSource)
212 boost::shared_ptr<modelgbp::epdr::EndPointFromSecGroupRTgt> result = addChild<modelgbp::epdr::EndPointFromSecGroupRTgt>(
213 CLASS_ID, getURI(), 2152693850ul, 90,
214 opflex::modb::URIBuilder(getURI()).addElement(
"EpdrEndPointFromSecGroupRTgt").addElement(epdrEndPointFromSecGroupRTgtSource).build()
216 result->setSource(epdrEndPointFromSecGroupRTgtSource);
236 opflex::modb::mointernal::MO::resolveChildren<modelgbp::epdr::EndPointFromSecGroupRTgt>(
237 getFramework(),
CLASS_ID, getURI(), 2152693850ul, 90, out);
252 const std::string& gbpSecGroupSubjectName)
270 const std::string& gbpSecGroupSubjectName)
272 boost::shared_ptr<modelgbp::gbp::SecGroupSubject> result = addChild<modelgbp::gbp::SecGroupSubject>(
273 CLASS_ID, getURI(), 2152693920ul, 160,
274 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).build()
276 result->setName(gbpSecGroupSubjectName);
296 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::SecGroupSubject>(
297 getFramework(),
CLASS_ID, getURI(), 2152693920ul, 160, out);
310 getTLMutator().remove(
CLASS_ID, getURI());
323 static void remove(opflex::ofcore::OFFramework& framework,
324 const opflex::modb::URI& uri)
326 MO::remove(framework,
CLASS_ID, uri);
339 static void remove(
const opflex::modb::URI& uri)
341 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
361 opflex::ofcore::OFFramework& framework,
362 const std::string& policySpaceName,
363 const std::string& gbpSecGroupName)
365 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).build());
385 const std::string& policySpaceName,
386 const std::string& gbpSecGroupName)
388 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName);
403 opflex::ofcore::OFFramework& framework,
404 opflex::modb::ObjectListener* listener)
406 opflex::modb::mointernal
407 ::MO::registerListener(framework, listener,
CLASS_ID);
422 opflex::modb::ObjectListener* listener)
434 opflex::ofcore::OFFramework& framework,
435 opflex::modb::ObjectListener* listener)
437 opflex::modb::mointernal
438 ::MO::unregisterListener(framework, listener,
CLASS_ID);
448 opflex::modb::ObjectListener* listener)
458 opflex::ofcore::OFFramework& framework,
459 const opflex::modb::URI& uri,
460 const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
461 : MO(framework,
CLASS_ID, uri, oi) { }
466 #endif // GI_GBP_SECGROUP_HPP
SecGroup(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SecGroup.
Definition: SecGroup.hpp:457
boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > addEpdrEndPointFromSecGroupRTgt(const std::string &epdrEndPointFromSecGroupRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroup.hpp:209
static boost::optional< boost::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:106
boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > resolveEpdrEndPointFromSecGroupRTgt(const std::string &epdrEndPointFromSecGroupRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: SecGroup.hpp:191
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SecGroup.
Definition: SecGroup.hpp:37
boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > resolveGbpSecGroupSubject(const std::string &gbpSecGroupSubjectName)
Retrieve the child object with the specified naming properties.
Definition: SecGroup.hpp:251
modelgbp::gbp::SecGroup & unsetName()
Unset name in the currently-active mutator.
Definition: SecGroup.hpp:89
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SecGroup.hpp:433
static boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EndPointFromSecGroupRTgt from the managed object store.
Definition: EndPointFromSecGroupRTgt.hpp:210
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SecGroup.hpp:447
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: SecGroup.hpp:402
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(const std::string &policySpaceName, const std::string &gbpSecGroupName)
Retrieve an instance of SecGroup from the default managed object store by constructing its URI from t...
Definition: SecGroup.hpp:173
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SecGroup.hpp:52
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSecGroupName)
Retrieve an instance of SecGroup from the managed object store by constructing its URI from the path ...
Definition: SecGroup.hpp:148
boost::shared_ptr< modelgbp::gbp::SecGroupSubject > addGbpSecGroupSubject(const std::string &gbpSecGroupSubjectName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroup.hpp:269
Definition: SecGroup.hpp:29
bool isNameSet()
Check whether name has been set.
Definition: SecGroup.hpp:43
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SecGroup.hpp:64
void resolveGbpSecGroupSubject(std::vector< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::SecGroupSubject.
Definition: SecGroup.hpp:294
modelgbp::gbp::SecGroup & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SecGroup.hpp:77
void resolveEpdrEndPointFromSecGroupRTgt(std::vector< boost::shared_ptr< modelgbp::epdr::EndPointFromSecGroupRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::epdr::EndPointFromSecGroupRTgt.
Definition: SecGroup.hpp:234
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroup > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SecGroup from the managed object store using the default framework instance...
Definition: SecGroup.hpp:124
static boost::optional< boost::shared_ptr< modelgbp::gbp::SecGroupSubject > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupSubject from the managed object store.
Definition: SecGroupSubject.hpp:102
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: SecGroup.hpp:421