Example usage for io.netty.channel ChannelHandlerContext fireChannelRead

List of usage examples for io.netty.channel ChannelHandlerContext fireChannelRead

Introduction

In this page you can find the example usage for io.netty.channel ChannelHandlerContext fireChannelRead.

Prototype

@Override
    ChannelHandlerContext fireChannelRead(Object msg);

Source Link

Usage

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnRm(ChannelHandlerContext ctx, RmRequest req) throws XrootdException {
    if (req.getPath().isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "no path specified");
    }//ww w . j a  va2 s  .co  m
    authorize(ctx, req, FilePerm.DELETE);
    ctx.fireChannelRead(req);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnRmDir(ChannelHandlerContext ctx, RmDirRequest req) throws XrootdException {
    if (req.getPath().isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "no path specified");
    }/*from  www.  j  a  va 2s.c o m*/

    authorize(ctx, req, FilePerm.DELETE);
    ctx.fireChannelRead(req);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnMkDir(ChannelHandlerContext ctx, MkDirRequest req) throws XrootdException {
    if (req.getPath().isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "no path specified");
    }//ww  w. j a va 2 s  .c o  m

    authorize(ctx, req, FilePerm.WRITE);
    ctx.fireChannelRead(req);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnMv(ChannelHandlerContext ctx, MvRequest req) throws XrootdException {
    String sourcePath = req.getSourcePath();
    if (sourcePath.isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "No source path specified");
    }/* www  . j  av a 2  s  .c o  m*/

    String targetPath = req.getTargetPath();
    if (targetPath.isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "No target path specified");
    }

    req.setSourcePath(authorize(ctx, req, FilePerm.DELETE, req.getSourcePath(), req.getSourceOpaque()));
    req.setTargetPath(authorize(ctx, req, FilePerm.WRITE, req.getTargetPath(), req.getTargetOpaque()));
    ctx.fireChannelRead(req);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnDirList(ChannelHandlerContext ctx, DirListRequest request) throws XrootdException {
    String path = request.getPath();
    if (path.isEmpty()) {
        throw new XrootdException(kXR_ArgMissing, "no source path specified");
    }/*from w  ww  .  java2  s. co  m*/
    authorize(ctx, request, FilePerm.READ);
    ctx.fireChannelRead(request);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnPrepare(ChannelHandlerContext ctx, PrepareRequest msg) {
    ctx.fireChannelRead(msg);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnLocate(ChannelHandlerContext ctx, LocateRequest msg) throws XrootdException {
    String path = msg.getPath();/*from  w w w. j a  v a  2s. c o m*/
    if (!path.startsWith("*")) {
        path = authorize(ctx, msg, FilePerm.READ, path, msg.getOpaque());
    } else if (!path.equals("*")) {
        path = authorize(ctx, msg, FilePerm.READ, path.substring(1), msg.getOpaque());
    }
    msg.setPath(path);
    ctx.fireChannelRead(msg);
    return null;
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnOpen(ChannelHandlerContext ctx, OpenRequest msg) throws XrootdException {
    authorize(ctx, msg, msg.getRequiredPermission());
    ctx.fireChannelRead(msg);
    return null;//  w w  w. jav  a  2  s.  c  o  m
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnRead(ChannelHandlerContext ctx, ReadRequest msg) throws XrootdException {
    ctx.fireChannelRead(msg);
    return null;//from w  w  w  .  j  ava  2 s  .c o  m
}

From source file:org.dcache.xrootd.core.XrootdAuthorizationHandler.java

License:Open Source License

@Override
protected Void doOnReadV(ChannelHandlerContext ctx, ReadVRequest msg) throws XrootdException {
    ctx.fireChannelRead(msg);
    return null;//  w  w  w .j ava 2s  .c om
}