- /**
- * Updates the suggested edition in both the request URI and the insert URI.
- *
- * @param latestEdition
- * The latest edition to update the URIs to
- */
- public void updateUris(long latestEdition) {
- if ((requestUri != null) && (requestUri.getEdition() < latestEdition)) {
- requestUri = requestUri.setSuggestedEdition(latestEdition);
- }
- if ((insertUri != null) && (insertUri.getEdition() < latestEdition)) {
- insertUri = insertUri.setSuggestedEdition(latestEdition);
- }
- }
-
- //
- // PRIVATE METHODS
- //
-
- /**
- * Updates the editions of the request URI and the insert URI (if latter is
- * not {@code null}) with the greater edition of either one.
- */
- private void updateEditions() {
- long requestEdition = 0;
- if (requestUri != null) {
- requestEdition = requestUri.getEdition();
- }
- long insertEdition = 0;
- if (insertUri != null) {
- insertEdition = insertUri.getEdition();
- }
- updateUris(Math.max(requestEdition, insertEdition));
- }
-