ResServerShutdown.java 3.3 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.IppInt;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.Writer;

public class ResServerShutdown
extends InMessage {
    static int MessageNumber = 2097955;
    private int operation_;
    private int delaySeconds_;
    private int requestorId_;

    public ResServerShutdown(int tag, int operation, int delaySeconds, int requestorId, int headClientId) {
        int fixedLength;
        this.tag_ = tag;
        this.headerClientId_ = headClientId;
        this.operation_ = operation;
        this.delaySeconds_ = delaySeconds;
        this.requestorId_ = requestorId;
        this.messageLength_ = fixedLength = 12;
        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_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.operation_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.delaySeconds_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.requestorId_);
        Ipp.Assert(pos.val == fixedLength, "IppWatermarkType length");
    }

    public ResServerShutdown() {
    }

    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.operation_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.delaySeconds_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.requestorId_ = IppInt.Unstuff(this.bodyBuffer_, pos);
    }

    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(": ResServerShutdown ");
        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");
        IppInt.Print(tf, "operation: ", this.operation_);
        IppInt.Print(tf, "delaySeconds: ", this.delaySeconds_);
        IppInt.Print(tf, "requestorId: ", this.requestorId_);
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("ResServerShutdown             ");
        buffer.append("[operation: " + String.valueOf(this.operation_) + "],");
        buffer.append("[delaySeconds: " + String.valueOf(this.delaySeconds_) + "],");
        buffer.append("[requestorId: " + String.valueOf(this.requestorId_) + "],");
        return buffer.toString();
    }

    public int operation() {
        return this.operation_;
    }

    public int delaySeconds() {
        return this.delaySeconds_;
    }

    public int requestorId() {
        return this.requestorId_;
    }
}