(file) Return to SystemLogListenerDestination.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Handler / SystemLogListenerDestination

Diff for /pegasus/src/Pegasus/Handler/SystemLogListenerDestination/SystemLogListenerDestination.cpp between version 1.1 and 1.3.8.1

version 1.1, 2005/02/14 21:15:34 version 1.3.8.1, 2006/02/10 16:11:44
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
 //  // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 46 
Line 47 
 #include <Pegasus/Common/CIMType.h> #include <Pegasus/Common/CIMType.h>
 #include <Pegasus/Common/IndicationFormatter.h> #include <Pegasus/Common/IndicationFormatter.h>
  
 #if defined(PEGASUS_USE_SYSLOGS)  
 #include <syslog.h>  
 #endif  
   
 #include "SystemLogListenerDestination.h" #include "SystemLogListenerDestination.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 66 
Line 63 
     CIMInstance& indication,     CIMInstance& indication,
     CIMInstance& handler,     CIMInstance& handler,
     CIMInstance& subscription,     CIMInstance& subscription,
     ContentLanguages & contentLanguages)      ContentLanguageList & contentLanguages)
 { {
     PEG_METHOD_ENTER (TRC_IND_HANDLER,     PEG_METHOD_ENTER (TRC_IND_HANDLER,
         "SystemLogListenerDestination::handleIndication");         "SystemLogListenerDestination::handleIndication");
  
     String ident_name = "CIM Indication";     String ident_name = "CIM Indication";
     String indicationText;     String indicationText;
     String textFormat = String::EMPTY;  
     CIMValue textFormatValue;  
     CIMValue textFormatParamsValue;  
   
     Array<String> textFormatParams = NULL;  
  
     try     try
     {     {
         // get TextFormat from subscription          // gets formatted indication message
         Uint32 textFormatPos =          indicationText = IndicationFormatter::getFormattedIndText(
             subscription.findProperty(_PROPERTY_TEXTFORMAT);              subscription, indication, contentLanguages);
   
         // if the property TextFormat is not found,  
         // indication is constructed with default format  
         if (textFormatPos == PEG_NOT_FOUND)  
         {  
             indicationText = IndicationFormatter::formatDefaultIndicationText  
                              (indication);  
         }  
         else  
         {  
             textFormatValue = subscription.getProperty(textFormatPos).  
                 getValue();  
   
             // if the value of textFormat is NULL,  
             // indication is constructed with default format  
             if (textFormatValue.isNull())  
             {  
                 indicationText =  
                     IndicationFormatter::formatDefaultIndicationText(indication);  
             }  
             else  
             {  
                 // get TextFormatParameters from subscription  
                 Uint32 textFormatParamsPos = subscription.findProperty(  
                     _PROPERTY_TEXTFORMATPARAMETERS);  
   
                 if (textFormatParamsPos != PEG_NOT_FOUND)  
                 {  
                     textFormatParamsValue = subscription.getProperty(  
                         textFormatParamsPos).getValue();  
                 }  
   
                 // constructs indication with specified format  
                 if ((textFormatValue.getType() == CIMTYPE_STRING) &&  
                     !(textFormatValue.isArray()))  
                 {  
                     textFormatValue.get(textFormat);  
                     if (!textFormatParamsValue.isNull())  
                     {  
                         if ((textFormatParamsValue.getType() ==  
                              CIMTYPE_STRING) &&  
                             (textFormatParamsValue.isArray()))  
                         {  
                             textFormatParamsValue.get(textFormatParams);  
                         }  
                     }  
   
                     indicationText = IndicationFormatter::formatIndicationText  
                                      (textFormat,  
                                       textFormatParams,  
                                       indication,  
                                       contentLanguages);  
                 }  
                 else  
                 {  
                     indicationText =  
                         IndicationFormatter::formatDefaultIndicationText(  
                             indication);  
                 }  
             }  
         }  
  
         // default severity         // default severity
         Uint32 severity = Logger::INFORMATION;         Uint32 severity = Logger::INFORMATION;
Line 250 
Line 181 
  
 #if defined(PEGASUS_USE_SYSLOGS) #if defined(PEGASUS_USE_SYSLOGS)
  
     // Open the syslog      System::syslog(identifier, severity, formattedText.getCString());
     System::openlog(identifier);  
   
     System::syslog(severity, (const char *)formattedText.getCString());  
   
     // Close the syslog  
     System::closelog();  
  
 #else #else
  


Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3.8.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2