Skip to content

Commit

Permalink
MONDRIAN: Implement olap4j methods OlapConnection.setRoleName and .ge…
Browse files Browse the repository at this point in the history
…tRoleName. Updated olap4j.jar to follow shortly.

[git-p4: depot-paths = "//open/mondrian/": change = 10652]
  • Loading branch information
julianhyde committed Mar 5, 2008
1 parent 200c815 commit 9aef0b9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/mondrian/olap4j/MondrianOlap4jConnection.java
Expand Up @@ -72,6 +72,7 @@ abstract class MondrianOlap4jConnection implements OlapConnection {

final Factory factory;
private Locale locale;
private String roleName;

/**
* Creates an Olap4j connection to Mondrian.
Expand Down Expand Up @@ -501,6 +502,26 @@ public Locale getLocale() {
return locale;
}

public void setRoleName(String roleName) throws OlapException {
final Role role;
if (roleName == null) {
role = null;
} else {
role = this.connection.getSchema().lookupRole(roleName);
if (role == null) {
throw helper.createException("Unknown role '" + roleName + "'");
}
}
// Remember the name of the role, because mondrian roles don't know
// their own name.
this.roleName = roleName;
this.connection.setRole(role);
}

public String getRoleName() {
return roleName;
}

// inner classes

/**
Expand Down

0 comments on commit 9aef0b9

Please sign in to comment.