Package org.acplt.oncrpc

Examples of org.acplt.oncrpc.XdrAble


     * @throws IOException
     */
    public FileAttribute setAttribute(final byte[] fileHandle, final int mode, final int uid,
            final int gid, final int size, final Time lastAccessed, final Time lastModified)
        throws NFS2Exception, IOException {
        XdrAble nfsParameter = new NFSParameter() {
            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeInt(mode);
                xdr.xdrEncodeInt(uid);
                xdr.xdrEncodeInt(gid);
                xdr.xdrEncodeInt(size);
                xdrEncodeTime(xdr, lastAccessed);
                xdrEncodeTime(xdr, lastModified);
            }
        };

        final FileAttribute fileAttribute = new FileAttribute();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                xdrFileAttributeDecode(xdr, fileAttribute);
            }
        };
        call(PROCEDURE_SET_ATTRIBUTE, nfsParameter, nfsResult);
View Full Code Here


    }

    public FileSystemAttribute getFileSystemAttribute(final byte[] fileHandle)
        throws NFS2Exception, IOException {

        XdrAble nfsParameter = new NFSParameter() {
            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, FILE_HANDLE_SIZE);
            }
        };

        final FileSystemAttribute fileSystemAttribute = new FileSystemAttribute();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                fileSystemAttribute.setTransferSize(xdrDecodeUnsignedInt(xdr));
                fileSystemAttribute.setBlockSize(xdrDecodeUnsignedInt(xdr));
                fileSystemAttribute.setBlockCount(xdrDecodeUnsignedInt(xdr));
                fileSystemAttribute.setFreeBlockCount(xdrDecodeUnsignedInt(xdr));
View Full Code Here

     * @throws IOException
     *                 if an I/O error occurs.
     * @throws MountException
     */
    public MountResult mount(final String path) throws IOException, MountException {
        XdrAble mountParameter = new Parameter() {
            public void xdrEncode(XdrEncodingStream xdrEncodingStream)
                throws OncRpcException, IOException {
                xdrEncodingStream.xdrEncodeString(path);
            }
        };

        final MountResult result = new MountResult();
        XdrAble mountResult = new Result() {
            public void xdrDecode(XdrDecodingStream xdrDecodingStream)
                throws OncRpcException, IOException {
                result.setFileHandle(readFileHandle(xdrDecodingStream));
            }
        };
View Full Code Here

    }

    public List<RemoteMountFileSystem> dump() throws IOException, MountException {
        final List<RemoteMountFileSystem> remoteMountFileSystemList =
                new ArrayList<RemoteMountFileSystem>();
        XdrAble dumpResult = new Result() {
            public void xdrDecode(XdrDecodingStream xdrDecodingStream)
                throws OncRpcException, IOException {
                while (xdrDecodingStream.xdrDecodeBoolean()) {
                    String host = xdrDecodingStream.xdrDecodeString();
                    String remoteDirectory = xdrDecodingStream.xdrDecodeString();
View Full Code Here

        return remoteMountFileSystemList;
    }

    public List<ExportEntry> export() throws IOException, MountException {
        final List<ExportEntry> exportEntryList = new ArrayList<ExportEntry>();
        XdrAble dumpResult = new Result() {
            public void xdrDecode(XdrDecodingStream xdrDecodingStream)
                throws OncRpcException, IOException {
                while (xdrDecodingStream.xdrDecodeBoolean()) {
                    String path = readPath(xdrDecodingStream);
                    List<String> groupList = readGroup(xdrDecodingStream);
View Full Code Here

        call(PROCEDURE_EXPORT, XdrVoid.XDR_VOID, dumpResult);
        return exportEntryList;
    }

    public void unmount(final String dirPath) throws IOException, MountException {
        XdrAble mountParameter = new Parameter() {
            public void xdrEncode(XdrEncodingStream xdrEncodingStream)
                throws OncRpcException, IOException {
                xdrEncodingStream.xdrEncodeString(dirPath);
            }
        };
View Full Code Here

TOP

Related Classes of org.acplt.oncrpc.XdrAble

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.