選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ReplicaFetchRequest.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (C) 2016, Google Inc. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.internal.ketch;
  11. import java.util.Map;
  12. import java.util.Set;
  13. import org.eclipse.jgit.annotations.Nullable;
  14. import org.eclipse.jgit.lib.ObjectId;
  15. import org.eclipse.jgit.lib.Ref;
  16. /**
  17. * A fetch request to obtain objects from a replica, and its result.
  18. */
  19. public class ReplicaFetchRequest {
  20. private final Set<String> wantRefs;
  21. private final Set<ObjectId> wantObjects;
  22. private Map<String, Ref> refs;
  23. /**
  24. * Construct a new fetch request for a replica.
  25. *
  26. * @param wantRefs
  27. * named references to be fetched.
  28. * @param wantObjects
  29. * specific objects to be fetched.
  30. */
  31. public ReplicaFetchRequest(Set<String> wantRefs,
  32. Set<ObjectId> wantObjects) {
  33. this.wantRefs = wantRefs;
  34. this.wantObjects = wantObjects;
  35. }
  36. /**
  37. * Get references to be fetched.
  38. *
  39. * @return references to be fetched.
  40. */
  41. public Set<String> getWantRefs() {
  42. return wantRefs;
  43. }
  44. /**
  45. * Get objects to be fetched.
  46. *
  47. * @return objects to be fetched.
  48. */
  49. public Set<ObjectId> getWantObjects() {
  50. return wantObjects;
  51. }
  52. /**
  53. * Get remote references, usually from the advertisement.
  54. *
  55. * @return remote references, usually from the advertisement.
  56. */
  57. @Nullable
  58. public Map<String, Ref> getRefs() {
  59. return refs;
  60. }
  61. /**
  62. * Set references observed from the replica.
  63. *
  64. * @param refs
  65. * references observed from the replica.
  66. */
  67. public void setRefs(Map<String, Ref> refs) {
  68. this.refs = refs;
  69. }
  70. }