reSIProcate/DialogUsageManager  9694
MasterProfile.hxx
Go to the documentation of this file.
00001 #ifndef RESIP_MasterProfile_hxx
00002 #define RESIP_MasterProfile_hxx
00003 
00004 #include <iosfwd>
00005 #include <set>
00006 #include <map>
00007 #include "resip/stack/Headers.hxx"
00008 #include "resip/stack/MethodTypes.hxx"
00009 #include "resip/stack/Token.hxx"
00010 #include "resip/dum/UserProfile.hxx"
00011 
00012 namespace resip
00013 {
00014 
00015 class Data;
00016 
00017 class MasterProfile : public UserProfile
00018 {
00019    public:  
00020       
00022       MasterProfile();  
00023       
00025       virtual void addSupportedScheme(const Data& scheme);          
00026       virtual bool isSchemeSupported(const Data& scheme) const;
00027       virtual void clearSupportedSchemes(void);
00028 
00030       virtual void addSupportedMethod(const MethodTypes& method);   
00031       virtual bool isMethodSupported(MethodTypes method) const;
00032       virtual Tokens getAllowedMethods() const;
00033       virtual Data getAllowedMethodsData() const;
00034 
00035       virtual void clearSupportedMethods(void);
00036 
00038       virtual void addSupportedOptionTag(const Token& tag);        
00039       virtual Tokens getUnsupportedOptionsTags(const Tokens& requires); // Returns list of unsupported option tags
00040       virtual Tokens getSupportedOptionTags() const;
00041       virtual void clearSupportedOptionTags(void);
00042 
00043       typedef enum
00044       {
00045          Never,
00046          Supported, 
00047          Required
00048       } ReliableProvisionalMode;
00049 
00050 
00051       // UAC PRACK support.  UPDATE must be enabled(currently defaults to on, do
00052       // not disable w/out disabling UAC PRACK support).
00053       //
00054       // Flows where an an answer is received in a 180rel and subsequent O/A
00055       // exchanges using UPDATE occur in the early dialog
00056       // have been tested.  
00057       //
00058       // A subsequent O/A exchange using 180rel/PRACK is also supported. This is
00059       // a really bad idea, as an answer must be generated; the offer cannot be
00060       // rejected. UPDATE should always be used for O/A exchanges once the
00061       // dialog is established.
00062       // Invite/18x(offer)/PRACK(ans) should work but has not been tested.
00063       //
00064       // Explicit limitations are:
00065       // Overlapping reliable provisional responses that contain a body are not
00066       // handled.
00067       // Offers in a 200(PRACK) are not supported, and anyone who generates them
00068       // should be summarily executed.
00069 
00070       virtual void setUacReliableProvisionalMode(ReliableProvisionalMode mode);
00071       virtual ReliableProvisionalMode getUacReliableProvisionalMode() const;
00072 
00073       //Not supported as UAS. Calling setUacReliableProvisionalMode will result
00074       //in an assert.
00075       virtual void setUasReliableProvisionalMode(ReliableProvisionalMode mode);
00076       virtual ReliableProvisionalMode getUasReliableProvisionalMode() const;
00077 
00079       virtual void addSupportedMimeType(const MethodTypes& method, const Mime& mimeType);      
00080       virtual bool removeSupportedMimeType(const MethodTypes& method, const Mime& mimeType);      
00081       virtual bool isMimeTypeSupported(const MethodTypes& method, const Mime& mimeType);
00082       virtual Mimes getSupportedMimeTypes(const MethodTypes& method);
00083       virtual void clearSupportedMimeTypes(const MethodTypes& method);
00084       virtual void clearSupportedMimeTypes(void);  // Clear for all Methods
00085 
00087       virtual void addSupportedEncoding(const Token& encoding);     
00088       virtual bool isContentEncodingSupported(const Token& contentEncoding) const;
00089       virtual Tokens getSupportedEncodings() const;
00090       virtual void clearSupportedEncodings(void);
00091 
00093       virtual void addSupportedLanguage(const Token& lang);         
00094       virtual bool isLanguageSupported(const Tokens& lang) const;
00095       virtual Tokens getSupportedLanguages() const;
00096       virtual void clearSupportedLanguages(void);
00097       
00099       virtual void addAllowedEvent(const Token& event);         
00100       virtual bool isEventAllowed(const Tokens& event) const;
00101       virtual Tokens getAllowedEvents() const;
00102       virtual void clearAllowedEvents(void);
00103       
00105       virtual bool& validateContentEnabled();
00106       virtual bool validateContentEnabled() const;
00107 
00109       virtual bool& validateContentLanguageEnabled();
00110       virtual bool validateContentLanguageEnabled() const;
00111 
00113       virtual bool& validateAcceptEnabled();
00114       virtual bool validateAcceptEnabled() const;
00115 
00118       virtual bool& allowBadRegistrationEnabled();
00119       virtual bool allowBadRegistrationEnabled() const;  
00120 
00121            
00127       virtual UInt32& serverRegistrationMinExpiresTime(void);
00128       virtual const UInt32 serverRegistrationMinExpiresTime(void) const;
00129 
00133       virtual UInt32& serverRegistrationMaxExpiresTime(void);
00134       virtual const UInt32 serverRegistrationMaxExpiresTime(void) const;
00135 
00137       virtual UInt32& serverRegistrationDefaultExpiresTime(void);
00138       virtual const UInt32 serverRegistrationDefaultExpiresTime(void) const;
00139 
00150       
00151       virtual bool& checkReqUriInMergeDetectionEnabled();
00152       virtual bool checkReqUriInMergeDetectionEnabled() const;
00153 
00154    private:
00155       virtual UserProfile* clone() const;
00156       std::set<Data> mSupportedSchemes;
00157       std::set<MethodTypes> mSupportedMethodTypes;
00158       Tokens mSupportedMethods;
00159       Tokens mSupportedOptionTags;
00160       std::map<MethodTypes, Mimes> mSupportedMimeTypes;
00161       Tokens mSupportedEncodings;
00162       Tokens mSupportedLanguages;
00163       Tokens mAllowedEvents;
00164 
00165       bool mValidateContentEnabled;
00166       bool mValidateContentLanguageEnabled;
00167       bool mValidateAcceptEnabled;
00168       bool mAllowBadRegistrationEnabled;    
00169       bool mHasServerRegistrationMinExpires;      
00170       bool mCheckReqUriInMergeDetectionEnabled;
00171       ReliableProvisionalMode mUacReliableProvisionalMode;
00172       ReliableProvisionalMode mUasReliableProvisionalMode;
00173       UInt32 mServerRegistrationMinExpires;
00174       UInt32 mServerRegistrationMaxExpires;
00175       UInt32 mServerRegistrationDefaultExpires;
00176 };
00177    
00178 }
00179 
00180 #endif
00181 
00182 /* ====================================================================
00183  * The Vovida Software License, Version 1.0 
00184  * 
00185  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00186  * 
00187  * Redistribution and use in source and binary forms, with or without
00188  * modification, are permitted provided that the following conditions
00189  * are met:
00190  * 
00191  * 1. Redistributions of source code must retain the above copyright
00192  *    notice, this list of conditions and the following disclaimer.
00193  * 
00194  * 2. Redistributions in binary form must reproduce the above copyright
00195  *    notice, this list of conditions and the following disclaimer in
00196  *    the documentation and/or other materials provided with the
00197  *    distribution.
00198  * 
00199  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00200  *    and "Vovida Open Communication Application Library (VOCAL)" must
00201  *    not be used to endorse or promote products derived from this
00202  *    software without prior written permission. For written
00203  *    permission, please contact vocal@vovida.org.
00204  *
00205  * 4. Products derived from this software may not be called "VOCAL", nor
00206  *    may "VOCAL" appear in their name, without prior written
00207  *    permission of Vovida Networks, Inc.
00208  * 
00209  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00210  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00211  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00212  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00213  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00214  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00215  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00216  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00217  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00218  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00219  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00220  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00221  * DAMAGE.
00222  * 
00223  * ====================================================================
00224  * 
00225  * This software consists of voluntary contributions made by Vovida
00226  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00227  * Inc.  For more information on Vovida Networks, Inc., please see
00228  * <http://www.vovida.org/>.
00229  *
00230  */
00231