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.

DataProviderClientRpc.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2000-2014 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.typed;
  17. import java.util.List;
  18. import com.vaadin.shared.communication.ClientRpc;
  19. import elemental.json.JsonArray;
  20. import elemental.json.JsonObject;
  21. /**
  22. * RPC interface used by DataProvider to send data to the client-side.
  23. *
  24. * @since
  25. */
  26. public interface DataProviderClientRpc extends ClientRpc {
  27. /**
  28. * Informs the client-side DataSource that all data has been invalidated.
  29. */
  30. void reset();
  31. /**
  32. * Sets the data of the client-side DataSource to match the given data
  33. * starting from given index.
  34. * <p>
  35. * <strong>Note:</strong> This method will override any existing data in the
  36. * range starting from first index with the length of the data array.
  37. *
  38. * @param firstIndex
  39. * first index to update
  40. * @param data
  41. * array of new data
  42. */
  43. void setData(long firstIndex, JsonArray data);
  44. /**
  45. * Adds a new data object to the client-side DataSource. The new data object
  46. * is added at the end of the data source.
  47. *
  48. * @param dataObject
  49. * single added data object
  50. */
  51. void add(JsonObject dataObject);
  52. /**
  53. * Removes data identified by given key from the client-side DataSource.
  54. *
  55. * @param key
  56. * key identifying the object to be removed
  57. */
  58. void drop(String key);
  59. /**
  60. * Updates an array of objects based on their identifying key.
  61. *
  62. * @param data
  63. * array of updated data
  64. */
  65. void updateData(JsonArray data);
  66. }