00001 /******************************************************************************* 00002 * Copyright (C) 2003-2004 Vintela, Inc. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions are met: 00006 * 00007 * - Redistributions of source code must retain the above copyright notice, 00008 * this list of conditions and the following disclaimer. 00009 * 00010 * - Redistributions in binary form must reproduce the above copyright notice, 00011 * this list of conditions and the following disclaimer in the documentation 00012 * and/or other materials provided with the distribution. 00013 * 00014 * - Neither the name of Vintela, Inc. nor the names of its 00015 * contributors may be used to endorse or promote products derived from this 00016 * software without specific prior written permission. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS 00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00028 * POSSIBILITY OF SUCH DAMAGE. 00029 *******************************************************************************/ 00030 00035 #include "OW_config.h" 00036 #include "OW_IndicationRepLayerMediator.hpp" 00037 #include "OW_MutexLock.hpp" 00038 00039 namespace OW_NAMESPACE 00040 { 00041 00043 UInt32 00044 IndicationRepLayerMediator::getClassCreationSubscriptionCount() 00045 { 00046 return AtomicGet(m_indicationCount) + AtomicGet(m_classCount) + AtomicGet(m_classCreationCount); 00047 } 00049 UInt32 00050 IndicationRepLayerMediator::getClassModificationSubscriptionCount() 00051 { 00052 return AtomicGet(m_indicationCount) + AtomicGet(m_classCount) + AtomicGet(m_classModificationCount); 00053 } 00055 UInt32 00056 IndicationRepLayerMediator::getClassDeletionSubscriptionCount() 00057 { 00058 return AtomicGet(m_indicationCount) + AtomicGet(m_classCount) + AtomicGet(m_classDeletionCount); 00059 } 00061 UInt32 00062 IndicationRepLayerMediator::getInstCreationSubscriptionCount() 00063 { 00064 return AtomicGet(m_indicationCount) + AtomicGet(m_instCount) + AtomicGet(m_instCreationCount); 00065 } 00067 UInt32 00068 IndicationRepLayerMediator::getInstModificationSubscriptionCount() 00069 { 00070 return AtomicGet(m_indicationCount) + AtomicGet(m_instCount) + AtomicGet(m_instModificationCount); 00071 } 00073 UInt32 00074 IndicationRepLayerMediator::getInstDeletionSubscriptionCount() 00075 { 00076 return AtomicGet(m_indicationCount) + AtomicGet(m_instCount) + AtomicGet(m_instDeletionCount); 00077 } 00079 UInt32 00080 IndicationRepLayerMediator::getInstReadSubscriptionCount() 00081 { 00082 return AtomicGet(m_indicationCount) + AtomicGet(m_instCount) + AtomicGet(m_instReadCount); 00083 } 00085 UInt32 00086 IndicationRepLayerMediator::getInstMethodCallSubscriptionCount() 00087 { 00088 return AtomicGet(m_indicationCount) + AtomicGet(m_instCount) + AtomicGet(m_instMethodCallCount); 00089 } 00091 void 00092 IndicationRepLayerMediator::addSubscription(const String& subName) 00093 { 00094 String name(subName); 00095 name.toLowerCase(); 00096 if (name == "cim_instcreation") 00097 { 00098 AtomicInc(m_instCreationCount); 00099 } 00100 else if (name == "cim_instmodification") 00101 { 00102 AtomicInc(m_instModificationCount); 00103 } 00104 else if (name == "cim_instdeletion") 00105 { 00106 AtomicInc(m_instDeletionCount); 00107 } 00108 else if (name == "cim_instmethodcall") 00109 { 00110 AtomicInc(m_instMethodCallCount); 00111 } 00112 else if (name == "cim_instread") 00113 { 00114 AtomicInc(m_instReadCount); 00115 } 00116 else if (name == "cim_instindication") 00117 { 00118 AtomicInc(m_instCount); 00119 } 00120 else if (name == "cim_classcreation") 00121 { 00122 AtomicInc(m_classCreationCount); 00123 } 00124 else if (name == "cim_classmodification") 00125 { 00126 AtomicInc(m_classModificationCount); 00127 } 00128 else if (name == "cim_classdeletion") 00129 { 00130 AtomicInc(m_classDeletionCount); 00131 } 00132 else if (name == "cim_classindication") 00133 { 00134 AtomicInc(m_classCount); 00135 } 00136 else if (name == "cim_indication") 00137 { 00138 AtomicInc(m_indicationCount); 00139 } 00140 } 00142 void 00143 IndicationRepLayerMediator::deleteSubscription(const String& subName) 00144 { 00145 String name(subName); 00146 name.toLowerCase(); 00147 if (name == "cim_instcreation") 00148 { 00149 AtomicDec(m_instCreationCount); 00150 } 00151 else if (name == "cim_instmodification") 00152 { 00153 AtomicDec(m_instModificationCount); 00154 } 00155 else if (name == "cim_instdeletion") 00156 { 00157 AtomicDec(m_instDeletionCount); 00158 } 00159 else if (name == "cim_instmethodcall") 00160 { 00161 AtomicDec(m_instMethodCallCount); 00162 } 00163 else if (name == "cim_instread") 00164 { 00165 AtomicDec(m_instReadCount); 00166 } 00167 else if (name == "cim_instindication") 00168 { 00169 AtomicDec(m_instCount); 00170 } 00171 else if (name == "cim_classcreation") 00172 { 00173 AtomicDec(m_classCreationCount); 00174 } 00175 else if (name == "cim_classmodification") 00176 { 00177 AtomicDec(m_classModificationCount); 00178 } 00179 else if (name == "cim_classdeletion") 00180 { 00181 AtomicDec(m_classDeletionCount); 00182 } 00183 else if (name == "cim_classindication") 00184 { 00185 AtomicDec(m_classCount); 00186 } 00187 else if (name == "cim_indication") 00188 { 00189 AtomicDec(m_indicationCount); 00190 } 00191 } 00192 00193 } // end namespace OW_NAMESPACE 00194