Ejemplo n.º 1
0
/*
================================================================================
NAME              : _constructKeyBindings
DESCRIPTION       : Constructs an array of keybindings for an IP Interface
ASSUMPTIONS       : None
PRE-CONDITIONS    :
POST-CONDITIONS   :
NOTES             :
PARAMETERS        : className, Process
================================================================================
*/
Array<CIMKeyBinding> BIPTLEpProvider::_constructKeyBindings(
					const CIMNamespaceName &nameSpace,
					const IPInterface &_ipif)
{
#ifdef DEBUG
  cout << "BIPTLEpProvider::_constructKeyBindings()" << endl;
#endif

  Array<CIMKeyBinding> keyBindings;
  String s, sn;
  CIMObjectPath op;

  if (_ipif.getSystemName(sn) == false)
  {
	throw CIMNotSupportedException(
		String("Host-specific module doesn't support Key `") +
		PROPERTY_SYSTEM_NAME.getString() + String("'"));
  }

  // Construct the key bindings
  op = CIMObjectPath(sn, //hostname
		       nameSpace,
		       CLASS_CIM_LAN_ENDPOINT,
                       _constructReference(
		                   CLASS_CIM_LAN_ENDPOINT,
				   sn,_ipif.get_LANInterfaceName()) );

  keyBindings.append(CIMKeyBinding(PROPERTY_ANTECEDENT,
                                   op.toString(),
                                   CIMKeyBinding::REFERENCE));

  if (_ipif.getName(s))
  {
	  op = CIMObjectPath(sn, //hostname
			       nameSpace,
			       CLASS_CIM_IP_PROTOCOL_ENDPOINT,
                               _constructReference(
			                   CLASS_CIM_IP_PROTOCOL_ENDPOINT,
					   sn,s) );

	  keyBindings.append(CIMKeyBinding(PROPERTY_DEPENDENT,
			     op.toString(),
                             CIMKeyBinding::REFERENCE));
  }
  else
  {
	throw CIMNotSupportedException(
		String("Host-specific module doesn't support Key `") +
		PROPERTY_NAME.getString() + String("'"));
  }

#ifdef DEBUG
  cout << "BIPTLEpProvider::_constructKeyBindings() -- done" << endl;
#endif

  return keyBindings;
}