Class NodeServiceClient

java.lang.Object
org.saidone.unrest.client.NodeServiceClient

public class NodeServiceClient extends Object
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

    Constructors
    Constructor
    Description
    NodeServiceClient(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 Type
    Method
    Description
    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.
    org.saidone.unrest.api.Node
    addProperties(String nodeRef, Map<String,org.saidone.unrest.api.Property> properties)
    Merges typed scalar or multi-valued properties.
    org.saidone.unrest.api.Node
    cancelCheckoutNode(org.saidone.unrest.api.NodeActionRequest request)
     
    org.saidone.unrest.api.Node
    checkoutNode(org.saidone.unrest.api.NodeActionRequest request)
     
    void
    deleteNode(String nodeRef)
    Deletes a node through the repository, preserving the server's protected-folder checks.
    void
    Deletes a node without retrying the request after a failure.
    void
    deleteNodeOnce(String nodeRef, boolean permanent)
     
    getAspects(String nodeRef)
    Returns the node's applied aspects as expanded qualified names.
    org.saidone.unrest.api.Node
    getNode(String nodeRef)
    Reads a complete node snapshot, including a readable primary parent.
    org.saidone.unrest.api.Node
    getNode(String nodeRef, com.google.protobuf.FieldMask fields)
    Reads explicitly selected node fields; an empty mask returns identity only.
    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.
    Map<String,org.saidone.unrest.api.Property>
    Reads the typed property map using qualified property names as keys.
    getType(String nodeRef)
    Returns the node's expanded qualified type name.
    org.saidone.unrest.api.Node
    lockNode(org.saidone.unrest.api.LockNodeRequest request)
     
    org.saidone.unrest.api.Node
    removeAspect(String nodeRef, String aspect)
    Removes a known aspect if present.
    org.saidone.unrest.api.Node
    setType(String nodeRef, String type)
    Changes the type while preserving the document/folder category.
    org.saidone.unrest.api.Node
    unlockNode(org.saidone.unrest.api.NodeActionRequest request)
     
    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.
    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.
    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.
    org.saidone.unrest.api.Node
    updateNodeProjected(org.saidone.unrest.api.UpdateNodeRequest request)
    Applies a mutation and returns the selected fields from its transaction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NodeServiceClient

      public NodeServiceClient(io.grpc.Channel channel, 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:
      channel - shared gRPC channel; ownership remains with the caller
      tickets - shared ticket provider, normally one AuthenticationServiceClient
      deadline - 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 service
      tickets - shared ticket provider, normally one AuthenticationServiceClient
      deadline - per-call deadline applied to every RPC attempt
  • Method Details

    • getProperties

      public Map<String,org.saidone.unrest.api.Property> getProperties(String nodeRef)
      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 alias
      properties - typed properties keyed by qualified name
      Returns:
      the resulting node snapshot
    • getType

      public String getType(String nodeRef)
      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

      public org.saidone.unrest.api.Node setType(String nodeRef, String type)
      Changes the type while preserving the document/folder category.
      Parameters:
      nodeRef - node reference, bare workspace ID or supported repository alias
      type - qualified type name; empty preserves the type on update and defaults to cm:content on create
      Returns:
      the resulting node snapshot
    • getAspects

      public Set<String> getAspects(String nodeRef)
      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 alias
      aspect - qualified name of the aspect to add or remove
      properties - typed properties keyed by qualified name
      Returns:
      the resulting node snapshot
    • removeAspect

      public org.saidone.unrest.api.Node removeAspect(String nodeRef, String aspect)
      Removes a known aspect if present.
      Parameters:
      nodeRef - node reference, bare workspace ID or supported repository alias
      aspect - qualified name of the aspect to add or remove
      Returns:
      the resulting node snapshot
    • getNode

      public org.saidone.unrest.api.Node getNode(String nodeRef)
      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

      public org.saidone.unrest.api.Node getNode(String nodeRef, com.google.protobuf.FieldMask fields)
      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 alias
      name - node name; empty preserves the name on update, move or copy
      properties - 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 alias
      name - node name; empty preserves the name on update, move or copy
      type - qualified type name; empty preserves the type on update and defaults to cm:content on create
      properties - 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 alias
      name - node name; empty preserves the name on update, move or copy
      type - qualified type name; empty preserves the type on update and defaults to cm:content on create
      properties - typed properties keyed by qualified name
      addAspects - qualified aspect names to add if absent
      removeAspects - qualified aspect names to remove if present
      Returns:
      the resulting node snapshot
    • deleteNode

      public void deleteNode(String nodeRef)
      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

      public void deleteNodeOnce(String nodeRef)
      Deletes a node without retrying the request after a failure.
    • deleteNodeOnce

      public void deleteNodeOnce(String nodeRef, boolean permanent)
    • 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.