Class FileFolderServiceClient

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

public class FileFolderServiceClient extends Object
Client of the platform's file/folder service: listing, creation, moves and copies.

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.

Create metadata uses the typed values built with Properties, with explicit scalar/list cardinality.

  • Constructor Summary

    Constructors
    Constructor
    Description
    FileFolderServiceClient(io.grpc.Channel channel, TicketProvider tickets, Duration deadline)
    Creates this service client with shared authentication and a per-call deadline.
    FileFolderServiceClient(org.saidone.unrest.api.FileFolderServiceGrpc.FileFolderServiceBlockingStub 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
    copy(String nodeRef, String targetParentRef, String name)
    Copies a node to another parent, optionally changing the copied name.
    org.saidone.unrest.api.Node
    copyProjected(org.saidone.unrest.api.CopyNodeRequest request)
    Applies a mutation and returns the selected fields from its transaction.
    org.saidone.unrest.api.Node
    create(String parentRef, String name, String type, Map<String,org.saidone.unrest.api.Property> properties, List<String> aspects, org.saidone.unrest.api.Content content)
    Creates a document or folder with optional properties, aspects and document content.
    org.saidone.unrest.api.Node
    create(String parentRef, String name, String type, Map<String,org.saidone.unrest.api.Property> properties, org.saidone.unrest.api.Content content)
    Creates a document or folder with optional properties, aspects and document content.
    org.saidone.unrest.api.Node
    createProjected(org.saidone.unrest.api.CreateNodeRequest request)
    Applies a mutation and returns the selected fields from its transaction.
    org.saidone.unrest.api.ListChildrenResponse
    list(String nodeRef, int skipCount, int maxItems)
    Lists files and folders directly under a parent, ordered by name.
    org.saidone.unrest.api.ListChildrenResponse
    list(String nodeRef, int skipCount, int maxItems, boolean countTotal)
    Lists a page with optional exact counting.
    org.saidone.unrest.api.ListChildrenResponse
    list(String nodeRef, int skipCount, int maxItems, boolean countTotal, com.google.protobuf.FieldMask fields)
    Lists projected nodes without changing ordering, permission filtering or pagination.
    org.saidone.unrest.api.ListChildrenResponse
    list(String nodeRef, int skipCount, int maxItems, boolean countTotal, com.google.protobuf.FieldMask fields, org.saidone.unrest.api.ListNavigation navigation)
    Lists a secured page with optional navigation, ordering and source selection.
    org.saidone.unrest.api.Node
    move(String nodeRef, String targetParentRef, String name)
    Moves a node to another parent, optionally renaming it.
    org.saidone.unrest.api.Node
    moveProjected(org.saidone.unrest.api.MoveNodeRequest 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

    • FileFolderServiceClient

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

      public FileFolderServiceClient(org.saidone.unrest.api.FileFolderServiceGrpc.FileFolderServiceBlockingStub 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

    • list

      public org.saidone.unrest.api.ListChildrenResponse list(String nodeRef, int skipCount, int maxItems)
      Lists files and folders directly under a parent, ordered by name. Returns name, type and properties along with node_ref; use the fields overload with * for complete snapshots.
      Parameters:
      nodeRef - node reference, bare workspace ID or supported repository alias
      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
    • list

      public org.saidone.unrest.api.ListChildrenResponse list(String nodeRef, int skipCount, int maxItems, boolean countTotal)
      Lists a page with optional exact counting. Disabling the count returns totalItems=-1 and preserves the continuation flag and the default name/type/properties projection. Pages are independent reads, so concurrent mutations can shift subsequent offsets. Older servers may ignore count_total.
      Parameters:
      nodeRef - parent reference, bare workspace ID or supported alias
      skipCount - non-negative number of entries to skip
      maxItems - page size in 1..1000; zero selects the server default
      countTotal - true to request an exact permission-filtered total, false to skip counting
      Returns:
      the result page and continuation flag, with -1 total when counting is disabled
    • list

      public org.saidone.unrest.api.ListChildrenResponse list(String nodeRef, int skipCount, int maxItems, boolean countTotal, com.google.protobuf.FieldMask fields)
      Lists projected nodes without changing ordering, permission filtering or pagination. Existing overloads select name, type and properties by default. Requires a platform supporting fields; older servers return full nodes.
      Parameters:
      nodeRef - parent reference or alias
      skipCount - non-negative page offset
      maxItems - page size in 1..1000; zero selects the default
      countTotal - whether to compute the exact total
      fields - Node field paths; empty selects node_ref only, a single * selects the complete node
      Returns:
      the page with selected fields; node_ref is always included
    • list

      public org.saidone.unrest.api.ListChildrenResponse list(String nodeRef, int skipCount, int maxItems, boolean countTotal, com.google.protobuf.FieldMask fields, org.saidone.unrest.api.ListNavigation navigation)
      Lists a secured page with optional navigation, ordering and source selection.
    • create

      public org.saidone.unrest.api.Node create(String parentRef, String name, String type, Map<String,org.saidone.unrest.api.Property> properties, org.saidone.unrest.api.Content content)
      Creates a document or folder with optional properties, aspects and document content.
      Parameters:
      parentRef - reference or alias of the destination parent folder
      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
      content - document bytes and metadata; optional only on creation
      Returns:
      the resulting node snapshot
    • create

      public org.saidone.unrest.api.Node create(String parentRef, String name, String type, Map<String,org.saidone.unrest.api.Property> properties, List<String> aspects, org.saidone.unrest.api.Content content)
      Creates a document or folder with optional properties, aspects and document content.
      Parameters:
      parentRef - reference or alias of the destination parent folder
      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
      aspects - qualified aspect names to add during creation
      content - document bytes and metadata; optional only on creation
      Returns:
      the resulting node snapshot
    • move

      public org.saidone.unrest.api.Node move(String nodeRef, String targetParentRef, String name)
      Moves a node to another parent, optionally renaming it.
      Parameters:
      nodeRef - node reference, bare workspace ID or supported repository alias
      targetParentRef - reference or alias of the destination parent folder
      name - node name; empty preserves the name on update, move or copy
      Returns:
      the resulting node snapshot
    • copy

      public org.saidone.unrest.api.Node copy(String nodeRef, String targetParentRef, String name)
      Copies a node to another parent, optionally changing the copied name.
      Parameters:
      nodeRef - node reference, bare workspace ID or supported repository alias
      targetParentRef - reference or alias of the destination parent folder
      name - node name; empty preserves the name on update, move or copy
      Returns:
      the resulting node snapshot
    • createProjected

      public org.saidone.unrest.api.Node createProjected(org.saidone.unrest.api.CreateNodeRequest request)
      Applies a mutation and returns the selected fields from its transaction.
    • moveProjected

      public org.saidone.unrest.api.Node moveProjected(org.saidone.unrest.api.MoveNodeRequest request)
      Applies a mutation and returns the selected fields from its transaction.
    • copyProjected

      public org.saidone.unrest.api.Node copyProjected(org.saidone.unrest.api.CopyNodeRequest request)
      Applies a mutation and returns the selected fields from its transaction.