Description of problem: CLI Doc issue, compile time errors in example 8.2.1 Version-Release number of selected component (if applicable): JON RC#1 How reproducible: 100% Expected results: doc examples do not have errors Actual results: compile time errors. the CLI API has changed since this example was written. Additional info: Lines 126-129 do not compile: this.resourceGroupManager = this.remoteClient.getResourceGroupManagerRemote(); this.resourceManager = this.remoteClient.getResourceManagerRemote(); this.roleManager = this.remoteClient.getRoleManagerRemote(); this.subjectManager = this.remoteClient.getSubjectManagerRemote(); line 142 does not compile: roleCriteria.setFilterName(JBAS_MANAGER_ROLE); lines 193 and 195 do not compile: roleCriteria = new RoleCriteria(); roleCriteria.setFilterId(jbasManagerRole.getId()); // add a fetch criteria to the criteria object to get the optionally returned subjects for the role. roleCriteria.setFetchSubjects(true);
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
Targeting 3.1.
This actually wasn't that bad (once I figured out how to do the whole "classpath" and "compile" thing). There were a couple of small things: 17c17 < import org.rhq.enterprise.client.RemoteClient; --- > import org.rhq.enterprise.clientapi.RemoteClient; 119,122c119,122 < this.resourceGroupManager = this.remoteClient.getResourceGroupManagerRemote(); < this.resourceManager = this.remoteClient.getResourceManagerRemote(); < this.roleManager = this.remoteClient.getRoleManagerRemote(); < this.subjectManager = this.remoteClient.getSubjectManagerRemote(); --- > this.resourceGroupManager = this.remoteClient.getResourceGroupManager(); > this.resourceManager = this.remoteClient.getResourceManager(); > this.roleManager = this.remoteClient.getRoleManager(); > this.subjectManager = this.remoteClient.getSubjectManager(); 133c133 < roleCriteria.setFilterName(JBAS_MANAGER_ROLE); --- > roleCriteria.addFilterName(JBAS_MANAGER_ROLE); 174,175c174,175 < roleCriteria.setFilterId(jbasManagerRole.getId()); < roleCriteria.setFetchSubjects(true); --- > roleCriteria.addFilterId(jbasManagerRole.getId()); > roleCriteria.fetchSubjects(true); One thing is that it uses a deprecated function: [root@server rhq-remoting-cli-4.4.0-SNAPSHOT]# javac -g SampleLdapClientMain.java -Xlint:deprecation SampleLdapClientMain.java:189: warning: [deprecation] getSubjectByName(java.lang.String) in org.rhq.enterprise.server.auth.SubjectManagerRemote has been deprecated jbasManagerSubject = subjectManager.getSubjectByName(jbasManager); ^ 1 warning I decided I don't particularly care about that, since I wasn't certain how to replace getSubjectByName(username) with getSubjectByNameAndSessionId(username,sessionId) because I don't know how to get the session ID. If that is an issue, let me know.
Verified that SampleLdapClientMain.java from http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/3.1/html/Dev_Writing_JON_Command-Line_Scripts/custom-java-client.html#ex.SampleLdapClientMain.java compiles.
Bulk closing of old issues in VERIFIED state.