Example #1
0
        /// <exception cref="System.IO.IOException"/>
        public static Org.Apache.Hadoop.Nfs.Nfs3.Request.MKNOD3Request Deserialize(XDR xdr
                                                                                   )
        {
            FileHandle handle  = ReadHandle(xdr);
            string     name    = xdr.ReadString();
            int        type    = xdr.ReadInt();
            SetAttr3   objAttr = new SetAttr3();

            Nfs3FileAttributes.Specdata3 spec = null;
            if (type == NfsFileType.Nfschr.ToValue() || type == NfsFileType.Nfsblk.ToValue())
            {
                objAttr.Deserialize(xdr);
                spec = new Nfs3FileAttributes.Specdata3(xdr.ReadInt(), xdr.ReadInt());
            }
            else
            {
                if (type == NfsFileType.Nfssock.ToValue() || type == NfsFileType.Nfsfifo.ToValue(
                        ))
                {
                    objAttr.Deserialize(xdr);
                }
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Request.MKNOD3Request(handle, name, type, objAttr
                                                                        , spec));
        }
Example #2
0
        /// <exception cref="System.IO.IOException"/>
        public static Org.Apache.Hadoop.Nfs.Nfs3.Request.CREATE3Request Deserialize(XDR xdr
                                                                                    )
        {
            FileHandle handle  = ReadHandle(xdr);
            string     name    = xdr.ReadString();
            int        mode    = xdr.ReadInt();
            SetAttr3   objAttr = new SetAttr3();
            long       verf    = 0;

            if ((mode == Nfs3Constant.CreateUnchecked) || (mode == Nfs3Constant.CreateGuarded
                                                           ))
            {
                objAttr.Deserialize(xdr);
            }
            else
            {
                if (mode == Nfs3Constant.CreateExclusive)
                {
                    verf = xdr.ReadHyper();
                }
                else
                {
                    throw new IOException("Wrong create mode:" + mode);
                }
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Request.CREATE3Request(handle, name, mode,
                                                                         objAttr, verf));
        }
Example #3
0
 public SYMLINK3Request(FileHandle handle, string name, SetAttr3 symAttr, string symData
                        )
     : base(handle)
 {
     this.name    = name;
     this.symAttr = symAttr;
     this.symData = symData;
 }
Example #4
0
 public SETATTR3Request(FileHandle handle, SetAttr3 attr, bool check, NfsTime ctime
                        )
     : base(handle)
 {
     this.attr  = attr;
     this.check = check;
     this.ctime = ctime;
 }
Example #5
0
 public MKNOD3Request(FileHandle handle, string name, int type, SetAttr3 objAttr,
                      Nfs3FileAttributes.Specdata3 spec)
     : base(handle)
 {
     this.name    = name;
     this.type    = type;
     this.objAttr = objAttr;
     this.spec    = spec;
 }
Example #6
0
 public CREATE3Request(FileHandle handle, string name, int mode, SetAttr3 objAttr,
                       long verf)
     : base(handle)
 {
     this.name    = name;
     this.mode    = mode;
     this.objAttr = objAttr;
     this.verf    = verf;
 }
Example #7
0
 /// <exception cref="System.IO.IOException"/>
 public static Org.Apache.Hadoop.Nfs.Nfs3.Request.MKDIR3Request Deserialize(XDR xdr
     )
 {
     FileHandle handle = ReadHandle(xdr);
     string name = xdr.ReadString();
     SetAttr3 objAttr = new SetAttr3();
     objAttr.Deserialize(xdr);
     return new Org.Apache.Hadoop.Nfs.Nfs3.Request.MKDIR3Request(handle, name, objAttr
         );
 }
Example #8
0
        // The name of the link
        // It contains the target
        /// <exception cref="System.IO.IOException"/>
        public static Org.Apache.Hadoop.Nfs.Nfs3.Request.SYMLINK3Request Deserialize(XDR
                                                                                     xdr)
        {
            FileHandle handle  = ReadHandle(xdr);
            string     name    = xdr.ReadString();
            SetAttr3   symAttr = new SetAttr3();

            symAttr.Deserialize(xdr);
            string symData = xdr.ReadString();

            return(new Org.Apache.Hadoop.Nfs.Nfs3.Request.SYMLINK3Request(handle, name, symAttr
                                                                          , symData));
        }
Example #9
0
        /* A client may request that the server check that the object is in an
         * expected state before performing the SETATTR operation. If guard.check is
         * TRUE, the server must compare the value of ctime to the current ctime of
         * the object. If the values are different, the server must preserve the
         * object attributes and must return a status of NFS3ERR_NOT_SYNC. If check is
         * FALSE, the server will not perform this check.
         */
        /// <exception cref="System.IO.IOException"/>
        public static Org.Apache.Hadoop.Nfs.Nfs3.Request.SETATTR3Request Deserialize(XDR
                                                                                     xdr)
        {
            FileHandle handle = ReadHandle(xdr);
            SetAttr3   attr   = new SetAttr3();

            attr.Deserialize(xdr);
            bool    check = xdr.ReadBoolean();
            NfsTime ctime;

            if (check)
            {
                ctime = NfsTime.Deserialize(xdr);
            }
            else
            {
                ctime = null;
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Request.SETATTR3Request(handle, attr, check
                                                                          , ctime));
        }
Example #10
0
 public MKDIR3Request(FileHandle handle, string name, SetAttr3 objAttr)
     : base(handle)
 {
     this.name = name;
     this.objAttr = objAttr;
 }