Package org.saidone.unrest.client
Class FileFolderServiceClient
java.lang.Object
org.saidone.unrest.client.FileFolderServiceClient
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
ConstructorsConstructorDescriptionFileFolderServiceClient(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 TypeMethodDescriptionorg.saidone.unrest.api.NodeCopies a node to another parent, optionally changing the copied name.org.saidone.unrest.api.NodecopyProjected(org.saidone.unrest.api.CopyNodeRequest request) Applies a mutation and returns the selected fields from its transaction.org.saidone.unrest.api.Nodecreate(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.Nodecreate(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.NodecreateProjected(org.saidone.unrest.api.CreateNodeRequest request) Applies a mutation and returns the selected fields from its transaction.org.saidone.unrest.api.ListChildrenResponseLists files and folders directly under a parent, ordered by name.org.saidone.unrest.api.ListChildrenResponseLists a page with optional exact counting.org.saidone.unrest.api.ListChildrenResponselist(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.ListChildrenResponselist(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.NodeMoves a node to another parent, optionally renaming it.org.saidone.unrest.api.NodemoveProjected(org.saidone.unrest.api.MoveNodeRequest request) Applies a mutation and returns the selected fields from its transaction.
-
Constructor Details
-
FileFolderServiceClient
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
-
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 servicetickets- shared ticket provider, normally one AuthenticationServiceClientdeadline- 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 aliasskipCount- non-negative number of entries to skipmaxItems- 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 aliasskipCount- non-negative number of entries to skipmaxItems- page size in 1..1000; zero selects the server defaultcountTotal- 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 aliasskipCount- non-negative page offsetmaxItems- page size in 1..1000; zero selects the defaultcountTotal- whether to compute the exact totalfields- 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
-
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 foldername- 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 namecontent- 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 foldername- 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 nameaspects- qualified aspect names to add during creationcontent- document bytes and metadata; optional only on creation- Returns:
- the resulting node snapshot
-
move
Moves a node to another parent, optionally renaming it.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliastargetParentRef- reference or alias of the destination parent foldername- node name; empty preserves the name on update, move or copy- Returns:
- the resulting node snapshot
-
copy
Copies a node to another parent, optionally changing the copied name.- Parameters:
nodeRef- node reference, bare workspace ID or supported repository aliastargetParentRef- reference or alias of the destination parent foldername- 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.
-