Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: add SelectionContext for event subscription
Motivation: In order to support door- and user specific root paths (see issue #5318) additional information must be provided to the EventSource plugins. Such a change implies breaking backwards compatibility with the EventSource SPI; however, to the best of my knowledge, there are currently no third-party EventSource plugins. To minimise the impact of any future changes, this patch introduces the SelectionContext interface. This should allow future patches to provide additional information within SelectionContext without breaking backwards compatibility. Modification: Introduce the SelectionContext interface. The channel-ID is now provided through the SelectionContext. A future patch will add extra information in SelectionContext. Result: This patch breaks the EventSource SPI, so any third-party EventSource plugins that use this SPI must be updated. Target: master Requires-notes: yes Requires-book: no Request: 6.1 Request: 6.0 Request: 5.2 Patch: https://rb.dcache.org/r/12316/ Acked-by: Tigran Mkrtchyan
- Loading branch information
1 parent
16396cf
commit 28d7d6b
Showing
5 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
modules/dcache-frontend/src/main/java/org/dcache/restful/events/spi/SelectionContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* dCache - http://www.dcache.org/ | ||
* | ||
* Copyright (C) 2020 Deutsches Elektronen-Synchrotron | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.dcache.restful.events.spi; | ||
|
||
/** | ||
* Optional, ancillary information supplied when a client is selecting events | ||
* from an EventStream. Unlike other (core) information, the information here | ||
* is available but not all plugins will need it. | ||
*/ | ||
public interface SelectionContext | ||
{ | ||
/** | ||
* The ID of the channel within which the selection is being made. | ||
*/ | ||
String channelId(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters