Package org.saidone.unrest.platform
Class GrpcFileFolderService
java.lang.Object
org.saidone.unrest.api.FileFolderServiceGrpc.FileFolderServiceImplBase
org.saidone.unrest.platform.GrpcFileFolderService
- All Implemented Interfaces:
io.grpc.BindableService,org.saidone.unrest.api.FileFolderServiceGrpc.AsyncService
public final class GrpcFileFolderService
extends org.saidone.unrest.api.FileFolderServiceGrpc.FileFolderServiceImplBase
Exposes file and folder listing, creation, moves and copies through gRPC.
Operations delegate to Alfresco's file/folder service and return mapped node snapshots. Listings include files and folders ordered by name. Creation can additionally set properties, aspects and document content in the same transaction. All operations preserve the calling user's repository permissions.
Requests accept the node reference forms described in the package documentation. Responses are emitted only after the repository transaction completes; errors are delivered to the response observer.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcFileFolderService(org.alfresco.service.ServiceRegistry services) Creates the adapter and its repository helpers without starting repository work. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(org.saidone.unrest.api.CopyNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Copies a node into a destination folder, optionally with a different name.voidcopyProjected(org.saidone.unrest.api.CopyNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Applies the mutation and projects its result in the same transaction.voidcreate(org.saidone.unrest.api.CreateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Creates a document or folder with optional metadata and aspects.voidcreateProjected(org.saidone.unrest.api.CreateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Applies the mutation and projects its result in the same transaction.voidlist(org.saidone.unrest.api.ListChildrenRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.ListChildrenResponse> observer) Lists files and folders directly under a parent, sorted by name.voidmove(org.saidone.unrest.api.MoveNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Moves a node to another parent, optionally renaming it.voidmoveProjected(org.saidone.unrest.api.MoveNodeRequest 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.FileFolderServiceGrpc.FileFolderServiceImplBase
bindService
-
Constructor Details
-
GrpcFileFolderService
public GrpcFileFolderService(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
-
list
public void list(org.saidone.unrest.api.ListChildrenRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.ListChildrenResponse> observer) Lists files and folders directly under a parent, sorted by name. A zero page size selects 100; explicit sizes must be 1..1000. Exact permission-filtered counting is the default for existing callers. Explicitly disabling count_total skips the count request and returns -1 while preserving entries and continuation. Each page is a separate repository read; concurrent creates, deletes or renames may shift later offsets. An absent fields mask selects name, type and properties; a single * requests complete nodes. An explicit empty mask returns references only. Selected fields do not change permission filtering, ordering, counting or continuation.- Parameters:
request- parent reference, pagination, optional exact counting and Node field selectionobserver- receives one page with entries, continuation flag and total count, or a gRPC error
-
create
public void create(org.saidone.unrest.api.CreateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Creates a document or folder with optional metadata and aspects. A blank type defaults to cm:content. Content is optional for documents and forbidden for folders. Creation, metadata and content writes share one transaction.- Parameters:
request- parent reference, name, type, properties, aspects and optional contentobserver- receives one snapshot of the newly created node, or a gRPC error
-
createProjected
public void createProjected(org.saidone.unrest.api.CreateNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Applies the mutation and projects its result in the same transaction. -
move
public void move(org.saidone.unrest.api.MoveNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Moves a node to another parent, optionally renaming it. A blank name preserves the current name. Duplicate names, locks, permissions and hierarchy constraints are enforced by Alfresco.- Parameters:
request- source reference, destination parent reference and optional new nameobserver- receives one snapshot of the moved node, or a gRPC error
-
moveProjected
public void moveProjected(org.saidone.unrest.api.MoveNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Applies the mutation and projects its result in the same transaction. -
copy
public void copy(org.saidone.unrest.api.CopyNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Copies a node into a destination folder, optionally with a different name. Folder copy behavior is delegated to Alfresco. A blank name preserves the original name.- Parameters:
request- source reference, destination parent reference and optional copied nameobserver- receives one snapshot of the new copy, or a gRPC error
-
copyProjected
public void copyProjected(org.saidone.unrest.api.CopyNodeRequest request, io.grpc.stub.StreamObserver<org.saidone.unrest.api.Node> observer) Applies the mutation and projects its result in the same transaction.
-