- * Returns whether the target Sone is trusted by the origin Sone.
- *
- * @param origin
- * The origin Sone
- * @param target
- * The target Sone
- * @return {@code true} if the target Sone is trusted by the origin Sone
- */
- public boolean isSoneTrusted(Sone origin, Sone target) {
- checkNotNull(origin, "origin must not be null");
- checkNotNull(target, "target must not be null");
- checkArgument(origin.getIdentity() instanceof OwnIdentity, "origin’s identity must be an OwnIdentity");
- return trustedIdentities.containsEntry(origin.getIdentity(), target.getIdentity());
- }
-
- /** {@inheritDoc} */
- @Override
- public Optional<Post> getPost(String postId) {
- return database.getPost(postId);
- }
-
- /** {@inheritDocs} */
- @Override
- public Collection<Post> getPosts(String soneId) {
- return database.getPosts(soneId);
- }
-
- /** {@inheritDoc} */
- @Override
- public Collection<Post> getDirectedPosts(final String recipientId) {
- checkNotNull(recipientId, "recipient must not be null");
- return database.getDirectedPosts(recipientId);
- }
-
- /**
- * Returns a post reply builder.
- *
- * @return A new post reply builder
- */
- public PostReplyBuilder postReplyBuilder() {
- return database.newPostReplyBuilder();
- }
-
- /** {@inheritDoc} */
- @Override
- public Optional<PostReply> getPostReply(String replyId) {
- return database.getPostReply(replyId);
- }
-
- /** {@inheritDoc} */
- @Override
- public List<PostReply> getReplies(final String postId) {
- return database.getReplies(postId);
- }
-
- /**