Package org.saidone.unrest.client
Class NodeServiceClient
java.lang.Object
org.saidone.unrest.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.unrest.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.unrest.api.NodeAdds an aspect and merges typed properties atomically.org.saidone.unrest.api.NodeaddProperties(String nodeRef, Map<String, org.saidone.unrest.api.Property> properties) Merges typed scalar or multi-valued properties.org.saidone.unrest.api.NodecancelCheckoutNode(org.saidone.unrest.api.NodeActionRequest request) org.saidone.unrest.api.NodecheckoutNode(org.saidone.unrest.api.NodeActionRequest request) 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) getAspects(String nodeRef) Returns the node's applied aspects as expanded qualified names.org.saidone.unrest.api.NodeReads a complete node snapshot, including a readable primary parent.org.saidone.unrest.api.NodeReads explicitly selected node fields; an empty mask returns identity only.org.saidone.unrest.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.unrest.api.NodelockNode(org.saidone.unrest.api.LockNodeRequest request) org.saidone.unrest.api.NoderemoveAspect(String nodeRef, String aspect) Removes a known aspect if present.org.saidone.unrest.api.NodeChanges the type while preserving the document/folder category.org.saidone.unrest.api.NodeunlockNode(org.saidone.unrest.api.NodeActionRequest request) org.saidone.unrest.api.NodeupdateNode(String nodeRef, String name, String type, Map<String, org.saidone.unrest.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.unrest.api.NodeupdateNode(String nodeRef, String name, String type, Map<String, org.saidone.unrest.api.Property> properties, List<String> addAspects, List<String> removeAspects) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.unrest.api.NodeupdateNode(String nodeRef, String name, Map<String, org.saidone.unrest.api.Property> properties) Atomically updates the supplied name, type, properties and aspect changes.org.saidone.unrest.api.NodeupdateNodeProjected(org.saidone.unrest.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.unrest.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.unrest.api.Node addProperties(String nodeRef, Map<String, org.saidone.unrest.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.unrest.api.Node addAspect(String nodeRef, String aspect, Map<String, org.saidone.unrest.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.unrest.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.unrest.api.Node updateNode(String nodeRef, String name, Map<String, org.saidone.unrest.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.unrest.api.Node updateNode(String nodeRef, String name, String type, Map<String, org.saidone.unrest.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.unrest.api.Node updateNode(String nodeRef, String name, String type, Map<String, org.saidone.unrest.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
-
lockNode
public org.saidone.unrest.api.Node lockNode(org.saidone.unrest.api.LockNodeRequest request) -
unlockNode
public org.saidone.unrest.api.Node unlockNode(org.saidone.unrest.api.NodeActionRequest request) -
checkoutNode
public org.saidone.unrest.api.Node checkoutNode(org.saidone.unrest.api.NodeActionRequest request) -
cancelCheckoutNode
public org.saidone.unrest.api.Node cancelCheckoutNode(org.saidone.unrest.api.NodeActionRequest request) -
updateNodeProjected
public org.saidone.unrest.api.Node updateNodeProjected(org.saidone.unrest.api.UpdateNodeRequest request) Applies a mutation and returns the selected fields from its transaction.
-