Interface TNodeProvider<I,R>

Type Parameters:
I - id class.
R - request class.

public interface TNodeProvider<I,R>
Client provider interface for hierarchically organized data. This class will be created of client-side TNodeService.
Since:
4.0.63
  • Field Details

    • SEARCH_ID

      static final int SEARCH_ID
      Search flag: search ids.
      Since:
      4.0.63
      See Also:
    • SEARCH_DATA

      static final int SEARCH_DATA
      Search flag: search data (like labels, properties, etc.).
      Since:
      4.0.63
      See Also:
    • SEARCH_EXACT

      static final int SEARCH_EXACT
      Search flag: enables exact search; default is a not-exact search.
      Since:
      4.0.63
      See Also:
  • Method Details

    • createRequest

      R createRequest(@NotNull @NotNull UserService userService, @Nullable @Nullable Map<String,String> properties)
      Creates a request object. Request objects are used to transport neccessary information about the client environment to the server. It's recommended to reuse this request object as long as possible.
      Parameters:
      userService - current user-service.
      properties - properties for the provider.
      Returns:
      request object.
      Since:
      4.0.63
    • createRequest

      R createRequest(@NotNull @NotNull IDProvider element, @Nullable @Nullable Map<String,String> properties)
      Creates a request object. Request objects are used to transport neccessary information about the client environment to the server. It's recommended to reuse this request object as long as possible.
      Parameters:
      element - current store-element.
      properties - properties for the provider.
      Returns:
      request object.
      Since:
      4.0.63
    • getIdClass

      @NotNull @NotNull Class<? extends I> getIdClass()
      Returns id class of this provider. This value must not be changed during lifetime of a provider.
      For implementors: Id classes must implement a constructor Id(String) which can be used to de-serialize a string represantation created with Id.toString().
      Returns:
      id class for this adapter.
      Since:
      4.0.63
    • getRoot

      @NotNull @NotNull TNode<I> getRoot(@NotNull R request)
      Returns root object.
      Parameters:
      request - request.
      Returns:
      root object.
      Since:
      4.0.63
    • getNodes

      @NotNull @NotNull List<TNode<I>> getNodes(@NotNull R request, @NotNull @NotNull Collection<I> ids)
      Returns objects for the given ids. For every index i with 0 <= i < ids.length is result[i] == null <=> ids[i] is unknown.
      Parameters:
      request - request.
      ids - object ids.
      Returns:
      objects for the given ids (result[i] == null <=> ids[i] is unknown).
      Since:
      4.0.63
    • getPath

      @NotNull @NotNull Iterable<TNode<I>> getPath(@NotNull R request, @NotNull I id)
      Returns path to root or null for root nodes. The path starts with the node's parent, ..., root node.
      Parameters:
      request - request.
      id - object id.
      Returns:
      path to root or null for root nodes.
      Since:
      4.0.63
    • search

      @NotNull @NotNull Iterable<TNode<I>> search(@NotNull R request, @NotNull @NotNull String text, int flags)
      Searches the given text. The flags specifies what ( ids and/or data) and how to search (e.g. exact).
      Example:
      Search for ids or data containing "test":
       ids = prov.search(request, "test", SEARCH_ID | SEARCH_DATA); // search objects = prov.get(request, ids); // get objects 
      Parameters:
      request - request.
      text - search text.
      flags - what (ids and/or data) and how to search (e.g. exact).
      Returns:
      ids of found objects.
      Since:
      4.0.63