KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > rolap > MemberCache


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/rolap/MemberCache.java#12 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2001-2002 Kana Software, Inc.
7 // Copyright (C) 2001-2007 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 22 December, 2001
12 */

13
14 package mondrian.rolap;
15
16 import java.util.List JavaDoc;
17
18 import mondrian.rolap.sql.TupleConstraint;
19 import mondrian.rolap.sql.MemberChildrenConstraint;
20
21 /**
22  * A <code>MemberCache</code> can retrieve members based upon their parent and
23  * name.
24  *
25  * @author jhyde
26  * @since 22 December, 2001
27  * @version $Id: //open/mondrian/src/main/mondrian/rolap/MemberCache.java#12 $
28  */

29 interface MemberCache {
30     /**
31      * Creates a key with which to {@link #getMember(Object)} or
32      * {@link #putMember(Object, RolapMember)} the
33      * {@link RolapMember} with a given parent and key.
34      */

35     Object JavaDoc makeKey(RolapMember parent, Object JavaDoc key);
36
37     /**
38      * Retrieves the {@link RolapMember} with a given key (created by
39      * {@link #makeKey}).
40      */

41     RolapMember getMember(Object JavaDoc key);
42
43     /**
44      * Retrieves the {@link RolapMember} with a given key (created by
45      * {@link #makeKey}). It is possible to disable the checking of the
46      * cache status with this call.
47      */

48     RolapMember getMember(Object JavaDoc key, boolean mustCheckCacheStatus);
49
50     /**
51      * Replaces the {@link RolapMember} with a given key (created by {@link
52      * #makeKey}). Returns the previous member with that key, or null.
53      */

54     Object JavaDoc putMember(Object JavaDoc key, RolapMember value);
55
56     /**
57      * returns the children of <code>member</code> if they are currently in the cache.
58      * Otherwise returns null. The children may be garbage collected as soon as the
59      * returned list may be garbage collected.
60      *
61      * @param parent the parent member
62      * @param constraint the condition that was used when the members were
63      * fetched. May be null for all members (no constraint)
64      */

65     List JavaDoc<RolapMember> getChildrenFromCache(
66         RolapMember parent,
67         MemberChildrenConstraint constraint);
68
69     /**
70      * returns the members of <code>level</code> if they are currently in the cache.
71      * Otherwise returns null. The members may be garbage collected as soon as the
72      * returned list may be garbage collected.
73      * @param level the level whose members should be fetched
74      * @param constraint the condition that was used when the members were
75      * fetched. May be null for all members (no constraint)
76      */

77     List JavaDoc getLevelMembersFromCache(RolapLevel level, TupleConstraint constraint);
78
79     /**
80      * Registers that the children of <code>member</code> are
81      * <code>children</code> (a list of {@link RolapMember}s).
82      * @param member the parent member
83      * @param constraint the condition that was used when the members were
84      * fetched. May be null for all members (no constraint)
85      */

86     void putChildren(
87         RolapMember member,
88         MemberChildrenConstraint constraint,
89         List JavaDoc<RolapMember> children);
90 }
91
92
93 // End MemberCache.java
94
Popular Tags