Oracle Coherence for C++ API
Release 3.7.0.0

E18684-01

coherence/net/DefaultOperationalContext.hpp

00001 /*
00002 * DefaultOperationalContext.hpp
00003 *
00004 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_DEFAULT_OPERATIONAL_CONTEXT_HPP
00017 #define COH_DEFAULT_OPERATIONAL_CONTEXT_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/net/Member.hpp"
00022 #include "coherence/net/OperationalContext.hpp"
00023 #include "coherence/run/xml/XmlDocument.hpp"
00024 #include "coherence/run/xml/XmlElement.hpp"
00025 #include "coherence/security/IdentityAsserter.hpp"
00026 #include "coherence/security/IdentityTransformer.hpp"
00027 #include "coherence/util/Map.hpp"
00028 
00029 COH_OPEN_NAMESPACE2(coherence,net)
00030 
00031 using coherence::run::xml::XmlDocument;
00032 using coherence::run::xml::XmlElement;
00033 using coherence::security::IdentityAsserter;
00034 using coherence::security::IdentityTransformer;
00035 using coherence::util::Map;
00036 
00037 
00038 /**
00039 * The DefaultOperationalContext provides an OperationalContext with
00040 * information obtained from XML in coherence.dtd format, system properties
00041 * (as set through environment variables) and default values.
00042 *
00043 * @author phf  2010.10.28
00044 *
00045 * @since Coherence 3.7
00046 */
00047 class COH_EXPORT DefaultOperationalContext
00048     : public class_spec<DefaultOperationalContext,
00049         extends<Object>,
00050         implements<OperationalContext> >
00051     {
00052     friend class factory<DefaultOperationalContext>;
00053 
00054     // ----- constructors ---------------------------------------------------
00055 
00056     protected:
00057         /**
00058         * Create a new DefaultOperationalContext.
00059         *
00060         * @param vXmlCoherence  an XML element corresponding to coherence.dtd
00061         */
00062         DefaultOperationalContext(XmlElement::View vXmlCoherence = NULL);
00063 
00064 
00065     // ----- typedef: ProductEdition ----------------------------------------
00066 
00067     public:
00068         /**
00069         * Extend editions.
00070         */
00071         typedef enum
00072             {
00073             edition_dc  = 0,
00074             edition_rtc = 1
00075             } ProductEdition;
00076 
00077 
00078     // ----- DefaultOperationalContext interface ----------------------------
00079 
00080     public:
00081         /**
00082         * The default XML configuration used when one isn't explicitly passed
00083         * in the constructor for this class.
00084         *
00085         * @return the default XML configuration
00086         */
00087         static XmlDocument::Handle getDefaultOperationalConfig();
00088 
00089 
00090     // ----- OperationalContext interface -----------------------------------
00091 
00092     public:
00093         /**
00094         * {@inheritDoc}
00095         */
00096         virtual int32_t getEdition() const;
00097 
00098         /**
00099         * {@inheritDoc}
00100         */
00101         virtual String::View getEditionName() const;
00102 
00103         /**
00104         * {@inheritDoc}
00105         */
00106         virtual Member::View getLocalMember() const;
00107 
00108         /**
00109         * {@inheritDoc}
00110         */
00111         virtual Map::View getFilterMap() const;
00112 
00113         /**
00114         * {@inheritDoc}
00115         */
00116         virtual IdentityAsserter::View getIdentityAsserter() const;
00117 
00118         /**
00119         * {@inheritDoc}
00120         */
00121         virtual IdentityTransformer::View getIdentityTransformer() const;
00122 
00123         /**
00124         * {@inheritDoc}
00125         */
00126         virtual bool isSubjectScopingEnabled() const;
00127 
00128         /**
00129         * {@inheritDoc}
00130         */
00131         virtual int32_t getLogLevel() const;
00132 
00133         /**
00134         * {@inheritDoc}
00135         */
00136         virtual int32_t getLogCharacterLimit() const;
00137 
00138         /**
00139         * {@inheritDoc}
00140         */
00141         virtual String::View getLogMessageFormat() const;
00142 
00143         /**
00144         * {@inheritDoc}
00145         */
00146         virtual String::View getLogDestination() const;
00147 
00148 
00149     // ----- data members ---------------------------------------------------
00150 
00151     protected:
00152         /**
00153         * The configured edition.
00154         */
00155         int32_t m_nEdition;
00156 
00157         /**
00158         * The configured edition in a formatted string for use by the Logger.
00159         */
00160         FinalView<String> m_vsEdition;
00161 
00162         /**
00163         * The configured Filter map.
00164         *
00165         * See OperationalContext::getFilterMap() for a description of the
00166         * keys and values.
00167         */
00168         FinalView<Map> m_vFilterMap;
00169 
00170         /**
00171         * The configured local member.
00172         */
00173         FinalView<Member> m_vMemberLocal;
00174 
00175         /**
00176         * The configured IdentityAsserter that validates a token in order to
00177         * establish a user's identity.
00178         */
00179         FinalView<IdentityAsserter> m_vAsserter;
00180 
00181         /**
00182         * The configured IdentityTransformer that transforms a Subject into
00183         * a token that asserts a user's identity.
00184         */
00185         FinalView<IdentityTransformer> m_vTransformer;
00186 
00187         /**
00188         * True iff subject scope configuration is set to true.
00189         */
00190         bool m_fSubjectScoped;
00191 
00192         /**
00193         * The configured logging severity level.
00194         */
00195         int32_t m_nLogLevel;
00196 
00197         /**
00198         * The the maximum number of characters for a logger daemon to queue
00199         * before truncating.
00200         */
00201         int32_t m_nLogCharacterLimit;
00202 
00203         /**
00204         * The configured log message format.
00205         */
00206         FinalView<String> m_vsLogMessageFormat;
00207 
00208         /**
00209         * The configured destination for log messages.
00210         */
00211         FinalView<String> m_vsLogDestination;
00212     };
00213 
00214 COH_CLOSE_NAMESPACE2
00215 
00216 #endif // COH_DEFAULT_OPERATIONAL_CONTEXT_HPP
Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.