This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 784907 - JON 3.01 RC#1 CLI Doc issue, compile time errors in example 8.2.1
JON 3.01 RC#1 CLI Doc issue, compile time errors in example 8.2.1
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Documentation (Show other bugs)
3.0.1
Unspecified Unspecified
high Severity high (vote)
: ---
: JON 3.1.0
Assigned To: Deon Ballard
Mike Foley
:
Depends On:
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
 
Reported: 2012-01-26 10:53 EST by Mike Foley
Modified: 2013-09-03 11:06 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-03 11:06:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Foley 2012-01-26 10:53:51 EST
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);
Comment 1 Mike Foley 2012-01-30 11:25:52 EST
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
Comment 2 Deon Ballard 2012-04-03 11:23:31 EDT
Targeting 3.1.
Comment 3 Deon Ballard 2012-05-25 23:00:51 EDT
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.
Comment 5 Heiko W. Rupp 2013-09-03 11:06:48 EDT
Bulk closing of old issues in VERIFIED state.

Note You need to log in before you can comment on or make changes to this bug.