Skip to Content.
Sympa Menu

grouper-users - [grouper-users] RE: Quartz

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] RE: Quartz


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "Imholz, John J." <>, "''" <>
  • Subject: [grouper-users] RE: Quartz
  • Date: Thu, 18 Nov 2010 13:11:03 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

So you are running the loader command line right?

Note, in GSH you can kick off a loader job that takes scheduling out of the
picture:

https://spaces.internet2.edu/display/Grouper/GrouperShell+%28gsh%29

grouperSession = GrouperSession.startRootSession();
loaderGroup = GroupFinder.findByName(grouperSession, "stem:group");
loaderRunOneJob(loaderGroup);

You can see a log of the loader in the grouper_loader_log table, you should
see a row for each job (I think manual or otherwise)

Here is a simple example of the loader:

https://spaces.internet2.edu/display/macepaccman/Grouper+and+the+CMU+Billing+Use+Case

Create a table for employees (note, in reality this would be a view)

CREATE TABLE cmu_employee (
employee_id varchar(50) NOT NULL,
PRIMARY KEY (employee_id)
);

Populate with some employees:

insert into cmu_employee (employee_id) values ('elbl');
insert into cmu_employee (employee_id) values ('dousti');
insert into cmu_employee (employee_id) values ('elbr');
insert into cmu_employee (employee_id) values ('elbu');
insert into cmu_employee (employee_id) values ('ben');
insert into cmu_employee (employee_id) values ('fibe');
insert into cmu_employee (employee_id) values ('fibl');
insert into cmu_employee (employee_id) values ('fibr');
commit;

Create an employee group:

gsh 18% employeesGroup = new
GroupSave(grouperSession).assignName("edu:cmu:community:employees").assignSaveMode(SaveMode.INSERT_OR_UPDATE).assignCreateParentStemsIfNotExist(true).save();

Add a loader job to auto-populate students:

gsh 19% groupAddType("edu:cmu:community:employees", "grouperLoader");
gsh 20% setGroupAttr("edu:cmu:community:employees", "grouperLoaderType",
"SQL_SIMPLE");
gsh 21% setGroupAttr("edu:cmu:community:employees", "grouperLoaderDbName",
"grouper");
gsh 22% setGroupAttr("edu:cmu:community:employees",
"grouperLoaderScheduleType", "CRON");
gsh 23% setGroupAttr("edu:cmu:community:employees",
"grouperLoaderQuartzCron", "0 0 7 * * ?");
gsh 24% setGroupAttr("edu:cmu:community:employees", "grouperLoaderQuery",
"SELECT employee_id AS subject_id, 'jdbc' AS subject_source_id FROM
cmu_employee");

Run the loader one time to init:

gsh 25% employeesGroup = GroupFinder.findByName(grouperSession,
"edu:cmu:community:employees", true);
gsh 26% loaderRunOneJob(employeesGroup);

Kick off the job and run loader automatically so it runs daily:

[appadmin@i2midev1
bin]$ cd /opt/grouper/1.6.1/grouper.apiBinary-1.6.1/bin
[appadmin@i2midev1
bin]$ ./gsh.sh -loader > /tmp/grouper.1.6.1_loader.log 2>&1 &

See that the group has the people it should:

gsh 27% employeesGroup = GroupFinder.findByName(grouperSession,
"edu:cmu:community:employees", true);

gsh 28% employeesGroup.getMembers();
member: id='elbl' type='person' source='jdbc'
uuid='079fb8bed3264e15aec231310e6135e0'
member: id='dousti' type='person' source='jdbc'
uuid='09d7fcdb9e3b497d8711bb23ae6f80f4'
member: id='fibr' type='person' source='jdbc'
uuid='172e3cd41e9d43ed8ac080e521e2e1e0'
member: id='elbu' type='person' source='jdbc'
uuid='2da8882b79384bdc88a4e2ebcf6131dc'
member: id='ben' type='person' source='jdbc'
uuid='35c959d61fb0458f9ba10cfe8ec2619b'
member: id='fibe' type='person' source='jdbc'
uuid='b8faa3b714c24acf8967d0d35c3f44e1'
member: id='fibl' type='person' source='jdbc'
uuid='dc4f29774c9b46db9053eb8e9522935a'
member: id='elbr' type='person' source='jdbc'
uuid='fc76b63e08cf426a94823197ace6c97a'

-----Original Message-----
From:


[mailto:]
On Behalf Of Imholz, John J.
Sent: Thursday, November 18, 2010 1:02 PM
To:
''
Subject: [grouper-users] Quartz

I'm having some trouble getting a group loaded (no SQL error, no log message
at all.)

How do I query what's currently scheduled?

jji



Archive powered by MHonArc 2.6.16.

Top of Page