Implementation of databookstore using social client REST API
This commit is contained in:
parent
5d6bdc94af
commit
c02408cc90
|
@ -170,19 +170,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean saveUserPost(Post post, List<Attachment> attachments) {
|
public boolean saveUserPost(Post post, List<Attachment> attachments) {
|
||||||
if (attachments != null && !attachments.isEmpty())
|
return postClient.saveUserPostLib(post, attachments);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -213,19 +201,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean saveAppPost(Post post, List<Attachment> attachments) {
|
public boolean saveAppPost(Post post, List<Attachment> attachments) {
|
||||||
if (attachments != null && !attachments.isEmpty())
|
return postClient.saveAppPostLib(post, attachments);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -826,7 +802,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException {
|
public List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException {
|
||||||
return hashTagClient.getVREFeedsByHashtagLib(vreid, hashtag);
|
return null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
|
Loading…
Reference in New Issue