reSIProcate/DialogUsageManager  9680
ChallengeInfo.cxx
Go to the documentation of this file.
00001 
00002 #include <cassert>
00003 
00004 #include "resip/dum/ChallengeInfo.hxx"
00005 #include "rutil/Data.hxx"
00006 #include "rutil/Logger.hxx"
00007 
00008 using namespace resip;
00009 using namespace std;
00010 
00011 #define RESIPROCATE_SUBSYSTEM Subsystem::DUM
00012 
00013 
00014 ChallengeInfo::ChallengeInfo( bool failed,
00015                               bool challengeRequired,
00016                               const Data& transactionId ):
00017    DumFeatureMessage(transactionId),
00018    mFailed(failed),
00019    mChallengeRequired(challengeRequired)
00020 {
00021 }
00022 
00023 ChallengeInfo::~ChallengeInfo()
00024 {
00025 }
00026 
00027 bool
00028 ChallengeInfo::isFailed() const
00029 {
00030    return mFailed;
00031 }
00032 
00033 bool
00034 ChallengeInfo::isChallengeRequired() const
00035 {
00036    return mChallengeRequired;
00037 }
00038 
00039 Data
00040 ChallengeInfo::brief() const
00041 {
00042    Data buffer;
00043    DataStream strm(buffer);
00044    strm << "ChallengeInfo " << mFailed << " : " << mChallengeRequired;
00045    strm.flush();
00046    return buffer;
00047 }
00048 
00049 resip::Message*
00050 ChallengeInfo::clone() const
00051 {
00052    assert(false); return NULL;
00053 }
00054 
00055 std::ostream&
00056 ChallengeInfo::encode(std::ostream& strm) const
00057 {
00058    strm << brief();
00059    return strm;
00060 }
00061 
00062 std::ostream&
00063 ChallengeInfo::encodeBrief(std::ostream& strm) const
00064 {
00065    return encode(strm);
00066 }
00067 
00068 std::ostream&
00069 resip::operator<<(std::ostream& strm, const ChallengeInfo& msg)
00070 {
00071    return msg.encode(strm);
00072 }
00073 
00074 /* ====================================================================
00075  * The Vovida Software License, Version 1.0
00076  *
00077  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00078  *
00079  * Redistribution and use in source and binary forms, with or without
00080  * modification, are permitted provided that the following conditions
00081  * are met:
00082  *
00083  * 1. Redistributions of source code must retain the above copyright
00084  *    notice, this list of conditions and the following disclaimer.
00085  *
00086  * 2. Redistributions in binary form must reproduce the above copyright
00087  *    notice, this list of conditions and the following disclaimer in
00088  *    the documentation and/or other materials provided with the
00089  *    distribution.
00090  *
00091  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00092  *    and "Vovida Open Communication Application Library (VOCAL)" must
00093  *    not be used to endorse or promote products derived from this
00094  *    software without prior written permission. For written
00095  *    permission, please contact vocal@vovida.org.
00096  *
00097  * 4. Products derived from this software may not be called "VOCAL", nor
00098  *    may "VOCAL" appear in their name, without prior written
00099  *    permission of Vovida Networks, Inc.
00100  *
00101  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00102  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00103  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00104  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00105  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00106  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00107  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00108  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00109  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00110  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00111  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00112  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00113  * DAMAGE.
00114  *
00115  * ====================================================================
00116  *
00117  * This software consists of voluntary contributions made by Vovida
00118  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00119  * Inc.  For more information on Vovida Networks, Inc., please see
00120  * <http://www.vovida.org/>.
00121  *
00122  */
00123