"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/dcache-frontend/src/main/java/org/dcache/restful/events/streams/inotify/InotifySelector.java" between
dcache-6.0.14-src.tar.gz and dcache-6.0.15-src.tar.gz

About: dCache provides a system for storing and retrieving huge amounts of data, distributed among a large number of heterogenous server nodes, under a single virtual filesystem tree with a variety of standard access methods. Free usage only for academic and non-profit organizations. Fature release. Source code.

InotifySelector.java  (dcache-6.0.14-src):InotifySelector.java  (dcache-6.0.15-src)
skipping to change at line 34 skipping to change at line 34
import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonSetter;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import diskCacheV111.util.FsPath; import diskCacheV111.util.FsPath;
import org.dcache.restful.events.spi.SelectionResult; import org.dcache.restful.events.spi.SelectionResult;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
/** /**
* The desired selection of events, as supplied by the client using a JSON * The desired selection of events, as supplied by the client using a JSON
* representation. This is equivalent to the inotify_add_watch(2) arguments. * representation. This is equivalent to the inotify_add_watch(2) arguments.
*/ */
@JsonInclude(value = JsonInclude.Include.NON_NULL) @JsonInclude(value = JsonInclude.Include.NON_NULL)
class InotifySelector class InotifySelector
{ {
public static final EnumSet<AddWatchFlag> UNSUPPORTED_FLAGS = EnumSet.of( public static final EnumSet<AddWatchFlag> UNSUPPORTED_FLAGS = EnumSet.of(
AddWatchFlag.IN_DONT_FOLLOW, AddWatchFlag.IN_EXCL_UNLINK); AddWatchFlag.IN_DONT_FOLLOW, AddWatchFlag.IN_EXCL_UNLINK);
@JsonIgnore @JsonIgnore
private Set<AddWatchFlag> flags = AddWatchFlag.ALL_EVENTS; private Set<AddWatchFlag> flags = AddWatchFlag.ALL_EVENTS;
private Set<AddWatchFlag> suppliedFlags; private Set<AddWatchFlag> suppliedFlags;
private String path; private String path;
@JsonIgnore @JsonIgnore
private FsPath fsPath; private FsPath fsPath;
/**
* Specify the client-supplied path. This may differ from the dCache
* path if the door has a non-default root path, or the user issuing the
* subscription request has a non-default root path.
*/
public void setPath(String path) public void setPath(String path)
{ {
this.path = path; this.path = requireNonNull(path);
fsPath = FsPath.create(path); }
/**
* Specify the dCache (internal) path. This may differ from the
* client-supplied path if the door has a non-default root path, or the
* user issuing the subscription request has a non-default root path.
*/
public void setFsPath(FsPath path)
{
fsPath = requireNonNull(path);
} }
@JsonSetter("flags") @JsonSetter("flags")
public void setSuppliedFlags(EnumSet<AddWatchFlag> suppliedFlags) public void setSuppliedFlags(EnumSet<AddWatchFlag> suppliedFlags)
{ {
this.suppliedFlags = EnumSet.copyOf(suppliedFlags); this.suppliedFlags = EnumSet.copyOf(suppliedFlags);
flags = EnumSet.noneOf(AddWatchFlag.class); flags = EnumSet.noneOf(AddWatchFlag.class);
for (AddWatchFlag suppliedFlag : suppliedFlags) { for (AddWatchFlag suppliedFlag : suppliedFlags) {
switch (suppliedFlag) { switch (suppliedFlag) {
case IN_ALL_EVENTS: case IN_ALL_EVENTS:
skipping to change at line 94 skipping to change at line 111
return suppliedFlags; return suppliedFlags;
} }
public Set<AddWatchFlag> flags() public Set<AddWatchFlag> flags()
{ {
return flags; return flags;
} }
public String getPath() public String getPath()
{ {
checkState(path != null, "path was not specified");
return path; return path;
} }
public FsPath getFsPath() public FsPath getFsPath()
{ {
checkState(fsPath != null, "fsPath was not specified");
return fsPath; return fsPath;
} }
public Optional<SelectionResult> validationError() public Optional<SelectionResult> validationError()
{ {
if (path == null) { if (path == null) {
return Optional.of(SelectionResult.badSelector("Missing path")); return Optional.of(SelectionResult.badSelector("Missing path"));
} }
EnumSet<AddWatchFlag> unsupported = EnumSet.copyOf(flags); EnumSet<AddWatchFlag> unsupported = EnumSet.copyOf(flags);
 End of changes. 5 change blocks. 
2 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)