All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ccsds.sle.transfer.service.cltu.structures.CltuNotification Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
/**
 * This class file was automatically generated by jASN1 v1.11.2 (http://www.beanit.com)
 */

package ccsds.sle.transfer.service.cltu.structures;

import java.io.IOException;
import java.io.EOFException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
import com.beanit.jasn1.ber.*;
import com.beanit.jasn1.ber.types.*;
import com.beanit.jasn1.ber.types.string.*;

import ccsds.sle.transfer.service.common.pdus.ReportingCycle;
import ccsds.sle.transfer.service.common.types.ConditionalTime;
import ccsds.sle.transfer.service.common.types.DeliveryMode;
import ccsds.sle.transfer.service.common.types.Diagnostics;
import ccsds.sle.transfer.service.common.types.Duration;
import ccsds.sle.transfer.service.common.types.ForwardDuStatus;
import ccsds.sle.transfer.service.common.types.IntPosLong;
import ccsds.sle.transfer.service.common.types.IntPosShort;
import ccsds.sle.transfer.service.common.types.IntUnsignedLong;
import ccsds.sle.transfer.service.common.types.IntUnsignedShort;
import ccsds.sle.transfer.service.common.types.ParameterName;
import ccsds.sle.transfer.service.common.types.SpaceLinkDataUnit;
import ccsds.sle.transfer.service.common.types.Time;

public class CltuNotification implements BerType, Serializable {

	private static final long serialVersionUID = 1L;

	public byte[] code = null;
	private BerNull cltuRadiated = null;
	private BerNull slduExpired = null;
	private BerNull productionInterrupted = null;
	private BerNull productionHalted = null;
	private BerNull productionOperational = null;
	private BerNull bufferEmpty = null;
	private EventInvocationId actionListCompleted = null;
	private EventInvocationId actionListNotCompleted = null;
	private EventInvocationId eventConditionEvFalse = null;
	
	public CltuNotification() {
	}

	public CltuNotification(byte[] code) {
		this.code = code;
	}

	public void setCltuRadiated(BerNull cltuRadiated) {
		this.cltuRadiated = cltuRadiated;
	}

	public BerNull getCltuRadiated() {
		return cltuRadiated;
	}

	public void setSlduExpired(BerNull slduExpired) {
		this.slduExpired = slduExpired;
	}

	public BerNull getSlduExpired() {
		return slduExpired;
	}

	public void setProductionInterrupted(BerNull productionInterrupted) {
		this.productionInterrupted = productionInterrupted;
	}

	public BerNull getProductionInterrupted() {
		return productionInterrupted;
	}

	public void setProductionHalted(BerNull productionHalted) {
		this.productionHalted = productionHalted;
	}

	public BerNull getProductionHalted() {
		return productionHalted;
	}

	public void setProductionOperational(BerNull productionOperational) {
		this.productionOperational = productionOperational;
	}

	public BerNull getProductionOperational() {
		return productionOperational;
	}

	public void setBufferEmpty(BerNull bufferEmpty) {
		this.bufferEmpty = bufferEmpty;
	}

	public BerNull getBufferEmpty() {
		return bufferEmpty;
	}

	public void setActionListCompleted(EventInvocationId actionListCompleted) {
		this.actionListCompleted = actionListCompleted;
	}

	public EventInvocationId getActionListCompleted() {
		return actionListCompleted;
	}

	public void setActionListNotCompleted(EventInvocationId actionListNotCompleted) {
		this.actionListNotCompleted = actionListNotCompleted;
	}

	public EventInvocationId getActionListNotCompleted() {
		return actionListNotCompleted;
	}

	public void setEventConditionEvFalse(EventInvocationId eventConditionEvFalse) {
		this.eventConditionEvFalse = eventConditionEvFalse;
	}

	public EventInvocationId getEventConditionEvFalse() {
		return eventConditionEvFalse;
	}

	public int encode(OutputStream reverseOS) throws IOException {

		if (code != null) {
			for (int i = code.length - 1; i >= 0; i--) {
				reverseOS.write(code[i]);
			}
			return code.length;
		}

		int codeLength = 0;
		if (eventConditionEvFalse != null) {
			codeLength += eventConditionEvFalse.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 8
			reverseOS.write(0x88);
			codeLength += 1;
			return codeLength;
		}
		
		if (actionListNotCompleted != null) {
			codeLength += actionListNotCompleted.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 7
			reverseOS.write(0x87);
			codeLength += 1;
			return codeLength;
		}
		
		if (actionListCompleted != null) {
			codeLength += actionListCompleted.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 6
			reverseOS.write(0x86);
			codeLength += 1;
			return codeLength;
		}
		
		if (bufferEmpty != null) {
			codeLength += bufferEmpty.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 5
			reverseOS.write(0x85);
			codeLength += 1;
			return codeLength;
		}
		
		if (productionOperational != null) {
			codeLength += productionOperational.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 4
			reverseOS.write(0x84);
			codeLength += 1;
			return codeLength;
		}
		
		if (productionHalted != null) {
			codeLength += productionHalted.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 3
			reverseOS.write(0x83);
			codeLength += 1;
			return codeLength;
		}
		
		if (productionInterrupted != null) {
			codeLength += productionInterrupted.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 2
			reverseOS.write(0x82);
			codeLength += 1;
			return codeLength;
		}
		
		if (slduExpired != null) {
			codeLength += slduExpired.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 1
			reverseOS.write(0x81);
			codeLength += 1;
			return codeLength;
		}
		
		if (cltuRadiated != null) {
			codeLength += cltuRadiated.encode(reverseOS, false);
			// write tag: CONTEXT_CLASS, PRIMITIVE, 0
			reverseOS.write(0x80);
			codeLength += 1;
			return codeLength;
		}
		
		throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
	}

	public int decode(InputStream is) throws IOException {
		return decode(is, null);
	}

	public int decode(InputStream is, BerTag berTag) throws IOException {

		int codeLength = 0;
		BerTag passedTag = berTag;

		if (berTag == null) {
			berTag = new BerTag();
			codeLength += berTag.decode(is);
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
			cltuRadiated = new BerNull();
			codeLength += cltuRadiated.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
			slduExpired = new BerNull();
			codeLength += slduExpired.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
			productionInterrupted = new BerNull();
			codeLength += productionInterrupted.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
			productionHalted = new BerNull();
			codeLength += productionHalted.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
			productionOperational = new BerNull();
			codeLength += productionOperational.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
			bufferEmpty = new BerNull();
			codeLength += bufferEmpty.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) {
			actionListCompleted = new EventInvocationId();
			codeLength += actionListCompleted.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) {
			actionListNotCompleted = new EventInvocationId();
			codeLength += actionListNotCompleted.decode(is, false);
			return codeLength;
		}

		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) {
			eventConditionEvFalse = new EventInvocationId();
			codeLength += eventConditionEvFalse.decode(is, false);
			return codeLength;
		}

		if (passedTag != null) {
			return 0;
		}

		throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
	}

	public void encodeAndSave(int encodingSizeGuess) throws IOException {
		ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
		encode(reverseOS);
		code = reverseOS.getArray();
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		appendAsString(sb, 0);
		return sb.toString();
	}

	public void appendAsString(StringBuilder sb, int indentLevel) {

		if (cltuRadiated != null) {
			sb.append("cltuRadiated: ").append(cltuRadiated);
			return;
		}

		if (slduExpired != null) {
			sb.append("slduExpired: ").append(slduExpired);
			return;
		}

		if (productionInterrupted != null) {
			sb.append("productionInterrupted: ").append(productionInterrupted);
			return;
		}

		if (productionHalted != null) {
			sb.append("productionHalted: ").append(productionHalted);
			return;
		}

		if (productionOperational != null) {
			sb.append("productionOperational: ").append(productionOperational);
			return;
		}

		if (bufferEmpty != null) {
			sb.append("bufferEmpty: ").append(bufferEmpty);
			return;
		}

		if (actionListCompleted != null) {
			sb.append("actionListCompleted: ").append(actionListCompleted);
			return;
		}

		if (actionListNotCompleted != null) {
			sb.append("actionListNotCompleted: ").append(actionListNotCompleted);
			return;
		}

		if (eventConditionEvFalse != null) {
			sb.append("eventConditionEvFalse: ").append(eventConditionEvFalse);
			return;
		}

		sb.append("");
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy