Package org.saidone.restless.client
Class NodeServiceClient
java.lang.Object
org.saidone.restless.client.NodeServiceClient
Client of the platform's node service for properties, types, aspects and node snapshots. File/folder
operations, content, search, versions and model lookups have dedicated clients.
Each call sends the shared provider's Alfresco ticket and a per-call deadline. Unary calls retry once after UNAUTHENTICATED if the provider supplies a different ticket. The caller owns the channel and should share one TicketProvider across service clients.
Writes take one typed property map, built with Properties. Omitted properties remain unchanged;
scalar/list cardinality and value kinds must match the repository dictionary.
-
Constructor Summary
ConstructorsConstructorDescriptionNodeServiceClient(io.grpc.Channel channel, TicketProvider tickets, Duration deadline) Creates this service client with shared authentication and a per-call deadline.NodeServiceClient(org.saidone.restless.api.NodeServiceGrpc.NodeServiceBlockingStub stub, TicketProvider tickets, Duration deadline) Creates this service client with shared authentication and a per-call deadline. -
Method Summary
Modifier and TypeMethodDescriptionorg.saidone.restless.api.NodeAdds an aspect and merges typed properties atomically.org.saidone.restless.api.NodeaddProperties(String nodeRef, Map<String, org.saidone.restless.api.Property> properties) Merges typed scalar or multi-valued properties.org.saidone.restless.api.NodecancelCheckoutNode(org.saidone.restless.api.NodeActionRequest request) Cancels checkout without replaying the mutation on authentication failure.org.saidone.restless.api.NodecheckoutNode(org.saidone.restless.api.NodeActionRequest request) Checks out a document without replaying the mutation on authentication failure.voiddeleteNode(String nodeRef) Deletes a node through the repository, preserving the server's protected-folder checks.voiddeleteNodeOnce(String nodeRef) Deletes a node without retrying the request after a failure.voiddeleteNodeOnce(String nodeRef, boolean permanent) Sends one deletion request.getAspects(String nodeRef) Returns the node's applied aspects as expanded qualified names.org.saidone.restless.api.NodeReads a complete node snapshot, including a readable primary parent.org.saidone.restless.api.NodeReads explicitly selected node fields; an empty mask returns identity only.org.saidone.restless.api.NodeResolves a relative path under the supplied node before mapping the result.getProperties(String nodeRef) Reads the typed property map using qualified property names as keys.Returns the node's expanded qualified type name.org.saidone.restless.api.NodelockNode(org.saidone.restless.api.LockNodeRequest request) Acquires a repository lock without replaying the mutation on authentication failure.org.saidone.restless.api.NoderemoveAspect(String nodeRef, String aspect) Removes a known aspect if present.org.saidone.restless.api.NodeChanges the type while preserving the document/folder category.org.saidone.restless.api.NodeunlockNode(org.saidone.restless.api.NodeActionRequest request) Releases a repository lock without replaying the mutation on authentication failure.org.saidone.restless.api.NodeupdateNode(String nodeRef, String name, String type, Map<String, org.saidone.restless.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.restless.api.NodeupdateNode(String nodeRef, String name, String type, Map<String, org.saidone.restless.api.Property> properties, List<String> addAspects, List<String> removeAspects) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.restless.api.NodeupdateNode(String nodeRef, String name, Map<String, org.saidone.restless.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.restless.api.NodeupdateNodePermissions(org.saidone.restless.api.UpdateNodeRequest request) Submits the combined ACL and node mutation once.org.saidone.restless.api.NodeupdateNodeProjected(org.saidone.restless.api.UpdateNodeRequest request) Applies a mutation and returns the selected fields from its transaction.
-
Constructor Details
-
NodeServiceClient
Creates this service client with shared authentication and a per-call deadline.The caller retains ownership of the channel; closing an application should close its shared channel once.
- Parameters:
channel- shared gRPC channel; ownership remains with the callertickets- shared ticket provider, normally one AuthenticationServiceClientdeadline- per-call deadline applied to every RPC attempt
-
NodeServiceClient
public NodeServiceClient(org.saidone.restless.api.NodeServiceGrpc.NodeServiceBlockingStub stub, TicketProvider tickets, Duration deadline) Creates this service client with shared authentication and a per-call deadline.The caller retains ownership of the channel; closing an application should close its shared channel once.
- Parameters:
stub- preconfigured stub for this repository servicetickets- shared ticket provider, normally one AuthenticationServiceClientdeadline- per-call deadline applied to every RPC attempt
-
-
Method Details
-
getProperties
Reads the typed property map using qualified property names as keys.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository alias- Returns:
- the read-only typed property map, keyed by expanded qualified names
-
addProperties
public org.saidone.restless.api.Node addProperties(String nodeRef, Map<String, org.saidone.restless.api.Property> properties) Merges typed scalar or multi-valued properties.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasproperties- typed properties keyed by qualified name- Returns:
- the resulting node snapshot
-
getType
Returns the node's expanded qualified type name.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository alias- Returns:
- the expanded qualified type name
-
setType
Changes the type while preserving the document/folder category.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliastype- qualified type name; empty preserves the type on update and defaults to cm:content on create- Returns:
- the resulting node snapshot
-
getAspects
Returns the node's applied aspects as expanded qualified names.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository alias- Returns:
- the set of applied aspect names
-
addAspect
public org.saidone.restless.api.Node addAspect(String nodeRef, String aspect, Map<String, org.saidone.restless.api.Property> properties) Adds an aspect and merges typed properties atomically.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasaspect- qualified name of the aspect to add or removeproperties- typed properties keyed by qualified name- Returns:
- the resulting node snapshot
-
removeAspect
Removes a known aspect if present.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasaspect- qualified name of the aspect to add or remove- Returns:
- the resulting node snapshot
-
getNode
Reads a complete node snapshot, including a readable primary parent.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository alias- Returns:
- the resulting node snapshot
-
getNode
Reads explicitly selected node fields; an empty mask returns identity only. -
getNode
public org.saidone.restless.api.Node getNode(String nodeRef, com.google.protobuf.FieldMask fields, String relativePath) Resolves a relative path under the supplied node before mapping the result. -
updateNode
public org.saidone.restless.api.Node updateNode(String nodeRef, String name, Map<String, org.saidone.restless.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasname- node name; empty preserves the name on update, move or copyproperties- typed properties keyed by qualified name- Returns:
- the resulting node snapshot
-
updateNode
public org.saidone.restless.api.Node updateNode(String nodeRef, String name, String type, Map<String, org.saidone.restless.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasname- node name; empty preserves the name on update, move or copytype- qualified type name; empty preserves the type on update and defaults to cm:content on createproperties- typed properties keyed by qualified name- Returns:
- the resulting node snapshot
-
updateNode
public org.saidone.restless.api.Node updateNode(String nodeRef, String name, String type, Map<String, org.saidone.restless.api.Property> properties, List<String> addAspects, List<String> removeAspects) Atomically updates the supplied name, type, properties and aspect changes.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliasname- node name; empty preserves the name on update, move or copytype- qualified type name; empty preserves the type on update and defaults to cm:content on createproperties- typed properties keyed by qualified nameaddAspects- qualified aspect names to add if absentremoveAspects- qualified aspect names to remove if present- Returns:
- the resulting node snapshot
-
deleteNode
Deletes a node through the repository, preserving the server's protected-folder checks.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository alias
-
deleteNodeOnce
Deletes a node without retrying the request after a failure. -
deleteNodeOnce
Sends one deletion request. A rejected ticket is discarded for subsequent calls.- Parameters:
nodeRef- node reference, bare workspace ID or supported aliaspermanent- whether to request permanent deletion instead of archiving a live node
-
lockNode
public org.saidone.restless.api.Node lockNode(org.saidone.restless.api.LockNodeRequest request) Acquires a repository lock without replaying the mutation on authentication failure.- Parameters:
request- target node, lock options and response field mask- Returns:
- the locked node with selected fields
-
unlockNode
public org.saidone.restless.api.Node unlockNode(org.saidone.restless.api.NodeActionRequest request) Releases a repository lock without replaying the mutation on authentication failure.- Parameters:
request- target node and response field mask- Returns:
- the unlocked node with selected fields
-
checkoutNode
public org.saidone.restless.api.Node checkoutNode(org.saidone.restless.api.NodeActionRequest request) Checks out a document without replaying the mutation on authentication failure.- Parameters:
request- document reference and response field mask- Returns:
- the resulting working copy
-
cancelCheckoutNode
public org.saidone.restless.api.Node cancelCheckoutNode(org.saidone.restless.api.NodeActionRequest request) Cancels checkout without replaying the mutation on authentication failure.- Parameters:
request- working-copy reference and response field mask- Returns:
- the original document
-
updateNodeProjected
public org.saidone.restless.api.Node updateNodeProjected(org.saidone.restless.api.UpdateNodeRequest request) Applies a mutation and returns the selected fields from its transaction. -
updateNodePermissions
public org.saidone.restless.api.Node updateNodePermissions(org.saidone.restless.api.UpdateNodeRequest request) Submits the combined ACL and node mutation once.
-