Developers can use the Cache and CubeCache classes of the Strategy Web SDK to monitor reports, documents, and Intelligent cubes caches. However, when using the getUser() method to get the user associated with a specific cache it returns a Null value:
CacheResults allCubes = cubesMonitor.getCaches();
Enumeration<Caches> cubesEnum = allCubes.elements();
while (cubesEnum.hasMoreElements()) {
//Get the intelligent cubes for one project
Caches cubesPerProject = cubesEnum.nextElement();
System.out.println("For project: " + cubesPerProject.getProjectName() + " number of cubes: " + cubesPerProject.getCount());
//iterate through the list of intelligent cubes of one project
for (int j = 0; j < cubesPerProject.getCount(); j++) {
CubeCache cube = (CubeCache) cubesPerProject.get(j);
//Get the name of the cube
System.out.println("Info for cache");
System.out.println("Name: " + cube.getCacheSourceName());
WebUser owner = cube.getUser();
System.out.println("Owner: " + owner.getDisplayName());
}Output:
Info for cache Name: Hawaiian Airlines Data Owner: Info for cache Name: Slot Machine Performance Data Owner: Info for cache Name: Worldwide Emissions Owner: .... ....
This is expected as the User object needs to be populated first before manipulating or retrieving the object information.
Populate the User object first:
//Get the name of the cube
System.out.println("Info for cache");
System.out.println("Name: " + cube.getCacheSourceName());
WebUser owner = cube.getUser();
// need to call populate method first
owner.populate();
System.out.println("Owner: " + owner.getDisplayName());Info for cache Name: Hawaiian Airlines Data Owner: Administrator Info for cache Name: Slot Machine Performance Data Owner: Administrator Info for cache Name: Worldwide Emissions Owner: Administrator .... ....
KB441347