Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326925 - SDO: New API to support multi-tenancy required
Summary: SDO: New API to support multi-tenancy required
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 10:23 EDT by David McCann CLA
Modified: 2022-06-09 10:19 EDT (History)
0 users

See Also:


Attachments
Contains proposed fix. (9.48 KB, patch)
2010-10-04 10:42 EDT, David McCann CLA
no flags Details | Diff
Contains proposed fix + supporting test case (13.92 KB, patch)
2010-10-04 15:15 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-10-04 10:23:54 EDT
The following API additions/modifications are required to support multi-tenancy:

    New API:

        /**
         * Return true if a HelperContext corresponding to this identifier or alias
         * already exists, else false.  If identifer is an alias, the corresponding
         * value in the alias Map will be used as the identifier for the lookup.
         *
         * @param identifier the alias or identifier used to lookup a helper context
         * @return true if an entry exists in the helper context map for identifier (or
         * the associated identifier value if identifier is an alias), false otherwise.
         */
        public static boolean hasHelperContext(String identifier);


        /**
         * Add an alias to identifier pair to the alias Map for the current application. 
         *
         * @param alias the alias to be associated with identifier
         * @param identifier assumed to be a key in the helper context Map
         */
        public static void addAlias(String alias, String identifier);


    Support for 'dirty' flag:

        /**
         * Add a name/value pair to the properties Map.
         *
         * @param name the name of the property
         * @param value the value of the property
         */
        public void setProperty(String name, Object value);

        /**
         * Return the value stored in the properties Map for a given
         * name, or null if an entry for name does not exist.
         *  
         * @param name the name of the property to be returned
         * @return the value associated with name, or null
         */
        public Object getProperty(String name);

    Existing API:

        /**
         * Return the local helper context associated with the given identifier, or create one if
         * it does not already exist.  If identifier is an alias, the value associated with it in the
         * alias Map will be used as the identifier value.
         *
         * @param identifier the identifier or alias to use for lookup/creation
         * @return HelperContext associated with identifier, or a new HelperContext
         * keyed on identifier if none eixsts
         */
        public static HelperContext getHelperContext(String identifier);

        /**
         * Replaces the provided  helper context in the map of identifiers to
         * helper contexts for this application. ctx.getIdentifier()  will be
         * used to obtain the identifier value. If identifier is a key in the
         * the alias Map, i.e. was previously set as an alias, the
         * corresponding entry will be removed from the alias Map.
         *
         * @param ctx the HelperContext to be added to the context Map for
         * the current application
         */
        public static void putHelperContext(HelperContext ctx);
Comment 1 David McCann CLA 2010-10-04 10:42:14 EDT
Created attachment 180172 [details]
Contains proposed fix.
Comment 2 David McCann CLA 2010-10-04 15:15:56 EDT
Created attachment 180200 [details]
Contains proposed fix + supporting test case
Comment 3 David McCann CLA 2010-10-04 16:24:50 EDT
Fix checked into the 2.1 stream.

Reviewed by:  matt.macivor@oracle.com, blaise.doughan@oracle.com
Tests:  sdo/helper/helpercontext/SDOHelperContextTest; all unit tests pass as expected

Revision: 8308
Comment 4 David McCann CLA 2010-10-04 16:26:42 EDT
Fix checked into the 2.2 stream (trunk)

Reviewed by:  matt.macivor@oracle.com, blaise.doughan@oracle.com
Tests:  sdo/helper/helpercontext/SDOHelperContextTest; all unit tests pass as expected

Revision: 8309
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:19:29 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink