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

public class ResLicense
extends InMessage {
    static int MessageNumber = 2097921;
    private boolean isValid_;
    private int encodingVersionMajor_;
    private int encodingVersionMinor_;
    private int sequenceNumber_;
    private int numImages_;
    private int numMegabytes_;
    private int numProcessors_;
    private int expirationMonth_;
    private boolean enableManager_;
    private boolean enableEditor_;
    private boolean enableReviewer_;
    private boolean enableCMS_;
    private int expirationDay_;

    public ResLicense(int tag, boolean isValid, int encodingVersionMajor, int encodingVersionMinor, int sequenceNumber, int numImages, int numMegabytes, int numProcessors, int expirationMonth, boolean enableManager, boolean enableEditor, boolean enableReviewer, boolean enableCMS, int expirationDay, int headClientId) {
        int fixedLength;
        this.tag_ = tag;
        this.headerClientId_ = headClientId;
        this.isValid_ = isValid;
        this.encodingVersionMajor_ = encodingVersionMajor;
        this.encodingVersionMinor_ = encodingVersionMinor;
        this.sequenceNumber_ = sequenceNumber;
        this.numImages_ = numImages;
        this.numMegabytes_ = numMegabytes;
        this.numProcessors_ = numProcessors;
        this.expirationMonth_ = expirationMonth;
        this.enableManager_ = enableManager;
        this.enableEditor_ = enableEditor;
        this.enableReviewer_ = enableReviewer;
        this.enableCMS_ = enableCMS;
        this.expirationDay_ = expirationDay;
        this.messageLength_ = fixedLength = 52;
        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_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.isValid_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.encodingVersionMajor_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.encodingVersionMinor_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.sequenceNumber_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.numImages_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.numMegabytes_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.numProcessors_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.expirationMonth_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.enableManager_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.enableEditor_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.enableReviewer_);
        IppBool.Stuff(this.bodyBuffer_, pos, null, this.enableCMS_);
        IppInt.Stuff(this.bodyBuffer_, pos, null, this.expirationDay_);
        Ipp.Assert(pos.val == fixedLength, "IppWatermarkType length");
    }

    public ResLicense() {
    }

    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.isValid_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        this.encodingVersionMajor_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.encodingVersionMinor_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.sequenceNumber_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.numImages_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.numMegabytes_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.numProcessors_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.expirationMonth_ = IppInt.Unstuff(this.bodyBuffer_, pos);
        this.enableManager_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        this.enableEditor_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        this.enableReviewer_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        this.enableCMS_ = IppBool.Unstuff(this.bodyBuffer_, pos);
        this.expirationDay_ = 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(": ResLicense ");
        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");
        IppBool.Print(tf, "isValid: ", this.isValid_);
        IppInt.Print(tf, "encodingVersionMajor: ", this.encodingVersionMajor_);
        IppInt.Print(tf, "encodingVersionMinor: ", this.encodingVersionMinor_);
        IppInt.Print(tf, "sequenceNumber: ", this.sequenceNumber_);
        IppInt.Print(tf, "numImages: ", this.numImages_);
        IppInt.Print(tf, "numMegabytes: ", this.numMegabytes_);
        IppInt.Print(tf, "numProcessors: ", this.numProcessors_);
        IppInt.Print(tf, "expirationMonth: ", this.expirationMonth_);
        IppBool.Print(tf, "enableManager: ", this.enableManager_);
        IppBool.Print(tf, "enableEditor: ", this.enableEditor_);
        IppBool.Print(tf, "enableReviewer: ", this.enableReviewer_);
        IppBool.Print(tf, "enableCMS: ", this.enableCMS_);
        IppInt.Print(tf, "expirationDay: ", this.expirationDay_);
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("ResLicense                    ");
        buffer.append("[isValid: " + String.valueOf(this.isValid_) + "],");
        buffer.append("[encodingVersionMajor: " + String.valueOf(this.encodingVersionMajor_) + "],");
        buffer.append("[encodingVersionMinor: " + String.valueOf(this.encodingVersionMinor_) + "],");
        buffer.append("[sequenceNumber: " + String.valueOf(this.sequenceNumber_) + "],");
        buffer.append("[numImages: " + String.valueOf(this.numImages_) + "],");
        buffer.append("[numMegabytes: " + String.valueOf(this.numMegabytes_) + "],");
        buffer.append("[numProcessors: " + String.valueOf(this.numProcessors_) + "],");
        buffer.append("[expirationMonth: " + String.valueOf(this.expirationMonth_) + "],");
        buffer.append("[enableManager: " + String.valueOf(this.enableManager_) + "],");
        buffer.append("[enableEditor: " + String.valueOf(this.enableEditor_) + "],");
        buffer.append("[enableReviewer: " + String.valueOf(this.enableReviewer_) + "],");
        buffer.append("[enableCMS: " + String.valueOf(this.enableCMS_) + "],");
        buffer.append("[expirationDay: " + String.valueOf(this.expirationDay_) + "],");
        return buffer.toString();
    }

    public boolean isValid() {
        return this.isValid_;
    }

    public int encodingVersionMajor() {
        return this.encodingVersionMajor_;
    }

    public int encodingVersionMinor() {
        return this.encodingVersionMinor_;
    }

    public int sequenceNumber() {
        return this.sequenceNumber_;
    }

    public int numImages() {
        return this.numImages_;
    }

    public int numMegabytes() {
        return this.numMegabytes_;
    }

    public int numProcessors() {
        return this.numProcessors_;
    }

    public int expirationMonth() {
        return this.expirationMonth_;
    }

    public boolean enableManager() {
        return this.enableManager_;
    }

    public boolean enableEditor() {
        return this.enableEditor_;
    }

    public boolean enableReviewer() {
        return this.enableReviewer_;
    }

    public boolean enableCMS() {
        return this.enableCMS_;
    }

    public int expirationDay() {
        return this.expirationDay_;
    }
}