Esempio n. 1
0
            byte[] DDMWriteCallback.getRecordData(DDMCallbackEvent ddmce, int i)
            {
                String data = _reader.ReadLine();

                byte[] returnData = ddmce.getFile().getRecordDataBuffer();

                for (int idx = 0; idx < _format.getFieldCount(); idx++)
                {
                    DDMField fld = _format.getField(idx);

                    // SRCSEQ/SRCDAT have to be handled differently
                    if ("SRCSEQ".Equals(fld.getName(), StringComparison.InvariantCultureIgnoreCase))
                    {
                        fld.setString(String.Format("{0}", _sequence), returnData);
                        _sequence += 1;
                    }
                    else if ("SRCDAT".Equals(fld.getName(), StringComparison.InvariantCultureIgnoreCase))
                    {
                        fld.setString(String.Format("{0}", 0), returnData);
                    }
                    //if ("SRCDTA".Equals(fld.getName(), StringComparison.InvariantCultureIgnoreCase))
                    else
                    {
                        fld.setString(data, returnData);
                    }
                }
                return(returnData);
            }
Esempio n. 2
0
 bool[] DDMWriteCallback.getNullFieldValues(DDMCallbackEvent ddmce, int i)
 {
     bool[] nulls = new bool[_format.getFieldCount()];
     for (int idx = 0; idx < _format.getFieldCount(); idx++)
     {
         nulls[idx] = false;
     }
     return(nulls);
 }
        public virtual void newRecord(DDMCallbackEvent @event, DDMDataBuffer dataBuffer)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final byte[] data = dataBuffer.getRecordDataBuffer();
            sbyte[] data = dataBuffer.RecordDataBuffer;
            string  line = Conv.ebcdicByteArrayToString(data, 0, data.Length, charBuffer_);

            if (skip_ == 1)
            {
                int index = line.IndexOf(":", StringComparison.Ordinal);
                if (index > 0)
                {
                    int end = line.IndexOf("System name", index, StringComparison.Ordinal);
                    if (end > index)
                    {
                        elapsedTime_ = line.Substring(index + 1, (end - index) - (index + 1)).Trim();
                    }
                }
                ++skip_;
            }
            else if (skip_ < 4)
            {
                ++skip_;
            }
            else if (!theEnd_)
            {
                if (line.IndexOf("E N D  O F  L I S T I N G", StringComparison.Ordinal) >= 0)
                {
                    theEnd_ = true;
                }
                else
                {
                    StringTokenizer st               = new StringTokenizer(line);
                    string          unit             = nextToken(st);
                    string          type             = nextToken(st);
                    string          sizeMB           = nextToken(st);
                    string          percentUsed      = nextToken(st);
                    string          ioRequests       = nextToken(st);
                    string          requestSizeKB    = nextToken(st);
                    string          readRequests     = nextToken(st);
                    string          writeRequests    = nextToken(st);
                    string          readKB           = nextToken(st);
                    string          writeKB          = nextToken(st);
                    string          percentBusy      = nextToken(st);
                    string          asp              = nextToken(st);
                    string          protectionType   = nextToken(st);
                    string          protectionStatus = nextToken(st);
                    string          compression      = nextToken(st);
                    DiskStatus      ds               = new DiskStatus(unit, type, sizeMB, percentUsed, ioRequests, requestSizeKB, readRequests, writeRequests, readKB, writeKB, percentBusy, asp, protectionType, protectionStatus, compression);
                    statuses_.Add(ds);
                }
            }
        }
Esempio n. 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void newRecord(DDMCallbackEvent event, DDMDataBuffer dataBuffer) throws IOException
        public void newRecord(DDMCallbackEvent @event, DDMDataBuffer dataBuffer)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final byte[] data = dataBuffer.getRecordDataBuffer();
            sbyte[]  data            = dataBuffer.RecordDataBuffer;
            string   userName        = rf_.getField("UPUPRF").getString(data);
            string   userClass       = rf_.getField("UPUSCL").getString(data);
            string   passwordExpired = rf_.getField("UPPWEX").getString(data);
            long     maxStorage      = rf_.getField("UPMXST").getLong(data);
            long     storageUsed     = rf_.getField("UPMXSU").getLong(data);
            string   description     = rf_.getField("UPTEXT").getString(data);
            string   locked          = rf_.getField("UPUPLK").getString(data);
            string   damaged         = rf_.getField("UPUPDM").getString(data);
            string   status          = rf_.getField("UPSTAT").getString(data);
            long     uid             = rf_.getField("UPUID").getLong(data);
            long     gid             = rf_.getField("UPGID").getLong(data);
            UserInfo ui = new UserInfo(userName, userClass, passwordExpired, maxStorage, storageUsed, description, locked, damaged, status, uid, gid);

            //    users_.addElement(ui);
            uiListener_.newUserInfo(ui);
        }
Esempio n. 5
0
        internal DDMFile(string library, string file, string member, sbyte[] recordFormatName, sbyte[] dclName, int openType, int recLength, int recInc, int batchSize, int nullFieldOffset, int numBuffers)
        {
            library_                = library;
            file_                   = file;
            member_                 = member;
            recordFormatName_       = recordFormatName;
            dclNam_                 = dclName;
            openType_               = openType;
            recordLength_           = recLength;
            recordIncrement_        = recInc;
            batchSize_              = batchSize;
            nullFieldByteMapOffset_ = nullFieldOffset;
            eventBuffer_            = new DDMCallbackEvent(this);

            numBuffers = numBuffers <= 0 ? 1 : numBuffers;

            buffers_ = new DDMDataBuffer[numBuffers];
            for (int i = 0; i < numBuffers; ++i)
            {
                buffers_[i] = new DDMDataBuffer(recordLength_, recordIncrement_ - recordLength_ + 2, recordIncrement_ - nullFieldOffset);
            }
        }
Esempio n. 6
0
 public virtual void endOfFile(DDMCallbackEvent @event)
 {
     done_ = true;
 }
Esempio n. 7
0
 public virtual void recordNotFound(DDMCallbackEvent @event)
 {
     done_ = true;
 }
Esempio n. 8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void newRecord(DDMCallbackEvent event, DDMDataBuffer dataBuffer) throws IOException
        public virtual void newRecord(DDMCallbackEvent @event, DDMDataBuffer dataBuffer)
        {
            newRecord(dataBuffer.RecordNumber, dataBuffer.RecordDataBuffer, dataBuffer.NullFieldValues);
        }
Esempio n. 9
0
 int DDMWriteCallback.getRecordDataOffset(DDMCallbackEvent ddmce, int i)
 {
     return(_format.getLength());
 }
Esempio n. 10
0
 int DDMWriteCallback.getNumberOfRecords(DDMCallbackEvent ddmce)
 {
     return(_numLines);
 }