You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataCommunicatorClientRpc.java 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.shared.data;
  17. import com.vaadin.shared.communication.ClientRpc;
  18. import elemental.json.JsonArray;
  19. /**
  20. * RPC interface used by DataProvider to send data to the client-side.
  21. *
  22. * @since 8.0
  23. */
  24. public interface DataCommunicatorClientRpc extends ClientRpc {
  25. /**
  26. * Informs the client-side DataSource that all data has been invalidated.
  27. *
  28. * @param size
  29. * size of the data source
  30. */
  31. void reset(int size);
  32. /**
  33. * Sets the data of the client-side DataSource to match the given data
  34. * starting from given index.
  35. * <p>
  36. * <strong>Note:</strong> This method will override any existing data in the
  37. * range starting from first index with the length of the data array.
  38. *
  39. * @param firstIndex
  40. * first index to update
  41. * @param data
  42. * array of new data
  43. */
  44. void setData(int firstIndex, JsonArray data);
  45. /**
  46. * Updates an array of objects based on their identifying key.
  47. *
  48. * @param data
  49. * array of updated data
  50. */
  51. void updateData(JsonArray data);
  52. // TODO: Notify add / remove
  53. }