ResMonProcessStatus.java 7.96 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.scene7.is.ipp.messages;

import com.scene7.is.ipp.messages.InMessage;
import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.IppBool;
import com.scene7.is.ipp.messages.IppDate;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.IppInt64;
import com.scene7.is.ipp.messages.IppMonStatusType;
import com.scene7.is.ipp.messages.IppString;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

public class ResMonProcessStatus
extends InMessage {
    static int MessageNumber = 5243649;
    private String processId_;
    private String description_;
    private int status_;
    private String statusDescription_;
    private long startTime_;
    private long exitTime_;
    private long virtualSize_;
    private long residentSize_;
    private int pid_;
    private String failedStart_;
    private boolean stopRequested_;

    public ResMonProcessStatus(int tag, String processId, String description, int status, String statusDescription, long startTime, long exitTime, long virtualSize, long residentSize, int pid, String failedStart, boolean stopRequested, int headClientId) {
        this.tag_ = tag;
        this.headerClientId_ = headClientId;
        this.processId_ = processId;
        this.description_ = description;
        this.status_ = status;
        this.statusDescription_ = statusDescription;
        this.startTime_ = startTime;
        this.exitTime_ = exitTime;
        this.virtualSize_ = virtualSize;
        this.residentSize_ = residentSize;
        this.pid_ = pid;
        this.failedStart_ = failedStart;
        this.stopRequested_ = stopRequested;
        int fixedLength = 64;
        Offset varPos = new Offset(fixedLength);
        try {
            varPos.val += processId.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
        try {
            varPos.val += description.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
        try {
            varPos.val += statusDescription.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
        try {
            varPos.val += failedStart.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
        this.messageLength_ = varPos.val;
        varPos.val = fixedLength;
        Offset pos = new Offset(0);
        this.headBuffer_ = new byte[32];
        this.bodyBuffer_ = new byte[this.messageLength_];
        Ipp.StuffHeader(this.headBuffer_, this.headerClientId_, tag, MessageNumber, this.messageLength_);
        IppString.Stuff(this.bodyBuffer_, pos, varPos, this.processId_);
        IppString.Stuff(this.bodyBuffer_, pos, varPos, this.description_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.status_);
        IppString.Stuff(this.bodyBuffer_, pos, varPos, this.statusDescription_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.startTime_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.exitTime_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.virtualSize_);
        IppInt64.Stuff(this.bodyBuffer_, pos, null, this.residentSize_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.pid_);
        IppString.Stuff(this.bodyBuffer_, pos, varPos, this.failedStart_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.stopRequested_);
        Ipp.StuffNullBytes(this.bodyBuffer_, pos, 4);
        Ipp.Assert(pos.val == fixedLength, "IppWatermarkType length");
    }

    public ResMonProcessStatus() {
    }

    public void process(int headClientId, int tg, byte[] bf) {
        this.headerClientId_ = headClientId;
        this.tag_ = tg;
        this.messageLength_ = bf.length;
        this.headBuffer_ = new byte[32];
        Ipp.StuffHeader(this.headBuffer_, this.headerClientId_, this.tag_, MessageNumber, this.messageLength_);
        this.bodyBuffer_ = bf;
        Offset pos = new Offset(0);
        this.processId_ = IppString.Unstuff(this.bodyBuffer_, pos);
        this.description_ = IppString.Unstuff(this.bodyBuffer_, pos);
        this.status_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.statusDescription_ = IppString.Unstuff(this.bodyBuffer_, pos);
        this.startTime_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.exitTime_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.virtualSize_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.residentSize_ = IppInt64.Unstuff(this.bodyBuffer_, pos);
        this.pid_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.failedStart_ = IppString.Unstuff(this.bodyBuffer_, pos);
        this.stopRequested_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        pos.val += 4;
    }

    public int classification() {
        return 1;
    }

    public int id() {
        return MessageNumber;
    }

    public void print(Writer tf, String heading) throws IOException {
        tf.write("\n");
        tf.write(heading);
        tf.write(": ResMonProcessStatus ");
        Ipp.PrintHex(tf, MessageNumber);
        tf.write("\n");
        tf.write("headClientId: " + this.headerClientId() + "\n");
        Ipp.PrintTag(tf, "tag: ", this.tag());
        tf.write("length: " + this.length());
        tf.write("\n");
        IppString.Print(tf, "processId: ", this.processId_);
        IppString.Print(tf, "description: ", this.description_);
        IppMonStatusType.Print(tf, "status: ", this.status_);
        IppString.Print(tf, "statusDescription: ", this.statusDescription_);
        IppDate.Print(tf, "startTime: ", this.startTime_);
        IppDate.Print(tf, "exitTime: ", this.exitTime_);
        IppInt64.Print(tf, "virtualSize: ", this.virtualSize_);
        IppInt64.Print(tf, "residentSize: ", this.residentSize_);
        IppInt.Print(tf, "pid: ", this.pid_);
        IppString.Print(tf, "failedStart: ", this.failedStart_);
        IppBool.Print(tf, "stopRequested: ", this.stopRequested_);
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("ResMonProcessStatus           ");
        buffer.append("[processId: " + String.valueOf(this.processId_) + "],");
        buffer.append("[description: " + String.valueOf(this.description_) + "],");
        buffer.append("[status: " + String.valueOf(this.status_) + "],");
        buffer.append("[statusDescription: " + String.valueOf(this.statusDescription_) + "],");
        buffer.append("[startTime: " + String.valueOf(this.startTime_) + "],");
        buffer.append("[exitTime: " + String.valueOf(this.exitTime_) + "],");
        buffer.append("[virtualSize: " + String.valueOf(this.virtualSize_) + "],");
        buffer.append("[residentSize: " + String.valueOf(this.residentSize_) + "],");
        buffer.append("[pid: " + String.valueOf(this.pid_) + "],");
        buffer.append("[failedStart: " + String.valueOf(this.failedStart_) + "],");
        buffer.append("[stopRequested: " + String.valueOf(this.stopRequested_) + "],");
        return buffer.toString();
    }

    public String processId() {
        return this.processId_;
    }

    public String description() {
        return this.description_;
    }

    public int status() {
        return this.status_;
    }

    public String statusDescription() {
        return this.statusDescription_;
    }

    public long startTime() {
        return this.startTime_;
    }

    public long exitTime() {
        return this.exitTime_;
    }

    public long virtualSize() {
        return this.virtualSize_;
    }

    public long residentSize() {
        return this.residentSize_;
    }

    public int pid() {
        return this.pid_;
    }

    public String failedStart() {
        return this.failedStart_;
    }

    public boolean stopRequested() {
        return this.stopRequested_;
    }
}