Implementation of databookstore using social client REST API

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2023-11-21 18:37:45 +01:00
parent 5d6bdc94af
commit c02408cc90
1 changed files with 3 additions and 27 deletions

View File

@ -170,19 +170,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
*/
@Override
public boolean saveUserPost(Post post, List<Attachment> attachments) {
if (attachments != null && !attachments.isEmpty())
post.setMultiFileUpload(true);
boolean savePostResult = saveUserPost(post);
if (savePostResult) {
String postkey = post.getKey();
for (Attachment attachment : attachments) {
boolean attachSaveResult = postClient.saveAttachmentEntryLib(postkey, attachment);
if (!attachSaveResult)
_log.warn("Some of the attachments failed to be saved: " + attachment.getName());
}
return true;
}
else return false;
return postClient.saveUserPostLib(post, attachments);
}
/**
@ -213,19 +201,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
*/
@Override
public boolean saveAppPost(Post post, List<Attachment> attachments) {
if (attachments != null && !attachments.isEmpty())
post.setMultiFileUpload(true);
boolean saveFeedResult = saveAppPost(post);
if (saveFeedResult) {
String feedKey = post.getKey();
for (Attachment attachment : attachments) {
boolean attachSaveResult = postClient.saveAttachmentEntryLib(feedKey, attachment);
if (!attachSaveResult)
_log.warn("Some of the attachments failed to be saved: " + attachment.getName());
}
return true;
}
else return false;
return postClient.saveAppPostLib(post, attachments);
}
/**
* {@inheritDoc}
@ -826,7 +802,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
*/
@Override
public List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException {
return hashTagClient.getVREFeedsByHashtagLib(vreid, hashtag);
return null;
}
/**
* {@inheritDoc}