reSIProcate/DialogUsageManager  9680
ClientPublication.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_CLIENTPUBLICATION_HXX)
00002 #define RESIP_CLIENTPUBLICATION_HXX
00003 
00004 #include "resip/dum/NonDialogUsage.hxx"
00005 
00006 namespace resip
00007 {
00008 
00009 class ClientPublication : public NonDialogUsage
00010 {
00011    public:
00012       ClientPublication(DialogUsageManager& dum, DialogSet& dialogSet, SharedPtr<SipMessage> pub);
00013 
00014       typedef Handle<ClientPublication> ClientPublicationHandle;
00015       ClientPublicationHandle getHandle();
00016       const Data& getEventType() { return mEventType; }
00017       const Contents* getContents() const { return mDocument; }
00018 
00019       //0 means the last value of Expires will be used.
00020       void refresh(unsigned int expiration=0);
00021       void update(const Contents* body);
00022       virtual void end();
00023       void end(bool immediate); // If immediate is true then usage is destroyed with no further messaging
00024 
00028       void updateCommand(const Contents* body);
00029       void refreshCommand(unsigned int expiration=0);
00030       virtual void endCommand(bool immediate=false);  // If immediate is true then usage is destroyed with no further messaging
00031 
00032       virtual void dispatch(const SipMessage& msg);
00033       virtual void dispatch(const DumTimeout& timer);
00034 
00035       virtual EncodeStream& dump(EncodeStream& strm) const;
00036 
00037    protected:
00038       virtual ~ClientPublication();
00039       virtual void send(SharedPtr<SipMessage> request);
00040       
00041    private:
00042       friend class DialogSet;
00043 
00044       bool mWaitingForResponse;
00045       bool mPendingPublish;
00046       
00047       SharedPtr<SipMessage> mPublish;
00048       Data mEventType;
00049       unsigned int mTimerSeq; // expected timer seq (all < are stale)
00050       const Contents* mDocument;
00051       
00052       // disabled
00053       ClientPublication(const ClientPublication&);
00054       ClientPublication& operator=(const ClientPublication&);
00055 };
00056  
00057 }
00058 
00059 #endif
00060 
00061 /* ====================================================================
00062  * The Vovida Software License, Version 1.0 
00063  * 
00064  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00065  * 
00066  * Redistribution and use in source and binary forms, with or without
00067  * modification, are permitted provided that the following conditions
00068  * are met:
00069  * 
00070  * 1. Redistributions of source code must retain the above copyright
00071  *    notice, this list of conditions and the following disclaimer.
00072  * 
00073  * 2. Redistributions in binary form must reproduce the above copyright
00074  *    notice, this list of conditions and the following disclaimer in
00075  *    the documentation and/or other materials provided with the
00076 
00077  *    distribution.
00078  * 
00079  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00080  *    and "Vovida Open Communication Application Library (VOCAL)" must
00081  *    not be used to endorse or promote products derived from this
00082  *    software without prior written permission. For written
00083  *    permission, please contact vocal@vovida.org.
00084  *
00085  * 4. Products derived from this software may not be called "VOCAL", nor
00086  *    may "VOCAL" appear in their name, without prior written
00087  *    permission of Vovida Networks, Inc.
00088  * 
00089  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00090  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00091  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00092  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00093  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00094  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00095  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00096  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00097  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00098  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00099  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00100  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00101  * DAMAGE.
00102  * 
00103  * ====================================================================
00104  * 
00105  * This software consists of voluntary contributions made by Vovida
00106  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00107  * Inc.  For more information on Vovida Networks, Inc., please see
00108  * <http://www.vovida.org/>.
00109  *
00110  */