Exemplo n.º 1
0
void _deleteSubscriptionInstance 
    (CIMClient & client, 
     const String & filterName,
     const String & handlerName)
{
    _deleteSubscriptionInstance (client, filterName, handlerName,
        CIMNamespaceName (), CIMNamespaceName (),
        PEGASUS_NAMESPACENAME_INTEROP);
}
Exemplo n.º 2
0
void _delete2 (CIMClient & client)
{
    try
    {
        _deleteSubscriptionInstance (client, String ("DEFilter02"),
            String ("DEHandler02"), NAMESPACE1, NAMESPACE2, NAMESPACE3);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "delete2 failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }

    PEGASUS_STD (cout) << "+++++ delete2 completed successfully"
                       << PEGASUS_STD (endl);
}
Exemplo n.º 3
0
void
_delete (CIMClient & client, String & filter, String & handler)
{
  //
  //  Delete subscription instances
  //
  _deleteSubscriptionInstance (client, filter,
			       PEGASUS_CLASSNAME_INDHANDLER_CIMXML, handler);

  //
  //  Delete handler instances
  //
  _deleteHandlerInstance (client, PEGASUS_CLASSNAME_INDHANDLER_CIMXML,
			  handler);
  //
  //  Delete filter instances
  //
  _deleteFilterInstance (client, filter);
}
Exemplo n.º 4
0
void
_cleanup (CIMClient & client)
{

  char cnt[512];
  String filter;
  String handler;

  for (Uint32 i = 0; i < QUERIES; i++)
    {

      sprintf (cnt, "%d", i);

      filter.clear ();
      filter.append (_filter);
      filter.append (cnt);

      handler.clear ();
      handler.append (_handler);
      handler.append (cnt);

      if (verbose)
	{
	  cerr << " Deleting filter " << filter << endl;
	  cerr << " Deleting handler" << handler << endl;
	}
      //
      //  Delete subscription instances
      //
      try
      {
	_deleteSubscriptionInstance (client, filter,
				     PEGASUS_CLASSNAME_INDHANDLER_CIMXML,
				     handler);
      }
      catch (...)
      {
      }
      //
      //  Delete handler instances
      //
      try
      {
	_deleteHandlerInstance (client, PEGASUS_CLASSNAME_INDHANDLER_CIMXML,
				handler);
      }
      catch (...)
      {
      }
      //
      //  Delete filter instances
      //
      try
      {
	_deleteFilterInstance (client, filter);
      }
      catch (...)
      {
      }
    }
  cout << "+++++ cleanup completed successfully" << endl;
}
Exemplo n.º 5
0
void _cleanup (CIMClient & client)
{
    try
    {
        _deleteSubscriptionInstance (client, FILTER_NAME,
                                     SNMPV1_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteSubscriptionInstance failure: "
                 << endl;
            throw;
        }
    }
    try
    {
        _deleteSubscriptionInstance (client, FILTER_NAME,
                                     SNMPV2C_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteSubscriptionInstance failure: "
                 << endl;
            throw;
        }
    }

#if defined(PEGASUS_ENABLE_IPV6)
    try
    {
        _deleteSubscriptionInstance (client, FILTER_NAME,
                                     SNMPV2C_IPV6_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteSubscriptionInstance failure: "
                 << endl;
            throw;
        }
    }
#endif

    try
    {
        _deleteFilterInstance (client, FILTER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteFilterInstance failure: " << endl;
            throw;
        }
    }

    try
    {
        _deleteHandlerInstance (client, SNMPV1_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteHandlerInstance failure: " << endl;
            throw;
        }
    }
    try
    {
        _deleteHandlerInstance (client, SNMPV2C_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteHandlerInstance failure: " << endl;
            throw;
        }
    }
#if defined(PEGASUS_ENABLE_IPV6)
    try
    {
        _deleteHandlerInstance (client, SNMPV2C_IPV6_HANDLER_NAME);
    }
    catch (CIMException& e)
    {
        if (e.getCode() != CIM_ERR_NOT_FOUND)
        {
            cerr << "----- Error: deleteHandlerInstance failure: " << endl;
            throw;
        }
    }
#endif
}