Author: sviluppatorefico
Date: 2008-05-18 07:00:50 -0400 (Sun, 18 May 2008)
New Revision: 10772
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java
Log:
added support for sessionId and guest
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java 2008-05-10
06:12:10 UTC (rev 10771)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java 2008-05-18
11:00:50 UTC (rev 10772)
@@ -34,20 +34,24 @@
public static final int NAVIGATION = 0;
- public static final int SIGN_OUT = 1;
+ public static final int EXIT = 1;
private String id;
+ private String sessionId;
+
private long timestamp;
private final int type;
+
+ public final static String GUEST = "guest";
private UserActivity()
{
this.type = NAVIGATION;
}
- public UserActivity(String id, long timestamp, int type)
+ public UserActivity(String id, String sessionId, long timestamp, int type)
{
if (id == null)
{
@@ -55,6 +59,7 @@
}
this.id = id;
+ this.sessionId = sessionId;
this.timestamp = timestamp;
this.type = type;
}
@@ -65,7 +70,8 @@
{
throw new IllegalArgumentException("Id (notification message) cannot be
null");
}
- this.id = notification.getMessage();
+ this.id = notification.getMessage().substring(0,
notification.getMessage().indexOf("_"));
+ this.sessionId =
notification.getMessage().substring(notification.getMessage().indexOf("_"));
this.timestamp = notification.getTimeStamp();
this.type = Integer.parseInt(notification.getType());
}
@@ -75,6 +81,11 @@
return id;
}
+ public String getSessionId()
+ {
+ return sessionId;
+ }
+
public long getTimestamp()
{
return timestamp;
@@ -99,7 +110,7 @@
UserActivity that = (UserActivity)o;
- if (!id.equals(that.id))
+ if (!id.equals(that.id) || !sessionId.equals(that.sessionId))
{
return false;
}
@@ -110,7 +121,7 @@
public int hashCode()
{
int result;
- result = id.hashCode();
+ result = id.hashCode()+sessionId.hashCode();
return result;
}
Show replies by date