Skip to content

Commit

Permalink
#12 Support for userLogon and userSession UserActivity.
Browse files Browse the repository at this point in the history
  • Loading branch information
baardl committed May 19, 2017
1 parent 2993a4a commit a23f5f8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/db/manual/create_users-mysql.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Normal User
CREATE USER 'vr'@'localhost' IDENTIFIED BY 'vr1234';
GRANT DELETE,INSERT,SELECT,UPDATE ON ValueReporter.* TO 'vr'@'localhost';
GRANT CREATE,DELETE,INSERT,SELECT,UPDATE ON ValueReporter.* TO 'vr'@'localhost';

#Admin
CREATE USER 'vrAdmin'@'localhost' IDENTIFIED BY 'vrAdmin1234';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use ValueReporter;
CREATE TABLE IF NOT EXISTS userLogon (
id bigint auto_increment primary key,
starttime TIMESTAMP NOT NULL,
userid varchar(255) NOT NULL
);

CREATE TABLE IF NOT EXISTS userSession (
id bigint auto_increment primary key,
starttime TIMESTAMP NOT NULL,
userid varchar(255) NOT NULL,
usersessionfunction varchar(255),
applicationtokenid varchar(255) NOT NULL,
applicationid varchar(255) NOT NULL
);
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public static void main(String[] args) throws InterruptedException {
String reporterPort = "4901";
String prefix = "test";
int cacheSize = 1;
int forwardInterval = 1000;
int forwardInterval = 10;
new Thread(new ObservedActivityDistributer(reporterHost, reporterPort, prefix, cacheSize, forwardInterval)).start();


String userid = "TODO";
do {
org.valuereporter.agent.activity.ObservedActivity observedActivity = new UserLogonObservedActivity(userid);
MonitorReporter.reportActivity(observedActivity);
Thread.sleep(10000);
Thread.sleep(100);
} while (true);
}
}

0 comments on commit a23f5f8

Please sign in to comment.