Bug 784907 - JON 3.01 RC#1 CLI Doc issue, compile time errors in example 8.2.1
Summary: JON 3.01 RC#1 CLI Doc issue, compile time errors in example 8.2.1
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Documentation
Version: 3.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: JON 3.1.0
Assignee: Deon Ballard
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
 
Reported: 2012-01-26 15:53 UTC by Mike Foley
Modified: 2013-09-03 15:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-03 15:06:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike Foley 2012-01-26 15:53:51 UTC
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 16:25:52 UTC
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos

Comment 2 Deon Ballard 2012-04-03 15:23:31 UTC
Targeting 3.1.

Comment 3 Deon Ballard 2012-05-26 03:00:51 UTC
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 15:06:48 UTC
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.