aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/filehistory
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2009-06-24 13:45:08 +0000
committerDamian Minkov <damencho@jitsi.org>2009-06-24 13:45:08 +0000
commit918a8ec7c019c192c2441e469b4091fe60b3e4cc (patch)
treee4ded068233046daf28d8a2edf66ef62a0ca240a /src/net/java/sip/communicator/impl/filehistory
parentab6e04cdcf2df326e13469c0a46ef1b52d6d43e6 (diff)
downloadjitsi-918a8ec7c019c192c2441e469b4091fe60b3e4cc.zip
jitsi-918a8ec7c019c192c2441e469b4091fe60b3e4cc.tar.gz
jitsi-918a8ec7c019c192c2441e469b4091fe60b3e4cc.tar.bz2
MetaHistory Service impl and add Contact field to FileRecord.
Diffstat (limited to 'src/net/java/sip/communicator/impl/filehistory')
-rw-r--r--src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java
index b71059a..95b968d 100644
--- a/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/filehistory/FileHistoryServiceImpl.java
@@ -213,7 +213,8 @@ public class FileHistoryServiceImpl
return readers;
}
- private FileRecord createFileRecordFromHistoryRecord(HistoryRecord hr)
+ private FileRecord createFileRecordFromHistoryRecord(
+ HistoryRecord hr, Contact contact)
{
String file = null;
String dir = null;
@@ -243,7 +244,7 @@ public class FileHistoryServiceImpl
status = hr.getPropertyValues()[i];
}
- return new FileRecord(dir, date, new File(file), status);
+ return new FileRecord(contact, dir, date, new File(file), status);
}
/**
@@ -265,13 +266,14 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
Iterator<HistoryRecord> recs = reader.findByStartDate(startDate);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -296,13 +298,14 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
Iterator<HistoryRecord> recs = reader.findByEndDate(endDate);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -350,6 +353,7 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
@@ -357,7 +361,7 @@ public class FileHistoryServiceImpl
startDate, endDate, keywords, SEARCH_FIELD, caseSensitive);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -384,13 +388,14 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
Iterator<HistoryRecord> recs = reader.findByPeriod(startDate, endDate);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -415,13 +420,14 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
Iterator<HistoryRecord> recs = reader.findLast(count);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -494,6 +500,7 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
@@ -501,7 +508,7 @@ public class FileHistoryServiceImpl
reader.findByKeywords(keywords, SEARCH_FIELD, caseSensitive);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -528,6 +535,7 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
@@ -535,7 +543,7 @@ public class FileHistoryServiceImpl
reader.findFirstRecordsAfter(date, count);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}
@@ -568,6 +576,7 @@ public class FileHistoryServiceImpl
for (Map.Entry<Contact, HistoryReader> readerEntry : readers.entrySet())
{
+ Contact c = readerEntry.getKey();
HistoryReader reader = readerEntry.getValue();
// add the progress listeners
@@ -575,7 +584,7 @@ public class FileHistoryServiceImpl
reader.findLastRecordsBefore(date, count);
while (recs.hasNext())
{
- result.add(createFileRecordFromHistoryRecord(recs.next()));
+ result.add(createFileRecordFromHistoryRecord(recs.next(), c));
}
}