added hashtag support, missing delete operation
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@100332 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
79ea470f94
commit
fdcd091f84
143
.gwt/.gwt-log
143
.gwt/.gwt-log
|
@ -102252,3 +102252,146 @@ Compiling...
|
||||||
Compilation completed in 0.01 seconds
|
Compilation completed in 0.01 seconds
|
||||||
Removing invalidated units
|
Removing invalidated units
|
||||||
Finding entry point classes
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
[WARN] Error processing classpath URL 'file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar'
|
||||||
|
java.net.URISyntaxException: Illegal character in path at index 26: file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar
|
||||||
|
at java.net.URI$Parser.fail(URI.java:2829)
|
||||||
|
at java.net.URI$Parser.checkChars(URI.java:3002)
|
||||||
|
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
|
||||||
|
at java.net.URI$Parser.parse(URI.java:3034)
|
||||||
|
at java.net.URI.<init>(URI.java:595)
|
||||||
|
at java.net.URL.toURI(URL.java:938)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.addAllClassPathEntries(ResourceOracleImpl.java:323)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.getAllClassPathEntries(ResourceOracleImpl.java:358)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.<init>(ResourceOracleImpl.java:402)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDef.normalize(ModuleDef.java:545)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:199)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:169)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.loadModule(HostedModeSupportImpl.java:85)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.createModuleSpaceHost(HostedModeSupportImpl.java:64)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.createModuleSpaceHost(HostedModeSupport.java:447)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:125)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:103)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.doWarmUp(WarmUpSupport.java:84)
|
||||||
|
at com.google.gdt.eclipse.designer.Activator.earlyStartup(Activator.java:190)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:73)
|
||||||
|
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
|
||||||
|
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
|
||||||
|
Translatable source found in...
|
||||||
|
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
0% complete (ETR: 68 seconds)
|
||||||
|
10% complete (ETR: 69 seconds)
|
||||||
|
20% complete (ETR: 58 seconds)
|
||||||
|
30% complete (ETR: 39 seconds)
|
||||||
|
40% complete (ETR: 30 seconds)
|
||||||
|
50% complete (ETR: 24 seconds)
|
||||||
|
60% complete (ETR: 17 seconds)
|
||||||
|
70% complete (ETR: 12 seconds)
|
||||||
|
80% complete (ETR: 8 seconds)
|
||||||
|
90% complete (ETR: 3 seconds)
|
||||||
|
100% complete (ETR: 0 seconds)
|
||||||
|
Compilation completed in 40.04 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
[WARN] Error processing classpath URL 'file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar'
|
||||||
|
java.net.URISyntaxException: Illegal character in path at index 26: file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar
|
||||||
|
at java.net.URI$Parser.fail(URI.java:2829)
|
||||||
|
at java.net.URI$Parser.checkChars(URI.java:3002)
|
||||||
|
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
|
||||||
|
at java.net.URI$Parser.parse(URI.java:3034)
|
||||||
|
at java.net.URI.<init>(URI.java:595)
|
||||||
|
at java.net.URL.toURI(URL.java:938)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.addAllClassPathEntries(ResourceOracleImpl.java:323)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.getAllClassPathEntries(ResourceOracleImpl.java:358)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.<init>(ResourceOracleImpl.java:402)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDef.normalize(ModuleDef.java:545)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:199)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:169)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.loadModule(HostedModeSupportImpl.java:85)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.createModuleSpaceHost(HostedModeSupportImpl.java:64)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.createModuleSpaceHost(HostedModeSupport.java:447)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:125)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:104)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.doWarmUp(WarmUpSupport.java:84)
|
||||||
|
at com.google.gdt.eclipse.designer.Activator.earlyStartup(Activator.java:190)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:73)
|
||||||
|
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
|
||||||
|
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
[WARN] Error processing classpath URL 'file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar'
|
||||||
|
java.net.URISyntaxException: Illegal character in path at index 26: file:/Applications/eclipse 4.3/plugins/com.google.gdt.eclipse.designer.hosted.2_2_3.1.2.r43x201303061525/gwt-dev-designtime.jar
|
||||||
|
at java.net.URI$Parser.fail(URI.java:2829)
|
||||||
|
at java.net.URI$Parser.checkChars(URI.java:3002)
|
||||||
|
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
|
||||||
|
at java.net.URI$Parser.parse(URI.java:3034)
|
||||||
|
at java.net.URI.<init>(URI.java:595)
|
||||||
|
at java.net.URL.toURI(URL.java:938)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.addAllClassPathEntries(ResourceOracleImpl.java:323)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.getAllClassPathEntries(ResourceOracleImpl.java:358)
|
||||||
|
at com.google.gwt.dev.resource.impl.ResourceOracleImpl.<init>(ResourceOracleImpl.java:402)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDef.normalize(ModuleDef.java:545)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:199)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:169)
|
||||||
|
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.loadModule(HostedModeSupportImpl.java:85)
|
||||||
|
at com.google.gwt.dev.shell.designtime.HostedModeSupportImpl.createModuleSpaceHost(HostedModeSupportImpl.java:64)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.createModuleSpaceHost(HostedModeSupport.java:447)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||||
|
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
|
||||||
|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||||
|
at java.lang.reflect.Method.invoke(Method.java:606)
|
||||||
|
at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:869)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:125)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.warmUpHostedMode(WarmUpSupport.java:105)
|
||||||
|
at com.google.gdt.eclipse.designer.WarmUpSupport.doWarmUp(WarmUpSupport.java:84)
|
||||||
|
at com.google.gdt.eclipse.designer.Activator.earlyStartup(Activator.java:190)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
|
||||||
|
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:73)
|
||||||
|
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
|
||||||
|
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
|
Binary file not shown.
5
pom.xml
5
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>social-networking-library</artifactId>
|
<artifactId>social-networking-library</artifactId>
|
||||||
<version>1.6.2-SNAPSHOT</version>
|
<version>1.7.0-SNAPSHOT</version>
|
||||||
<name>gCube Social Networking Library</name>
|
<name>gCube Social Networking Library</name>
|
||||||
<description>
|
<description>
|
||||||
The gCube Social Networking Library is the 'bridge' between your gCube Applications and the social networking facilities.
|
The gCube Social Networking Library is the 'bridge' between your gCube Applications and the social networking facilities.
|
||||||
|
@ -46,7 +46,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.netflix.astyanax</groupId>
|
<groupId>com.netflix.astyanax</groupId>
|
||||||
<artifactId>astyanax</artifactId>
|
<artifactId>astyanax</artifactId>
|
||||||
<version>1.56.21</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.resources.discovery</groupId>
|
<groupId>org.gcube.resources.discovery</groupId>
|
||||||
|
@ -55,12 +54,10 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common.portal</groupId>
|
<groupId>org.gcube.common.portal</groupId>
|
||||||
<artifactId>portal-manager</artifactId>
|
<artifactId>portal-manager</artifactId>
|
||||||
<version>[0.1.0-SNAPSHOT, 1.0.0-SNAPSHOT)</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google</groupId>
|
<groupId>com.google</groupId>
|
||||||
<artifactId>gwt-jsonmaker</artifactId>
|
<artifactId>gwt-jsonmaker</artifactId>
|
||||||
<version>1.2.1</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.liferay.portal</groupId>
|
<groupId>com.liferay.portal</groupId>
|
||||||
|
|
|
@ -187,6 +187,8 @@ public class CassandraClusterConnection {
|
||||||
ColumnFamilyDefinition cfDefUserNotifications = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_NOTIFICATIONS);
|
ColumnFamilyDefinition cfDefUserNotifications = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_NOTIFICATIONS);
|
||||||
ColumnFamilyDefinition cfDefUserMessagesNotifications = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_MESSAGES_NOTIFICATIONS);
|
ColumnFamilyDefinition cfDefUserMessagesNotifications = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_MESSAGES_NOTIFICATIONS);
|
||||||
ColumnFamilyDefinition cfDefUserNotificationsPreferences = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_NOTIFICATIONS_PREFERENCES);
|
ColumnFamilyDefinition cfDefUserNotificationsPreferences = getDynamicCFDef(DBCassandraAstyanaxImpl.USER_NOTIFICATIONS_PREFERENCES);
|
||||||
|
ColumnFamilyDefinition cfDefHashtagsCounter = getDynamicCFDef(DBCassandraAstyanaxImpl.HASHTAGS_COUNTER);
|
||||||
|
ColumnFamilyDefinition cfDefHashtagTimeline = getDynamicCFDef(DBCassandraAstyanaxImpl.HASHTAGGED_FEEDS);
|
||||||
|
|
||||||
|
|
||||||
ksDef.setName(keyspaceName)
|
ksDef.setName(keyspaceName)
|
||||||
|
@ -204,7 +206,9 @@ public class CassandraClusterConnection {
|
||||||
.addColumnFamily(cfDefUserNotifications)
|
.addColumnFamily(cfDefUserNotifications)
|
||||||
.addColumnFamily(cfDefUserMessagesNotifications)
|
.addColumnFamily(cfDefUserMessagesNotifications)
|
||||||
.addColumnFamily(cfDefUserNotificationsPreferences)
|
.addColumnFamily(cfDefUserNotificationsPreferences)
|
||||||
.addColumnFamily(cfDefUserLikedFeeds);
|
.addColumnFamily(cfDefUserLikedFeeds)
|
||||||
|
.addColumnFamily(cfDefHashtagsCounter)
|
||||||
|
.addColumnFamily(cfDefHashtagTimeline);
|
||||||
|
|
||||||
cluster.addKeyspace(ksDef);
|
cluster.addKeyspace(ksDef);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,9 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
public static final String USER_NOTIFICATIONS = "USERNotifications"; // regular user notifications timeline
|
public static final String USER_NOTIFICATIONS = "USERNotifications"; // regular user notifications timeline
|
||||||
public static final String USER_MESSAGES_NOTIFICATIONS = "USERMessagesNotifications"; // user messages notifications timeline
|
public static final String USER_MESSAGES_NOTIFICATIONS = "USERMessagesNotifications"; // user messages notifications timeline
|
||||||
public static final String USER_NOTIFICATIONS_PREFERENCES = "USERNotificationsPreferences"; // preferences for notifications
|
public static final String USER_NOTIFICATIONS_PREFERENCES = "USERNotificationsPreferences"; // preferences for notifications
|
||||||
|
public static final String HASHTAGS_COUNTER = "HashtagsCounter"; // count the hashtags per group and type
|
||||||
|
public static final String HASHTAGGED_FEEDS = "HashtaggedFeeds"; // contains hashtags per type associated with vre and feed
|
||||||
|
|
||||||
|
|
||||||
private static ColumnFamily<String, String> cf_Connections = new ColumnFamily<String, String>(
|
private static ColumnFamily<String, String> cf_Connections = new ColumnFamily<String, String>(
|
||||||
CONNECTIONS, // Column Family Name
|
CONNECTIONS, // Column Family Name
|
||||||
|
@ -126,6 +129,14 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
USER_NOTIFICATIONS_PREFERENCES, // Column Family Name
|
USER_NOTIFICATIONS_PREFERENCES, // Column Family Name
|
||||||
StringSerializer.get(), // Key Serializer
|
StringSerializer.get(), // Key Serializer
|
||||||
StringSerializer.get()); // Column Serializer
|
StringSerializer.get()); // Column Serializer
|
||||||
|
private static ColumnFamily<String, String> cf_HashtagsCounter = new ColumnFamily<String, String>(
|
||||||
|
HASHTAGS_COUNTER, // Column Family Name
|
||||||
|
StringSerializer.get(), // Key Serializer
|
||||||
|
StringSerializer.get()); // Column Serializer
|
||||||
|
protected static ColumnFamily<String, String> cf_HashtagTimeline = new ColumnFamily<String, String>(
|
||||||
|
HASHTAGGED_FEEDS, // Column Family Name
|
||||||
|
StringSerializer.get(), // Key Serializer
|
||||||
|
StringSerializer.get()); // Column Serializer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -737,6 +748,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
|
|
||||||
return execute(m);
|
return execute(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -1408,7 +1420,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
toReturn.add(toAdd);
|
toReturn.add(toAdd);
|
||||||
}
|
}
|
||||||
} catch (ConnectionException e) {
|
} catch (ConnectionException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return toReturn;
|
return toReturn;
|
||||||
|
@ -1417,6 +1428,74 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
public boolean saveHashTags(String feedid, String vreid, List<String> hashtags) throws FeedIDNotFoundException {
|
||||||
|
// Inserting data
|
||||||
|
MutationBatch m = conn.getKeyspace().prepareMutationBatch();
|
||||||
|
for (String hashtag : hashtags) {
|
||||||
|
m.withRow(cf_HashtagTimeline, hashtag).putColumn(feedid, vreid, null);
|
||||||
|
boolean firstInsert = execute(m);
|
||||||
|
boolean secondInsert = updateVREHashtagCount(vreid, hashtag, true);
|
||||||
|
if (! (firstInsert && secondInsert)) {
|
||||||
|
_log.error("saveHashTag: Could not save the hashtag(s)");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> getVREHashtagsWithOccurrence(String vreid) {
|
||||||
|
OperationResult<Rows<String, String>> result = null;
|
||||||
|
try {
|
||||||
|
result = conn.getKeyspace().prepareQuery(cf_HashtagsCounter)
|
||||||
|
.getKeySlice(vreid)
|
||||||
|
.execute();
|
||||||
|
} catch (ConnectionException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Integer> toReturn = new HashMap<String, Integer> ();
|
||||||
|
|
||||||
|
// Iterate rows and their columns
|
||||||
|
for (Row<String, String> row : result.getResult()) {
|
||||||
|
for (Column<String> column : row.getColumns()) {
|
||||||
|
int curValue = Integer.parseInt(column.getStringValue());
|
||||||
|
toReturn.put(column.getName(), curValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException {
|
||||||
|
List<Feed> toReturn = new ArrayList<Feed>();
|
||||||
|
OperationResult<Rows<String, String>> result = null;
|
||||||
|
try {
|
||||||
|
result = conn.getKeyspace().prepareQuery(cf_HashtagTimeline)
|
||||||
|
.getKeySlice(hashtag)
|
||||||
|
.execute();
|
||||||
|
} catch (ConnectionException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ArrayList<String> feedIds = new ArrayList<String>();
|
||||||
|
// Iterate rows and their columns
|
||||||
|
for (Row<String, String> row : result.getResult()) {
|
||||||
|
for (Column<String> column : row.getColumns()) {
|
||||||
|
if (column.getStringValue().compareTo(vreid)==0)
|
||||||
|
feedIds.add(column.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toReturn = getFeedsByIds(feedIds);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void closeConnection() {
|
public void closeConnection() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
}
|
}
|
||||||
|
@ -1675,6 +1754,43 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update the hashtag count by incrementing or decrementing it by (1)
|
||||||
|
* used when adding or removing a hashtag in a feed
|
||||||
|
* @param vreid the vreid
|
||||||
|
* @param hashtag the hashtag
|
||||||
|
* @param increment set true if you want to add 1, false to subtract 1.
|
||||||
|
*/
|
||||||
|
private boolean updateVREHashtagCount(String vreid, String hashtag, boolean increment) {
|
||||||
|
Map<String, Integer> vreHashtags = getVREHashtagsWithOccurrence(vreid);
|
||||||
|
//if the hashtag not yet exist
|
||||||
|
int newCount = 0;
|
||||||
|
|
||||||
|
if (!vreHashtags.containsKey(hashtag)) {
|
||||||
|
newCount = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
try {
|
||||||
|
int current = vreHashtags.get(hashtag);
|
||||||
|
newCount = increment ? current+1 : current-1;
|
||||||
|
}
|
||||||
|
catch (NumberFormatException e) {
|
||||||
|
_log.error("Hashtag Number found is not a number: " + newCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_log.info("Updating counter for " + hashtag + " to " + newCount);
|
||||||
|
MutationBatch m = conn.getKeyspace().prepareMutationBatch();
|
||||||
|
m.withRow(cf_HashtagsCounter, vreid).putColumn(hashtag, ""+newCount, null);
|
||||||
|
try {
|
||||||
|
m.execute();
|
||||||
|
} catch (ConnectionException e) {
|
||||||
|
_log.error("Hashtag Count update NOT OK ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_log.info("Hashtag Count update OK to: " + newCount);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
package org.gcube.portal.databook.server;
|
package org.gcube.portal.databook.server;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
|
import java.sql.Savepoint;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.portal.databook.shared.Comment;
|
|
||||||
import org.gcube.portal.databook.shared.Feed;
|
import org.gcube.portal.databook.shared.Feed;
|
||||||
import org.gcube.portal.databook.shared.FeedType;
|
import org.gcube.portal.databook.shared.FeedType;
|
||||||
import org.gcube.portal.databook.shared.Like;
|
|
||||||
import org.gcube.portal.databook.shared.Notification;
|
|
||||||
import org.gcube.portal.databook.shared.NotificationChannelType;
|
import org.gcube.portal.databook.shared.NotificationChannelType;
|
||||||
import org.gcube.portal.databook.shared.NotificationType;
|
import org.gcube.portal.databook.shared.NotificationType;
|
||||||
import org.gcube.portal.databook.shared.PrivacyLevel;
|
import org.gcube.portal.databook.shared.PrivacyLevel;
|
||||||
import org.gcube.portal.databook.shared.RangeFeeds;
|
|
||||||
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
|
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
|
||||||
import org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException;
|
import org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException;
|
||||||
import org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException;
|
import org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException;
|
||||||
|
@ -26,10 +22,15 @@ import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.netflix.astyanax.connectionpool.OperationResult;
|
import com.netflix.astyanax.connectionpool.OperationResult;
|
||||||
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
|
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
|
||||||
|
import com.netflix.astyanax.ddl.ColumnFamilyDefinition;
|
||||||
|
import com.netflix.astyanax.model.ColumnFamily;
|
||||||
import com.netflix.astyanax.model.Row;
|
import com.netflix.astyanax.model.Row;
|
||||||
import com.netflix.astyanax.model.Rows;
|
import com.netflix.astyanax.model.Rows;
|
||||||
|
import com.netflix.astyanax.serializers.StringSerializer;
|
||||||
|
import com.netflix.astyanax.thrift.ddl.ThriftColumnFamilyDefinitionImpl;
|
||||||
|
|
||||||
public class DatabookCassandraTest {
|
public class DatabookCassandraTest {
|
||||||
private static DBCassandraAstyanaxImpl store;
|
private static DBCassandraAstyanaxImpl store;
|
||||||
|
@ -46,338 +47,404 @@ public class DatabookCassandraTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<String> getKeys() {
|
|
||||||
List<String> toReturn = new ArrayList<String>();
|
|
||||||
try {
|
|
||||||
|
|
||||||
OperationResult<Rows<String, String>> rows = store.getConnection().getKeyspace().prepareQuery(DBCassandraAstyanaxImpl.cf_UserNotificationsPreferences)
|
|
||||||
.getAllRows()
|
|
||||||
.setRowLimit(1000) // This is the page size
|
|
||||||
.execute();
|
|
||||||
int i = 1;
|
|
||||||
for (Row<String, String> row : rows.getResult()) {
|
|
||||||
System.out.println(i+" ROW: " + row.getKey() + " " + row.getColumns().size());
|
|
||||||
toReturn.add(row.getKey());
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
} catch (ConnectionException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return toReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUserNotificationPreferences() {
|
public void testHashTag() {
|
||||||
System.out.println("Notification type" + NotificationType.POST_ALERT.toString() +" OFF for:");
|
|
||||||
try {
|
try {
|
||||||
for (String user : getKeys()) {
|
final String VREID = "/gcube/devsec/devVRE5";
|
||||||
List<NotificationChannelType> channels = store.getUserNotificationChannels(user, NotificationType.POST_ALERT);
|
final String HASHTAG1 = "#anotherHashTag";
|
||||||
if (channels.isEmpty()) {
|
final String HASHTAG2 = "#yetAnotherHashTag";
|
||||||
System.out.println(user);
|
List<String> hashtags = new LinkedList<String>();
|
||||||
}
|
hashtags.add(HASHTAG1);
|
||||||
else if (! channels.contains(NotificationChannelType.EMAIL)) {
|
hashtags.add(HASHTAG2);
|
||||||
System.out.println(user + "->" + channels.toString());
|
|
||||||
}
|
Feed feed = new Feed(UUID.randomUUID().toString(), FeedType.TWEET, "massimiliano.assante", new Date(), VREID,
|
||||||
|
"www.d4science.org/monitor", "thumbUri", "This is a feed with " + HASHTAG1 + " and " + HASHTAG2, PrivacyLevel.VRES, "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host");
|
||||||
|
assertTrue(store.saveUserFeed(feed));
|
||||||
|
assertTrue(store.saveHashTags(feed.getKey(), VREID, hashtags));
|
||||||
|
System.out.println(feed);
|
||||||
|
|
||||||
|
System.out.println("\ngetting getVREHashtagsWithOccurrence for " + VREID);
|
||||||
|
Map<String, Integer> hashtagsWithOcc = store.getVREHashtagsWithOccurrence(VREID);
|
||||||
|
for (String hashtag : hashtagsWithOcc.keySet()) {
|
||||||
|
System.out.println(hashtag + ":" + hashtagsWithOcc.get(hashtag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("\ngetting getVREFeedsByHashtag for " + VREID + " and " + HASHTAG1);
|
||||||
|
for (Feed theFeed : store.getVREFeedsByHashtag(VREID, HASHTAG1)) {
|
||||||
|
System.out.println(theFeed);
|
||||||
|
}
|
||||||
|
|
||||||
// for (NotificationChannelType channel : store.getUserNotificationChannels("roberto.trasarti", NotificationType.POST_ALERT)) {
|
} catch (Exception e) {
|
||||||
// System.out.println(channel);
|
|
||||||
// }
|
|
||||||
} catch (NotificationChannelTypeNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (NotificationTypeNotFoundException e) {
|
}
|
||||||
e.printStackTrace();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testLikes() {
|
|
||||||
// int count = 10;
|
|
||||||
// Feed feed = new Feed(UUID.randomUUID().toString(), FeedType.SHARE, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
|
||||||
// "http://www.d4science.org/monitor", "thumbUri", "This feed is Liked ", PrivacyLevel.PUBLIC,
|
|
||||||
// "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
|
||||||
// assertTrue(store.saveUserFeed(feed));
|
|
||||||
// Like toUnlike = new Like(UUID.randomUUID().toString(),"massimiliano.assante",
|
|
||||||
// new Date(), feed.getKey().toString(), "Massi Pallino", "thumbUrl");
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// assertTrue(store.like(toUnlike));
|
|
||||||
// for (int i = 0; i < count; i++)
|
|
||||||
// assertTrue(store.like(new Like(UUID.randomUUID().toString(),"massimiliano.assante",
|
|
||||||
// new Date(), feed.getKey().toString(), "Rino Pallino", "thumbUrl")));
|
|
||||||
//
|
|
||||||
// System.out.println("massimiliano.assante liked the following feeds: ");
|
|
||||||
// for (String feedid : store.getAllLikedFeedIdsByUser("massimiliano.assante")) {
|
|
||||||
// System.out.println(feedid);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// for (Like like : store.getAllLikesByFeed(feed.getKey().toString())) {
|
|
||||||
// System.out.println(like);
|
|
||||||
// }
|
|
||||||
// System.out.println("massimiliano.assante trying unlike the following feed: " + toUnlike);
|
|
||||||
// store.unlike("massimiliano.assante", toUnlike.getKey(), toUnlike.getFeedid());
|
|
||||||
//
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// System.out.println("Exception feed id not found");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// /**
|
// /**
|
||||||
// * use exclusively to add a new CF to a keyspace
|
// * use exclusively to add a new (Dynamic) CF to a keyspace
|
||||||
// */
|
// */
|
||||||
// @Test
|
// @Test
|
||||||
// public void addNotifPreferencesColumnFamily() {
|
// public void addHashtagsColumnFamilies() {
|
||||||
// // ColumnFamily<String, String> cf_UserNotificationsPreferences = new ColumnFamily<String, String>(
|
// ColumnFamily<String, String> cf_HashtagsCounter = new ColumnFamily<String, String>(
|
||||||
// // DBCassandraAstyanaxImpl.USER_NOTIFICATIONS_PREFERENCES, // Column Family Name
|
// DBCassandraAstyanaxImpl.HASHTAGS_COUNTER, // Column Family Name
|
||||||
// // StringSerializer.get(), // Key Serializer
|
// StringSerializer.get(), // Key Serializer
|
||||||
// // StringSerializer.get()); // Column Serializer
|
// StringSerializer.get()); // Column Serializer
|
||||||
// //
|
// ColumnFamily<String, String> cf_HashtagTimeline = new ColumnFamily<String, String>(
|
||||||
// // try {
|
// DBCassandraAstyanaxImpl.HASHTAGGED_FEEDS, // Column Family Name
|
||||||
// // new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_UserNotificationsPreferences, ImmutableMap.<String, Object>builder()
|
// StringSerializer.get(), // Key Serializer
|
||||||
// // .put("default_validation_class", "UTF8Type")
|
// StringSerializer.get()); // Column Serializer
|
||||||
// // .put("key_validation_class", "UTF8Type")
|
|
||||||
// // .put("comparator_type", "UTF8Type")
|
|
||||||
// // .build());
|
|
||||||
// // } catch (ConnectionException e) {
|
|
||||||
// // e.printStackTrace();
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// @Test
|
|
||||||
// public void testFriendships() {
|
|
||||||
// assertTrue(store.requestFriendship("massimiliano.assante", "leonardo.candela"));
|
|
||||||
// assertTrue(store.requestFriendship("massimiliano.assante", "ermit"));
|
|
||||||
// assertTrue(store.requestFriendship("massimiliano.assante", "giorgino"));
|
|
||||||
// assertTrue(store.requestFriendship("barabba", "massimiliano.assante"));
|
|
||||||
//
|
|
||||||
// assertTrue(store.approveFriendship("leonardo.candela", "massimiliano.assante"));
|
|
||||||
// assertTrue(store.approveFriendship("ermit", "massimiliano.assante"));
|
|
||||||
//
|
|
||||||
// assertTrue(store.denyFriendship("giorgino", "massimiliano.assante"));
|
|
||||||
// System.out.println("Pending Connections for massimiliano.assante:");
|
|
||||||
// for (String userid: store.getPendingFriendRequests("massimiliano.assante")) {
|
|
||||||
// System.out.println(userid);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// System.out.println("Connections for massimiliano.assante:");
|
|
||||||
// for (String userid: store.getFriends("massimiliano.assante")) {
|
|
||||||
// System.out.println(userid);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// @Test
|
|
||||||
// public void testLikedFeedsRetrieval() {
|
|
||||||
// try {
|
// try {
|
||||||
// for (Feed feed : store.getAllLikedFeedsByUser("luca.frosini", 10)) {
|
// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_HashtagsCounter, ImmutableMap.<String, Object>builder()
|
||||||
// System.out.println(feed);
|
// .put("default_validation_class", "UTF8Type")
|
||||||
// }
|
// .put("key_validation_class", "UTF8Type")
|
||||||
// } catch (Exception e) {
|
// .put("comparator_type", "UTF8Type")
|
||||||
|
// .build());
|
||||||
|
//
|
||||||
|
// new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_HashtagTimeline, ImmutableMap.<String, Object>builder()
|
||||||
|
// .put("default_validation_class", "UTF8Type")
|
||||||
|
// .put("key_validation_class", "UTF8Type")
|
||||||
|
// .put("comparator_type", "UTF8Type")
|
||||||
|
// .build());
|
||||||
|
//
|
||||||
|
// } catch (ConnectionException e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
// private List<String> getKeys() {
|
||||||
//
|
// List<String> toReturn = new ArrayList<String>();
|
||||||
// @Test
|
// try {
|
||||||
// public void testSingleNotification() {
|
//
|
||||||
// Notification not = new Notification(
|
// OperationResult<Rows<String, String>> rows = store.getConnection().getKeyspace().prepareQuery(DBCassandraAstyanaxImpl.cf_UserNotificationsPreferences)
|
||||||
// UUID.randomUUID().toString(),
|
// .getAllRows()
|
||||||
// NotificationType.LIKE,
|
// .setRowLimit(1000) // This is the page size
|
||||||
// "leonardo.candela",
|
// .execute();
|
||||||
// "MESSAGEID",
|
// int i = 1;
|
||||||
// new Date(),
|
// for (Row<String, String> row : rows.getResult()) {
|
||||||
// "uri",
|
// System.out.println(i+" ROW: " + row.getKey() + " " + row.getColumns().size());
|
||||||
// "This is notification about a like",
|
// toReturn.add(row.getKey());
|
||||||
// false,
|
// i++;
|
||||||
// "leonardo.candela", "Leonardo Candela",
|
// }
|
||||||
// "thumburl");
|
// } catch (ConnectionException e) {
|
||||||
// assertTrue(store.saveNotification(not));
|
// e.printStackTrace();
|
||||||
//
|
// }
|
||||||
// not = new Notification(
|
// return toReturn;
|
||||||
// UUID.randomUUID().toString(),
|
// }
|
||||||
// NotificationType.MESSAGE,
|
//
|
||||||
// "massimiliano.assante",
|
// @Test
|
||||||
// "MESSAGEID",
|
// public void testUserNotificationPreferences() {
|
||||||
// new Date(),
|
// System.out.println("Notification type" + NotificationType.POST_ALERT.toString() +" OFF for:");
|
||||||
// "uri",
|
// try {
|
||||||
// "This is notification about a like",
|
// for (String user : getKeys()) {
|
||||||
// false,
|
// List<NotificationChannelType> channels = store.getUserNotificationChannels(user, NotificationType.POST_ALERT);
|
||||||
// "antonio.gioia", "Antonio Gioia",
|
// if (channels.isEmpty()) {
|
||||||
// "thumburl");
|
// System.out.println(user);
|
||||||
// assertTrue(store.saveNotification(not));
|
// }
|
||||||
// System.out.println("Writing one Notification " + not);
|
// else if (! channels.contains(NotificationChannelType.EMAIL)) {
|
||||||
// }
|
// System.out.println(user + "->" + channels.toString());
|
||||||
//
|
// }
|
||||||
// @Test
|
// }
|
||||||
// public void testNotifications() {
|
|
||||||
// Notification not = null;
|
|
||||||
// System.out.println("Writing 18 Notifications");
|
// for (NotificationChannelType channel : store.getUserNotificationChannels("roberto.trasarti", NotificationType.POST_ALERT)) {
|
||||||
// int count = 18;
|
// System.out.println(channel);
|
||||||
// for (int i = 0; i < count; i++) {
|
// }
|
||||||
// if (i % 2 != 0) {
|
// } catch (NotificationChannelTypeNotFoundException e) {
|
||||||
// not = new Notification(UUID.randomUUID().toString(), NotificationType.JOB_COMPLETED_OK,
|
// e.printStackTrace();
|
||||||
// "leonardo.candela", "TWEETID", new Date(), "uri", "This is notification about job completed OK #"+i, false, "pasquale.pagano", "Pasquale Pagano", "thumburl");
|
// } catch (NotificationTypeNotFoundException e) {
|
||||||
// } else {
|
// e.printStackTrace();
|
||||||
// not = new Notification(UUID.randomUUID().toString(), NotificationType.JOB_COMPLETED_NOK,
|
// };
|
||||||
// "massimiliano.assante", "MESSAGEID", new Date(), "uri", "This is notification about completed NOK #"+i, false, "leonardo.candela", "Leonardo Candela", "thumburl");
|
//
|
||||||
// }
|
// }
|
||||||
// assertTrue(store.saveNotification(not));
|
|
||||||
// try {
|
// @Test
|
||||||
// Thread.sleep(150);
|
// public void testLikes() {
|
||||||
// } catch (InterruptedException e) {
|
// int count = 10;
|
||||||
// // TODO Auto-generated catch block
|
// Feed feed = new Feed(UUID.randomUUID().toString(), FeedType.SHARE, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
||||||
// e.printStackTrace();
|
// "http://www.d4science.org/monitor", "thumbUri", "This feed is Liked ", PrivacyLevel.PUBLIC,
|
||||||
// }
|
// "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
||||||
// }
|
// assertTrue(store.saveUserFeed(feed));
|
||||||
//
|
// Like toUnlike = new Like(UUID.randomUUID().toString(),"massimiliano.assante",
|
||||||
// Notification rNot= null;
|
// new Date(), feed.getKey().toString(), "Massi Pallino", "thumbUrl");
|
||||||
// try {
|
//
|
||||||
//
|
// try {
|
||||||
// //read
|
// assertTrue(store.like(toUnlike));
|
||||||
// rNot = store.readNotification(not.getKey().toString());
|
// for (int i = 0; i < count; i++)
|
||||||
// assertNotNull(rNot);
|
// assertTrue(store.like(new Like(UUID.randomUUID().toString(),"massimiliano.assante",
|
||||||
// System.out.println("Reading one Notification " + rNot.getKey() + ": " + rNot.getDescription() + " Type: " + rNot.getType());
|
// new Date(), feed.getKey().toString(), "Rino Pallino", "thumbUrl")));
|
||||||
//
|
//
|
||||||
// //set Read
|
// System.out.println("massimiliano.assante liked the following feeds: ");
|
||||||
// assertTrue(store.setNotificationRead(rNot.getKey().toString()));
|
// for (String feedid : store.getAllLikedFeedIdsByUser("massimiliano.assante")) {
|
||||||
//
|
// System.out.println(feedid);
|
||||||
// System.out.println("Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " was set to READ");
|
// }
|
||||||
//
|
//
|
||||||
// not = new Notification(UUID.randomUUID().toString(), NotificationType.LIKE,
|
// for (Like like : store.getAllLikesByFeed(feed.getKey().toString())) {
|
||||||
// "leonardo.candela", "FEEDID", new Date(), "uri", "This is notification of a Liked Leo feed by Massi", false, "massimiliano.assante", "Massimiliano Assante", "thumburl");
|
// System.out.println(like);
|
||||||
// assertTrue(store.saveNotification(not));
|
// }
|
||||||
// try {
|
// System.out.println("massimiliano.assante trying unlike the following feed: " + toUnlike);
|
||||||
// Thread.sleep(150);
|
// store.unlike("massimiliano.assante", toUnlike.getKey(), toUnlike.getFeedid());
|
||||||
// } catch (InterruptedException e) {
|
//
|
||||||
// // TODO Auto-generated catch block
|
// } catch (Exception e) {
|
||||||
// e.printStackTrace();
|
// System.out.println("Exception feed id not found");
|
||||||
// }
|
// }
|
||||||
// rNot = store.readNotification(not.getKey().toString());
|
// }
|
||||||
// System.out.println("Reading another Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " Read:? " + rNot.isRead());
|
// /**
|
||||||
// // //set Read
|
// * use exclusively to add a new CF to a keyspace
|
||||||
// // assertTrue(store.setNotificationRead(rNot.getKey().toString()));
|
// */
|
||||||
// // System.out.println("Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " was set to READ subject was this: " + rNot.getSubjectid());
|
// @Test
|
||||||
// //
|
// public void addNotifPreferencesColumnFamily() {
|
||||||
// Random randomGenerator = new Random();
|
// // ColumnFamily<String, String> cf_UserNotificationsPreferences = new ColumnFamily<String, String>(
|
||||||
//
|
// // DBCassandraAstyanaxImpl.USER_NOTIFICATIONS_PREFERENCES, // Column Family Name
|
||||||
// System.out.println("leonardo.candela Notifications: ");
|
// // StringSerializer.get(), // Key Serializer
|
||||||
// List<Notification> recentNots = store.getAllNotificationByUser("leonardo.candela", randomGenerator.nextInt(50));
|
// // StringSerializer.get()); // Column Serializer
|
||||||
// assertNotNull(recentNots);
|
// //
|
||||||
// for (Notification notif :recentNots)
|
// // try {
|
||||||
// System.out.println(notif);
|
// // new CassandraClusterConnection(false).getKeyspace().createColumnFamily(cf_UserNotificationsPreferences, ImmutableMap.<String, Object>builder()
|
||||||
//
|
// // .put("default_validation_class", "UTF8Type")
|
||||||
//
|
// // .put("key_validation_class", "UTF8Type")
|
||||||
// System.out.println("massimiliano.assante Notifications: ");
|
// // .put("comparator_type", "UTF8Type")
|
||||||
// recentNots = store.getUnreadNotificationsByUser("massimiliano.assante");
|
// // .build());
|
||||||
// assertNotNull(recentNots);
|
// // } catch (ConnectionException e) {
|
||||||
// for (Notification notif :recentNots)
|
// // e.printStackTrace();
|
||||||
// System.out.println(notif);
|
// // }
|
||||||
// } catch (Exception e) {
|
// }
|
||||||
// e.printStackTrace();
|
//
|
||||||
// }
|
// @Test
|
||||||
//
|
// public void testFriendships() {
|
||||||
// System.out.println("getRangeNotificationsByUser massimiliano.assante: ");
|
// assertTrue(store.requestFriendship("massimiliano.assante", "leonardo.candela"));
|
||||||
// try {
|
// assertTrue(store.requestFriendship("massimiliano.assante", "ermit"));
|
||||||
// int from = 0;
|
// assertTrue(store.requestFriendship("massimiliano.assante", "giorgino"));
|
||||||
// for (int i = 0; i < 5; i++) {
|
// assertTrue(store.requestFriendship("barabba", "massimiliano.assante"));
|
||||||
// System.out.println("\nFROM="+from);
|
//
|
||||||
// List<Notification> range = store.getRangeNotificationsByUser("massimiliano.assante", from, 50);
|
// assertTrue(store.approveFriendship("leonardo.candela", "massimiliano.assante"));
|
||||||
// for (Notification notification : range) {
|
// assertTrue(store.approveFriendship("ermit", "massimiliano.assante"));
|
||||||
// System.out.println(notification.getDescription());
|
//
|
||||||
// from = 1+i * 50;
|
// assertTrue(store.denyFriendship("giorgino", "massimiliano.assante"));
|
||||||
// }
|
// System.out.println("Pending Connections for massimiliano.assante:");
|
||||||
// }
|
// for (String userid: store.getPendingFriendRequests("massimiliano.assante")) {
|
||||||
// } catch (Exception e) {
|
// System.out.println(userid);
|
||||||
// e.printStackTrace();
|
// }
|
||||||
// }
|
//
|
||||||
// }
|
// System.out.println("Connections for massimiliano.assante:");
|
||||||
//
|
// for (String userid: store.getFriends("massimiliano.assante")) {
|
||||||
//
|
// System.out.println(userid);
|
||||||
// @Test
|
// }
|
||||||
// public void testFeeds() {
|
//
|
||||||
// int count = 18;
|
// }
|
||||||
// Feed feed = null;
|
// @Test
|
||||||
// for (int i = 0; i < count; i++) {
|
// public void testLikedFeedsRetrieval() {
|
||||||
// if (i % 2 != 0) {
|
// try {
|
||||||
// feed = new Feed(UUID.randomUUID().toString(), FeedType.JOIN, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
// for (Feed feed : store.getAllLikedFeedsByUser("luca.frosini", 10)) {
|
||||||
// "www.d4science.org/monitor", "thumbUri", "This is feed# "+ i, PrivacyLevel.VRES, "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host");
|
// System.out.println(feed);
|
||||||
// } else {
|
// }
|
||||||
// feed = new Feed(UUID.randomUUID().toString(), FeedType.TWEET, "leonardo.candela", new Date(), "",
|
// } catch (Exception e) {
|
||||||
// "www.d4science.org/web/guest", "thumbUri", "This is feed# "+ i, PrivacyLevel.PORTAL, "Leonardo Candela", "leonardo.candela@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host");
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
// assertTrue(store.saveUserFeed(feed));
|
// }
|
||||||
// try {
|
//
|
||||||
// Thread.sleep(150);
|
//
|
||||||
// } catch (InterruptedException e) {
|
//
|
||||||
// // TODO Auto-generated catch block
|
//
|
||||||
// e.printStackTrace();
|
// @Test
|
||||||
// }
|
// public void testSingleNotification() {
|
||||||
// }
|
// Notification not = new Notification(
|
||||||
//
|
// UUID.randomUUID().toString(),
|
||||||
// Feed rFeed = null;
|
// NotificationType.LIKE,
|
||||||
// try {
|
// "leonardo.candela",
|
||||||
// rFeed = store.readFeed(feed.getKey().toString());
|
// "MESSAGEID",
|
||||||
// rFeed = store.readFeed(feed.getKey().toString());
|
// new Date(),
|
||||||
// rFeed = store.readFeed(feed.getKey().toString());
|
// "uri",
|
||||||
// rFeed = store.readFeed(feed.getKey().toString());
|
// "This is notification about a like",
|
||||||
// assertNotNull(rFeed);
|
// false,
|
||||||
//
|
// "leonardo.candela", "Leonardo Candela",
|
||||||
// String feedIdToDelete = UUID.randomUUID().toString();
|
// "thumburl");
|
||||||
// feed = new Feed(feedIdToDelete, FeedType.PUBLISH, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
// assertTrue(store.saveNotification(not));
|
||||||
// "www.d4science.org/monitor", "thumbUri", "This is feed to be deleted", PrivacyLevel.VRES, "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
//
|
||||||
// assertTrue(store.saveUserFeed(feed));
|
// not = new Notification(
|
||||||
// try {
|
// UUID.randomUUID().toString(),
|
||||||
// Thread.sleep(250);
|
// NotificationType.MESSAGE,
|
||||||
// } catch (InterruptedException e) {
|
// "massimiliano.assante",
|
||||||
// // TODO Auto-generated catch block
|
// "MESSAGEID",
|
||||||
// e.printStackTrace();
|
// new Date(),
|
||||||
// }
|
// "uri",
|
||||||
// System.out.println("Test Delete Feed ");
|
// "This is notification about a like",
|
||||||
// assertTrue(store.deleteFeed(feedIdToDelete));
|
// false,
|
||||||
//
|
// "antonio.gioia", "Antonio Gioia",
|
||||||
// System.out.println("massimiliano.assante ALL FEEDS: ");
|
// "thumburl");
|
||||||
// for (Feed recFeed : store.getAllFeedsByUser("massimiliano.assante"))
|
// assertTrue(store.saveNotification(not));
|
||||||
// System.out.println(recFeed);
|
// System.out.println("Writing one Notification " + not);
|
||||||
// }
|
// }
|
||||||
// catch (Exception e) {
|
//
|
||||||
// e.printStackTrace();
|
// @Test
|
||||||
// }
|
// public void testNotifications() {
|
||||||
// }
|
// Notification not = null;
|
||||||
//
|
// System.out.println("Writing 18 Notifications");
|
||||||
//
|
// int count = 18;
|
||||||
//
|
// for (int i = 0; i < count; i++) {
|
||||||
// @Test
|
// if (i % 2 != 0) {
|
||||||
// public void testComments() {
|
// not = new Notification(UUID.randomUUID().toString(), NotificationType.JOB_COMPLETED_OK,
|
||||||
// int count = 10;
|
// "leonardo.candela", "TWEETID", new Date(), "uri", "This is notification about job completed OK #"+i, false, "pasquale.pagano", "Pasquale Pagano", "thumburl");
|
||||||
// Feed feed = new Feed(UUID.randomUUID().toString(), FeedType.SHARE, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
// } else {
|
||||||
// "http://www.d4science.org/monitor", "thumbUri", "This is feed that is going to be commented ", PrivacyLevel.PUBLIC, "Massimiliano Assante",
|
// not = new Notification(UUID.randomUUID().toString(), NotificationType.JOB_COMPLETED_NOK,
|
||||||
// "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
// "massimiliano.assante", "MESSAGEID", new Date(), "uri", "This is notification about completed NOK #"+i, false, "leonardo.candela", "Leonardo Candela", "thumburl");
|
||||||
// assertTrue(store.saveUserFeed(feed));
|
// }
|
||||||
//
|
// assertTrue(store.saveNotification(not));
|
||||||
// Comment toDelete = null;
|
// try {
|
||||||
// for (int i = 0; i < count; i++) {
|
// Thread.sleep(150);
|
||||||
// try {
|
// } catch (InterruptedException e) {
|
||||||
// toDelete = new Comment(UUID.randomUUID().toString(),"leonardo.candela",
|
// // TODO Auto-generated catch block
|
||||||
// new Date(), feed.getKey().toString(), "This comment #"+i, "Leonardo Candela", "thumbUrl");
|
// e.printStackTrace();
|
||||||
// assertTrue(store.addComment(toDelete));
|
// }
|
||||||
//
|
// }
|
||||||
// } catch (FeedIDNotFoundException e) {
|
//
|
||||||
// System.out.println("Exception feed id not found");
|
// Notification rNot= null;
|
||||||
// }
|
// try {
|
||||||
// }
|
//
|
||||||
// System.out.println("GetAllCOmmentsByFeed ");
|
// //read
|
||||||
// for (Comment cm : store.getAllCommentByFeed(feed.getKey().toString())) {
|
// rNot = store.readNotification(not.getKey().toString());
|
||||||
// System.out.println(cm.getText());
|
// assertNotNull(rNot);
|
||||||
// };
|
// System.out.println("Reading one Notification " + rNot.getKey() + ": " + rNot.getDescription() + " Type: " + rNot.getType());
|
||||||
//
|
//
|
||||||
// try {
|
// //set Read
|
||||||
// assertTrue(store.deleteComment(toDelete.getKey(), toDelete.getFeedid()));
|
// assertTrue(store.setNotificationRead(rNot.getKey().toString()));
|
||||||
// } catch (Exception e) {
|
//
|
||||||
// System.out.println("Exception feed id not found");
|
// System.out.println("Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " was set to READ");
|
||||||
// }
|
//
|
||||||
// }
|
// not = new Notification(UUID.randomUUID().toString(), NotificationType.LIKE,
|
||||||
|
// "leonardo.candela", "FEEDID", new Date(), "uri", "This is notification of a Liked Leo feed by Massi", false, "massimiliano.assante", "Massimiliano Assante", "thumburl");
|
||||||
|
// assertTrue(store.saveNotification(not));
|
||||||
|
// try {
|
||||||
|
// Thread.sleep(150);
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// rNot = store.readNotification(not.getKey().toString());
|
||||||
|
// System.out.println("Reading another Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " Read:? " + rNot.isRead());
|
||||||
|
// // //set Read
|
||||||
|
// // assertTrue(store.setNotificationRead(rNot.getKey().toString()));
|
||||||
|
// // System.out.println("Notification " + rNot.getKey() + " of Type: " + rNot.getType() + " was set to READ subject was this: " + rNot.getSubjectid());
|
||||||
|
// //
|
||||||
|
// Random randomGenerator = new Random();
|
||||||
|
//
|
||||||
|
// System.out.println("leonardo.candela Notifications: ");
|
||||||
|
// List<Notification> recentNots = store.getAllNotificationByUser("leonardo.candela", randomGenerator.nextInt(50));
|
||||||
|
// assertNotNull(recentNots);
|
||||||
|
// for (Notification notif :recentNots)
|
||||||
|
// System.out.println(notif);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// System.out.println("massimiliano.assante Notifications: ");
|
||||||
|
// recentNots = store.getUnreadNotificationsByUser("massimiliano.assante");
|
||||||
|
// assertNotNull(recentNots);
|
||||||
|
// for (Notification notif :recentNots)
|
||||||
|
// System.out.println(notif);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// System.out.println("getRangeNotificationsByUser massimiliano.assante: ");
|
||||||
|
// try {
|
||||||
|
// int from = 0;
|
||||||
|
// for (int i = 0; i < 5; i++) {
|
||||||
|
// System.out.println("\nFROM="+from);
|
||||||
|
// List<Notification> range = store.getRangeNotificationsByUser("massimiliano.assante", from, 50);
|
||||||
|
// for (Notification notification : range) {
|
||||||
|
// System.out.println(notification.getDescription());
|
||||||
|
// from = 1+i * 50;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @Test
|
||||||
|
// public void testFeeds() {
|
||||||
|
// int count = 18;
|
||||||
|
// Feed feed = null;
|
||||||
|
// for (int i = 0; i < count; i++) {
|
||||||
|
// if (i % 2 != 0) {
|
||||||
|
// feed = new Feed(UUID.randomUUID().toString(), FeedType.JOIN, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
||||||
|
// "www.d4science.org/monitor", "thumbUri", "This is feed# "+ i, PrivacyLevel.VRES, "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host");
|
||||||
|
// } else {
|
||||||
|
// feed = new Feed(UUID.randomUUID().toString(), FeedType.TWEET, "leonardo.candela", new Date(), "",
|
||||||
|
// "www.d4science.org/web/guest", "thumbUri", "This is feed# "+ i, PrivacyLevel.PORTAL, "Leonardo Candela", "leonardo.candela@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host");
|
||||||
|
// }
|
||||||
|
// assertTrue(store.saveUserFeed(feed));
|
||||||
|
// try {
|
||||||
|
// Thread.sleep(150);
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Feed rFeed = null;
|
||||||
|
// try {
|
||||||
|
// rFeed = store.readFeed(feed.getKey().toString());
|
||||||
|
// rFeed = store.readFeed(feed.getKey().toString());
|
||||||
|
// rFeed = store.readFeed(feed.getKey().toString());
|
||||||
|
// rFeed = store.readFeed(feed.getKey().toString());
|
||||||
|
// assertNotNull(rFeed);
|
||||||
|
//
|
||||||
|
// String feedIdToDelete = UUID.randomUUID().toString();
|
||||||
|
// feed = new Feed(feedIdToDelete, FeedType.PUBLISH, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
||||||
|
// "www.d4science.org/monitor", "thumbUri", "This is feed to be deleted", PrivacyLevel.VRES, "Massimiliano Assante", "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
||||||
|
// assertTrue(store.saveUserFeed(feed));
|
||||||
|
// try {
|
||||||
|
// Thread.sleep(250);
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// // TODO Auto-generated catch block
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// System.out.println("Test Delete Feed ");
|
||||||
|
// assertTrue(store.deleteFeed(feedIdToDelete));
|
||||||
|
//
|
||||||
|
// System.out.println("massimiliano.assante ALL FEEDS: ");
|
||||||
|
// for (Feed recFeed : store.getAllFeedsByUser("massimiliano.assante"))
|
||||||
|
// System.out.println(recFeed);
|
||||||
|
// }
|
||||||
|
// catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @Test
|
||||||
|
// public void testComments() {
|
||||||
|
// int count = 10;
|
||||||
|
// Feed feed = new Feed(UUID.randomUUID().toString(), FeedType.SHARE, "massimiliano.assante", new Date(), "/gcube/devsec/devVRE",
|
||||||
|
// "http://www.d4science.org/monitor", "thumbUri", "This is feed that is going to be commented ", PrivacyLevel.PUBLIC, "Massimiliano Assante",
|
||||||
|
// "massimiliano.assante@isti.cnr.it", "thumburl", "linkTitle", "linkDesc", "host", false);
|
||||||
|
// assertTrue(store.saveUserFeed(feed));
|
||||||
|
//
|
||||||
|
// Comment toDelete = null;
|
||||||
|
// for (int i = 0; i < count; i++) {
|
||||||
|
// try {
|
||||||
|
// toDelete = new Comment(UUID.randomUUID().toString(),"leonardo.candela",
|
||||||
|
// new Date(), feed.getKey().toString(), "This comment #"+i, "Leonardo Candela", "thumbUrl");
|
||||||
|
// assertTrue(store.addComment(toDelete));
|
||||||
|
//
|
||||||
|
// } catch (FeedIDNotFoundException e) {
|
||||||
|
// System.out.println("Exception feed id not found");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// System.out.println("GetAllCOmmentsByFeed ");
|
||||||
|
// for (Comment cm : store.getAllCommentByFeed(feed.getKey().toString())) {
|
||||||
|
// System.out.println(cm.getText());
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// assertTrue(store.deleteComment(toDelete.getKey(), toDelete.getFeedid()));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// System.out.println("Exception feed id not found");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException;
|
||||||
/**
|
/**
|
||||||
* @author Massimiliano Assante ISTI-CNR
|
* @author Massimiliano Assante ISTI-CNR
|
||||||
*
|
*
|
||||||
* @version 1.0 Feb 2013
|
|
||||||
* <class>DatabookStore</class> is the high level interface for querying and adding data to DatabookStore
|
* <class>DatabookStore</class> is the high level interface for querying and adding data to DatabookStore
|
||||||
*/
|
*/
|
||||||
public interface DatabookStore {
|
public interface DatabookStore {
|
||||||
|
@ -278,7 +277,7 @@ public interface DatabookStore {
|
||||||
/**
|
/**
|
||||||
* delete a comment
|
* delete a comment
|
||||||
* @param commentid the comment identifier to delete
|
* @param commentid the comment identifier to delete
|
||||||
* @parma feedid the feedid to shich the comment is associated
|
* @parma feedid the feedid to which the comment is associated
|
||||||
* @return true if success, false otherwise
|
* @return true if success, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean deleteComment(String commentid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, FeedIDNotFoundException;
|
boolean deleteComment(String commentid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, FeedIDNotFoundException;
|
||||||
|
@ -292,7 +291,7 @@ public interface DatabookStore {
|
||||||
* unlike a feed
|
* unlike a feed
|
||||||
* @param userid user identifier
|
* @param userid user identifier
|
||||||
* @param likeid the like identifier to delete
|
* @param likeid the like identifier to delete
|
||||||
* @param feedid the feedid to shich the comment is associated
|
* @param feedid the feedid to which the comment is associated
|
||||||
* @return true if success, false otherwise
|
* @return true if success, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean unlike(String userid, String likeid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, LikeIDNotFoundException, FeedIDNotFoundException;
|
boolean unlike(String userid, String likeid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, LikeIDNotFoundException, FeedIDNotFoundException;
|
||||||
|
@ -317,7 +316,33 @@ public interface DatabookStore {
|
||||||
* return all the likes belonging to the feedid
|
* return all the likes belonging to the feedid
|
||||||
*/
|
*/
|
||||||
List<Like> getAllLikesByFeed(String feedid);
|
List<Like> getAllLikesByFeed(String feedid);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param hashtags the hashtag including the '#'
|
||||||
|
* @param feedid the feedid to which the hashtag is associated
|
||||||
|
* @param vreid VRE identifier
|
||||||
|
* @return true if success, false otherwise
|
||||||
|
* @throws FeedIDNotFoundException
|
||||||
|
*/
|
||||||
|
boolean saveHashTags(String feedid, String vreid, List<String> hashtags) throws FeedIDNotFoundException;
|
||||||
|
/**
|
||||||
|
* get a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VRE
|
||||||
|
* @param vreid vre identifier (scope)
|
||||||
|
* @return a HashMap<String, Integer> of vre Hashtags associated with their occurrence
|
||||||
|
*/
|
||||||
|
Map<String, Integer> getVREHashtagsWithOccurrence(String vreid);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param vreid VRE identifier
|
||||||
|
* @param hashtag the hashtag to look for including the '#'
|
||||||
|
* @throws ColumnNameNotFoundException .
|
||||||
|
* @throws FeedIDNotFoundException .
|
||||||
|
* @throws FeedTypeNotFoundException .
|
||||||
|
* @throws PrivacyLevelTypeNotFoundException
|
||||||
|
* @throws FeedIDNotFoundException .
|
||||||
|
* @return all the feeds having the hashtag passed as parameter
|
||||||
|
*/
|
||||||
|
List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException;
|
||||||
/**
|
/**
|
||||||
* close the connection to the underlying database
|
* close the connection to the underlying database
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue