Package org.moera.lib.node
Class MoeraNode
java.lang.Object
org.moera.lib.node.NodeApiClient
org.moera.lib.node.MoeraNode
MoeraNode
is a client for interfacing with Moera nodes using the Moera Node API.-
Nested Class Summary
Nested classes/interfaces inherited from class org.moera.lib.node.NodeApiClient
NodeApiClient.ResponseConsumer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaskRemoteNode
(String nodeName, AskDescription details) Send a request to the remote node.blockInstant
(BlockedInstantAttributes instant) Blocks creation of instants of the given story type, related to the given entry, optionally unblocking at the given time in the future.Blocks the given node from performing the given operations, in a particular posting or globally, optionally unblocking at the given time in the future.Cancel the request to delete the node.Check whether the credentials are initialized already.createAvatar
(AvatarAttributes avatar) Create a new avatar from a public media file that exists on the node.createCartes
(CarteAttributes attributes) Create a set of cartes with the given attributes.createComment
(String postingId, CommentText comment) Create a comment from the given text and add it to the given posting.createCommentReaction
(String postingId, String commentId, ReactionDescription reaction) Add a reaction to the given comment.createCredentials
(Credentials credentials) Initialize credentials if they are not set yet.createDomain
(DomainAttributes domain) Create a new domain with the given hostname.createDraft
(DraftText draft) Create a new draft from the text given.createFriendGroup
(FriendGroupDescription friendGroup) Create a group of friends.createNodeName
(NameToRegister nameToRegister) Register a new name for the node.createPosting
(PostingText posting) Create a new posting from the text given and publish it in the given feeds (if any).createPostingReaction
(String postingId, ReactionDescription reaction) Add a reaction to the given posting.createRemoteComment
(String nodeName, String postingId, CommentSourceText comment) Add a comment to the posting on the remote node and register it in the registry at the local node.createRemoteCommentReaction
(String nodeName, String postingId, String commentId, ReactionAttributes reaction) Add a reaction to the comment on the remote node and register it in the registry at the local node.createRemotePosting
(String nodeName, PostingSourceText posting) Add a posting to the remote node and register it in the registry at the local node.createRemotePostingReaction
(String nodeName, String postingId, ReactionAttributes reaction) Add a reaction to the posting on the remote node and register it in the registry at the local node.createRemoteSheriffOrder
(String nodeName, SheriffOrderAttributes sheriffOrder) Sign and send the order to the remote node and store it in the registry at the local node.createSheriffComplaint
(SheriffComplaintText complaint) Send a complaint to the sheriff.createSheriffOrder
(SheriffOrderDetails sheriffOrder) Receive and execute the sheriff's order.createSubscriber
(SubscriberDescription subscriber) Subscribe to a particular group of notifications.createSubscription
(SubscriptionDescription subscription) Register a subscription to notifications from a particular node.createToken
(TokenAttributes token) Sign in and create a token.createUserListItem
(String name, UserListItemAttributes item) Add a node to the user list.deleteAllCommentReactions
(String postingId, String commentId) Delete all reactions to the given comment.deleteAllPostingReactions
(String postingId) Delete all reactions to the given posting.deleteAvatar
(String id) Delete an avatar.deleteComment
(String postingId, String commentId) Delete the comment.deleteCommentReaction
(String postingId, String commentId, String ownerName) Delete the reaction of the given owner to the given comment.Delete credentials.deleteDomain
(String name) Delete the domain with the given hostname.deleteDraft
(String id) Delete the draft.Delete the group of friends.Delete all the information related to the node name (including the signing key) from the node.deletePosting
(String id) Delete the posting.deletePostingReaction
(String postingId, String ownerName) Delete the reaction of the given owner to the given posting.deleteRemoteComment
(String nodeName, String postingId, String commentId) Delete a comment from the registry of all comments at the local node.deleteRemoteCommentReaction
(String nodeName, String postingId, String commentId) Delete a reaction from the registry of all reactions at the local node.deleteRemotePosting
(String nodeName, String postingId) Delete a posting from the registry of all remote postings at the local node.deleteRemotePostingReaction
(String nodeName, String postingId) Delete a reaction from the registry of all reactions at the local node.Delete the updating key mnemonic stored on the node.deleteStory
(String id) Delete the story.Delete the subscriber and return the updated information about the node that was subscribed.Delete the subscription and return the updated information about the node that was subscribed to.deleteToken
(String id) Delete the token.deleteUserListItem
(String name, String nodeName) Delete a node from the user listGet the list of all nodes having administrative permissions on this node.Get an individual avatar.Get the list of avatars in the ascending order of their ordinals.Get details about the given node that blocked this node.Get details about the given blocked instant.getBlockedUser
(String id) Get details about the given blocked user.Get checksums of the information about the blocked users.getClientSettings
(String prefix) Get all client settings, sorted by name.getComment
(String postingId, String commentId, boolean withSource) Get an individual comment.getCommentReaction
(String postingId, String commentId, String ownerName) Get the detailed information about the reaction of the given owner to the given comment.getCommentReactionsSlice
(String postingId, String commentId, Boolean negative, Integer emoji, Long before, Integer limit) Get a slice of the list of reactions to the given comment, optionally filtered by reaction type, delimited bybefore
moment and the givenlimit
.getCommentReactionTotals
(String postingId, String commentId) Get a summary of reactions to the comment given.getCommentRevision
(String postingId, String commentId, String id) Get an individual revision of the comment.getCommentRevisions
(String postingId, String commentId) Get all revisions of the comment.getCommentsSlice
(String postingId, Long after, Long before, Integer limit) Get a slice of the list of comments, delimited bybefore
orafter
moments (but not both) and the givenlimit
.getContacts
(String query, Integer limit) Search for contacts matching the searchquery
.Get an individual deleted posting.getDeletedPostingRevision
(String postingId, String id) Get an individual revision of the deleted posting.getDeletedPostings
(Integer page, Integer limit) Get the list of deleted postings, page by page.Get the current status of the request to delete the node.getDeletePostingRevisions
(String postingId, Integer limit) Get all revisions of the deleted posting, but not more thanlimit
.Get information about the domain with the given hostname.Get the list of registered domains.Get an individual draft.getDrafts
(DraftType draftType, String nodeName, String postingId, String commentId, Integer page, Integer limit) Get the list of drafts, page by page, filtered by the given criteria.Get information about features supported by the node.getFeedGeneral
(String feedName) Get general information about the feed.FeedInfo[]
getFeeds()
Get general information about all feeds accessible by client.getFeedSlice
(String feedName, Long after, Long before, Integer limit) Get a slice of the feed, delimited bybefore
orafter
moments (but not both) and the givenlimit
.getFeedStatus
(String feedName) Get information about the total number and number of non-read and non-viewed stories in the feed.Get the friendship information for the node given.getFriendGroup
(String id) Get the information about the group of friends.Get the list of all groups of friends that exist on the node.getFriendOf
(String name) Get the information for the node given, whether it has added this node to its friends.Get the list of all nodes that added this node to their friends.getFriends
(String groupId) Get the list of all friends of the node or friends belonging to a particular group.Get information about the administrative permissions granted to the node.Get the name of the node.getNodeSettings
(String prefix) Get all node settings, sorted by name.getNodeSettingsMetadata
(String prefix) Get all node settings metadata, sorted by name.Get general information about other nodes.Get information about the plugin.Get information about all plugins registered for the node and server.getPosting
(String id, boolean withSource) Get an individual posting.getPostingReaction
(String postingId, String ownerName) Get the detailed information about the reaction of the given owner to the given posting.getPostingReactionsSlice
(String postingId, Boolean negative, Integer emoji, Long before, Integer limit) Get a slice of the list of reactions to the given posting, optionally filtered by reaction type, delimited bybefore
moment and the givenlimit
.getPostingReactionTotals
(String postingId) Get a summary of reactions to the posting given.getPostingRevision
(String postingId, String id) Get an individual revision of the posting.getPostingRevisions
(String postingId, Integer limit) Get all revisions of the posting, but not more thanlimit
.getPostingsAttachedToComment
(String postingId, String commentId) Get all postings linked to media attached to the given comment.Get all postings linked to media attached to the given posting.void
getPrivateMedia
(String id, Integer width, Boolean download, NodeApiClient.ResponseConsumer responseConsumer) Get media file content (returned in the response body).Get media file details.Get the list of all postings and comments the media file is attached to.getProfile
(boolean withSource) Get the profile.void
getPublicMedia
(String id, Integer width, Boolean download, NodeApiClient.ResponseConsumer responseConsumer) Get media file content (returned in the response body).Get media file details.Get the status of the asynchronous operation that performs verification of a remote posting signature.Get the status of the asynchronous operation that performs verification of the signature of a reaction to a remote posting.getRemoteSheriffOrder
(String nodeName, String id) Get the details of the given sheriff's orderGet details of the given group of complaints.getSheriffComplaintGroupsSlice
(Long after, Long before, Integer limit, SheriffComplaintStatus status) Get a slice of the list of groups of complaints, optionally filtered by status, delimited by thebefore
orafter
moment and the givenlimit
.Get complaints included in the given group of complaints.Get the updating key mnemonic stored on the node.Get an individual story.getSubscriber
(String id) Get an individual subscriber.getSubscribers
(String nodeName, SubscriptionType type, String feedName, String entryId) Get the list of all subscribers, optionally filtered by some criteria.getSubscriptions
(String nodeName, SubscriptionType type) Get the list of all subscriptions, optionally filtered by some criteria.getTokenInfo
(String id) Get information about the token.Get the list of all existing tokens.getUserListGeneral
(String name) Get the general information about the user list given.getUserListItem
(String name, String nodeName) Get the information from the user list about the node given.getUserListSlice
(String name, Long after, Long before, Integer limit) Get a slice of the user list, delimited by thebefore
orafter
moment and the givenlimit
.grantOrRevoke
(String nodeName, GrantChange change) Grant a set of administrative permissions to the node or revoke them.isDomainAvailable
(String nodeName) Get an available domain name recommended for the given node name.proxyLinkPreview
(String url) Parse the page located at the URL and return the title, the description and the picture that may be used to build a preview of the page.void
proxyMedia
(String url, NodeApiClient.ResponseConsumer responseConsumer) Open the URL passed in the parameters and pass to the client the media file returned by the server.registerAtPushRelay
(PushRelayClientAttributes attributes) Register a client at the push relay server to receive messages from this node.registerPlugin
(PluginDescription plugin) Register the plugin.reorderAvatars
(AvatarsOrdered order) Reorder avatars.The node generates credentials reset token that is sent to the node admin by E-mail or using any other way that is defined for recovery of credentials.Restore a posting.restoreDeletedPostingRevision
(String postingId, String id) Restore a posting at a particular revision.restorePostingRevision
(String postingId, String id) Restore a revision of the posting.Revoke all administrative permissions granted to the node.Get the list of all reactions performed by the node, filtered by some criteria.Search nodes that blocked this node, by the given criteria.Search blocked instants by the given criteria.searchBlockedUsers
(BlockedUserFilter filter) Search blocked users by the given criteria.Search reactions by criteria provided.Search summaries of reactions by criteria provided.Search for subscriptions by the given criteria.sendDeleteNodeRequest
(DeleteNodeText deleteNodeText) Send a request to the provider to delete the node.sendNotification
(NotificationPacket packet) Accept a notification packet from another node.storeMnemonic
(KeyMnemonic mnemonic) Store the updating key mnemonic on the node.unblockInstant
(String id) Unblock the given instant.unblockUser
(String id) Unblock the given user.unregisterPlugin
(String pluginName) Unregister the plugin.updateAllComments
(String postingId, CommentMassAttributes attributes) Update operation overrides for all comments in the posting.updateComment
(String postingId, String commentId, CommentText comment) Update the comment, creating a new revision of it.updateCommentReaction
(String postingId, String commentId, String ownerName, ReactionOverride reaction) Update the reaction's operations or set operations' overrides.updateCredentials
(CredentialsChange credentials) Update credentials.updateDomain
(String name, DomainAttributes domain) Update the domain with the given hostname.updateDraft
(String id, DraftText draft) Update the draft.updateFeedStatus
(String feedName, FeedStatusChange change) Update information about non-read and non-viewed stories in the feed.updateFriendGroup
(String id, FriendGroupDescription friendGroup) Update the details of the group of friends.updateFriends
(FriendDescription[] friends) Update the friendship status of the nodes passed in the input.updateNodeName
(RegisteredNameSecret secret) Update the name of the node.updateNodeSettingsMetadata
(SettingMetaAttributes[] metadata) Update node settings metadata, overriding built-in defaults.updatePosting
(String id, PostingText posting) Update the posting, creating a new revision of it.updatePostingReaction
(String postingId, String ownerName, ReactionOverride reaction) Update the reaction's operations or set operations' overrides.updateProfile
(ProfileAttributes profile) Update the profile.updateRemoteComment
(String nodeName, String postingId, String commentId, CommentSourceText comment) Update a comment to the posting on the remote node.updateRemotePosting
(String nodeName, String postingId, PostingSourceText posting) Update a posting on the remote node.updateSettings
(SettingInfo[] settings) Update the given settings.updateSheriffComplaintGroup
(String id, SheriffComplaintDecisionText decision) Make a decision on the given group of complaints.updateStory
(String id, StoryAttributes story) Update the story.updateSubscriber
(String id, SubscriberOverride subscriber) Update the subscriber's operations or set operations' overrides.updateSubscription
(String id, SubscriptionOverride subscription) Update the subscription's operations or set operations' overrides.updateToken
(String id, TokenUpdate update) Update the name or permissions of the token.uploadAdminMedia
(Path body, String contentType) Upload a new media file owned by the node admin.uploadPrivateMedia
(String clientName, Path body, String contentType) Upload a new media file owned by the given node.uploadPublicMedia
(Path body, String contentType) Upload a new media file.verifyCarte
(ClientCarte clientCarte) Verify if the given carte may be used for authentication on this node.verifyRemoteComment
(String nodeName, String postingId, String commentId) Verify the signature of the given comment to the posting on the remote node.verifyRemoteCommentReaction
(String nodeName, String postingId, String commentId, String ownerName) Verify the signature of the reaction of the given owner to the comment on the remote node.verifyRemotePosting
(String nodeName, String id) Verify the signature of the given posting.verifyRemotePostingReaction
(String nodeName, String postingId, String ownerName) Verify the signature of the reaction of the given owner to the posting on the remote node.verifyRemotePostingRevision
(String nodeName, String id, String revisionId) Verify the signature of the given revision of a posting.whoAmI()
Get brief information about the node.Methods inherited from class org.moera.lib.node.NodeApiClient
auth, authAdmin, authMethod, authRootAdmin, call, call, call, call, carte, carteSource, commaSeparatedFlags, getRoot, moeraRoot, noAuth, nodeUrl, rootSecret, token, ue
-
Constructor Details
-
MoeraNode
public MoeraNode()Constructs a new MoeraNode object. -
MoeraNode
Constructs a new MoeraNode object with the specified node URL.- Parameters:
nodeUrl
- node URL
-
-
Method Details
-
searchActivityReactions
public ActivityReactionInfo[] searchActivityReactions(ActivityReactionFilter filter) throws MoeraNodeException Get the list of all reactions performed by the node, filtered by some criteria.- Parameters:
filter
- filter- Returns:
- ActivityReactionInfo[]
- Throws:
MoeraNodeException
-
getRemotePostingVerificationStatus
public RemotePostingVerificationInfo getRemotePostingVerificationStatus(String id) throws MoeraNodeException Get the status of the asynchronous operation that performs verification of a remote posting signature.- Parameters:
id
- asynchronous operation ID- Returns:
- RemotePostingVerificationInfo
- Throws:
MoeraNodeException
-
getRemoteReactionVerificationStatus
public RemoteReactionVerificationInfo getRemoteReactionVerificationStatus(String id) throws MoeraNodeException Get the status of the asynchronous operation that performs verification of the signature of a reaction to a remote posting.- Parameters:
id
- asynchronous operation ID- Returns:
- RemoteReactionVerificationInfo
- Throws:
MoeraNodeException
-
getAvatars
Get the list of avatars in the ascending order of their ordinals.- Returns:
- AvatarInfo[]
- Throws:
MoeraNodeException
-
createAvatar
Create a new avatar from a public media file that exists on the node. A new public media file is created for the avatar. If the avatar's ordinal is not provided in the input, the avatar is assigned an ordinal that is greater than ordinals of all existing avatars.- Parameters:
avatar
- avatar- Returns:
- AvatarInfo
- Throws:
MoeraNodeException
-
getAvatar
Get an individual avatar.- Parameters:
id
- avatar ID- Returns:
- AvatarInfo
- Throws:
MoeraNodeException
-
deleteAvatar
Delete an avatar.- Parameters:
id
- avatar ID- Returns:
- Result
- Throws:
MoeraNodeException
-
reorderAvatars
Reorder avatars. Every avatar mentioned in the input is assigned an ordinal in ascending order as they appear in the input. Ordinals of avatars not mentioned in the input are not touched.- Parameters:
order
- order- Returns:
- AvatarOrdinal[]
- Throws:
MoeraNodeException
-
blockInstant
Blocks creation of instants of the given story type, related to the given entry, optionally unblocking at the given time in the future.- Parameters:
instant
- instant- Returns:
- BlockedInstantInfo
- Throws:
MoeraNodeException
-
getBlockedInstant
Get details about the given blocked instant.- Parameters:
id
- ID of the blocked instant- Returns:
- BlockedInstantInfo
- Throws:
MoeraNodeException
-
unblockInstant
Unblock the given instant.- Parameters:
id
- ID of the blocked instant- Returns:
- Result
- Throws:
MoeraNodeException
-
searchBlockedInstants
public BlockedInstantInfo[] searchBlockedInstants(BlockedInstantFilter filter) throws MoeraNodeException Search blocked instants by the given criteria.- Parameters:
filter
- filter- Returns:
- BlockedInstantInfo[]
- Throws:
MoeraNodeException
-
blockUser
Blocks the given node from performing the given operations, in a particular posting or globally, optionally unblocking at the given time in the future.- Parameters:
user
- user- Returns:
- BlockedUserInfo
- Throws:
MoeraNodeException
-
getBlockedUser
Get details about the given blocked user.- Parameters:
id
- ID of the blocked user- Returns:
- BlockedUserInfo
- Throws:
MoeraNodeException
-
unblockUser
Unblock the given user.- Parameters:
id
- ID of the blocked user- Returns:
- Result
- Throws:
MoeraNodeException
-
searchBlockedUsers
Search blocked users by the given criteria.- Parameters:
filter
- filter- Returns:
- BlockedUserInfo[]
- Throws:
MoeraNodeException
-
getBlockedUsersChecksums
Get checksums of the information about the blocked users. This request may be used to quickly detect the changes in the blocked users list to update the cache on the client side.- Returns:
- BlockedUsersChecksums
- Throws:
MoeraNodeException
-
getBlockedByUser
Get details about the given node that blocked this node.- Parameters:
id
- ID of the blocked-by user- Returns:
- BlockedByUserInfo
- Throws:
MoeraNodeException
-
searchBlockedByUsers
public BlockedByUserInfo[] searchBlockedByUsers(BlockedByUserFilter filter) throws MoeraNodeException Search nodes that blocked this node, by the given criteria.- Parameters:
filter
- filter- Returns:
- BlockedByUserInfo[]
- Throws:
MoeraNodeException
-
createCartes
Create a set of cartes with the given attributes. Cartes in the sequence correspond to successive periods of time.- Parameters:
attributes
- attributes- Returns:
- CarteSet
- Throws:
MoeraNodeException
-
verifyCarte
Verify if the given carte may be used for authentication on this node. Additionally, ifclientName
is provided, it is compared to the carte owner's name.- Parameters:
clientCarte
- clientCarte- Returns:
- CarteVerificationInfo
- Throws:
MoeraNodeException
-
getCommentsSlice
public CommentsSliceInfo getCommentsSlice(String postingId, Long after, Long before, Integer limit) throws MoeraNodeException Get a slice of the list of comments, delimited bybefore
orafter
moments (but not both) and the givenlimit
. If neitherbefore
norafter
are provided, the latest comments are returned. The node may decide to return fewer comments than the givenlimit
. The stories are always sorted by moment, ascending.- Parameters:
postingId
- ID of the postingafter
- filter comments posted strongly after this momentbefore
- filter comments posted at or before this momentlimit
- maximum number of comments returned- Returns:
- CommentsSliceInfo
- Throws:
MoeraNodeException
-
createComment
public CommentCreated createComment(String postingId, CommentText comment) throws MoeraNodeException Create a comment from the given text and add it to the given posting. The comment owner must authenticate in some way. If the comment is not signed, it will be kept for a limited period of time and then erased. If authenticated as admin, the node signs the comment.- Parameters:
postingId
- ID of the postingcomment
- comment- Returns:
- CommentCreated
- Throws:
MoeraNodeException
-
getComment
public CommentInfo getComment(String postingId, String commentId, boolean withSource) throws MoeraNodeException Get an individual comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentwithSource
- include source text of the comment- Returns:
- CommentInfo
- Throws:
MoeraNodeException
-
updateAllComments
public Result updateAllComments(String postingId, CommentMassAttributes attributes) throws MoeraNodeException Update operation overrides for all comments in the posting.- Parameters:
postingId
- ID of the postingattributes
- attributes- Returns:
- Result
- Throws:
MoeraNodeException
-
updateComment
public CommentInfo updateComment(String postingId, String commentId, CommentText comment) throws MoeraNodeException Update the comment, creating a new revision of it. The text is processed just like in thePOST
request.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentcomment
- comment- Returns:
- CommentInfo
- Throws:
MoeraNodeException
-
deleteComment
Delete the comment. The comment may not be purged from the database immediately, but preserved for some period of time to give a chance to restore it.- Parameters:
postingId
- ID of the postingcommentId
- ID of the comment- Returns:
- CommentTotalInfo
- Throws:
MoeraNodeException
-
getPostingsAttachedToComment
public PostingInfo[] getPostingsAttachedToComment(String postingId, String commentId) throws MoeraNodeException Get all postings linked to media attached to the given comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the comment- Returns:
- PostingInfo[]
- Throws:
MoeraNodeException
-
getCommentRevisions
public CommentRevisionInfo[] getCommentRevisions(String postingId, String commentId) throws MoeraNodeException Get all revisions of the comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the comment- Returns:
- CommentRevisionInfo[]
- Throws:
MoeraNodeException
-
getCommentRevision
public CommentRevisionInfo getCommentRevision(String postingId, String commentId, String id) throws MoeraNodeException Get an individual revision of the comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentid
- ID of the revision- Returns:
- CommentRevisionInfo
- Throws:
MoeraNodeException
-
createCommentReaction
public ReactionCreated createCommentReaction(String postingId, String commentId, ReactionDescription reaction) throws MoeraNodeException Add a reaction to the given comment. The reaction owner must authenticate in some way. Only one reaction is allowed from each owner to a particular comment. If a reaction from the same owner to this comment already exists, it is overwritten. If the reaction is not signed, the reaction will be kept for a limited period of time and then erased (the previous reaction of the same owner will be restored, if any).- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentreaction
- reaction- Returns:
- ReactionCreated
- Throws:
MoeraNodeException
-
updateCommentReaction
public ReactionInfo updateCommentReaction(String postingId, String commentId, String ownerName, ReactionOverride reaction) throws MoeraNodeException Update the reaction's operations or set operations' overrides.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentownerName
- reaction owner node namereaction
- reaction- Returns:
- ReactionInfo
- Throws:
MoeraNodeException
-
getCommentReactionsSlice
public ReactionsSliceInfo getCommentReactionsSlice(String postingId, String commentId, Boolean negative, Integer emoji, Long before, Integer limit) throws MoeraNodeException Get a slice of the list of reactions to the given comment, optionally filtered by reaction type, delimited bybefore
moment and the givenlimit
. Ifbefore
is not provided, the latest reactions are returned. The node may decide to return fewer reactions than the givenlimit
. The reactions are always sorted by moment, descending.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentnegative
-true
, to filter negative reactions,false
, to filter positive onesemoji
- filter by reaction code, usually interpreted by clients as emoji code pointbefore
- filter reactions created at or before this momentlimit
- maximum number of reactions returned- Returns:
- ReactionsSliceInfo
- Throws:
MoeraNodeException
-
getCommentReaction
public ReactionInfo getCommentReaction(String postingId, String commentId, String ownerName) throws MoeraNodeException Get the detailed information about the reaction of the given owner to the given comment. If no reaction with such an owner exists, an empty structure with justcommentId
is returned.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentownerName
- reaction owner node name- Returns:
- ReactionInfo
- Throws:
MoeraNodeException
-
deleteAllCommentReactions
public Result deleteAllCommentReactions(String postingId, String commentId) throws MoeraNodeException Delete all reactions to the given comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the comment- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteCommentReaction
public ReactionTotalsInfo deleteCommentReaction(String postingId, String commentId, String ownerName) throws MoeraNodeException Delete the reaction of the given owner to the given comment.- Parameters:
postingId
- ID of the postingcommentId
- ID of the commentownerName
- reaction owner node name- Returns:
- ReactionTotalsInfo
- Throws:
MoeraNodeException
-
getCommentReactionTotals
public ReactionTotalsInfo getCommentReactionTotals(String postingId, String commentId) throws MoeraNodeException Get a summary of reactions to the comment given.- Parameters:
postingId
- ID of the postingcommentId
- ID of the comment- Returns:
- ReactionTotalsInfo
- Throws:
MoeraNodeException
-
getContacts
Search for contacts matching the searchquery
. Every space-delimited word in the query must match case-insensitively a beginning of the contact's node name or a beginning of any space-delimited word in the contact's full name. The order of words is not significant.
The node may decide to return fewer contacts than the givenlimit
.
The contacts are sorted by their closeness to the node, which is calculated from the number of reactions and comments and their age.- Parameters:
query
- the search querylimit
- maximum number of contacts returned- Returns:
- ContactInfo[]
- Throws:
MoeraNodeException
-
checkCredentials
Check whether the credentials are initialized already.- Returns:
- CredentialsCreated
- Throws:
MoeraNodeException
-
createCredentials
Initialize credentials if they are not set yet. Note that this operation can be executed without authentication, so this should be done as soon as possible after the node installation. Sign in is not allowed until the credentials are set.- Parameters:
credentials
- credentials- Returns:
- Result
- Throws:
MoeraNodeException
-
updateCredentials
Update credentials. Either old password or credentials reset token should be set in the input for the operation to succeed. Credentials reset token is not related to the authentication token and usually is sent to the user by E-mail.- Parameters:
credentials
- credentials- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteCredentials
Delete credentials.- Returns:
- Result
- Throws:
MoeraNodeException
-
resetCredentials
The node generates credentials reset token that is sent to the node admin by E-mail or using any other way that is defined for recovery of credentials. This token then may be used to change the credentials without knowing the password.- Returns:
- EmailHint
- Throws:
MoeraNodeException
-
getDeletedPostings
Get the list of deleted postings, page by page. The node may decide to use a smaller page size than the givenlimit
. The postings are always sorted by the deletion timestamp, descending.- Parameters:
page
- page number, 0 by defaultlimit
- page size (maximum number of postings returned), the default is defined by the node- Returns:
- PostingInfo[]
- Throws:
MoeraNodeException
-
getDeletedPosting
Get an individual deleted posting.- Parameters:
id
- ID of the posting- Returns:
- PostingInfo
- Throws:
MoeraNodeException
-
restoreDeletedPosting
Restore a posting. A new revision is created with the same content as in the latest revision.- Parameters:
id
- ID of the posting- Returns:
- PostingInfo
- Throws:
MoeraNodeException
-
getDeletePostingRevisions
public PostingRevisionInfo[] getDeletePostingRevisions(String postingId, Integer limit) throws MoeraNodeException Get all revisions of the deleted posting, but not more thanlimit
. The node may decide to return fewer revisions than the givenlimit
.- Parameters:
postingId
- ID of the postinglimit
- maximum number of revisions returned- Returns:
- PostingRevisionInfo[]
- Throws:
MoeraNodeException
-
getDeletedPostingRevision
public PostingRevisionInfo getDeletedPostingRevision(String postingId, String id) throws MoeraNodeException Get an individual revision of the deleted posting.- Parameters:
postingId
- ID of the postingid
- ID of the revision- Returns:
- PostingRevisionInfo
- Throws:
MoeraNodeException
-
restoreDeletedPostingRevision
public PostingRevisionInfo restoreDeletedPostingRevision(String postingId, String id) throws MoeraNodeException Restore a posting at a particular revision. A new revision is created with the same content as in the given revision.- Parameters:
postingId
- ID of the postingid
- ID of the revision- Returns:
- PostingRevisionInfo
- Throws:
MoeraNodeException
-
getDomains
Get the list of registered domains.- Returns:
- DomainInfo[]
- Throws:
MoeraNodeException
-
getDomain
Get information about the domain with the given hostname. If domain registration for this server is public, this request does not require authentication.- Parameters:
name
- domain name- Returns:
- DomainInfo
- Throws:
MoeraNodeException
-
createDomain
Create a new domain with the given hostname. IfnodeId
is not passed, it is generated automatically. If domain registration for this server is public, this request does not require authentication.- Parameters:
domain
- domain- Returns:
- DomainInfo
- Throws:
MoeraNodeException
-
updateDomain
Update the domain with the given hostname. If the new hostname is not passed, the old hostname is preserved. (Note that you cannot pass a new name for the default hostname, because it cannot be renamed and_default_
is not a valid hostname. Skip this field if you want to update the default hostname.) IfnodeId
is not passed, it is generated automatically.- Parameters:
name
- domain's hostnamedomain
- domain- Returns:
- DomainInfo
- Throws:
MoeraNodeException
-
deleteDomain
Delete the domain with the given hostname. This operation deletes the domain record only, the user's data related to the domain is preserved.- Parameters:
name
- domain name- Returns:
- Result
- Throws:
MoeraNodeException
-
isDomainAvailable
Get an available domain name recommended for the given node name. The domain name is usually chosen to be close to the node name in English transcription. If domain registration for this server is not public, this request is not accessible.- Parameters:
nodeName
- node name- Returns:
- DomainAvailable
- Throws:
MoeraNodeException
-
getDrafts
public DraftInfo[] getDrafts(DraftType draftType, String nodeName, String postingId, String commentId, Integer page, Integer limit) throws MoeraNodeException Get the list of drafts, page by page, filtered by the given criteria. The node may decide to use a smaller page size than the givenlimit
. The drafts are always sorted by the creation timestamp, descending.- Parameters:
draftType
- type of the draftsnodeName
- name of the node the drafts are related topostingId
- ID of the posting, mandatory for all types, exceptnew-posting
commentId
- ID of the comment, mandatory forcomment-update
typepage
- page number, 0 by defaultlimit
- page size (maximum number of postings returned), the default is defined by the node- Returns:
- DraftInfo[]
- Throws:
MoeraNodeException
-
createDraft
Create a new draft from the text given.- Parameters:
draft
- draft- Returns:
- DraftInfo
- Throws:
MoeraNodeException
-
getDraft
Get an individual draft.- Parameters:
id
- ID of the draft- Returns:
- DraftInfo
- Throws:
MoeraNodeException
-
updateDraft
Update the draft.- Parameters:
id
- ID of the draftdraft
- draft- Returns:
- DraftInfo
- Throws:
MoeraNodeException
-
deleteDraft
Delete the draft.- Parameters:
id
- ID of the draft- Returns:
- Result
- Throws:
MoeraNodeException
-
getFeatures
Get information about features supported by the node.- Returns:
- Features
- Throws:
MoeraNodeException
-
getFeeds
Get general information about all feeds accessible by client.- Returns:
- FeedInfo[]
- Throws:
MoeraNodeException
-
getFeedGeneral
Get general information about the feed.- Parameters:
feedName
- name of the feed- Returns:
- FeedInfo
- Throws:
MoeraNodeException
-
getFeedStatus
Get information about the total number and number of non-read and non-viewed stories in the feed.- Parameters:
feedName
- name of the feed- Returns:
- FeedStatus
- Throws:
MoeraNodeException
-
updateFeedStatus
public FeedStatus updateFeedStatus(String feedName, FeedStatusChange change) throws MoeraNodeException Update information about non-read and non-viewed stories in the feed.- Parameters:
feedName
- name of the feedchange
- change- Returns:
- FeedStatus
- Throws:
MoeraNodeException
-
getFeedSlice
public FeedSliceInfo getFeedSlice(String feedName, Long after, Long before, Integer limit) throws MoeraNodeException Get a slice of the feed, delimited bybefore
orafter
moments (but not both) and the givenlimit
. If neitherbefore
norafter
are provided, the latest stories are returned. The node may decide to return fewer stories than the givenlimit
. The stories are always sorted by moment, descending.- Parameters:
feedName
- name of the feedafter
- filter stories posted strongly after this momentbefore
- filter stories posted at or before this momentlimit
- maximum number of stories returned- Returns:
- FeedSliceInfo
- Throws:
MoeraNodeException
-
getFriendGroups
Get the list of all groups of friends that exist on the node.- Returns:
- FriendGroupInfo[]
- Throws:
MoeraNodeException
-
getFriendGroup
Get the information about the group of friends.- Parameters:
id
- ID of the group of friends- Returns:
- FriendGroupInfo
- Throws:
MoeraNodeException
-
createFriendGroup
public FriendGroupInfo createFriendGroup(FriendGroupDescription friendGroup) throws MoeraNodeException Create a group of friends.- Parameters:
friendGroup
- friendGroup- Returns:
- FriendGroupInfo
- Throws:
MoeraNodeException
-
updateFriendGroup
public FriendGroupInfo updateFriendGroup(String id, FriendGroupDescription friendGroup) throws MoeraNodeException Update the details of the group of friends.- Parameters:
id
- ID of the group of friendsfriendGroup
- friendGroup- Returns:
- FriendGroupInfo
- Throws:
MoeraNodeException
-
deleteFriendGroup
Delete the group of friends.- Parameters:
id
- ID of the group of friends- Returns:
- Result
- Throws:
MoeraNodeException
-
getFriends
Get the list of all friends of the node or friends belonging to a particular group.- Parameters:
groupId
- ID of a group of friends- Returns:
- FriendInfo[]
- Throws:
MoeraNodeException
-
getFriend
Get the friendship information for the node given.- Parameters:
name
- name of the node- Returns:
- FriendInfo
- Throws:
MoeraNodeException
-
updateFriends
Update the friendship status of the nodes passed in the input. If some node passed in the input is not a member of some of the groups of friends listed for it, the node is added to them. If it is a member of some groups of friends that are not listed for it, the node is removed from them.- Parameters:
friends
- friends- Returns:
- FriendInfo[]
- Throws:
MoeraNodeException
-
getFriendOfs
Get the list of all nodes that added this node to their friends.- Returns:
- FriendOfInfo[]
- Throws:
MoeraNodeException
-
getFriendOf
Get the information for the node given, whether it has added this node to its friends.- Parameters:
name
- name of the node- Returns:
- FriendOfInfo
- Throws:
MoeraNodeException
-
getAllGrants
Get the list of all nodes having administrative permissions on this node.- Returns:
- GrantInfo[]
- Throws:
MoeraNodeException
-
getGrant
Get information about the administrative permissions granted to the node.- Parameters:
nodeName
- name of the node- Returns:
- GrantInfo
- Throws:
MoeraNodeException
-
grantOrRevoke
Grant a set of administrative permissions to the node or revoke them.- Parameters:
nodeName
- name of the nodechange
- change- Returns:
- GrantInfo
- Throws:
MoeraNodeException
-
revokeAll
Revoke all administrative permissions granted to the node.- Parameters:
nodeName
- name of the node- Returns:
- Result
- Throws:
MoeraNodeException
-
uploadAdminMedia
public PrivateMediaFileInfo uploadAdminMedia(Path body, String contentType) throws MoeraNodeException Upload a new media file owned by the node admin. The content of the file is passed in the request body.- Parameters:
body
- bodycontentType
- content-type of ``body``- Returns:
- PrivateMediaFileInfo
- Throws:
MoeraNodeException
-
uploadPrivateMedia
public PrivateMediaFileInfo uploadPrivateMedia(String clientName, Path body, String contentType) throws MoeraNodeException Upload a new media file owned by the given node. The content of the file is passed in the request body.- Parameters:
clientName
- name of the node owning the media filebody
- bodycontentType
- content-type of ``body``- Returns:
- PrivateMediaFileInfo
- Throws:
MoeraNodeException
-
getPrivateMedia
public void getPrivateMedia(String id, Integer width, Boolean download, NodeApiClient.ResponseConsumer responseConsumer) throws MoeraNodeException Get media file content (returned in the response body).- Parameters:
id
- media file IDwidth
- preferred width of the media in pixels; if present, the node will try to return the smallest in size, but the best in quality variant of the media, according to the width provideddownload
- iftrue
, the node will addContent-Disposition: attachment
header to the outputresponseConsumer
- consumer of the data received- Throws:
MoeraNodeException
-
getPrivateMediaInfo
Get media file details.- Parameters:
id
- media file ID- Returns:
- PrivateMediaFileInfo
- Throws:
MoeraNodeException
-
getPrivateMediaParentEntry
Get the list of all postings and comments the media file is attached to.- Parameters:
id
- media file ID- Returns:
- EntryInfo[]
- Throws:
MoeraNodeException
-
uploadPublicMedia
public PublicMediaFileInfo uploadPublicMedia(Path body, String contentType) throws MoeraNodeException Upload a new media file. The content of the file is passed in the request body- Parameters:
body
- bodycontentType
- content-type of ``body``- Returns:
- PublicMediaFileInfo
- Throws:
MoeraNodeException
-
getPublicMedia
public void getPublicMedia(String id, Integer width, Boolean download, NodeApiClient.ResponseConsumer responseConsumer) throws MoeraNodeException Get media file content (returned in the response body).- Parameters:
id
- media file IDwidth
- preferred width of the media in pixels; if present, the node will try to return the smallest in size, but the best in quality variant of the media, according to the width provideddownload
- iftrue
, the node will addContent-Disposition: attachment
header to the outputresponseConsumer
- consumer of the data received- Throws:
MoeraNodeException
-
getPublicMediaInfo
Get media file details.- Parameters:
id
- media file ID- Returns:
- PublicMediaFileInfo
- Throws:
MoeraNodeException
-
getNodeName
Get the name of the node. Admin user receives the current status of the latest operation with the node name.- Returns:
- NodeNameInfo
- Throws:
MoeraNodeException
-
createNodeName
Register a new name for the node. The corresponding signing key is generated automatically and stored at the node. The updating key is generated and returned in the encoded form and in the form of mnemonic (a sequence of English words). The words need to be written down and stored securely to be able to perform further operations with the name.- Parameters:
nameToRegister
- nameToRegister- Returns:
- RegisteredNameSecret
- Throws:
MoeraNodeException
-
updateNodeName
Update the name of the node. May be used to assign an already-registered name to the node (the corresponding signing key is generated automatically and stored at the node), or to prolong the name. The secret or mnemonic of the updating key must be provided for this operation.- Parameters:
secret
- secret- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteNodeName
Delete all the information related to the node name (including the signing key) from the node. The name record on the naming server is not touched.- Returns:
- Result
- Throws:
MoeraNodeException
-
getStoredMnemonic
Get the updating key mnemonic stored on the node.- Returns:
- KeyMnemonic
- Throws:
MoeraNodeException
-
storeMnemonic
Store the updating key mnemonic on the node.- Parameters:
mnemonic
- mnemonic- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteStoredMnemonic
Delete the updating key mnemonic stored on the node.- Returns:
- Result
- Throws:
MoeraNodeException
-
sendNotification
Accept a notification packet from another node. Notification packets older than 10 minutes are ignored. The sending node should update the packet timestamp and the signature and send the packet again. This mechanism prevents attackers from recording and resending old signed packets.- Parameters:
packet
- packet- Returns:
- Result
- Throws:
MoeraNodeException
-
getPeopleGeneral
Get general information about other nodes.- Returns:
- PeopleGeneralInfo
- Throws:
MoeraNodeException
-
registerPlugin
Register the plugin. If the plugin authenticates as root admin, the plugin is registered at the server level. If the plugin authenticates as node admin, the plugin is registered at the node level.- Parameters:
plugin
- plugin- Returns:
- PluginInfo
- Throws:
MoeraNodeException
-
getPlugins
Get information about all plugins registered for the node and server.- Returns:
- PluginInfo[]
- Throws:
MoeraNodeException
-
getPlugin
Get information about the plugin.- Parameters:
pluginName
- name of the plugin- Returns:
- PluginInfo
- Throws:
MoeraNodeException
-
unregisterPlugin
Unregister the plugin.- Parameters:
pluginName
- name of the plugin- Returns:
- Result
- Throws:
MoeraNodeException
-
createPosting
Create a new posting from the text given and publish it in the given feeds (if any). The heading and the preview of the posting are created automatically, if needed. The posting owner must authenticate in some way. If the posting is not signed, it will be kept for a limited period of time and then erased. If authenticated as admin, the node signs the posting.- Parameters:
posting
- posting- Returns:
- PostingInfo
- Throws:
MoeraNodeException
-
updatePosting
Update the posting, creating a new revision of it. The text is processed just like in thePOST
request.- Parameters:
id
- ID of the postingposting
- posting- Returns:
- PostingInfo
- Throws:
MoeraNodeException
-
getPosting
Get an individual posting.- Parameters:
id
- ID of the postingwithSource
- include source text of the posting- Returns:
- PostingInfo
- Throws:
MoeraNodeException
-
deletePosting
Delete the posting. The posting may not be purged from the database immediately, but preserved for some period of time to give a chance to restore it.- Parameters:
id
- ID of the posting- Returns:
- Result
- Throws:
MoeraNodeException
-
getPostingsAttachedToPosting
Get all postings linked to media attached to the given posting.- Parameters:
id
- ID of the posting- Returns:
- PostingInfo[]
- Throws:
MoeraNodeException
-
getPostingRevisions
public PostingRevisionInfo[] getPostingRevisions(String postingId, Integer limit) throws MoeraNodeException Get all revisions of the posting, but not more thanlimit
. The node may decide to return fewer revisions than the givenlimit
.- Parameters:
postingId
- ID of the postinglimit
- maximum number of revisions returned- Returns:
- PostingRevisionInfo[]
- Throws:
MoeraNodeException
-
getPostingRevision
public PostingRevisionInfo getPostingRevision(String postingId, String id) throws MoeraNodeException Get an individual revision of the posting.- Parameters:
postingId
- ID of the postingid
- ID of the revision- Returns:
- PostingRevisionInfo
- Throws:
MoeraNodeException
-
restorePostingRevision
public PostingRevisionInfo restorePostingRevision(String postingId, String id) throws MoeraNodeException Restore a revision of the posting. A new revision is created with the same content as in the given revision.- Parameters:
postingId
- ID of the postingid
- ID of the revision- Returns:
- PostingRevisionInfo
- Throws:
MoeraNodeException
-
createPostingReaction
public ReactionCreated createPostingReaction(String postingId, ReactionDescription reaction) throws MoeraNodeException Add a reaction to the given posting. The reaction owner must authenticate in some way. Only one reaction is allowed from each owner to a particular posting. If a reaction from the same owner to this posting already exists, it is overwritten. If the reaction is not signed, the reaction will be kept for a limited period of time and then erased (the previous reaction of the same owner will be restored, if any).- Parameters:
postingId
- ID of the postingreaction
- reaction- Returns:
- ReactionCreated
- Throws:
MoeraNodeException
-
getPostingReactionsSlice
public ReactionsSliceInfo getPostingReactionsSlice(String postingId, Boolean negative, Integer emoji, Long before, Integer limit) throws MoeraNodeException Get a slice of the list of reactions to the given posting, optionally filtered by reaction type, delimited bybefore
moment and the givenlimit
. Ifbefore
is not provided, the latest reactions are returned. The node may decide to return fewer reactions than the givenlimit
. The reactions are always sorted by moment, descending.- Parameters:
postingId
- ID of the postingnegative
-true
, to filter negative reactions,false
, to filter positive onesemoji
- filter by reaction code, usually interpreted by clients as emoji code pointbefore
- filter reactions created at or before this momentlimit
- maximum number of reactions returned- Returns:
- ReactionsSliceInfo
- Throws:
MoeraNodeException
-
updatePostingReaction
public ReactionInfo updatePostingReaction(String postingId, String ownerName, ReactionOverride reaction) throws MoeraNodeException Update the reaction's operations or set operations' overrides.- Parameters:
postingId
- ID of the postingownerName
- reaction owner node namereaction
- reaction- Returns:
- ReactionInfo
- Throws:
MoeraNodeException
-
getPostingReaction
public ReactionInfo getPostingReaction(String postingId, String ownerName) throws MoeraNodeException Get the detailed information about the reaction of the given owner to the given posting. If no reaction with such an owner exists, an empty structure with justpostingId
is returned.- Parameters:
postingId
- ID of the postingownerName
- reaction owner node name- Returns:
- ReactionInfo
- Throws:
MoeraNodeException
-
deleteAllPostingReactions
Delete all reactions to the given posting.- Parameters:
postingId
- ID of the posting- Returns:
- Result
- Throws:
MoeraNodeException
-
deletePostingReaction
public ReactionTotalsInfo deletePostingReaction(String postingId, String ownerName) throws MoeraNodeException Delete the reaction of the given owner to the given posting.- Parameters:
postingId
- ID of the postingownerName
- reaction owner node name- Returns:
- ReactionTotalsInfo
- Throws:
MoeraNodeException
-
searchPostingReactions
Search reactions by criteria provided. Both reaction owner and at least one posting ID should be provided to search, otherwise an empty list is returned.- Parameters:
filter
- filter- Returns:
- ReactionInfo[]
- Throws:
MoeraNodeException
-
getPostingReactionTotals
Get a summary of reactions to the posting given.- Parameters:
postingId
- ID of the posting- Returns:
- ReactionTotalsInfo
- Throws:
MoeraNodeException
-
searchPostingReactionTotals
public ReactionTotalsInfo[] searchPostingReactionTotals(ReactionTotalsFilter filter) throws MoeraNodeException Search summaries of reactions by criteria provided. At least one posting ID should be provided to search, otherwise an empty list is returned.- Parameters:
filter
- filter- Returns:
- ReactionTotalsInfo[]
- Throws:
MoeraNodeException
-
getProfile
Get the profile.- Parameters:
withSource
- include source text of the bio- Returns:
- ProfileInfo
- Throws:
MoeraNodeException
-
updateProfile
Update the profile. Fields that are not set in the request body are left intact. Fields that are set to an empty value are reset to their defaults.- Parameters:
profile
- profile- Returns:
- ProfileInfo
- Throws:
MoeraNodeException
-
getDeleteNodeRequestStatus
Get the current status of the request to delete the node.- Returns:
- DeleteNodeStatus
- Throws:
MoeraNodeException
-
sendDeleteNodeRequest
public DeleteNodeStatus sendDeleteNodeRequest(DeleteNodeText deleteNodeText) throws MoeraNodeException Send a request to the provider to delete the node.- Parameters:
deleteNodeText
- deleteNodeText- Returns:
- DeleteNodeStatus
- Throws:
MoeraNodeException
-
cancelDeleteNodeRequest
Cancel the request to delete the node.- Returns:
- DeleteNodeStatus
- Throws:
MoeraNodeException
-
proxyMedia
public void proxyMedia(String url, NodeApiClient.ResponseConsumer responseConsumer) throws MoeraNodeException Open the URL passed in the parameters and pass to the client the media file returned by the server.- Parameters:
url
- urlresponseConsumer
- consumer of the data received- Throws:
MoeraNodeException
-
proxyLinkPreview
Parse the page located at the URL and return the title, the description and the picture that may be used to build a preview of the page.- Parameters:
url
- url- Returns:
- LinkPreviewInfo
- Throws:
MoeraNodeException
-
registerAtPushRelay
Register a client at the push relay server to receive messages from this node. The operation is synchronous.- Parameters:
attributes
- attributes- Returns:
- Result
- Throws:
MoeraNodeException
-
askRemoteNode
Send a request to the remote node.- Parameters:
nodeName
- name of the remote nodedetails
- details- Returns:
- Result
- Throws:
MoeraNodeException
-
createRemoteComment
public Result createRemoteComment(String nodeName, String postingId, CommentSourceText comment) throws MoeraNodeException Add a comment to the posting on the remote node and register it in the registry at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecomment
- comment- Returns:
- Result
- Throws:
MoeraNodeException
-
updateRemoteComment
public Result updateRemoteComment(String nodeName, String postingId, String commentId, CommentSourceText comment) throws MoeraNodeException Update a comment to the posting on the remote node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote nodecomment
- comment- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteRemoteComment
public Result deleteRemoteComment(String nodeName, String postingId, String commentId) throws MoeraNodeException Delete a comment from the registry of all comments at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote node- Returns:
- Result
- Throws:
MoeraNodeException
-
verifyRemoteComment
public AsyncOperationCreated verifyRemoteComment(String nodeName, String postingId, String commentId) throws MoeraNodeException Verify the signature of the given comment to the posting on the remote node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote node- Returns:
- AsyncOperationCreated
- Throws:
MoeraNodeException
-
createRemoteCommentReaction
public Result createRemoteCommentReaction(String nodeName, String postingId, String commentId, ReactionAttributes reaction) throws MoeraNodeException Add a reaction to the comment on the remote node and register it in the registry at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote nodereaction
- reaction- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteRemoteCommentReaction
public Result deleteRemoteCommentReaction(String nodeName, String postingId, String commentId) throws MoeraNodeException Delete a reaction from the registry of all reactions at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote node- Returns:
- Result
- Throws:
MoeraNodeException
-
verifyRemoteCommentReaction
public AsyncOperationCreated verifyRemoteCommentReaction(String nodeName, String postingId, String commentId, String ownerName) throws MoeraNodeException Verify the signature of the reaction of the given owner to the comment on the remote node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodecommentId
- ID of the comment on the remote nodeownerName
- reaction owner node name- Returns:
- AsyncOperationCreated
- Throws:
MoeraNodeException
-
createRemotePosting
public Result createRemotePosting(String nodeName, PostingSourceText posting) throws MoeraNodeException Add a posting to the remote node and register it in the registry at the local node.- Parameters:
nodeName
- name of the remote nodeposting
- posting- Returns:
- Result
- Throws:
MoeraNodeException
-
updateRemotePosting
public Result updateRemotePosting(String nodeName, String postingId, PostingSourceText posting) throws MoeraNodeException Update a posting on the remote node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodeposting
- posting- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteRemotePosting
Delete a posting from the registry of all remote postings at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote node- Returns:
- Result
- Throws:
MoeraNodeException
-
verifyRemotePosting
public AsyncOperationCreated verifyRemotePosting(String nodeName, String id) throws MoeraNodeException Verify the signature of the given posting.- Parameters:
nodeName
- name of the remote nodeid
- ID of the posting on the remote node- Returns:
- AsyncOperationCreated
- Throws:
MoeraNodeException
-
verifyRemotePostingRevision
public AsyncOperationCreated verifyRemotePostingRevision(String nodeName, String id, String revisionId) throws MoeraNodeException Verify the signature of the given revision of a posting.- Parameters:
nodeName
- name of the remote nodeid
- ID of the posting on the remote noderevisionId
- ID of the posting revision- Returns:
- AsyncOperationCreated
- Throws:
MoeraNodeException
-
createRemotePostingReaction
public Result createRemotePostingReaction(String nodeName, String postingId, ReactionAttributes reaction) throws MoeraNodeException Add a reaction to the posting on the remote node and register it in the registry at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodereaction
- reaction- Returns:
- Result
- Throws:
MoeraNodeException
-
deleteRemotePostingReaction
public Result deleteRemotePostingReaction(String nodeName, String postingId) throws MoeraNodeException Delete a reaction from the registry of all reactions at the local node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote node- Returns:
- Result
- Throws:
MoeraNodeException
-
verifyRemotePostingReaction
public AsyncOperationCreated verifyRemotePostingReaction(String nodeName, String postingId, String ownerName) throws MoeraNodeException Verify the signature of the reaction of the given owner to the posting on the remote node.- Parameters:
nodeName
- name of the remote nodepostingId
- ID of the posting on the remote nodeownerName
- reaction owner node name- Returns:
- AsyncOperationCreated
- Throws:
MoeraNodeException
-
createRemoteSheriffOrder
public Result createRemoteSheriffOrder(String nodeName, SheriffOrderAttributes sheriffOrder) throws MoeraNodeException Sign and send the order to the remote node and store it in the registry at the local node.- Parameters:
nodeName
- name of the remote nodesheriffOrder
- sheriffOrder- Returns:
- Result
- Throws:
MoeraNodeException
-
getRemoteSheriffOrder
Get the details of the given sheriff's order- Parameters:
nodeName
- name of the remote nodeid
- ID of the order- Returns:
- SheriffOrderInfo
- Throws:
MoeraNodeException
-
updateSettings
Update the given settings. If the input contains node settings, they are validated and the first validation error is returned, if any. The update is always performed as a whole - if there is an error saving any one of the settings in the input, none of them are updated.
If one of the settings to be updated is privileged, root secret authentication is required. If one of the settings to be updated is non-privileged, admin authentication is required.- Parameters:
settings
- settings- Returns:
- Result
- Throws:
MoeraNodeException
-
getClientSettings
Get all client settings, sorted by name.- Parameters:
prefix
- filter settings whose names start with the given prefix, case-sensitive (client.
prefix must be included)- Returns:
- SettingInfo[]
- Throws:
MoeraNodeException
-
getNodeSettings
Get all node settings, sorted by name. If a setting has not changed its value from the default, it is omitted.- Parameters:
prefix
- filter settings whose names start with the given prefix, case-sensitive- Returns:
- SettingInfo[]
- Throws:
MoeraNodeException
-
getNodeSettingsMetadata
Get all node settings metadata, sorted by name.- Parameters:
prefix
- filter settings whose names start with the given prefix, case-sensitive- Returns:
- SettingMetaInfo[]
- Throws:
MoeraNodeException
-
updateNodeSettingsMetadata
public Result updateNodeSettingsMetadata(SettingMetaAttributes[] metadata) throws MoeraNodeException Update node settings metadata, overriding built-in defaults.- Parameters:
metadata
- metadata- Returns:
- Result
- Throws:
MoeraNodeException
-
getSheriffComplaintGroupsSlice
public SheriffComplaintGroupsSliceInfo getSheriffComplaintGroupsSlice(Long after, Long before, Integer limit, SheriffComplaintStatus status) throws MoeraNodeException Get a slice of the list of groups of complaints, optionally filtered by status, delimited by thebefore
orafter
moment and the givenlimit
. If neitherbefore
norafter
are provided, the latest groups are returned. The node may decide to return fewer groups than the givenlimit
. The groups are always sorted by moment, descending.- Parameters:
after
- filter groups created strongly after this momentbefore
- filter groups created at or before this momentlimit
- maximum number of groups returnedstatus
- filter groups by status- Returns:
- SheriffComplaintGroupsSliceInfo
- Throws:
MoeraNodeException
-
getSheriffComplaintGroup
Get details of the given group of complaints.- Parameters:
id
- ID of the group of complaints- Returns:
- SheriffComplaintGroupInfo
- Throws:
MoeraNodeException
-
getSheriffComplaintsByGroup
Get complaints included in the given group of complaints.- Parameters:
id
- ID of the group of complaints- Returns:
- SheriffComplaintInfo[]
- Throws:
MoeraNodeException
-
updateSheriffComplaintGroup
public SheriffComplaintGroupInfo updateSheriffComplaintGroup(String id, SheriffComplaintDecisionText decision) throws MoeraNodeException Make a decision on the given group of complaints.- Parameters:
id
- ID of the group of complaintsdecision
- decision- Returns:
- SheriffComplaintGroupInfo
- Throws:
MoeraNodeException
-
createSheriffComplaint
public SheriffComplaintInfo createSheriffComplaint(SheriffComplaintText complaint) throws MoeraNodeException Send a complaint to the sheriff.- Parameters:
complaint
- complaint- Returns:
- SheriffComplaintInfo
- Throws:
MoeraNodeException
-
createSheriffOrder
Receive and execute the sheriff's order.- Parameters:
sheriffOrder
- sheriffOrder- Returns:
- Result
- Throws:
MoeraNodeException
-
getStory
Get an individual story.- Parameters:
id
- ID of the story- Returns:
- StoryInfo
- Throws:
MoeraNodeException
-
updateStory
Update the story.- Parameters:
id
- ID of the storystory
- story- Returns:
- StoryInfo
- Throws:
MoeraNodeException
-
deleteStory
Delete the story.- Parameters:
id
- ID of the story- Returns:
- Result
- Throws:
MoeraNodeException
-
getSubscribers
public SubscriberInfo[] getSubscribers(String nodeName, SubscriptionType type, String feedName, String entryId) throws MoeraNodeException Get the list of all subscribers, optionally filtered by some criteria.- Parameters:
nodeName
- filter by subscribed node nametype
- filter by subscription typefeedName
- filter by name of the feed subscribed toentryId
- filter by ID of the entry subscribed to- Returns:
- SubscriberInfo[]
- Throws:
MoeraNodeException
-
createSubscriber
Subscribe to a particular group of notifications.- Parameters:
subscriber
- subscriber- Returns:
- SubscriberInfo
- Throws:
MoeraNodeException
-
getSubscriber
Get an individual subscriber.- Parameters:
id
- ID of the subscriber- Returns:
- SubscriberInfo
- Throws:
MoeraNodeException
-
updateSubscriber
public SubscriberInfo updateSubscriber(String id, SubscriberOverride subscriber) throws MoeraNodeException Update the subscriber's operations or set operations' overrides.- Parameters:
id
- ID of the subscribersubscriber
- subscriber- Returns:
- SubscriberInfo
- Throws:
MoeraNodeException
-
deleteSubscriber
Delete the subscriber and return the updated information about the node that was subscribed.- Parameters:
id
- ID of the subscriber- Returns:
- ContactInfo
- Throws:
MoeraNodeException
-
getSubscriptions
public SubscriptionInfo[] getSubscriptions(String nodeName, SubscriptionType type) throws MoeraNodeException Get the list of all subscriptions, optionally filtered by some criteria.- Parameters:
nodeName
- filter by node nametype
- filter by subscription type- Returns:
- SubscriptionInfo[]
- Throws:
MoeraNodeException
-
createSubscription
public SubscriptionInfo createSubscription(SubscriptionDescription subscription) throws MoeraNodeException Register a subscription to notifications from a particular node.- Parameters:
subscription
- subscription- Returns:
- SubscriptionInfo
- Throws:
MoeraNodeException
-
updateSubscription
public SubscriptionInfo updateSubscription(String id, SubscriptionOverride subscription) throws MoeraNodeException Update the subscription's operations or set operations' overrides.- Parameters:
id
- ID of the subscriptionsubscription
- subscription- Returns:
- SubscriptionInfo
- Throws:
MoeraNodeException
-
deleteSubscription
Delete the subscription and return the updated information about the node that was subscribed to.- Parameters:
id
- ID of the subscription- Returns:
- ContactInfo
- Throws:
MoeraNodeException
-
searchSubscriptions
Search for subscriptions by the given criteria.- Parameters:
filter
- filter- Returns:
- SubscriptionInfo[]
- Throws:
MoeraNodeException
-
getTokens
Get the list of all existing tokens.- Returns:
- TokenInfo[]
- Throws:
MoeraNodeException
-
createToken
Sign in and create a token.- Parameters:
token
- token- Returns:
- TokenInfo
- Throws:
MoeraNodeException
-
getTokenInfo
Get information about the token.- Parameters:
id
- ID of the token- Returns:
- TokenInfo
- Throws:
MoeraNodeException
-
updateToken
Update the name or permissions of the token. It is not possible to grant token additional permissions with this request, but the granted permissions can be revoked.- Parameters:
id
- ID of the tokenupdate
- update- Returns:
- TokenInfo
- Throws:
MoeraNodeException
-
deleteToken
Delete the token.- Parameters:
id
- ID of the token- Returns:
- Result
- Throws:
MoeraNodeException
-
getUserListGeneral
Get the general information about the user list given.- Parameters:
name
- the name of the list- Returns:
- UserListInfo
- Throws:
MoeraNodeException
-
getUserListSlice
public UserListSliceInfo getUserListSlice(String name, Long after, Long before, Integer limit) throws MoeraNodeException Get a slice of the user list, delimited by thebefore
orafter
moment and the givenlimit
. If neitherbefore
norafter
are provided, the latest items are returned. The node may decide to return fewer items than the givenlimit
. The items are always sorted by moment, descending.- Parameters:
name
- the name of the listafter
- filter items created strongly after this momentbefore
- filter items created at or before this momentlimit
- maximum number of items returned- Returns:
- UserListSliceInfo
- Throws:
MoeraNodeException
-
getUserListItem
Get the information from the user list about the node given.- Parameters:
name
- the name of the listnodeName
- the node name to get information about- Returns:
- UserListItemInfo
- Throws:
MoeraNodeException
-
createUserListItem
public UserListItemInfo createUserListItem(String name, UserListItemAttributes item) throws MoeraNodeException Add a node to the user list.- Parameters:
name
- the name of the listitem
- item- Returns:
- UserListItemInfo
- Throws:
MoeraNodeException
-
deleteUserListItem
Delete a node from the user list- Parameters:
name
- the name of the listnodeName
- the node name to delete- Returns:
- Result
- Throws:
MoeraNodeException
-
whoAmI
Get brief information about the node.- Returns:
- WhoAmI
- Throws:
MoeraNodeException
-