Skip to content

Commit

Permalink
MONDRIAN-821 Adds a unique ID property to the schema. This id is expe…
Browse files Browse the repository at this point in the history
…cted to be different across different Mondrian instances. It allows clients to refresh their schema caches when that ID changes. This usually happened when a dynamic schema processor is used and the schema changes when a user login changes.

[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13882]
  • Loading branch information
lucboudreau committed Oct 27, 2010
1 parent 6694713 commit 52dc403
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/mondrian/rolap/RolapSchema.java
Expand Up @@ -153,6 +153,14 @@ public class RolapSchema implements Schema {
private final List<Exception> warningList = new ArrayList<Exception>();
private Map<String, Annotation> annotationMap;

/**
* This is a unique schema instance id which will be used
* to inform clients when the schema has changed.
*
* <p>Expect a different ID for each Mondrian instance node.
*/
private final String id;

/**
* This is ONLY called by other constructors (and MUST be called
* by them) and NEVER by the Pool.
Expand All @@ -168,6 +176,7 @@ private RolapSchema(
final DataSource dataSource,
final String md5Bytes)
{
this.id = UUID.randomUUID().toString();
this.key = key;
this.md5Bytes = md5Bytes;
// the order of the next two lines is important
Expand Down Expand Up @@ -345,6 +354,14 @@ public String getName() {
return name;
}

/**
* Returns this schema instance unique ID.
* @return A string representing the schema ID.
*/
public String getId() {
return this.id;
}

public Map<String, Annotation> getAnnotationMap() {
return annotationMap;
}
Expand Down

0 comments on commit 52dc403

Please sign in to comment.