Package org.acplt.oncrpc

Examples of org.acplt.oncrpc.XdrAble


        call(PROCEDURE_TEST, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID);
    }

    public LookupResult lookup(final byte[] fileHandle, final String entryName)
        throws NFS2Exception, IOException {
        XdrAble nfsParameter = new NFSParameter() {
            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, NFS2Client.FILE_HANDLE_SIZE);
                xdr.xdrEncodeString(entryName);
            }
        };
        final LookupResult result = new LookupResult();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                result.setFileHandle(xdr.xdrDecodeOpaque(NFS2Client.FILE_HANDLE_SIZE));
                FileAttribute fileAttribute = new FileAttribute();
                xdrFileAttributeDecode(xdr, fileAttribute);
                result.setFileAttribute(fileAttribute);
View Full Code Here


        return result;
    }

    public ListDirectoryResult listDirectory(final byte[] fileHandle, final byte[] cookie,
            final int count) throws NFS2Exception, IOException {
        XdrAble nfsParameter = new NFSParameter() {
            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeOpaque(cookie, COOKIE_SIZE);
                xdr.xdrEncodeInt(count);
            }
        };
        final ListDirectoryResult result = new ListDirectoryResult();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                List<Entry> entryList = new ArrayList<Entry>();
                while (xdr.xdrDecodeBoolean()) {
                    int fileId = xdr.xdrDecodeInt();
                    String name = xdr.xdrDecodeString();
View Full Code Here

        throws NFS2Exception, IOException {
        if (count > MAX_DATA) {
            throw new IllegalArgumentException(
                    "The number of bytes read by the nfs client can not be greater than " + MAX_DATA);
        }
        XdrAble nfsParameter = new NFSParameter() {
            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeInt(offset);
                xdr.xdrEncodeInt(count);
                xdr.xdrEncodeInt(0);
            }
        };
        final ReadFileResult result = new ReadFileResult();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                FileAttribute fileAttribute = new FileAttribute();
                xdrFileAttributeDecode(xdr, fileAttribute);
                result.setFileAttribute(fileAttribute);
                // TODO Optimize this
View Full Code Here

            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(fileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeString(name);
            }
        };
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
            }
        };
        call(PROCEDURE_REMOVE_DIRECTORY, nfsParameter, nfsResult);
    }
View Full Code Here

            public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException {
                xdr.xdrEncodeOpaque(parentFileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeString(name);
            }
        };
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
            }
        };
        call(PROCEDURE_REMOVE_FILE, nfsParameter, nfsResult);
    }
View Full Code Here

                xdr.xdrEncodeOpaque(toParentFileHandle, FILE_HANDLE_SIZE);
                xdr.xdrEncodeString(toName);
            }
        };

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

                xdrEncodeTime(xdr, lastModified);
            }
        };

        final CreateDirectoryResult result = new CreateDirectoryResult();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                result.setFileHandle(xdr.xdrDecodeOpaque(NFS2Client.FILE_HANDLE_SIZE));
                FileAttribute fileAttribute = new FileAttribute();
                xdrFileAttributeDecode(xdr, fileAttribute);
                result.setFileAttribute(fileAttribute);
View Full Code Here

                xdrEncodeTime(xdr, lastModified);
            }
        };

        final CreateFileResult result = new CreateFileResult();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                result.setFileHandle(xdr.xdrDecodeOpaque(NFS2Client.FILE_HANDLE_SIZE));
                FileAttribute fileAttribute = new FileAttribute();
                xdrFileAttributeDecode(xdr, fileAttribute);
                result.setFileAttribute(fileAttribute);
View Full Code Here

                xdr.xdrEncodeOpaque(buffer, bufferIndex, bufferCount);
            }
        };

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

        call(PROCEDURE_WRITE_FILE, nfsParameter, nfsResult);
        return fileAttribute;
    }

    public FileAttribute getAttribute(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 FileAttribute fileAttribute = new FileAttribute();
        XdrAble nfsResult = new NFSResult() {
            public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException {
                xdrFileAttributeDecode(xdr, fileAttribute);
            }
        };
        call(PROCEDURE_GET_ATTRIBUTE, nfsParameter, nfsResult);
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.