Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

coherence/net/DefaultOperationalContext.hpp

00001 /*
00002 * DefaultOperationalContext.hpp
00003 *
00004 * Copyright (c) 2000, 2013, 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 Map::View getSerializerMap() const;
00117 
00118         /**
00119         * {@inheritDoc}
00120         */
00121         virtual Map::View getAddressProviderMap() const;
00122 
00123         /**
00124         * {@inheritDoc}
00125         */
00126         virtual IdentityAsserter::View getIdentityAsserter() const;
00127 
00128         /**
00129         * {@inheritDoc}
00130         */
00131         virtual IdentityTransformer::View getIdentityTransformer() const;
00132 
00133         /**
00134         * {@inheritDoc}
00135         */
00136         virtual bool isSubjectScopingEnabled() const;
00137 
00138         /**
00139         * {@inheritDoc}
00140         */
00141         virtual int32_t getLogLevel() const;
00142 
00143         /**
00144         * {@inheritDoc}
00145         */
00146         virtual int32_t getLogCharacterLimit() const;
00147 
00148         /**
00149         * {@inheritDoc}
00150         */
00151         virtual String::View getLogMessageFormat() const;
00152 
00153         /**
00154         * {@inheritDoc}
00155         */
00156         virtual String::View getLogDestination() const;
00157 
00158 
00159     // ----- data members ---------------------------------------------------
00160 
00161     protected:
00162         /**
00163         * The configured edition.
00164         */
00165         int32_t m_nEdition;
00166 
00167         /**
00168         * The configured edition in a formatted string for use by the Logger.
00169         */
00170         FinalView<String> f_vsEdition;
00171 
00172         /**
00173         * The configured Filter map.
00174         *
00175         * See OperationalContext::getFilterMap() for a description of the
00176         * keys and values.
00177         */
00178         FinalView<Map> f_vFilterMap;
00179 
00180         /**
00181         * The configured Serializer map.
00182         *
00183         * See OperationalContext::getSerializerMap() for a description of the
00184         * keys and values.
00185         */
00186         FinalView<Map> f_vSerializerMap;
00187 
00188         /**
00189         * The configured AddressProvider map.
00190         *
00191         * See OperationalContext::getAddressProviderMap() for a description of the
00192         * keys and values.
00193         */
00194         FinalView<Map> f_vAddressProviderMap;
00195 
00196         /**
00197         * The configured local member.
00198         */
00199         FinalView<Member> f_vMemberLocal;
00200 
00201         /**
00202         * The configured IdentityAsserter that validates a token in order to
00203         * establish a user's identity.
00204         */
00205         FinalView<IdentityAsserter> f_vAsserter;
00206 
00207         /**
00208         * The configured IdentityTransformer that transforms a Subject into
00209         * a token that asserts a user's identity.
00210         */
00211         FinalView<IdentityTransformer> f_vTransformer;
00212 
00213         /**
00214         * True iff subject scope configuration is set to true.
00215         */
00216         bool m_fSubjectScoped;
00217 
00218         /**
00219         * The configured logging severity level.
00220         */
00221         int32_t m_nLogLevel;
00222 
00223         /**
00224         * The the maximum number of characters for a logger daemon to queue
00225         * before truncating.
00226         */
00227         int32_t m_nLogCharacterLimit;
00228 
00229         /**
00230         * The configured log message format.
00231         */
00232         FinalView<String> f_vsLogMessageFormat;
00233 
00234         /**
00235         * The configured destination for log messages.
00236         */
00237         FinalView<String> f_vsLogDestination;
00238     };
00239 
00240 COH_CLOSE_NAMESPACE2
00241 
00242 #endif // COH_DEFAULT_OPERATIONAL_CONTEXT_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.