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

E26041-01

coherence/security/GenericPrincipal.hpp

00001 /*
00002 * GenericPrincipal.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_GENERIC_PRINCIPAL_HPP
00017 #define COH_GENERIC_PRINCIPAL_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/security/Principal.hpp"
00022 
00023 COH_OPEN_NAMESPACE2(coherence,security)
00024 
00025 
00026 /**
00027 * A generic implementation of the Principal interface.
00028 *
00029 * @author mf  2008.08.22
00030 */
00031 class COH_EXPORT GenericPrincipal
00032     : public cloneable_spec<GenericPrincipal,
00033         extends<Object>,
00034         implements<Principal> >
00035     {
00036     friend class factory<GenericPrincipal>;
00037 
00038     // ----- constructors ---------------------------------------------------
00039 
00040     private:
00041         /**
00042         * Construct a new GenericPrincipal for the given name.
00043         *
00044         * @param vsName  the name of the principal
00045         */
00046         GenericPrincipal(String::View vsName);
00047 
00048         /**
00049         * Copy constructor.
00050         */
00051         GenericPrincipal(const GenericPrincipal& that);
00052 
00053 
00054     // ----- Principal interface --------------------------------------------
00055 
00056     public:
00057         /**
00058         * {@inheritDoc}
00059         */
00060         virtual String::View getName() const;
00061 
00062 
00063     // ----- Object interface -----------------------------------------------
00064 
00065     public:
00066         /**
00067         * {@inheritDoc}
00068         */
00069         virtual bool equals(Object::View vThat) const;
00070 
00071         /**
00072         * {@inheritDoc}
00073         */
00074         virtual size32_t hashCode() const;
00075 
00076         /**
00077         * {@inheritDoc}
00078         */
00079         virtual bool isImmutable() const;
00080 
00081         /**
00082         * {@inheritDoc}
00083         */
00084         virtual void toStream(std::ostream& out) const;
00085 
00086 
00087     // ----- data members ---------------------------------------------------
00088 
00089     private:
00090         /**
00091         * The principal name.
00092         */
00093         FinalView<String> f_vsName;
00094     };
00095 
00096 COH_CLOSE_NAMESPACE2
00097 
00098 #endif // COH_GENERIC_PRINCIPAL_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.