Class GrpcNodeService

java.lang.Object
org.saidone.unrest.api.NodeServiceGrpc.NodeServiceImplBase
org.saidone.unrest.platform.GrpcNodeService
All Implemented Interfaces:
io.grpc.BindableService, org.saidone.unrest.api.NodeServiceGrpc.AsyncService

public final class GrpcNodeService extends org.saidone.unrest.api.NodeServiceGrpc.NodeServiceImplBase
Exposes node metadata and aspect operations through gRPC.

Primitive operations follow Alfresco's node service. getNode(org.saidone.unrest.api.GetNodeRequest, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node>) returns a complete snapshot and updateNode(org.saidone.unrest.api.UpdateNodeRequest, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node>) applies a composite update in one transaction; these two methods are remote convenience extensions. Property and aspect names accept prefix notation or expanded qualified names.

Reads run in read-only transactions; mutations run in retryable read-write transactions as the user established by TicketInterceptor. Successful unary calls emit one result after the transaction finishes. Failures are reported through the observer using the status mappings described in the package documentation.

See Also:
  • NodeService
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrpcNodeService(org.alfresco.service.ServiceRegistry services)
    Creates the adapter and its repository helpers without starting repository work.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAspect(org.saidone.unrest.api.AddAspectRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Adds a known non-system aspect and merges any supplied properties in one transaction.
    void
    addProperties(org.saidone.unrest.api.AddPropertiesRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Merges writable metadata into a node without replacing unrelated properties.
    void
    cancelCheckoutNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
     
    void
    checkoutNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
     
    void
    deleteNode(org.saidone.unrest.api.DeleteNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.DeleteNodeResponse> observer)
    Deletes a node through Alfresco, normally moving it to the archive store.
    void
    getAspects(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeAspects> observer)
    Lists the aspects currently applied to the node, sorted by expanded qualified name.
    void
    getNode(org.saidone.unrest.api.GetNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Returns a complete core snapshot by default, or an explicitly selected subset.
    void
    getProperties(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeProperties> observer)
    Reads the node property map, preserving scalar types, nulls and collection cardinality.
    void
    getType(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeType> observer)
    Reads the node type as an expanded qualified name.
    void
    lockNode(org.saidone.unrest.api.LockNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
     
    void
    removeAspect(org.saidone.unrest.api.RemoveAspectRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Removes a known non-system aspect if present.
    void
    setType(org.saidone.unrest.api.SetTypeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Changes a node to a known document or folder type.
    void
    unlockNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
     
    void
    updateNode(org.saidone.unrest.api.UpdateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Atomically renames a node, changes its type, adds/removes aspects and merges metadata.
    void
    updateNodeProjected(org.saidone.unrest.api.UpdateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    Applies the mutation and projects its result in the same transaction.

    Methods inherited from class org.saidone.unrest.api.NodeServiceGrpc.NodeServiceImplBase

    bindService

    Methods inherited from class java.lang.Object

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

    • GrpcNodeService

      public GrpcNodeService(org.alfresco.service.ServiceRegistry services)
      Creates the adapter and its repository helpers without starting repository work.
      Parameters:
      services - Alfresco service registry; repository work uses its secured services
  • Method Details

    • lockNode

      public void lockNode(org.saidone.unrest.api.LockNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    • unlockNode

      public void unlockNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    • checkoutNode

      public void checkoutNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    • cancelCheckoutNode

      public void cancelCheckoutNode(org.saidone.unrest.api.NodeActionRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
    • getProperties

      public void getProperties(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeProperties> observer)
      Reads the node property map, preserving scalar types, nulls and collection cardinality. Content values contain metadata only.
      Parameters:
      request - node reference to inspect
      observer - receives one property map keyed by expanded qualified names, or a gRPC error
    • addProperties

      public void addProperties(org.saidone.unrest.api.AddPropertiesRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Merges writable metadata into a node without replacing unrelated properties. Empty input is a no-op. Property value kinds and explicit cardinality must match the repository dictionary.
      Parameters:
      request - node reference and scalar or list-valued properties to merge
      observer - receives one updated node snapshot, or a gRPC error
    • getType

      public void getType(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeType> observer)
      Reads the node type as an expanded qualified name.
      Parameters:
      request - node reference to inspect
      observer - receives one qualified type name, or a gRPC error
    • setType

      public void setType(org.saidone.unrest.api.SetTypeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Changes a node to a known document or folder type. The new type must remain in the same document/folder category; blank type names are invalid.
      Parameters:
      request - node reference and required type name in prefix or expanded form
      observer - receives one updated node snapshot, or a gRPC error
    • getAspects

      public void getAspects(org.saidone.unrest.api.NodeRefRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.NodeAspects> observer)
      Lists the aspects currently applied to the node, sorted by expanded qualified name.
      Parameters:
      request - node reference to inspect
      observer - receives one ordered list of aspect names, or a gRPC error
    • addAspect

      public void addAspect(org.saidone.unrest.api.AddAspectRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Adds a known non-system aspect and merges any supplied properties in one transaction. An already present aspect is left in place and supplied properties are still applied.
      Parameters:
      request - node reference, aspect name and optional scalar or list-valued properties
      observer - receives one updated node snapshot, or a gRPC error
    • removeAspect

      public void removeAspect(org.saidone.unrest.api.RemoveAspectRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Removes a known non-system aspect if present. An absent aspect is ignored; Alfresco enforces model constraints and aspect removal effects.
      Parameters:
      request - node reference and aspect name to remove
      observer - receives one updated node snapshot, or a gRPC error
    • deleteNode

      public void deleteNode(org.saidone.unrest.api.DeleteNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.DeleteNodeResponse> observer)
      Deletes a node through Alfresco, normally moving it to the archive store. Company Home, Shared Files and the calling user's home folder are explicitly protected and rejected as invalid arguments.
      Parameters:
      request - node reference to delete
      observer - receives one empty acknowledgement after the write succeeds, or a gRPC error
    • getNode

      public void getNode(org.saidone.unrest.api.GetNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Returns a complete core snapshot by default, or an explicitly selected subset. Optional enriched metadata is requested separately through the metadata field mask. Core fields combine name, type, aspects, properties and a readable primary parent. This convenience extension is not a single native Alfresco node-service operation.
      Parameters:
      request - node reference to inspect
      observer - receives one snapshot; an unreadable or absent parent is omitted, or a gRPC error
    • updateNode

      public void updateNode(org.saidone.unrest.api.UpdateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Atomically renames a node, changes its type, adds/removes aspects and merges metadata. Empty name/type fields preserve their current values. At least one change is required; document/folder category changes are rejected.
      Parameters:
      request - node reference and requested name, type, property and aspect changes
      observer - receives one snapshot of the updated node, or a gRPC error
    • updateNodeProjected

      public void updateNodeProjected(org.saidone.unrest.api.UpdateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer)
      Applies the mutation and projects its result in the same transaction.