Class NodeArchiveServiceClient

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

public class NodeArchiveServiceClient extends Object
Client of the platform's node archive service: lists and permanently purges the nodes in the trashcan.

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.

  • Constructor Summary

    Constructors
    Constructor
    Description
    NodeArchiveServiceClient(io.grpc.Channel channel, TicketProvider tickets, Duration deadline)
    Creates this service client with shared authentication and a per-call deadline.
    NodeArchiveServiceClient(org.saidone.unrest.api.NodeArchiveServiceGrpc.NodeArchiveServiceBlockingStub 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.ListArchivedNodesResponse
    listArchivedNodes(String filter, int skipCount, int maxItems)
    Lists the archived nodes visible to the caller, most recently deleted first: every node for an administrator, otherwise only the nodes the caller deleted.
    long
    Permanently deletes every archived node the caller can list: the whole trashcan for an administrator.
    long
    Permanently deletes one archived node; it cannot be restored afterwards.

    Methods inherited from class java.lang.Object

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

    • NodeArchiveServiceClient

      public NodeArchiveServiceClient(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
    • NodeArchiveServiceClient

      public NodeArchiveServiceClient(org.saidone.unrest.api.NodeArchiveServiceGrpc.NodeArchiveServiceBlockingStub 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

    • listArchivedNodes

      public org.saidone.unrest.api.ListArchivedNodesResponse listArchivedNodes(String filter, int skipCount, int maxItems)
      Lists the archived nodes visible to the caller, most recently deleted first: every node for an administrator, otherwise only the nodes the caller deleted.
      Parameters:
      filter - optional name filter; empty lists every visible node
      skipCount - non-negative number of entries to skip
      maxItems - page size in 1..1000; zero selects the server default
      Returns:
      the result page, total count and continuation flag
    • purgeArchivedNode

      public long purgeArchivedNode(String nodeRef)
      Permanently deletes one archived node; it cannot be restored afterwards.
      Parameters:
      nodeRef - archived node reference (archive://SpacesStore/<id>) or bare node ID
      Returns:
      the number of purged nodes
    • purgeAllArchivedNodes

      public long purgeAllArchivedNodes()
      Permanently deletes every archived node the caller can list: the whole trashcan for an administrator.
      Returns:
      the number of purged nodes