-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restful: provide functionality to remove or add labels of a file
Motivation Allow any dCache service to modify and remove labels attributes. Modification: Add set-label and rm-label fucntions to restful Api. Additional Message subclasses has been added to allow dCache services to request that PnfsManager updates (remove) a file's label. Implement support for these new message in PnfsManager. The following curl command will be used to modify file's label. Result: user- or admin can mdify remove file labels. Target: master Require-book: yes Require-notes: yes Patch: https://rb.dcache.org/r/13079/ Acked-by: Lea Morschel, Tigran Mkrtchyan Commited
- Loading branch information
1 parent
84b45e6
commit 2fc1f8d
Showing
9 changed files
with
231 additions
and
1 deletion.
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
58 changes: 58 additions & 0 deletions
58
modules/dcache-vehicles/src/main/java/diskCacheV111/vehicles/PnfsRemoveLabelsMessage.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,58 @@ | ||
/* dCache - http://www.dcache.org/ | ||
* | ||
* Copyright (C) 2021 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 diskCacheV111.vehicles; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import diskCacheV111.util.PnfsId; | ||
|
||
/** | ||
* Remove a label of a file object. | ||
*/ | ||
public class PnfsRemoveLabelsMessage extends PnfsMessage | ||
{ | ||
private static final long serialVersionUID = -3390360138874265448L; | ||
|
||
private final Set<String> _labels = new HashSet<>(); | ||
|
||
public PnfsRemoveLabelsMessage(PnfsId id) | ||
{ | ||
super(id); | ||
} | ||
|
||
public PnfsRemoveLabelsMessage(String path) | ||
{ | ||
setPnfsPath(path); | ||
} | ||
|
||
public void addLabel(String label) | ||
{ | ||
_labels.add(label); | ||
} | ||
|
||
public Set<String> getLabels() | ||
{ | ||
return _labels; | ||
} | ||
|
||
public void clearLabel() | ||
{ | ||
_labels.clear(); | ||
} | ||
} |
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
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
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