- started to implement client side get file directory service
parent
c9d8278029
commit
bdb5db7aa0
@ -1,137 +1,144 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class AccessResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private DataAccessError failure = null;
|
||||
private Data success = null;
|
||||
|
||||
public AccessResult() {
|
||||
}
|
||||
|
||||
public AccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFailure(DataAccessError failure) {
|
||||
this.failure = failure;
|
||||
}
|
||||
|
||||
public DataAccessError getFailure() {
|
||||
return failure;
|
||||
}
|
||||
|
||||
public void setSuccess(Data success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public Data getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (success != null) {
|
||||
codeLength += success.encode(os);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (failure != null) {
|
||||
codeLength += failure.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
failure = new DataAccessError();
|
||||
codeLength += failure.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
success = new Data();
|
||||
int choiceDecodeLength = success.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
success = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (failure != null) {
|
||||
sb.append("failure: ").append(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (success != null) {
|
||||
sb.append("success: ");
|
||||
success.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private DataAccessError failure = null;
|
||||
private Data success = null;
|
||||
|
||||
public AccessResult() {
|
||||
}
|
||||
|
||||
public AccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFailure(DataAccessError failure) {
|
||||
this.failure = failure;
|
||||
}
|
||||
|
||||
public DataAccessError getFailure() {
|
||||
return failure;
|
||||
}
|
||||
|
||||
public void setSuccess(Data success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public Data getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (success != null) {
|
||||
codeLength += success.encode(os);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (failure != null) {
|
||||
codeLength += failure.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
failure = new DataAccessError();
|
||||
codeLength += failure.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
success = new Data();
|
||||
int choiceDecodeLength = success.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
success = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (failure != null) {
|
||||
sb.append("failure: ").append(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (success != null) {
|
||||
sb.append("success: ");
|
||||
success.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,241 +1,242 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class AlternateAccess implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class CHOICE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private AlternateAccessSelection unnamed = null;
|
||||
|
||||
public CHOICE() {
|
||||
}
|
||||
|
||||
public CHOICE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public void setUnnamed(AlternateAccessSelection unnamed) {
|
||||
this.unnamed = unnamed;
|
||||
}
|
||||
public static class CHOICE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AlternateAccessSelection getUnnamed() {
|
||||
return unnamed;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (unnamed != null) {
|
||||
codeLength += unnamed.encode(os);
|
||||
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);
|
||||
}
|
||||
|
||||
unnamed = new AlternateAccessSelection();
|
||||
int choiceDecodeLength = unnamed.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
unnamed = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (unnamed != null) {
|
||||
sb.append("unnamed: ");
|
||||
unnamed.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<CHOICE> seqOf = null;
|
||||
|
||||
public AlternateAccess() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public AlternateAccess(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<CHOICE> getCHOICE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
CHOICE element = new CHOICE();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<CHOICE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
public byte[] code = null;
|
||||
private AlternateAccessSelection unnamed = null;
|
||||
|
||||
public CHOICE() {
|
||||
}
|
||||
|
||||
public CHOICE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setUnnamed(AlternateAccessSelection unnamed) {
|
||||
this.unnamed = unnamed;
|
||||
}
|
||||
|
||||
public AlternateAccessSelection getUnnamed() {
|
||||
return unnamed;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (unnamed != null) {
|
||||
codeLength += unnamed.encode(os);
|
||||
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);
|
||||
}
|
||||
|
||||
unnamed = new AlternateAccessSelection();
|
||||
int choiceDecodeLength = unnamed.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
unnamed = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (unnamed != null) {
|
||||
sb.append("unnamed: ");
|
||||
unnamed.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<CHOICE> seqOf = null;
|
||||
|
||||
public AlternateAccess() {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
|
||||
public AlternateAccess(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<CHOICE> getCHOICE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
CHOICE element = new CHOICE();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<CHOICE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class BasicIdentifier extends BerVisibleString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BasicIdentifier() {
|
||||
}
|
||||
public BasicIdentifier() {
|
||||
}
|
||||
|
||||
public BasicIdentifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public BasicIdentifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerNull;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class ConcludeRequestPDU extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ConcludeRequestPDU() {
|
||||
}
|
||||
public ConcludeRequestPDU() {
|
||||
}
|
||||
|
||||
public ConcludeRequestPDU(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public ConcludeRequestPDU(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,203 +1,209 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class ConfirmedErrorPDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private Unsigned32 modifierPosition = null;
|
||||
private ServiceError serviceError = null;
|
||||
|
||||
public ConfirmedErrorPDU() {
|
||||
}
|
||||
|
||||
public ConfirmedErrorPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setModifierPosition(Unsigned32 modifierPosition) {
|
||||
this.modifierPosition = modifierPosition;
|
||||
}
|
||||
|
||||
public Unsigned32 getModifierPosition() {
|
||||
return modifierPosition;
|
||||
}
|
||||
|
||||
public void setServiceError(ServiceError serviceError) {
|
||||
this.serviceError = serviceError;
|
||||
}
|
||||
|
||||
public ServiceError getServiceError() {
|
||||
return serviceError;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += serviceError.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
|
||||
if (modifierPosition != null) {
|
||||
codeLength += modifierPosition.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += invokeID.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
modifierPosition = new Unsigned32();
|
||||
subCodeLength += modifierPosition.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
serviceError = new ServiceError();
|
||||
subCodeLength += serviceError.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (modifierPosition != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("modifierPosition: ").append(modifierPosition);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (serviceError != null) {
|
||||
sb.append("serviceError: ");
|
||||
serviceError.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("serviceError: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private Unsigned32 modifierPosition = null;
|
||||
private ServiceError serviceError = null;
|
||||
|
||||
public ConfirmedErrorPDU() {
|
||||
}
|
||||
|
||||
public ConfirmedErrorPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setModifierPosition(Unsigned32 modifierPosition) {
|
||||
this.modifierPosition = modifierPosition;
|
||||
}
|
||||
|
||||
public Unsigned32 getModifierPosition() {
|
||||
return modifierPosition;
|
||||
}
|
||||
|
||||
public void setServiceError(ServiceError serviceError) {
|
||||
this.serviceError = serviceError;
|
||||
}
|
||||
|
||||
public ServiceError getServiceError() {
|
||||
return serviceError;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += serviceError.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
|
||||
if (modifierPosition != null) {
|
||||
codeLength += modifierPosition.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += invokeID.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
modifierPosition = new Unsigned32();
|
||||
subCodeLength += modifierPosition.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
serviceError = new ServiceError();
|
||||
subCodeLength += serviceError.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (modifierPosition != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("modifierPosition: ").append(modifierPosition);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (serviceError != null) {
|
||||
sb.append("serviceError: ");
|
||||
serviceError.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("serviceError: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,166 +1,171 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class ConfirmedRequestPDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceRequest service = null;
|
||||
|
||||
public ConfirmedRequestPDU() {
|
||||
}
|
||||
|
||||
public ConfirmedRequestPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceRequest service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public ConfirmedServiceRequest getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += invokeID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerInteger.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceRequest();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceRequest service = null;
|
||||
|
||||
public ConfirmedRequestPDU() {
|
||||
}
|
||||
|
||||
public ConfirmedRequestPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceRequest service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public ConfirmedServiceRequest getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += invokeID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(Unsigned32.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceRequest();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,166 +1,171 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class ConfirmedResponsePDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceResponse service = null;
|
||||
|
||||
public ConfirmedResponsePDU() {
|
||||
}
|
||||
|
||||
public ConfirmedResponsePDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceResponse service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public ConfirmedServiceResponse getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += invokeID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerInteger.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceResponse();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 invokeID = null;
|
||||
private ConfirmedServiceResponse service = null;
|
||||
|
||||
public ConfirmedResponsePDU() {
|
||||
}
|
||||
|
||||
public ConfirmedResponsePDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInvokeID(Unsigned32 invokeID) {
|
||||
this.invokeID = invokeID;
|
||||
}
|
||||
|
||||
public Unsigned32 getInvokeID() {
|
||||
return invokeID;
|
||||
}
|
||||
|
||||
public void setService(ConfirmedServiceResponse service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public ConfirmedServiceResponse getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += invokeID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(Unsigned32.tag)) {
|
||||
invokeID = new Unsigned32();
|
||||
subCodeLength += invokeID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
service = new ConfirmedServiceResponse();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (invokeID != null) {
|
||||
sb.append("invokeID: ").append(invokeID);
|
||||
}
|
||||
else {
|
||||
sb.append("invokeID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,293 +1,328 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class ConfirmedServiceRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private GetNameListRequest getNameList = null;
|
||||
private ReadRequest read = null;
|
||||
private WriteRequest write = null;
|
||||
private GetVariableAccessAttributesRequest getVariableAccessAttributes = null;
|
||||
private DefineNamedVariableListRequest defineNamedVariableList = null;
|
||||
private GetNamedVariableListAttributesRequest getNamedVariableListAttributes = null;
|
||||
private DeleteNamedVariableListRequest deleteNamedVariableList = null;
|
||||
|
||||
public ConfirmedServiceRequest() {
|
||||
}
|
||||
|
||||
public ConfirmedServiceRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListRequest getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public GetNameListRequest getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setRead(ReadRequest read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public ReadRequest getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setWrite(WriteRequest write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public WriteRequest getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(GetVariableAccessAttributesRequest getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesRequest getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListRequest defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListRequest getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(
|
||||
GetNamedVariableListAttributesRequest getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesRequest getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListRequest deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListRequest getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
os.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sublength = getNamedVariableListAttributes.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
os.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 11
|
||||
os.write(0xAB);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sublength = getVariableAccessAttributes.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
os.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
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.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListRequest();
|
||||
codeLength += getNameList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadRequest();
|
||||
codeLength += read.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteRequest();
|
||||
codeLength += write.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesRequest();
|
||||
codeLength += getVariableAccessAttributes.decode(is, null);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListRequest();
|
||||
codeLength += defineNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesRequest();
|
||||
codeLength += getNamedVariableListAttributes.decode(is, null);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListRequest();
|
||||
codeLength += deleteNamedVariableList.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (getNameList != null) {
|
||||
sb.append("getNameList: ");
|
||||
getNameList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
sb.append("read: ");
|
||||
read.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
sb.append("write: ");
|
||||
write.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sb.append("getVariableAccessAttributes: ");
|
||||
getVariableAccessAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
sb.append("defineNamedVariableList: ");
|
||||
defineNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sb.append("getNamedVariableListAttributes: ");
|
||||
getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
sb.append("deleteNamedVariableList: ");
|
||||
deleteNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private GetNameListRequest getNameList = null;
|
||||
private ReadRequest read = null;
|
||||
private WriteRequest write = null;
|
||||
private GetVariableAccessAttributesRequest getVariableAccessAttributes = null;
|
||||
private DefineNamedVariableListRequest defineNamedVariableList = null;
|
||||
private GetNamedVariableListAttributesRequest getNamedVariableListAttributes = null;
|
||||
private DeleteNamedVariableListRequest deleteNamedVariableList = null;
|
||||
private FileDirectoryRequest fileDirectory = null;
|
||||
|
||||
public ConfirmedServiceRequest() {
|
||||
}
|
||||
|
||||
public ConfirmedServiceRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListRequest getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public GetNameListRequest getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setRead(ReadRequest read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public ReadRequest getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setWrite(WriteRequest write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public WriteRequest getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(GetVariableAccessAttributesRequest getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesRequest getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListRequest defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListRequest getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(GetNamedVariableListAttributesRequest getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesRequest getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListRequest deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListRequest getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public void setFileDirectory(FileDirectoryRequest fileDirectory) {
|
||||
this.fileDirectory = fileDirectory;
|
||||
}
|
||||
|
||||
public FileDirectoryRequest getFileDirectory() {
|
||||
return fileDirectory;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (fileDirectory != null) {
|
||||
codeLength += fileDirectory.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
|
||||
os.write(0x4D);
|
||||
os.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
os.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sublength = getNamedVariableListAttributes.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
os.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 11
|
||||
os.write(0xAB);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sublength = getVariableAccessAttributes.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
os.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
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.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListRequest();
|
||||
codeLength += getNameList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadRequest();
|
||||
codeLength += read.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteRequest();
|
||||
codeLength += write.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesRequest();
|
||||
codeLength += getVariableAccessAttributes.decode(is, null);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListRequest();
|
||||
codeLength += defineNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesRequest();
|
||||
codeLength += getNamedVariableListAttributes.decode(is, null);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListRequest();
|
||||
codeLength += deleteNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
|
||||
fileDirectory = new FileDirectoryRequest();
|
||||
codeLength += fileDirectory.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (getNameList != null) {
|
||||
sb.append("getNameList: ");
|
||||
getNameList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
sb.append("read: ");
|
||||
read.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
sb.append("write: ");
|
||||
write.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sb.append("getVariableAccessAttributes: ");
|
||||
getVariableAccessAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
sb.append("defineNamedVariableList: ");
|
||||
defineNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sb.append("getNamedVariableListAttributes: ");
|
||||
getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
sb.append("deleteNamedVariableList: ");
|
||||
deleteNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDirectory != null) {
|
||||
sb.append("fileDirectory: ");
|
||||
fileDirectory.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,283 +1,319 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class ConfirmedServiceResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private GetNameListResponse getNameList = null;
|
||||
private ReadResponse read = null;
|
||||
private WriteResponse write = null;
|
||||
private GetVariableAccessAttributesResponse getVariableAccessAttributes = null;
|
||||
private DefineNamedVariableListResponse defineNamedVariableList = null;
|
||||
private GetNamedVariableListAttributesResponse getNamedVariableListAttributes = null;
|
||||
private DeleteNamedVariableListResponse deleteNamedVariableList = null;
|
||||
|
||||
public ConfirmedServiceResponse() {
|
||||
}
|
||||
|
||||
public ConfirmedServiceResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListResponse getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public GetNameListResponse getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setRead(ReadResponse read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public ReadResponse getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setWrite(WriteResponse write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public WriteResponse getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(GetVariableAccessAttributesResponse getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesResponse getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListResponse defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListResponse getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(
|
||||
GetNamedVariableListAttributesResponse getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesResponse getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListResponse deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListResponse getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
os.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
codeLength += getNamedVariableListAttributes.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
os.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
|
||||
os.write(0x8B);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
codeLength += getVariableAccessAttributes.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
os.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
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.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListResponse();
|
||||
codeLength += getNameList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadResponse();
|
||||
codeLength += read.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteResponse();
|
||||
codeLength += write.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesResponse();
|
||||
codeLength += getVariableAccessAttributes.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListResponse();
|
||||
codeLength += defineNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesResponse();
|
||||
codeLength += getNamedVariableListAttributes.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListResponse();
|
||||
codeLength += deleteNamedVariableList.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (getNameList != null) {
|
||||
sb.append("getNameList: ");
|
||||
getNameList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
sb.append("read: ");
|
||||
read.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
sb.append("write: ");
|
||||
write.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sb.append("getVariableAccessAttributes: ");
|
||||
getVariableAccessAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
sb.append("defineNamedVariableList: ").append(defineNamedVariableList);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sb.append("getNamedVariableListAttributes: ");
|
||||
getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
sb.append("deleteNamedVariableList: ");
|
||||
deleteNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private GetNameListResponse getNameList = null;
|
||||
private ReadResponse read = null;
|
||||
private WriteResponse write = null;
|
||||
private GetVariableAccessAttributesResponse getVariableAccessAttributes = null;
|
||||
private DefineNamedVariableListResponse defineNamedVariableList = null;
|
||||
private GetNamedVariableListAttributesResponse getNamedVariableListAttributes = null;
|
||||
private DeleteNamedVariableListResponse deleteNamedVariableList = null;
|
||||
private FileDirectoryResponse fileDirectory = null;
|
||||
|
||||
public ConfirmedServiceResponse() {
|
||||
}
|
||||
|
||||
public ConfirmedServiceResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setGetNameList(GetNameListResponse getNameList) {
|
||||
this.getNameList = getNameList;
|
||||
}
|
||||
|
||||
public GetNameListResponse getGetNameList() {
|
||||
return getNameList;
|
||||
}
|
||||
|
||||
public void setRead(ReadResponse read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public ReadResponse getRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setWrite(WriteResponse write) {
|
||||
this.write = write;
|
||||
}
|
||||
|
||||
public WriteResponse getWrite() {
|
||||
return write;
|
||||
}
|
||||
|
||||
public void setGetVariableAccessAttributes(GetVariableAccessAttributesResponse getVariableAccessAttributes) {
|
||||
this.getVariableAccessAttributes = getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesResponse getGetVariableAccessAttributes() {
|
||||
return getVariableAccessAttributes;
|
||||
}
|
||||
|
||||
public void setDefineNamedVariableList(DefineNamedVariableListResponse defineNamedVariableList) {
|
||||
this.defineNamedVariableList = defineNamedVariableList;
|
||||
}
|
||||
|
||||
public DefineNamedVariableListResponse getDefineNamedVariableList() {
|
||||
return defineNamedVariableList;
|
||||
}
|
||||
|
||||
public void setGetNamedVariableListAttributes(GetNamedVariableListAttributesResponse getNamedVariableListAttributes) {
|
||||
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesResponse getGetNamedVariableListAttributes() {
|
||||
return getNamedVariableListAttributes;
|
||||
}
|
||||
|
||||
public void setDeleteNamedVariableList(DeleteNamedVariableListResponse deleteNamedVariableList) {
|
||||
this.deleteNamedVariableList = deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListResponse getDeleteNamedVariableList() {
|
||||
return deleteNamedVariableList;
|
||||
}
|
||||
|
||||
public void setFileDirectory(FileDirectoryResponse fileDirectory) {
|
||||
this.fileDirectory = fileDirectory;
|
||||
}
|
||||
|
||||
public FileDirectoryResponse getFileDirectory() {
|
||||
return fileDirectory;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (fileDirectory != null) {
|
||||
codeLength += fileDirectory.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
|
||||
os.write(0x4D);
|
||||
os.write(0xBF);
|
||||
codeLength += 2;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
codeLength += deleteNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
|
||||
os.write(0xAD);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
codeLength += getNamedVariableListAttributes.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
|
||||
os.write(0xAC);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
codeLength += defineNamedVariableList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
|
||||
os.write(0x8B);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
codeLength += getVariableAccessAttributes.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
os.write(0xA6);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
codeLength += write.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
codeLength += read.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (getNameList != null) {
|
||||
codeLength += getNameList.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
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.CONSTRUCTED, 1)) {
|
||||
getNameList = new GetNameListResponse();
|
||||
codeLength += getNameList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
read = new ReadResponse();
|
||||
codeLength += read.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
write = new WriteResponse();
|
||||
codeLength += write.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
getVariableAccessAttributes = new GetVariableAccessAttributesResponse();
|
||||
codeLength += getVariableAccessAttributes.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
|
||||
defineNamedVariableList = new DefineNamedVariableListResponse();
|
||||
codeLength += defineNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
|
||||
getNamedVariableListAttributes = new GetNamedVariableListAttributesResponse();
|
||||
codeLength += getNamedVariableListAttributes.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
|
||||
deleteNamedVariableList = new DeleteNamedVariableListResponse();
|
||||
codeLength += deleteNamedVariableList.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
|
||||
fileDirectory = new FileDirectoryResponse();
|
||||
codeLength += fileDirectory.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (getNameList != null) {
|
||||
sb.append("getNameList: ");
|
||||
getNameList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (read != null) {
|
||||
sb.append("read: ");
|
||||
read.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (write != null) {
|
||||
sb.append("write: ");
|
||||
write.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getVariableAccessAttributes != null) {
|
||||
sb.append("getVariableAccessAttributes: ");
|
||||
getVariableAccessAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (defineNamedVariableList != null) {
|
||||
sb.append("defineNamedVariableList: ").append(defineNamedVariableList);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getNamedVariableListAttributes != null) {
|
||||
sb.append("getNamedVariableListAttributes: ");
|
||||
getNamedVariableListAttributes.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (deleteNamedVariableList != null) {
|
||||
sb.append("deleteNamedVariableList: ");
|
||||
deleteNamedVariableList.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileDirectory != null) {
|
||||
sb.append("fileDirectory: ");
|
||||
fileDirectory.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class DataAccessError extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DataAccessError() {
|
||||
}
|
||||
public DataAccessError() {
|
||||
}
|
||||
|
||||
public DataAccessError(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public DataAccessError(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public DataAccessError(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public DataAccessError(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public DataAccessError(long value) {
|
||||
super(value);
|
||||
}
|
||||
public DataAccessError(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,166 +1,172 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class DefineNamedVariableListRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName variableListName = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
|
||||
public DefineNamedVariableListRequest() {
|
||||
}
|
||||
|
||||
public DefineNamedVariableListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableListName(ObjectName variableListName) {
|
||||
this.variableListName = variableListName;
|
||||
}
|
||||
|
||||
public ObjectName getVariableListName() {
|
||||
return variableListName;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableListName.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableListName = new ObjectName();
|
||||
subCodeLength += variableListName.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
subCodeLength += listOfVariable.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableListName != null) {
|
||||
sb.append("variableListName: ");
|
||||
variableListName.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableListName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfVariable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName variableListName = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
|
||||
public DefineNamedVariableListRequest() {
|
||||
}
|
||||
|
||||
public DefineNamedVariableListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableListName(ObjectName variableListName) {
|
||||
this.variableListName = variableListName;
|
||||
}
|
||||
|
||||
public ObjectName getVariableListName() {
|
||||
return variableListName;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableListName.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableListName = new ObjectName();
|
||||
subCodeLength += variableListName.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
subCodeLength += listOfVariable.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableListName != null) {
|
||||
sb.append("variableListName: ");
|
||||
variableListName.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableListName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfVariable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerNull;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class DefineNamedVariableListResponse extends BerNull {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DefineNamedVariableListResponse() {
|
||||
}
|
||||
public DefineNamedVariableListResponse() {
|
||||
}
|
||||
|
||||
public DefineNamedVariableListResponse(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public DefineNamedVariableListResponse(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,446 +1,444 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
|
||||
|
||||
public class DeleteNamedVariableListRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfVariableListName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<ObjectName> seqOf = null;
|
||||
|
||||
public ListOfVariableListName() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ListOfVariableListName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<ObjectName> getObjectName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
ObjectName element = new ObjectName();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength
|
||||
+ " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<ObjectName> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class DomainName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BasicIdentifier basic = null;
|
||||
|
||||
public DomainName() {
|
||||
}
|
||||
|
||||
public DomainName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setBasic(BasicIdentifier basic) {
|
||||
this.basic = basic;
|
||||
}
|
||||
|
||||
public BasicIdentifier getBasic() {
|
||||
return basic;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (basic != null) {
|
||||
codeLength += basic.encode(os, true);
|
||||
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(BerVisibleString.tag)) {
|
||||
basic = new BasicIdentifier();
|
||||
codeLength += basic.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (basic != null) {
|
||||
sb.append("basic: ").append(basic);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerInteger scopeOfDelete = null;
|
||||
private ListOfVariableListName listOfVariableListName = null;
|
||||
private DomainName domainName = null;
|
||||
|
||||
public DeleteNamedVariableListRequest() {
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setScopeOfDelete(BerInteger scopeOfDelete) {
|
||||
this.scopeOfDelete = scopeOfDelete;
|
||||
}
|
||||
|
||||
public BerInteger getScopeOfDelete() {
|
||||
return scopeOfDelete;
|
||||
}
|
||||
|
||||
public void setListOfVariableListName(ListOfVariableListName listOfVariableListName) {
|
||||
this.listOfVariableListName = listOfVariableListName;
|
||||
}
|
||||
|
||||
public ListOfVariableListName getListOfVariableListName() {
|
||||
return listOfVariableListName;
|
||||
}
|
||||
|
||||
public void setDomainName(DomainName domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public DomainName getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (domainName != null) {
|
||||
sublength = domainName.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (listOfVariableListName != null) {
|
||||
codeLength += listOfVariableListName.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (scopeOfDelete != null) {
|
||||
codeLength += scopeOfDelete.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
if (totalLength == 0) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
scopeOfDelete = new BerInteger();
|
||||
subCodeLength += scopeOfDelete.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfVariableListName = new ListOfVariableListName();
|
||||
subCodeLength += listOfVariableListName.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
subCodeLength += length.decode(is);
|
||||
domainName = new DomainName();
|
||||
subCodeLength += domainName.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (scopeOfDelete != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("scopeOfDelete: ").append(scopeOfDelete);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (listOfVariableListName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("listOfVariableListName: ");
|
||||
listOfVariableListName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (domainName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("domainName: ");
|
||||
domainName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfVariableListName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<ObjectName> seqOf = null;
|
||||
|
||||
public ListOfVariableListName() {
|
||||
seqOf = new ArrayList<ObjectName>();
|
||||
}
|
||||
|
||||
public ListOfVariableListName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<ObjectName> getObjectName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<ObjectName>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
ObjectName element = new ObjectName();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<ObjectName> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class DomainName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BasicIdentifier basic = null;
|
||||
|
||||
public DomainName() {
|
||||
}
|
||||
|
||||
public DomainName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setBasic(BasicIdentifier basic) {
|
||||
this.basic = basic;
|
||||
}
|
||||
|
||||
public BasicIdentifier getBasic() {
|
||||
return basic;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (basic != null) {
|
||||
codeLength += basic.encode(os, true);
|
||||
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(BasicIdentifier.tag)) {
|
||||
basic = new BasicIdentifier();
|
||||
codeLength += basic.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (basic != null) {
|
||||
sb.append("basic: ").append(basic);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerInteger scopeOfDelete = null;
|
||||
private ListOfVariableListName listOfVariableListName = null;
|
||||
private DomainName domainName = null;
|
||||
|
||||
public DeleteNamedVariableListRequest() {
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setScopeOfDelete(BerInteger scopeOfDelete) {
|
||||
this.scopeOfDelete = scopeOfDelete;
|
||||
}
|
||||
|
||||
public BerInteger getScopeOfDelete() {
|
||||
return scopeOfDelete;
|
||||
}
|
||||
|
||||
public void setListOfVariableListName(ListOfVariableListName listOfVariableListName) {
|
||||
this.listOfVariableListName = listOfVariableListName;
|
||||
}
|
||||
|
||||
public ListOfVariableListName getListOfVariableListName() {
|
||||
return listOfVariableListName;
|
||||
}
|
||||
|
||||
public void setDomainName(DomainName domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public DomainName getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (domainName != null) {
|
||||
sublength = domainName.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (listOfVariableListName != null) {
|
||||
codeLength += listOfVariableListName.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (scopeOfDelete != null) {
|
||||
codeLength += scopeOfDelete.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
if (totalLength == 0) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
scopeOfDelete = new BerInteger();
|
||||
subCodeLength += scopeOfDelete.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfVariableListName = new ListOfVariableListName();
|
||||
subCodeLength += listOfVariableListName.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
subCodeLength += length.decode(is);
|
||||
domainName = new DomainName();
|
||||
subCodeLength += domainName.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (scopeOfDelete != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("scopeOfDelete: ").append(scopeOfDelete);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (listOfVariableListName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("listOfVariableListName: ");
|
||||
listOfVariableListName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (domainName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("domainName: ");
|
||||
domainName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,172 +1,178 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class DeleteNamedVariableListResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 numberMatched = null;
|
||||
private Unsigned32 numberDeleted = null;
|
||||
|
||||
public DeleteNamedVariableListResponse() {
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumberMatched(Unsigned32 numberMatched) {
|
||||
this.numberMatched = numberMatched;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberMatched() {
|
||||
return numberMatched;
|
||||
}
|
||||
|
||||
public void setNumberDeleted(Unsigned32 numberDeleted) {
|
||||
this.numberDeleted = numberDeleted;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberDeleted() {
|
||||
return numberDeleted;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += numberDeleted.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += numberMatched.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
numberMatched = new Unsigned32();
|
||||
subCodeLength += numberMatched.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
numberDeleted = new Unsigned32();
|
||||
subCodeLength += numberDeleted.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (numberMatched != null) {
|
||||
sb.append("numberMatched: ").append(numberMatched);
|
||||
}
|
||||
else {
|
||||
sb.append("numberMatched: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (numberDeleted != null) {
|
||||
sb.append("numberDeleted: ").append(numberDeleted);
|
||||
}
|
||||
else {
|
||||
sb.append("numberDeleted: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 numberMatched = null;
|
||||
private Unsigned32 numberDeleted = null;
|
||||
|
||||
public DeleteNamedVariableListResponse() {
|
||||
}
|
||||
|
||||
public DeleteNamedVariableListResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumberMatched(Unsigned32 numberMatched) {
|
||||
this.numberMatched = numberMatched;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberMatched() {
|
||||
return numberMatched;
|
||||
}
|
||||
|
||||
public void setNumberDeleted(Unsigned32 numberDeleted) {
|
||||
this.numberDeleted = numberDeleted;
|
||||
}
|
||||
|
||||
public Unsigned32 getNumberDeleted() {
|
||||
return numberDeleted;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += numberDeleted.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += numberMatched.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
numberMatched = new Unsigned32();
|
||||
subCodeLength += numberMatched.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
numberDeleted = new Unsigned32();
|
||||
subCodeLength += numberDeleted.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (numberMatched != null) {
|
||||
sb.append("numberMatched: ").append(numberMatched);
|
||||
}
|
||||
else {
|
||||
sb.append("numberMatched: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (numberDeleted != null) {
|
||||
sb.append("numberDeleted: ").append(numberDeleted);
|
||||
}
|
||||
else {
|
||||
sb.append("numberDeleted: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class DirectoryEntry implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private FileName fileName = null;
|
||||
private FileAttributes fileAttributes = null;
|
||||
|
||||
public DirectoryEntry() {
|
||||
}
|
||||
|
||||
public DirectoryEntry(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFileName(FileName fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public FileName getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileAttributes(FileAttributes fileAttributes) {
|
||||
this.fileAttributes = fileAttributes;
|
||||
}
|
||||
|
||||
public FileAttributes getFileAttributes() {
|
||||
return fileAttributes;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += fileAttributes.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += fileName.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fileName = new FileName();
|
||||
subCodeLength += fileName.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
fileAttributes = new FileAttributes();
|
||||
subCodeLength += fileAttributes.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (fileName != null) {
|
||||
sb.append("fileName: ");
|
||||
fileName.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("fileName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (fileAttributes != null) {
|
||||
sb.append("fileAttributes: ");
|
||||
fileAttributes.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("fileAttributes: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class FileAttributes implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Unsigned32 sizeOfFile = null;
|
||||
private BerGeneralizedTime lastModified = null;
|
||||
|
||||
public FileAttributes() {
|
||||
}
|
||||
|
||||
public FileAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setSizeOfFile(Unsigned32 sizeOfFile) {
|
||||
this.sizeOfFile = sizeOfFile;
|
||||
}
|
||||
|
||||
public Unsigned32 getSizeOfFile() {
|
||||
return sizeOfFile;
|
||||
}
|
||||
|
||||
public void setLastModified(BerGeneralizedTime lastModified) {
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public BerGeneralizedTime getLastModified() {
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (lastModified != null) {
|
||||
codeLength += lastModified.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += sizeOfFile.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
sizeOfFile = new Unsigned32();
|
||||
subCodeLength += sizeOfFile.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
lastModified = new BerGeneralizedTime();
|
||||
subCodeLength += lastModified.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (sizeOfFile != null) {
|
||||
sb.append("sizeOfFile: ").append(sizeOfFile);
|
||||
}
|
||||
else {
|
||||
sb.append("sizeOfFile: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (lastModified != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("lastModified: ").append(lastModified);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,186 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class FileDirectoryRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private FileName fileSpecification = null;
|
||||
private FileName continueAfter = null;
|
||||
|
||||
public FileDirectoryRequest() {
|
||||
}
|
||||
|
||||
public FileDirectoryRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFileSpecification(FileName fileSpecification) {
|
||||
this.fileSpecification = fileSpecification;
|
||||
}
|
||||
|
||||
public FileName getFileSpecification() {
|
||||
return fileSpecification;
|
||||
}
|
||||
|
||||
public void setContinueAfter(FileName continueAfter) {
|
||||
this.continueAfter = continueAfter;
|
||||
}
|
||||
|
||||
public FileName getContinueAfter() {
|
||||
return continueAfter;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (continueAfter != null) {
|
||||
codeLength += continueAfter.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (fileSpecification != null) {
|
||||
codeLength += fileSpecification.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
if (totalLength == 0) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fileSpecification = new FileName();
|
||||
subCodeLength += fileSpecification.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
continueAfter = new FileName();
|
||||
subCodeLength += continueAfter.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (fileSpecification != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("fileSpecification: ");
|
||||
fileSpecification.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (continueAfter != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("continueAfter: ");
|
||||
continueAfter.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,312 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class FileDirectoryResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfDirectoryEntry implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<DirectoryEntry> seqOf = null;
|
||||
|
||||
public ListOfDirectoryEntry() {
|
||||
seqOf = new ArrayList<DirectoryEntry>();
|
||||
}
|
||||
|
||||
public ListOfDirectoryEntry(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<DirectoryEntry> getDirectoryEntry() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<DirectoryEntry>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
DirectoryEntry element = new DirectoryEntry();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<DirectoryEntry> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ListOfDirectoryEntry listOfDirectoryEntry = null;
|
||||
private BerBoolean moreFollows = null;
|
||||
|
||||
public FileDirectoryResponse() {
|
||||
}
|
||||
|
||||
public FileDirectoryResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setListOfDirectoryEntry(ListOfDirectoryEntry listOfDirectoryEntry) {
|
||||
this.listOfDirectoryEntry = listOfDirectoryEntry;
|
||||
}
|
||||
|
||||
public ListOfDirectoryEntry getListOfDirectoryEntry() {
|
||||
return listOfDirectoryEntry;
|
||||
}
|
||||
|
||||
public void setMoreFollows(BerBoolean moreFollows) {
|
||||
this.moreFollows = moreFollows;
|
||||
}
|
||||
|
||||
public BerBoolean getMoreFollows() {
|
||||
return moreFollows;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (moreFollows != null) {
|
||||
codeLength += moreFollows.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
sublength = listOfDirectoryEntry.encode(os, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
subCodeLength += length.decode(is);
|
||||
listOfDirectoryEntry = new ListOfDirectoryEntry();
|
||||
subCodeLength += listOfDirectoryEntry.decode(is, true);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
moreFollows = new BerBoolean();
|
||||
subCodeLength += moreFollows.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfDirectoryEntry != null) {
|
||||
sb.append("listOfDirectoryEntry: ");
|
||||
listOfDirectoryEntry.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfDirectoryEntry: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (moreFollows != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("moreFollows: ").append(moreFollows);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,147 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class FileName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<BerGraphicString> seqOf = null;
|
||||
|
||||
public FileName() {
|
||||
seqOf = new ArrayList<BerGraphicString>();
|
||||
}
|
||||
|
||||
public FileName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<BerGraphicString> getBerGraphicString() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<BerGraphicString>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
BerGraphicString element = new BerGraphicString();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<BerGraphicString> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerOctetString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class FloatingPoint extends BerOctetString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FloatingPoint() {
|
||||
}
|
||||
public FloatingPoint() {
|
||||
}
|
||||
|
||||
public FloatingPoint(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public FloatingPoint(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,370 +1,374 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerNull;
|
||||
|
||||
public class GetNameListRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ObjectScope implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BerNull vmdSpecific = null;
|
||||
private Identifier domainSpecific = null;
|
||||
private BerNull aaSpecific = null;
|
||||
|
||||
public ObjectScope() {
|
||||
}
|
||||
|
||||
public ObjectScope(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVmdSpecific(BerNull vmdSpecific) {
|
||||
this.vmdSpecific = vmdSpecific;
|
||||
}
|
||||
|
||||
public BerNull getVmdSpecific() {
|
||||
return vmdSpecific;
|
||||
}
|
||||
|
||||
public void setDomainSpecific(Identifier domainSpecific) {
|
||||
this.domainSpecific = domainSpecific;
|
||||
}
|
||||
|
||||
public Identifier getDomainSpecific() {
|
||||
return domainSpecific;
|
||||
}
|
||||
|
||||
public void setAaSpecific(BerNull aaSpecific) {
|
||||
this.aaSpecific = aaSpecific;
|
||||
}
|
||||
|
||||
public BerNull getAaSpecific() {
|
||||
return aaSpecific;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (aaSpecific != null) {
|
||||
codeLength += aaSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
codeLength += domainSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
codeLength += vmdSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
vmdSpecific = new BerNull();
|
||||
codeLength += vmdSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
domainSpecific = new Identifier();
|
||||
codeLength += domainSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
aaSpecific = new BerNull();
|
||||
codeLength += aaSpecific.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
sb.append("vmdSpecific: ").append(vmdSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
sb.append("domainSpecific: ").append(domainSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aaSpecific != null) {
|
||||
sb.append("aaSpecific: ").append(aaSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectClass objectClass = null;
|
||||
private ObjectScope objectScope = null;
|
||||
private Identifier continueAfter = null;
|
||||
|
||||
public GetNameListRequest() {
|
||||
}
|
||||
|
||||
public GetNameListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setObjectClass(ObjectClass objectClass) {
|
||||
this.objectClass = objectClass;
|
||||
}
|
||||
|
||||
public ObjectClass getObjectClass() {
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
public void setObjectScope(ObjectScope objectScope) {
|
||||
this.objectScope = objectScope;
|
||||
}
|
||||
|
||||
public ObjectScope getObjectScope() {
|
||||
return objectScope;
|
||||
}
|
||||
|
||||
public void setContinueAfter(Identifier continueAfter) {
|
||||
this.continueAfter = continueAfter;
|
||||
}
|
||||
|
||||
public Identifier getContinueAfter() {
|
||||
return continueAfter;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (continueAfter != null) {
|
||||
codeLength += continueAfter.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
sublength = objectScope.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
sublength = objectClass.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
subCodeLength += length.decode(is);
|
||||
objectClass = new ObjectClass();
|
||||
subCodeLength += objectClass.decode(is, null);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
subCodeLength += length.decode(is);
|
||||
objectScope = new ObjectScope();
|
||||
subCodeLength += objectScope.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
continueAfter = new Identifier();
|
||||
subCodeLength += continueAfter.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (objectClass != null) {
|
||||
sb.append("objectClass: ");
|
||||
objectClass.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("objectClass: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (objectScope != null) {
|
||||
sb.append("objectScope: ");
|
||||
objectScope.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("objectScope: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (continueAfter != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("continueAfter: ").append(continueAfter);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ObjectScope implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BerNull vmdSpecific = null;
|
||||
private Identifier domainSpecific = null;
|
||||
private BerNull aaSpecific = null;
|
||||
|
||||
public ObjectScope() {
|
||||
}
|
||||
|
||||
public ObjectScope(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVmdSpecific(BerNull vmdSpecific) {
|
||||
this.vmdSpecific = vmdSpecific;
|
||||
}
|
||||
|
||||
public BerNull getVmdSpecific() {
|
||||
return vmdSpecific;
|
||||
}
|
||||
|
||||
public void setDomainSpecific(Identifier domainSpecific) {
|
||||
this.domainSpecific = domainSpecific;
|
||||
}
|
||||
|
||||
public Identifier getDomainSpecific() {
|
||||
return domainSpecific;
|
||||
}
|
||||
|
||||
public void setAaSpecific(BerNull aaSpecific) {
|
||||
this.aaSpecific = aaSpecific;
|
||||
}
|
||||
|
||||
public BerNull getAaSpecific() {
|
||||
return aaSpecific;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (aaSpecific != null) {
|
||||
codeLength += aaSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
codeLength += domainSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
codeLength += vmdSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
vmdSpecific = new BerNull();
|
||||
codeLength += vmdSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
domainSpecific = new Identifier();
|
||||
codeLength += domainSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
aaSpecific = new BerNull();
|
||||
codeLength += aaSpecific.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
sb.append("vmdSpecific: ").append(vmdSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
sb.append("domainSpecific: ").append(domainSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aaSpecific != null) {
|
||||
sb.append("aaSpecific: ").append(aaSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectClass objectClass = null;
|
||||
private ObjectScope objectScope = null;
|
||||
private Identifier continueAfter = null;
|
||||
|
||||
public GetNameListRequest() {
|
||||
}
|
||||
|
||||
public GetNameListRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setObjectClass(ObjectClass objectClass) {
|
||||
this.objectClass = objectClass;
|
||||
}
|
||||
|
||||
public ObjectClass getObjectClass() {
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
public void setObjectScope(ObjectScope objectScope) {
|
||||
this.objectScope = objectScope;
|
||||
}
|
||||
|
||||
public ObjectScope getObjectScope() {
|
||||
return objectScope;
|
||||
}
|
||||
|
||||
public void setContinueAfter(Identifier continueAfter) {
|
||||
this.continueAfter = continueAfter;
|
||||
}
|
||||
|
||||
public Identifier getContinueAfter() {
|
||||
return continueAfter;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (continueAfter != null) {
|
||||
codeLength += continueAfter.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
sublength = objectScope.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
sublength = objectClass.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
subCodeLength += length.decode(is);
|
||||
objectClass = new ObjectClass();
|
||||
subCodeLength += objectClass.decode(is, null);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
subCodeLength += length.decode(is);
|
||||
objectScope = new ObjectScope();
|
||||
subCodeLength += objectScope.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
continueAfter = new Identifier();
|
||||
subCodeLength += continueAfter.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (objectClass != null) {
|
||||
sb.append("objectClass: ");
|
||||
objectClass.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("objectClass: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (objectScope != null) {
|
||||
sb.append("objectScope: ");
|
||||
objectScope.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("objectScope: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (continueAfter != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("continueAfter: ").append(continueAfter);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,307 +1,307 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerBoolean;
|
||||
|
||||
public class GetNameListResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfIdentifier implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<Identifier> seqOf = null;
|
||||
|
||||
public ListOfIdentifier() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ListOfIdentifier(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
Identifier element = new Identifier();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength
|
||||
+ " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<Identifier> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ListOfIdentifier listOfIdentifier = null;
|
||||
private BerBoolean moreFollows = null;
|
||||
|
||||
public GetNameListResponse() {
|
||||
}
|
||||
|
||||
public GetNameListResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setListOfIdentifier(ListOfIdentifier listOfIdentifier) {
|
||||
this.listOfIdentifier = listOfIdentifier;
|
||||
}
|
||||
|
||||
public ListOfIdentifier getListOfIdentifier() {
|
||||
return listOfIdentifier;
|
||||
}
|
||||
|
||||
public void setMoreFollows(BerBoolean moreFollows) {
|
||||
this.moreFollows = moreFollows;
|
||||
}
|
||||
|
||||
public BerBoolean getMoreFollows() {
|
||||
return moreFollows;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (moreFollows != null) {
|
||||
codeLength += moreFollows.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += listOfIdentifier.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfIdentifier = new ListOfIdentifier();
|
||||
subCodeLength += listOfIdentifier.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
moreFollows = new BerBoolean();
|
||||
subCodeLength += moreFollows.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfIdentifier != null) {
|
||||
sb.append("listOfIdentifier: ");
|
||||
listOfIdentifier.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfIdentifier: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (moreFollows != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("moreFollows: ").append(moreFollows);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfIdentifier implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<Identifier> seqOf = null;
|
||||
|
||||
public ListOfIdentifier() {
|
||||
seqOf = new ArrayList<Identifier>();
|
||||
}
|
||||
|
||||
public ListOfIdentifier(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Identifier> getIdentifier() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<Identifier>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
Identifier element = new Identifier();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<Identifier> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private ListOfIdentifier listOfIdentifier = null;
|
||||
private BerBoolean moreFollows = null;
|
||||
|
||||
public GetNameListResponse() {
|
||||
}
|
||||
|
||||
public GetNameListResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setListOfIdentifier(ListOfIdentifier listOfIdentifier) {
|
||||
this.listOfIdentifier = listOfIdentifier;
|
||||
}
|
||||
|
||||
public ListOfIdentifier getListOfIdentifier() {
|
||||
return listOfIdentifier;
|
||||
}
|
||||
|
||||
public void setMoreFollows(BerBoolean moreFollows) {
|
||||
this.moreFollows = moreFollows;
|
||||
}
|
||||
|
||||
public BerBoolean getMoreFollows() {
|
||||
return moreFollows;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (moreFollows != null) {
|
||||
codeLength += moreFollows.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += listOfIdentifier.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfIdentifier = new ListOfIdentifier();
|
||||
subCodeLength += listOfIdentifier.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
moreFollows = new BerBoolean();
|
||||
subCodeLength += moreFollows.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfIdentifier != null) {
|
||||
sb.append("listOfIdentifier: ");
|
||||
listOfIdentifier.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfIdentifier: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (moreFollows != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("moreFollows: ").append(moreFollows);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,18 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class GetNamedVariableListAttributesRequest extends ObjectName {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public GetNamedVariableListAttributesRequest() {
|
||||
}
|
||||
public GetNamedVariableListAttributesRequest() {
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesRequest(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public GetNamedVariableListAttributesRequest(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,174 +1,179 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerBoolean;
|
||||
|
||||
public class GetNamedVariableListAttributesResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean mmsDeletable = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
|
||||
public GetNamedVariableListAttributesResponse() {
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMmsDeletable(BerBoolean mmsDeletable) {
|
||||
this.mmsDeletable = mmsDeletable;
|
||||
}
|
||||
|
||||
public BerBoolean getMmsDeletable() {
|
||||
return mmsDeletable;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += mmsDeletable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
mmsDeletable = new BerBoolean();
|
||||
subCodeLength += mmsDeletable.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
subCodeLength += listOfVariable.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (mmsDeletable != null) {
|
||||
sb.append("mmsDeletable: ").append(mmsDeletable);
|
||||
}
|
||||
else {
|
||||
sb.append("mmsDeletable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfVariable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean mmsDeletable = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
|
||||
public GetNamedVariableListAttributesResponse() {
|
||||
}
|
||||
|
||||
public GetNamedVariableListAttributesResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMmsDeletable(BerBoolean mmsDeletable) {
|
||||
this.mmsDeletable = mmsDeletable;
|
||||
}
|
||||
|
||||
public BerBoolean getMmsDeletable() {
|
||||
return mmsDeletable;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += mmsDeletable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
mmsDeletable = new BerBoolean();
|
||||
subCodeLength += mmsDeletable.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
subCodeLength += listOfVariable.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (mmsDeletable != null) {
|
||||
sb.append("mmsDeletable: ").append(mmsDeletable);
|
||||
}
|
||||
else {
|
||||
sb.append("mmsDeletable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfVariable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,115 +1,121 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class GetVariableAccessAttributesRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName name = null;
|
||||
|
||||
public GetVariableAccessAttributesRequest() {
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(ObjectName name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ObjectName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (name != null) {
|
||||
sublength = name.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
name = new ObjectName();
|
||||
codeLength += name.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (name != null) {
|
||||
sb.append("name: ");
|
||||
name.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName name = null;
|
||||
|
||||
public GetVariableAccessAttributesRequest() {
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(ObjectName name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ObjectName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (name != null) {
|
||||
sublength = name.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
name = new ObjectName();
|
||||
codeLength += name.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (name != null) {
|
||||
sb.append("name: ");
|
||||
name.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,179 +1,184 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerBoolean;
|
||||
|
||||
public class GetVariableAccessAttributesResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean mmsDeletable = null;
|
||||
private TypeDescription typeDescription = null;
|
||||
|
||||
public GetVariableAccessAttributesResponse() {
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMmsDeletable(BerBoolean mmsDeletable) {
|
||||
this.mmsDeletable = mmsDeletable;
|
||||
}
|
||||
|
||||
public BerBoolean getMmsDeletable() {
|
||||
return mmsDeletable;
|
||||
}
|
||||
|
||||
public void setTypeDescription(TypeDescription typeDescription) {
|
||||
this.typeDescription = typeDescription;
|
||||
}
|
||||
|
||||
public TypeDescription getTypeDescription() {
|
||||
return typeDescription;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = typeDescription.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += mmsDeletable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
mmsDeletable = new BerBoolean();
|
||||
subCodeLength += mmsDeletable.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
subCodeLength += length.decode(is);
|
||||
typeDescription = new TypeDescription();
|
||||
subCodeLength += typeDescription.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (mmsDeletable != null) {
|
||||
sb.append("mmsDeletable: ").append(mmsDeletable);
|
||||
}
|
||||
else {
|
||||
sb.append("mmsDeletable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (typeDescription != null) {
|
||||
sb.append("typeDescription: ");
|
||||
typeDescription.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("typeDescription: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean mmsDeletable = null;
|
||||
private TypeDescription typeDescription = null;
|
||||
|
||||
public GetVariableAccessAttributesResponse() {
|
||||
}
|
||||
|
||||
public GetVariableAccessAttributesResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMmsDeletable(BerBoolean mmsDeletable) {
|
||||
this.mmsDeletable = mmsDeletable;
|
||||
}
|
||||
|
||||
public BerBoolean getMmsDeletable() {
|
||||
return mmsDeletable;
|
||||
}
|
||||
|
||||
public void setTypeDescription(TypeDescription typeDescription) {
|
||||
this.typeDescription = typeDescription;
|
||||
}
|
||||
|
||||
public TypeDescription getTypeDescription() {
|
||||
return typeDescription;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = typeDescription.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += mmsDeletable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
mmsDeletable = new BerBoolean();
|
||||
subCodeLength += mmsDeletable.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
subCodeLength += length.decode(is);
|
||||
typeDescription = new TypeDescription();
|
||||
subCodeLength += typeDescription.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (mmsDeletable != null) {
|
||||
sb.append("mmsDeletable: ").append(mmsDeletable);
|
||||
}
|
||||
else {
|
||||
sb.append("mmsDeletable: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (typeDescription != null) {
|
||||
sb.append("typeDescription: ");
|
||||
typeDescription.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("typeDescription: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class Identifier extends BerVisibleString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Identifier() {
|
||||
}
|
||||
public Identifier() {
|
||||
}
|
||||
|
||||
public Identifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public Identifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,297 +1,298 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class InformationReport implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfAccessResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<AccessResult> seqOf = null;
|
||||
|
||||
public ListOfAccessResult() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ListOfAccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AccessResult> getAccessResult() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
AccessResult element = new AccessResult();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength
|
||||
+ " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AccessResult> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfAccessResult listOfAccessResult = null;
|
||||
|
||||
public InformationReport() {
|
||||
}
|
||||
|
||||
public InformationReport(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
|
||||
this.listOfAccessResult = listOfAccessResult;
|
||||
}
|
||||
|
||||
public ListOfAccessResult getListOfAccessResult() {
|
||||
return listOfAccessResult;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfAccessResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableAccessSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfAccessResult = new ListOfAccessResult();
|
||||
subCodeLength += listOfAccessResult.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfAccessResult != null) {
|
||||
sb.append("listOfAccessResult: ");
|
||||
listOfAccessResult.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfAccessResult: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfAccessResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<AccessResult> seqOf = null;
|
||||
|
||||
public ListOfAccessResult() {
|
||||
seqOf = new ArrayList<AccessResult>();
|
||||
}
|
||||
|
||||
public ListOfAccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AccessResult> getAccessResult() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<AccessResult>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
AccessResult element = new AccessResult();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AccessResult> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfAccessResult listOfAccessResult = null;
|
||||
|
||||
public InformationReport() {
|
||||
}
|
||||
|
||||
public InformationReport(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
|
||||
this.listOfAccessResult = listOfAccessResult;
|
||||
}
|
||||
|
||||
public ListOfAccessResult getListOfAccessResult() {
|
||||
return listOfAccessResult;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfAccessResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableAccessSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfAccessResult = new ListOfAccessResult();
|
||||
subCodeLength += listOfAccessResult.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfAccessResult != null) {
|
||||
sb.append("listOfAccessResult: ");
|
||||
listOfAccessResult.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfAccessResult: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,18 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class InitiateErrorPDU extends ServiceError {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public InitiateErrorPDU() {
|
||||
}
|
||||
public InitiateErrorPDU() {
|
||||
}
|
||||
|
||||
public InitiateErrorPDU(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public InitiateErrorPDU(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,463 +1,468 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class InitiateRequestPDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class InitRequestDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer16 proposedVersionNumber = null;
|
||||
private ParameterSupportOptions proposedParameterCBB = null;
|
||||
private ServiceSupportOptions servicesSupportedCalling = null;
|
||||
|
||||
public InitRequestDetail() {
|
||||
}
|
||||
|
||||
public InitRequestDetail(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setProposedVersionNumber(Integer16 proposedVersionNumber) {
|
||||
this.proposedVersionNumber = proposedVersionNumber;
|
||||
}
|
||||
|
||||
public Integer16 getProposedVersionNumber() {
|
||||
return proposedVersionNumber;
|
||||
}
|
||||
|
||||
public void setProposedParameterCBB(ParameterSupportOptions proposedParameterCBB) {
|
||||
this.proposedParameterCBB = proposedParameterCBB;
|
||||
}
|
||||
|
||||
public ParameterSupportOptions getProposedParameterCBB() {
|
||||
return proposedParameterCBB;
|
||||
}
|
||||
|
||||
public void setServicesSupportedCalling(ServiceSupportOptions servicesSupportedCalling) {
|
||||
this.servicesSupportedCalling = servicesSupportedCalling;
|
||||
}
|
||||
|
||||
public ServiceSupportOptions getServicesSupportedCalling() {
|
||||
return servicesSupportedCalling;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += servicesSupportedCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedParameterCBB.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedVersionNumber.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
proposedVersionNumber = new Integer16();
|
||||
subCodeLength += proposedVersionNumber.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
proposedParameterCBB = new ParameterSupportOptions();
|
||||
subCodeLength += proposedParameterCBB.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
servicesSupportedCalling = new ServiceSupportOptions();
|
||||
subCodeLength += servicesSupportedCalling.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength
|
||||
+ ", actual sequence length: " + subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedVersionNumber != null) {
|
||||
sb.append("proposedVersionNumber: ").append(proposedVersionNumber);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedVersionNumber: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedParameterCBB != null) {
|
||||
sb.append("proposedParameterCBB: ").append(proposedParameterCBB);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedParameterCBB: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (servicesSupportedCalling != null) {
|
||||
sb.append("servicesSupportedCalling: ").append(servicesSupportedCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("servicesSupportedCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer32 localDetailCalling = null;
|
||||
private Integer16 proposedMaxServOutstandingCalling = null;
|
||||
private Integer16 proposedMaxServOutstandingCalled = null;
|
||||
private Integer8 proposedDataStructureNestingLevel = null;
|
||||
private InitRequestDetail initRequestDetail = null;
|
||||
|
||||
public InitiateRequestPDU() {
|
||||
}
|
||||
|
||||
public InitiateRequestPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setLocalDetailCalling(Integer32 localDetailCalling) {
|
||||
this.localDetailCalling = localDetailCalling;
|
||||
}
|
||||
|
||||
public Integer32 getLocalDetailCalling() {
|
||||
return localDetailCalling;
|
||||
}
|
||||
|
||||
public void setProposedMaxServOutstandingCalling(Integer16 proposedMaxServOutstandingCalling) {
|
||||
this.proposedMaxServOutstandingCalling = proposedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public Integer16 getProposedMaxServOutstandingCalling() {
|
||||
return proposedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public void setProposedMaxServOutstandingCalled(Integer16 proposedMaxServOutstandingCalled) {
|
||||
this.proposedMaxServOutstandingCalled = proposedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public Integer16 getProposedMaxServOutstandingCalled() {
|
||||
return proposedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public void setProposedDataStructureNestingLevel(Integer8 proposedDataStructureNestingLevel) {
|
||||
this.proposedDataStructureNestingLevel = proposedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public Integer8 getProposedDataStructureNestingLevel() {
|
||||
return proposedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public void setInitRequestDetail(InitRequestDetail initRequestDetail) {
|
||||
this.initRequestDetail = initRequestDetail;
|
||||
}
|
||||
|
||||
public InitRequestDetail getInitRequestDetail() {
|
||||
return initRequestDetail;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += initRequestDetail.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
|
||||
if (proposedDataStructureNestingLevel != null) {
|
||||
codeLength += proposedDataStructureNestingLevel.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
os.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += proposedMaxServOutstandingCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedMaxServOutstandingCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
if (localDetailCalling != null) {
|
||||
codeLength += localDetailCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
localDetailCalling = new Integer32();
|
||||
subCodeLength += localDetailCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
proposedMaxServOutstandingCalling = new Integer16();
|
||||
subCodeLength += proposedMaxServOutstandingCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
proposedMaxServOutstandingCalled = new Integer16();
|
||||
subCodeLength += proposedMaxServOutstandingCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
proposedDataStructureNestingLevel = new Integer8();
|
||||
subCodeLength += proposedDataStructureNestingLevel.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
initRequestDetail = new InitRequestDetail();
|
||||
subCodeLength += initRequestDetail.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (localDetailCalling != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("localDetailCalling: ").append(localDetailCalling);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedMaxServOutstandingCalling != null) {
|
||||
sb.append("proposedMaxServOutstandingCalling: ").append(proposedMaxServOutstandingCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedMaxServOutstandingCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedMaxServOutstandingCalled != null) {
|
||||
sb.append("proposedMaxServOutstandingCalled: ").append(proposedMaxServOutstandingCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedMaxServOutstandingCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (proposedDataStructureNestingLevel != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("proposedDataStructureNestingLevel: ").append(proposedDataStructureNestingLevel);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (initRequestDetail != null) {
|
||||
sb.append("initRequestDetail: ");
|
||||
initRequestDetail.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("initRequestDetail: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class InitRequestDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer16 proposedVersionNumber = null;
|
||||
private ParameterSupportOptions proposedParameterCBB = null;
|
||||
private ServiceSupportOptions servicesSupportedCalling = null;
|
||||
|
||||
public InitRequestDetail() {
|
||||
}
|
||||
|
||||
public InitRequestDetail(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setProposedVersionNumber(Integer16 proposedVersionNumber) {
|
||||
this.proposedVersionNumber = proposedVersionNumber;
|
||||
}
|
||||
|
||||
public Integer16 getProposedVersionNumber() {
|
||||
return proposedVersionNumber;
|
||||
}
|
||||
|
||||
public void setProposedParameterCBB(ParameterSupportOptions proposedParameterCBB) {
|
||||
this.proposedParameterCBB = proposedParameterCBB;
|
||||
}
|
||||
|
||||
public ParameterSupportOptions getProposedParameterCBB() {
|
||||
return proposedParameterCBB;
|
||||
}
|
||||
|
||||
public void setServicesSupportedCalling(ServiceSupportOptions servicesSupportedCalling) {
|
||||
this.servicesSupportedCalling = servicesSupportedCalling;
|
||||
}
|
||||
|
||||
public ServiceSupportOptions getServicesSupportedCalling() {
|
||||
return servicesSupportedCalling;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += servicesSupportedCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedParameterCBB.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedVersionNumber.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
proposedVersionNumber = new Integer16();
|
||||
subCodeLength += proposedVersionNumber.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
proposedParameterCBB = new ParameterSupportOptions();
|
||||
subCodeLength += proposedParameterCBB.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
servicesSupportedCalling = new ServiceSupportOptions();
|
||||
subCodeLength += servicesSupportedCalling.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedVersionNumber != null) {
|
||||
sb.append("proposedVersionNumber: ").append(proposedVersionNumber);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedVersionNumber: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedParameterCBB != null) {
|
||||
sb.append("proposedParameterCBB: ").append(proposedParameterCBB);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedParameterCBB: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (servicesSupportedCalling != null) {
|
||||
sb.append("servicesSupportedCalling: ").append(servicesSupportedCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("servicesSupportedCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer32 localDetailCalling = null;
|
||||
private Integer16 proposedMaxServOutstandingCalling = null;
|
||||
private Integer16 proposedMaxServOutstandingCalled = null;
|
||||
private Integer8 proposedDataStructureNestingLevel = null;
|
||||
private InitRequestDetail initRequestDetail = null;
|
||||
|
||||
public InitiateRequestPDU() {
|
||||
}
|
||||
|
||||
public InitiateRequestPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setLocalDetailCalling(Integer32 localDetailCalling) {
|
||||
this.localDetailCalling = localDetailCalling;
|
||||
}
|
||||
|
||||
public Integer32 getLocalDetailCalling() {
|
||||
return localDetailCalling;
|
||||
}
|
||||
|
||||
public void setProposedMaxServOutstandingCalling(Integer16 proposedMaxServOutstandingCalling) {
|
||||
this.proposedMaxServOutstandingCalling = proposedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public Integer16 getProposedMaxServOutstandingCalling() {
|
||||
return proposedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public void setProposedMaxServOutstandingCalled(Integer16 proposedMaxServOutstandingCalled) {
|
||||
this.proposedMaxServOutstandingCalled = proposedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public Integer16 getProposedMaxServOutstandingCalled() {
|
||||
return proposedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public void setProposedDataStructureNestingLevel(Integer8 proposedDataStructureNestingLevel) {
|
||||
this.proposedDataStructureNestingLevel = proposedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public Integer8 getProposedDataStructureNestingLevel() {
|
||||
return proposedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public void setInitRequestDetail(InitRequestDetail initRequestDetail) {
|
||||
this.initRequestDetail = initRequestDetail;
|
||||
}
|
||||
|
||||
public InitRequestDetail getInitRequestDetail() {
|
||||
return initRequestDetail;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += initRequestDetail.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
|
||||
if (proposedDataStructureNestingLevel != null) {
|
||||
codeLength += proposedDataStructureNestingLevel.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
os.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += proposedMaxServOutstandingCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += proposedMaxServOutstandingCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
if (localDetailCalling != null) {
|
||||
codeLength += localDetailCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
localDetailCalling = new Integer32();
|
||||
subCodeLength += localDetailCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
proposedMaxServOutstandingCalling = new Integer16();
|
||||
subCodeLength += proposedMaxServOutstandingCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
proposedMaxServOutstandingCalled = new Integer16();
|
||||
subCodeLength += proposedMaxServOutstandingCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
proposedDataStructureNestingLevel = new Integer8();
|
||||
subCodeLength += proposedDataStructureNestingLevel.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
initRequestDetail = new InitRequestDetail();
|
||||
subCodeLength += initRequestDetail.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (localDetailCalling != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("localDetailCalling: ").append(localDetailCalling);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedMaxServOutstandingCalling != null) {
|
||||
sb.append("proposedMaxServOutstandingCalling: ").append(proposedMaxServOutstandingCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedMaxServOutstandingCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (proposedMaxServOutstandingCalled != null) {
|
||||
sb.append("proposedMaxServOutstandingCalled: ").append(proposedMaxServOutstandingCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("proposedMaxServOutstandingCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (proposedDataStructureNestingLevel != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("proposedDataStructureNestingLevel: ").append(proposedDataStructureNestingLevel);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (initRequestDetail != null) {
|
||||
sb.append("initRequestDetail: ");
|
||||
initRequestDetail.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("initRequestDetail: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,463 +1,468 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class InitiateResponsePDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class InitResponseDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer16 negotiatedVersionNumber = null;
|
||||
private ParameterSupportOptions negotiatedParameterCBB = null;
|
||||
private ServiceSupportOptions servicesSupportedCalled = null;
|
||||
|
||||
public InitResponseDetail() {
|
||||
}
|
||||
|
||||
public InitResponseDetail(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNegotiatedVersionNumber(Integer16 negotiatedVersionNumber) {
|
||||
this.negotiatedVersionNumber = negotiatedVersionNumber;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedVersionNumber() {
|
||||
return negotiatedVersionNumber;
|
||||
}
|
||||
|
||||
public void setNegotiatedParameterCBB(ParameterSupportOptions negotiatedParameterCBB) {
|
||||
this.negotiatedParameterCBB = negotiatedParameterCBB;
|
||||
}
|
||||
|
||||
public ParameterSupportOptions getNegotiatedParameterCBB() {
|
||||
return negotiatedParameterCBB;
|
||||
}
|
||||
|
||||
public void setServicesSupportedCalled(ServiceSupportOptions servicesSupportedCalled) {
|
||||
this.servicesSupportedCalled = servicesSupportedCalled;
|
||||
}
|
||||
|
||||
public ServiceSupportOptions getServicesSupportedCalled() {
|
||||
return servicesSupportedCalled;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += servicesSupportedCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedParameterCBB.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedVersionNumber.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
negotiatedVersionNumber = new Integer16();
|
||||
subCodeLength += negotiatedVersionNumber.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
negotiatedParameterCBB = new ParameterSupportOptions();
|
||||
subCodeLength += negotiatedParameterCBB.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
servicesSupportedCalled = new ServiceSupportOptions();
|
||||
subCodeLength += servicesSupportedCalled.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength
|
||||
+ ", actual sequence length: " + subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedVersionNumber != null) {
|
||||
sb.append("negotiatedVersionNumber: ").append(negotiatedVersionNumber);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedVersionNumber: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedParameterCBB != null) {
|
||||
sb.append("negotiatedParameterCBB: ").append(negotiatedParameterCBB);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedParameterCBB: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (servicesSupportedCalled != null) {
|
||||
sb.append("servicesSupportedCalled: ").append(servicesSupportedCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("servicesSupportedCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer32 localDetailCalled = null;
|
||||
private Integer16 negotiatedMaxServOutstandingCalling = null;
|
||||
private Integer16 negotiatedMaxServOutstandingCalled = null;
|
||||
private Integer8 negotiatedDataStructureNestingLevel = null;
|
||||
private InitResponseDetail initResponseDetail = null;
|
||||
|
||||
public InitiateResponsePDU() {
|
||||
}
|
||||
|
||||
public InitiateResponsePDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setLocalDetailCalled(Integer32 localDetailCalled) {
|
||||
this.localDetailCalled = localDetailCalled;
|
||||
}
|
||||
|
||||
public Integer32 getLocalDetailCalled() {
|
||||
return localDetailCalled;
|
||||
}
|
||||
|
||||
public void setNegotiatedMaxServOutstandingCalling(Integer16 negotiatedMaxServOutstandingCalling) {
|
||||
this.negotiatedMaxServOutstandingCalling = negotiatedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedMaxServOutstandingCalling() {
|
||||
return negotiatedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public void setNegotiatedMaxServOutstandingCalled(Integer16 negotiatedMaxServOutstandingCalled) {
|
||||
this.negotiatedMaxServOutstandingCalled = negotiatedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedMaxServOutstandingCalled() {
|
||||
return negotiatedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public void setNegotiatedDataStructureNestingLevel(Integer8 negotiatedDataStructureNestingLevel) {
|
||||
this.negotiatedDataStructureNestingLevel = negotiatedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public Integer8 getNegotiatedDataStructureNestingLevel() {
|
||||
return negotiatedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public void setInitResponseDetail(InitResponseDetail initResponseDetail) {
|
||||
this.initResponseDetail = initResponseDetail;
|
||||
}
|
||||
|
||||
public InitResponseDetail getInitResponseDetail() {
|
||||
return initResponseDetail;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += initResponseDetail.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
|
||||
if (negotiatedDataStructureNestingLevel != null) {
|
||||
codeLength += negotiatedDataStructureNestingLevel.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
os.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += negotiatedMaxServOutstandingCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedMaxServOutstandingCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
if (localDetailCalled != null) {
|
||||
codeLength += localDetailCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
localDetailCalled = new Integer32();
|
||||
subCodeLength += localDetailCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
negotiatedMaxServOutstandingCalling = new Integer16();
|
||||
subCodeLength += negotiatedMaxServOutstandingCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
negotiatedMaxServOutstandingCalled = new Integer16();
|
||||
subCodeLength += negotiatedMaxServOutstandingCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
negotiatedDataStructureNestingLevel = new Integer8();
|
||||
subCodeLength += negotiatedDataStructureNestingLevel.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
initResponseDetail = new InitResponseDetail();
|
||||
subCodeLength += initResponseDetail.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (localDetailCalled != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("localDetailCalled: ").append(localDetailCalled);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedMaxServOutstandingCalling != null) {
|
||||
sb.append("negotiatedMaxServOutstandingCalling: ").append(negotiatedMaxServOutstandingCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedMaxServOutstandingCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedMaxServOutstandingCalled != null) {
|
||||
sb.append("negotiatedMaxServOutstandingCalled: ").append(negotiatedMaxServOutstandingCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedMaxServOutstandingCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (negotiatedDataStructureNestingLevel != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("negotiatedDataStructureNestingLevel: ").append(negotiatedDataStructureNestingLevel);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (initResponseDetail != null) {
|
||||
sb.append("initResponseDetail: ");
|
||||
initResponseDetail.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("initResponseDetail: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class InitResponseDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer16 negotiatedVersionNumber = null;
|
||||
private ParameterSupportOptions negotiatedParameterCBB = null;
|
||||
private ServiceSupportOptions servicesSupportedCalled = null;
|
||||
|
||||
public InitResponseDetail() {
|
||||
}
|
||||
|
||||
public InitResponseDetail(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNegotiatedVersionNumber(Integer16 negotiatedVersionNumber) {
|
||||
this.negotiatedVersionNumber = negotiatedVersionNumber;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedVersionNumber() {
|
||||
return negotiatedVersionNumber;
|
||||
}
|
||||
|
||||
public void setNegotiatedParameterCBB(ParameterSupportOptions negotiatedParameterCBB) {
|
||||
this.negotiatedParameterCBB = negotiatedParameterCBB;
|
||||
}
|
||||
|
||||
public ParameterSupportOptions getNegotiatedParameterCBB() {
|
||||
return negotiatedParameterCBB;
|
||||
}
|
||||
|
||||
public void setServicesSupportedCalled(ServiceSupportOptions servicesSupportedCalled) {
|
||||
this.servicesSupportedCalled = servicesSupportedCalled;
|
||||
}
|
||||
|
||||
public ServiceSupportOptions getServicesSupportedCalled() {
|
||||
return servicesSupportedCalled;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += servicesSupportedCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedParameterCBB.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedVersionNumber.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
negotiatedVersionNumber = new Integer16();
|
||||
subCodeLength += negotiatedVersionNumber.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
negotiatedParameterCBB = new ParameterSupportOptions();
|
||||
subCodeLength += negotiatedParameterCBB.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
servicesSupportedCalled = new ServiceSupportOptions();
|
||||
subCodeLength += servicesSupportedCalled.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedVersionNumber != null) {
|
||||
sb.append("negotiatedVersionNumber: ").append(negotiatedVersionNumber);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedVersionNumber: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedParameterCBB != null) {
|
||||
sb.append("negotiatedParameterCBB: ").append(negotiatedParameterCBB);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedParameterCBB: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (servicesSupportedCalled != null) {
|
||||
sb.append("servicesSupportedCalled: ").append(servicesSupportedCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("servicesSupportedCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Integer32 localDetailCalled = null;
|
||||
private Integer16 negotiatedMaxServOutstandingCalling = null;
|
||||
private Integer16 negotiatedMaxServOutstandingCalled = null;
|
||||
private Integer8 negotiatedDataStructureNestingLevel = null;
|
||||
private InitResponseDetail initResponseDetail = null;
|
||||
|
||||
public InitiateResponsePDU() {
|
||||
}
|
||||
|
||||
public InitiateResponsePDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setLocalDetailCalled(Integer32 localDetailCalled) {
|
||||
this.localDetailCalled = localDetailCalled;
|
||||
}
|
||||
|
||||
public Integer32 getLocalDetailCalled() {
|
||||
return localDetailCalled;
|
||||
}
|
||||
|
||||
public void setNegotiatedMaxServOutstandingCalling(Integer16 negotiatedMaxServOutstandingCalling) {
|
||||
this.negotiatedMaxServOutstandingCalling = negotiatedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedMaxServOutstandingCalling() {
|
||||
return negotiatedMaxServOutstandingCalling;
|
||||
}
|
||||
|
||||
public void setNegotiatedMaxServOutstandingCalled(Integer16 negotiatedMaxServOutstandingCalled) {
|
||||
this.negotiatedMaxServOutstandingCalled = negotiatedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public Integer16 getNegotiatedMaxServOutstandingCalled() {
|
||||
return negotiatedMaxServOutstandingCalled;
|
||||
}
|
||||
|
||||
public void setNegotiatedDataStructureNestingLevel(Integer8 negotiatedDataStructureNestingLevel) {
|
||||
this.negotiatedDataStructureNestingLevel = negotiatedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public Integer8 getNegotiatedDataStructureNestingLevel() {
|
||||
return negotiatedDataStructureNestingLevel;
|
||||
}
|
||||
|
||||
public void setInitResponseDetail(InitResponseDetail initResponseDetail) {
|
||||
this.initResponseDetail = initResponseDetail;
|
||||
}
|
||||
|
||||
public InitResponseDetail getInitResponseDetail() {
|
||||
return initResponseDetail;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += initResponseDetail.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
|
||||
if (negotiatedDataStructureNestingLevel != null) {
|
||||
codeLength += negotiatedDataStructureNestingLevel.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
os.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += negotiatedMaxServOutstandingCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += negotiatedMaxServOutstandingCalling.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
|
||||
if (localDetailCalled != null) {
|
||||
codeLength += localDetailCalled.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
localDetailCalled = new Integer32();
|
||||
subCodeLength += localDetailCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
negotiatedMaxServOutstandingCalling = new Integer16();
|
||||
subCodeLength += negotiatedMaxServOutstandingCalling.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
negotiatedMaxServOutstandingCalled = new Integer16();
|
||||
subCodeLength += negotiatedMaxServOutstandingCalled.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
negotiatedDataStructureNestingLevel = new Integer8();
|
||||
subCodeLength += negotiatedDataStructureNestingLevel.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
initResponseDetail = new InitResponseDetail();
|
||||
subCodeLength += initResponseDetail.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (localDetailCalled != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("localDetailCalled: ").append(localDetailCalled);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedMaxServOutstandingCalling != null) {
|
||||
sb.append("negotiatedMaxServOutstandingCalling: ").append(negotiatedMaxServOutstandingCalling);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedMaxServOutstandingCalling: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (negotiatedMaxServOutstandingCalled != null) {
|
||||
sb.append("negotiatedMaxServOutstandingCalled: ").append(negotiatedMaxServOutstandingCalled);
|
||||
}
|
||||
else {
|
||||
sb.append("negotiatedMaxServOutstandingCalled: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (negotiatedDataStructureNestingLevel != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("negotiatedDataStructureNestingLevel: ").append(negotiatedDataStructureNestingLevel);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (initResponseDetail != null) {
|
||||
sb.append("initResponseDetail: ");
|
||||
initResponseDetail.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("initResponseDetail: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Integer16 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer16() {
|
||||
}
|
||||
public Integer16() {
|
||||
}
|
||||
|
||||
public Integer16(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Integer16(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Integer16(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer16(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Integer16(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer16(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Integer32 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer32() {
|
||||
}
|
||||
public Integer32() {
|
||||
}
|
||||
|
||||
public Integer32(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Integer32(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Integer32(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer32(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Integer32(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer32(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Integer8 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer8() {
|
||||
}
|
||||
public Integer8() {
|
||||
}
|
||||
|
||||
public Integer8(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Integer8(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Integer8(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer8(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Integer8(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Integer8(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class MMSString extends BerVisibleString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public MMSString() {
|
||||
}
|
||||
public MMSString() {
|
||||
}
|
||||
|
||||
public MMSString(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public MMSString(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,340 +1,347 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class MMSpdu implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ConfirmedRequestPDU confirmedRequestPDU = null;
|
||||
private ConfirmedResponsePDU confirmedResponsePDU = null;
|
||||
private ConfirmedErrorPDU confirmedErrorPDU = null;
|
||||
private UnconfirmedPDU unconfirmedPDU = null;
|
||||
private RejectPDU rejectPDU = null;
|
||||
private InitiateRequestPDU initiateRequestPDU = null;
|
||||
private InitiateResponsePDU initiateResponsePDU = null;
|
||||
private InitiateErrorPDU initiateErrorPDU = null;
|
||||
private ConcludeRequestPDU concludeRequestPDU = null;
|
||||
|
||||
public MMSpdu() {
|
||||
}
|
||||
|
||||
public MMSpdu(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setConfirmedRequestPDU(ConfirmedRequestPDU confirmedRequestPDU) {
|
||||
this.confirmedRequestPDU = confirmedRequestPDU;
|
||||
}
|
||||
|
||||
public ConfirmedRequestPDU getConfirmedRequestPDU() {
|
||||
return confirmedRequestPDU;
|
||||
}
|
||||
|
||||
public void setConfirmedResponsePDU(ConfirmedResponsePDU confirmedResponsePDU) {
|
||||
this.confirmedResponsePDU = confirmedResponsePDU;
|
||||
}
|
||||
|
||||
public ConfirmedResponsePDU getConfirmedResponsePDU() {
|
||||
return confirmedResponsePDU;
|
||||
}
|
||||
|
||||
public void setConfirmedErrorPDU(ConfirmedErrorPDU confirmedErrorPDU) {
|
||||
this.confirmedErrorPDU = confirmedErrorPDU;
|
||||
}
|
||||
|
||||
public ConfirmedErrorPDU getConfirmedErrorPDU() {
|
||||
return confirmedErrorPDU;
|
||||
}
|
||||
|
||||
public void setUnconfirmedPDU(UnconfirmedPDU unconfirmedPDU) {
|
||||
this.unconfirmedPDU = unconfirmedPDU;
|
||||
}
|
||||
|
||||
public UnconfirmedPDU getUnconfirmedPDU() {
|
||||
return unconfirmedPDU;
|
||||
}
|
||||
|
||||
public void setRejectPDU(RejectPDU rejectPDU) {
|
||||
this.rejectPDU = rejectPDU;
|
||||
}
|
||||
|
||||
public RejectPDU getRejectPDU() {
|
||||
return rejectPDU;
|
||||
}
|
||||
|
||||
public void setInitiateRequestPDU(InitiateRequestPDU initiateRequestPDU) {
|
||||
this.initiateRequestPDU = initiateRequestPDU;
|
||||
}
|
||||
|
||||
public InitiateRequestPDU getInitiateRequestPDU() {
|
||||
return initiateRequestPDU;
|
||||
}
|
||||
|
||||
public void setInitiateResponsePDU(InitiateResponsePDU initiateResponsePDU) {
|
||||
this.initiateResponsePDU = initiateResponsePDU;
|
||||
}
|
||||
|
||||
public InitiateResponsePDU getInitiateResponsePDU() {
|
||||
return initiateResponsePDU;
|
||||
}
|
||||
|
||||
public void setInitiateErrorPDU(InitiateErrorPDU initiateErrorPDU) {
|
||||
this.initiateErrorPDU = initiateErrorPDU;
|
||||
}
|
||||
|
||||
public InitiateErrorPDU getInitiateErrorPDU() {
|
||||
return initiateErrorPDU;
|
||||
}
|
||||
|
||||
public void setConcludeRequestPDU(ConcludeRequestPDU concludeRequestPDU) {
|
||||
this.concludeRequestPDU = concludeRequestPDU;
|
||||
}
|
||||
|
||||
public ConcludeRequestPDU getConcludeRequestPDU() {
|
||||
return concludeRequestPDU;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (concludeRequestPDU != null) {
|
||||
codeLength += concludeRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
|
||||
os.write(0x8B);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateErrorPDU != null) {
|
||||
codeLength += initiateErrorPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 10
|
||||
os.write(0xAA);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateResponsePDU != null) {
|
||||
codeLength += initiateResponsePDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 9
|
||||
os.write(0xA9);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateRequestPDU != null) {
|
||||
codeLength += initiateRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 8
|
||||
os.write(0xA8);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (rejectPDU != null) {
|
||||
codeLength += rejectPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (unconfirmedPDU != null) {
|
||||
codeLength += unconfirmedPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
|
||||
os.write(0xA3);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedErrorPDU != null) {
|
||||
codeLength += confirmedErrorPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedResponsePDU != null) {
|
||||
codeLength += confirmedResponsePDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedRequestPDU != null) {
|
||||
codeLength += confirmedRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
confirmedRequestPDU = new ConfirmedRequestPDU();
|
||||
codeLength += confirmedRequestPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
confirmedResponsePDU = new ConfirmedResponsePDU();
|
||||
codeLength += confirmedResponsePDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
confirmedErrorPDU = new ConfirmedErrorPDU();
|
||||
codeLength += confirmedErrorPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
|
||||
unconfirmedPDU = new UnconfirmedPDU();
|
||||
codeLength += unconfirmedPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
rejectPDU = new RejectPDU();
|
||||
codeLength += rejectPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
|
||||
initiateRequestPDU = new InitiateRequestPDU();
|
||||
codeLength += initiateRequestPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
|
||||
initiateResponsePDU = new InitiateResponsePDU();
|
||||
codeLength += initiateResponsePDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) {
|
||||
initiateErrorPDU = new InitiateErrorPDU();
|
||||
codeLength += initiateErrorPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
|
||||
concludeRequestPDU = new ConcludeRequestPDU();
|
||||
codeLength += concludeRequestPDU.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (confirmedRequestPDU != null) {
|
||||
sb.append("confirmedRequestPDU: ");
|
||||
confirmedRequestPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirmedResponsePDU != null) {
|
||||
sb.append("confirmedResponsePDU: ");
|
||||
confirmedResponsePDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirmedErrorPDU != null) {
|
||||
sb.append("confirmedErrorPDU: ");
|
||||
confirmedErrorPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (unconfirmedPDU != null) {
|
||||
sb.append("unconfirmedPDU: ");
|
||||
unconfirmedPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rejectPDU != null) {
|
||||
sb.append("rejectPDU: ");
|
||||
rejectPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateRequestPDU != null) {
|
||||
sb.append("initiateRequestPDU: ");
|
||||
initiateRequestPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateResponsePDU != null) {
|
||||
sb.append("initiateResponsePDU: ");
|
||||
initiateResponsePDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateErrorPDU != null) {
|
||||
sb.append("initiateErrorPDU: ");
|
||||
initiateErrorPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (concludeRequestPDU != null) {
|
||||
sb.append("concludeRequestPDU: ").append(concludeRequestPDU);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ConfirmedRequestPDU confirmedRequestPDU = null;
|
||||
private ConfirmedResponsePDU confirmedResponsePDU = null;
|
||||
private ConfirmedErrorPDU confirmedErrorPDU = null;
|
||||
private UnconfirmedPDU unconfirmedPDU = null;
|
||||
private RejectPDU rejectPDU = null;
|
||||
private InitiateRequestPDU initiateRequestPDU = null;
|
||||
private InitiateResponsePDU initiateResponsePDU = null;
|
||||
private InitiateErrorPDU initiateErrorPDU = null;
|
||||
private ConcludeRequestPDU concludeRequestPDU = null;
|
||||
|
||||
public MMSpdu() {
|
||||
}
|
||||
|
||||
public MMSpdu(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setConfirmedRequestPDU(ConfirmedRequestPDU confirmedRequestPDU) {
|
||||
this.confirmedRequestPDU = confirmedRequestPDU;
|
||||
}
|
||||
|
||||
public ConfirmedRequestPDU getConfirmedRequestPDU() {
|
||||
return confirmedRequestPDU;
|
||||
}
|
||||
|
||||
public void setConfirmedResponsePDU(ConfirmedResponsePDU confirmedResponsePDU) {
|
||||
this.confirmedResponsePDU = confirmedResponsePDU;
|
||||
}
|
||||
|
||||
public ConfirmedResponsePDU getConfirmedResponsePDU() {
|
||||
return confirmedResponsePDU;
|
||||
}
|
||||
|
||||
public void setConfirmedErrorPDU(ConfirmedErrorPDU confirmedErrorPDU) {
|
||||
this.confirmedErrorPDU = confirmedErrorPDU;
|
||||
}
|
||||
|
||||
public ConfirmedErrorPDU getConfirmedErrorPDU() {
|
||||
return confirmedErrorPDU;
|
||||
}
|
||||
|
||||
public void setUnconfirmedPDU(UnconfirmedPDU unconfirmedPDU) {
|
||||
this.unconfirmedPDU = unconfirmedPDU;
|
||||
}
|
||||
|
||||
public UnconfirmedPDU getUnconfirmedPDU() {
|
||||
return unconfirmedPDU;
|
||||
}
|
||||
|
||||
public void setRejectPDU(RejectPDU rejectPDU) {
|
||||
this.rejectPDU = rejectPDU;
|
||||
}
|
||||
|
||||
public RejectPDU getRejectPDU() {
|
||||
return rejectPDU;
|
||||
}
|
||||
|
||||
public void setInitiateRequestPDU(InitiateRequestPDU initiateRequestPDU) {
|
||||
this.initiateRequestPDU = initiateRequestPDU;
|
||||
}
|
||||
|
||||
public InitiateRequestPDU getInitiateRequestPDU() {
|
||||
return initiateRequestPDU;
|
||||
}
|
||||
|
||||
public void setInitiateResponsePDU(InitiateResponsePDU initiateResponsePDU) {
|
||||
this.initiateResponsePDU = initiateResponsePDU;
|
||||
}
|
||||
|
||||
public InitiateResponsePDU getInitiateResponsePDU() {
|
||||
return initiateResponsePDU;
|
||||
}
|
||||
|
||||
public void setInitiateErrorPDU(InitiateErrorPDU initiateErrorPDU) {
|
||||
this.initiateErrorPDU = initiateErrorPDU;
|
||||
}
|
||||
|
||||
public InitiateErrorPDU getInitiateErrorPDU() {
|
||||
return initiateErrorPDU;
|
||||
}
|
||||
|
||||
public void setConcludeRequestPDU(ConcludeRequestPDU concludeRequestPDU) {
|
||||
this.concludeRequestPDU = concludeRequestPDU;
|
||||
}
|
||||
|
||||
public ConcludeRequestPDU getConcludeRequestPDU() {
|
||||
return concludeRequestPDU;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (concludeRequestPDU != null) {
|
||||
codeLength += concludeRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
|
||||
os.write(0x8B);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateErrorPDU != null) {
|
||||
codeLength += initiateErrorPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 10
|
||||
os.write(0xAA);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateResponsePDU != null) {
|
||||
codeLength += initiateResponsePDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 9
|
||||
os.write(0xA9);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (initiateRequestPDU != null) {
|
||||
codeLength += initiateRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 8
|
||||
os.write(0xA8);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (rejectPDU != null) {
|
||||
codeLength += rejectPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
|
||||
os.write(0xA4);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (unconfirmedPDU != null) {
|
||||
codeLength += unconfirmedPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
|
||||
os.write(0xA3);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedErrorPDU != null) {
|
||||
codeLength += confirmedErrorPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
os.write(0xA2);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedResponsePDU != null) {
|
||||
codeLength += confirmedResponsePDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (confirmedRequestPDU != null) {
|
||||
codeLength += confirmedRequestPDU.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
confirmedRequestPDU = new ConfirmedRequestPDU();
|
||||
codeLength += confirmedRequestPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
confirmedResponsePDU = new ConfirmedResponsePDU();
|
||||
codeLength += confirmedResponsePDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
confirmedErrorPDU = new ConfirmedErrorPDU();
|
||||
codeLength += confirmedErrorPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
|
||||
unconfirmedPDU = new UnconfirmedPDU();
|
||||
codeLength += unconfirmedPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
|
||||
rejectPDU = new RejectPDU();
|
||||
codeLength += rejectPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
|
||||
initiateRequestPDU = new InitiateRequestPDU();
|
||||
codeLength += initiateRequestPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
|
||||
initiateResponsePDU = new InitiateResponsePDU();
|
||||
codeLength += initiateResponsePDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) {
|
||||
initiateErrorPDU = new InitiateErrorPDU();
|
||||
codeLength += initiateErrorPDU.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
|
||||
concludeRequestPDU = new ConcludeRequestPDU();
|
||||
codeLength += concludeRequestPDU.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (confirmedRequestPDU != null) {
|
||||
sb.append("confirmedRequestPDU: ");
|
||||
confirmedRequestPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirmedResponsePDU != null) {
|
||||
sb.append("confirmedResponsePDU: ");
|
||||
confirmedResponsePDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirmedErrorPDU != null) {
|
||||
sb.append("confirmedErrorPDU: ");
|
||||
confirmedErrorPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (unconfirmedPDU != null) {
|
||||
sb.append("unconfirmedPDU: ");
|
||||
unconfirmedPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rejectPDU != null) {
|
||||
sb.append("rejectPDU: ");
|
||||
rejectPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateRequestPDU != null) {
|
||||
sb.append("initiateRequestPDU: ");
|
||||
initiateRequestPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateResponsePDU != null) {
|
||||
sb.append("initiateResponsePDU: ");
|
||||
initiateResponsePDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initiateErrorPDU != null) {
|
||||
sb.append("initiateErrorPDU: ");
|
||||
initiateErrorPDU.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (concludeRequestPDU != null) {
|
||||
sb.append("concludeRequestPDU: ").append(concludeRequestPDU);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,109 +1,115 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class ObjectClass implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BerInteger basicObjectClass = null;
|
||||
|
||||
public ObjectClass() {
|
||||
}
|
||||
|
||||
public ObjectClass(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setBasicObjectClass(BerInteger basicObjectClass) {
|
||||
this.basicObjectClass = basicObjectClass;
|
||||
}
|
||||
|
||||
public BerInteger getBasicObjectClass() {
|
||||
return basicObjectClass;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (basicObjectClass != null) {
|
||||
codeLength += basicObjectClass.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
basicObjectClass = new BerInteger();
|
||||
codeLength += basicObjectClass.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (basicObjectClass != null) {
|
||||
sb.append("basicObjectClass: ").append(basicObjectClass);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private BerInteger basicObjectClass = null;
|
||||
|
||||
public ObjectClass() {
|
||||
}
|
||||
|
||||
public ObjectClass(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setBasicObjectClass(BerInteger basicObjectClass) {
|
||||
this.basicObjectClass = basicObjectClass;
|
||||
}
|
||||
|
||||
public BerInteger getBasicObjectClass() {
|
||||
return basicObjectClass;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (basicObjectClass != null) {
|
||||
codeLength += basicObjectClass.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
basicObjectClass = new BerInteger();
|
||||
codeLength += basicObjectClass.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (basicObjectClass != null) {
|
||||
sb.append("basicObjectClass: ").append(basicObjectClass);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,320 +1,323 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
|
||||
|
||||
public class ObjectName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
|
||||
public static class DomainSpecific implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Identifier domainID = null;
|
||||
private Identifier itemID = null;
|
||||
|
||||
public DomainSpecific() {
|
||||
}
|
||||
|
||||
public DomainSpecific(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setDomainID(Identifier domainID) {
|
||||
this.domainID = domainID;
|
||||
}
|
||||
|
||||
public Identifier getDomainID() {
|
||||
return domainID;
|
||||
}
|
||||
|
||||
public void setItemID(Identifier itemID) {
|
||||
this.itemID = itemID;
|
||||
}
|
||||
|
||||
public Identifier getItemID() {
|
||||
return itemID;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += itemID.encode(os, true);
|
||||
|
||||
codeLength += domainID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerVisibleString.tag)) {
|
||||
domainID = new Identifier();
|
||||
subCodeLength += domainID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerVisibleString.tag)) {
|
||||
itemID = new Identifier();
|
||||
subCodeLength += itemID.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength
|
||||
+ ", actual sequence length: " + subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (domainID != null) {
|
||||
sb.append("domainID: ").append(domainID);
|
||||
}
|
||||
else {
|
||||
sb.append("domainID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (itemID != null) {
|
||||
sb.append("itemID: ").append(itemID);
|
||||
}
|
||||
else {
|
||||
sb.append("itemID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Identifier vmdSpecific = null;
|
||||
private DomainSpecific domainSpecific = null;
|
||||
private Identifier aaSpecific = null;
|
||||
|
||||
public ObjectName() {
|
||||
}
|
||||
|
||||
public ObjectName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVmdSpecific(Identifier vmdSpecific) {
|
||||
this.vmdSpecific = vmdSpecific;
|
||||
}
|
||||
|
||||
public Identifier getVmdSpecific() {
|
||||
return vmdSpecific;
|
||||
}
|
||||
|
||||
public void setDomainSpecific(DomainSpecific domainSpecific) {
|
||||
this.domainSpecific = domainSpecific;
|
||||
}
|
||||
|
||||
public DomainSpecific getDomainSpecific() {
|
||||
return domainSpecific;
|
||||
}
|
||||
|
||||
public void setAaSpecific(Identifier aaSpecific) {
|
||||
this.aaSpecific = aaSpecific;
|
||||
}
|
||||
|
||||
public Identifier getAaSpecific() {
|
||||
return aaSpecific;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (aaSpecific != null) {
|
||||
codeLength += aaSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
codeLength += domainSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
codeLength += vmdSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
vmdSpecific = new Identifier();
|
||||
codeLength += vmdSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
domainSpecific = new DomainSpecific();
|
||||
codeLength += domainSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
aaSpecific = new Identifier();
|
||||
codeLength += aaSpecific.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
sb.append("vmdSpecific: ").append(vmdSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
sb.append("domainSpecific: ");
|
||||
domainSpecific.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aaSpecific != null) {
|
||||
sb.append("aaSpecific: ").append(aaSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
public static class DomainSpecific implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private Identifier domainID = null;
|
||||
private Identifier itemID = null;
|
||||
|
||||
public DomainSpecific() {
|
||||
}
|
||||
|
||||
public DomainSpecific(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setDomainID(Identifier domainID) {
|
||||
this.domainID = domainID;
|
||||
}
|
||||
|
||||
public Identifier getDomainID() {
|
||||
return domainID;
|
||||
}
|
||||
|
||||
public void setItemID(Identifier itemID) {
|
||||
this.itemID = itemID;
|
||||
}
|
||||
|
||||
public Identifier getItemID() {
|
||||
return itemID;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += itemID.encode(os, true);
|
||||
|
||||
codeLength += domainID.encode(os, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(Identifier.tag)) {
|
||||
domainID = new Identifier();
|
||||
subCodeLength += domainID.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match the mandatory sequence element tag.");
|
||||
}
|
||||
|
||||
if (berTag.equals(Identifier.tag)) {
|
||||
itemID = new Identifier();
|
||||
subCodeLength += itemID.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (domainID != null) {
|
||||
sb.append("domainID: ").append(domainID);
|
||||
}
|
||||
else {
|
||||
sb.append("domainID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (itemID != null) {
|
||||
sb.append("itemID: ").append(itemID);
|
||||
}
|
||||
else {
|
||||
sb.append("itemID: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Identifier vmdSpecific = null;
|
||||
private DomainSpecific domainSpecific = null;
|
||||
private Identifier aaSpecific = null;
|
||||
|
||||
public ObjectName() {
|
||||
}
|
||||
|
||||
public ObjectName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVmdSpecific(Identifier vmdSpecific) {
|
||||
this.vmdSpecific = vmdSpecific;
|
||||
}
|
||||
|
||||
public Identifier getVmdSpecific() {
|
||||
return vmdSpecific;
|
||||
}
|
||||
|
||||
public void setDomainSpecific(DomainSpecific domainSpecific) {
|
||||
this.domainSpecific = domainSpecific;
|
||||
}
|
||||
|
||||
public DomainSpecific getDomainSpecific() {
|
||||
return domainSpecific;
|
||||
}
|
||||
|
||||
public void setAaSpecific(Identifier aaSpecific) {
|
||||
this.aaSpecific = aaSpecific;
|
||||
}
|
||||
|
||||
public Identifier getAaSpecific() {
|
||||
return aaSpecific;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (aaSpecific != null) {
|
||||
codeLength += aaSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
os.write(0x82);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
codeLength += domainSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
codeLength += vmdSpecific.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
vmdSpecific = new Identifier();
|
||||
codeLength += vmdSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
domainSpecific = new DomainSpecific();
|
||||
codeLength += domainSpecific.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
aaSpecific = new Identifier();
|
||||
codeLength += aaSpecific.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (vmdSpecific != null) {
|
||||
sb.append("vmdSpecific: ").append(vmdSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
if (domainSpecific != null) {
|
||||
sb.append("domainSpecific: ");
|
||||
domainSpecific.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aaSpecific != null) {
|
||||
sb.append("aaSpecific: ").append(aaSpecific);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,28 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerBitString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class ParameterSupportOptions extends BerBitString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ParameterSupportOptions() {
|
||||
}
|
||||
public ParameterSupportOptions() {
|
||||
}
|
||||
|
||||
public ParameterSupportOptions(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public ParameterSupportOptions(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public ParameterSupportOptions(byte[] value, int numBits) {
|
||||
super(value, numBits);
|
||||
}
|
||||
public ParameterSupportOptions(byte[] value, int numBits) {
|
||||
super(value, numBits);
|
||||
}
|
||||
|
||||
public ParameterSupportOptions(boolean[] value) {
|
||||
super(value);
|
||||
}
|
||||
public ParameterSupportOptions(boolean[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,179 +1,184 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerBoolean;
|
||||
|
||||
public class ReadRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean specificationWithResult = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
|
||||
public ReadRequest() {
|
||||
}
|
||||
|
||||
public ReadRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setSpecificationWithResult(BerBoolean specificationWithResult) {
|
||||
this.specificationWithResult = specificationWithResult;
|
||||
}
|
||||
|
||||
public BerBoolean getSpecificationWithResult() {
|
||||
return specificationWithResult;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = variableAccessSpecification.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
if (specificationWithResult != null) {
|
||||
codeLength += specificationWithResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
specificationWithResult = new BerBoolean();
|
||||
subCodeLength += specificationWithResult.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
subCodeLength += length.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (specificationWithResult != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("specificationWithResult: ").append(specificationWithResult);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private BerBoolean specificationWithResult = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
|
||||
public ReadRequest() {
|
||||
}
|
||||
|
||||
public ReadRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setSpecificationWithResult(BerBoolean specificationWithResult) {
|
||||
this.specificationWithResult = specificationWithResult;
|
||||
}
|
||||
|
||||
public BerBoolean getSpecificationWithResult() {
|
||||
return specificationWithResult;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = variableAccessSpecification.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
if (specificationWithResult != null) {
|
||||
codeLength += specificationWithResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
specificationWithResult = new BerBoolean();
|
||||
subCodeLength += specificationWithResult.decode(is, false);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
subCodeLength += length.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, null);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (specificationWithResult != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("specificationWithResult: ").append(specificationWithResult);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,310 +1,311 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class ReadResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfAccessResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<AccessResult> seqOf = null;
|
||||
|
||||
public ListOfAccessResult() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ListOfAccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AccessResult> getAccessResult() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
AccessResult element = new AccessResult();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength
|
||||
+ " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AccessResult> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfAccessResult listOfAccessResult = null;
|
||||
|
||||
public ReadResponse() {
|
||||
}
|
||||
|
||||
public ReadResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
|
||||
this.listOfAccessResult = listOfAccessResult;
|
||||
}
|
||||
|
||||
public ListOfAccessResult getListOfAccessResult() {
|
||||
return listOfAccessResult;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
codeLength += listOfAccessResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
if (variableAccessSpecification != null) {
|
||||
sublength = variableAccessSpecification.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
subCodeLength += length.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, null);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfAccessResult = new ListOfAccessResult();
|
||||
subCodeLength += listOfAccessResult.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfAccessResult != null) {
|
||||
sb.append("listOfAccessResult: ");
|
||||
listOfAccessResult.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfAccessResult: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfAccessResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<AccessResult> seqOf = null;
|
||||
|
||||
public ListOfAccessResult() {
|
||||
seqOf = new ArrayList<AccessResult>();
|
||||
}
|
||||
|
||||
public ListOfAccessResult(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AccessResult> getAccessResult() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<AccessResult>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
AccessResult element = new AccessResult();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AccessResult> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfAccessResult listOfAccessResult = null;
|
||||
|
||||
public ReadResponse() {
|
||||
}
|
||||
|
||||
public ReadResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
|
||||
this.listOfAccessResult = listOfAccessResult;
|
||||
}
|
||||
|
||||
public ListOfAccessResult getListOfAccessResult() {
|
||||
return listOfAccessResult;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
codeLength += listOfAccessResult.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
if (variableAccessSpecification != null) {
|
||||
sublength = variableAccessSpecification.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
subCodeLength += length.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, null);
|
||||
subCodeLength += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
listOfAccessResult = new ListOfAccessResult();
|
||||
subCodeLength += listOfAccessResult.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfAccessResult != null) {
|
||||
sb.append("listOfAccessResult: ");
|
||||
listOfAccessResult.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfAccessResult: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerBitString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class ServiceSupportOptions extends BerBitString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ServiceSupportOptions() {
|
||||
}
|
||||
public ServiceSupportOptions() {
|
||||
}
|
||||
|
||||
public ServiceSupportOptions(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public ServiceSupportOptions(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public ServiceSupportOptions(byte[] value, int numBits) {
|
||||
super(value, numBits);
|
||||
}
|
||||
public ServiceSupportOptions(byte[] value, int numBits) {
|
||||
super(value, numBits);
|
||||
}
|
||||
|
||||
public ServiceSupportOptions(boolean[] value) {
|
||||
super(value);
|
||||
}
|
||||
public ServiceSupportOptions(boolean[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerOctetString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class TimeOfDay extends BerOctetString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TimeOfDay() {
|
||||
}
|
||||
public TimeOfDay() {
|
||||
}
|
||||
|
||||
public TimeOfDay(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public TimeOfDay(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,109 +1,116 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class TypeSpecification implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private TypeDescription typeDescription = null;
|
||||
|
||||
public TypeSpecification() {
|
||||
}
|
||||
|
||||
public TypeSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTypeDescription(TypeDescription typeDescription) {
|
||||
this.typeDescription = typeDescription;
|
||||
}
|
||||
|
||||
public TypeDescription getTypeDescription() {
|
||||
return typeDescription;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (typeDescription != null) {
|
||||
codeLength += typeDescription.encode(os);
|
||||
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);
|
||||
}
|
||||
|
||||
typeDescription = new TypeDescription();
|
||||
int choiceDecodeLength = typeDescription.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
typeDescription = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (typeDescription != null) {
|
||||
sb.append("typeDescription: ");
|
||||
typeDescription.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private TypeDescription typeDescription = null;
|
||||
|
||||
public TypeSpecification() {
|
||||
}
|
||||
|
||||
public TypeSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTypeDescription(TypeDescription typeDescription) {
|
||||
this.typeDescription = typeDescription;
|
||||
}
|
||||
|
||||
public TypeDescription getTypeDescription() {
|
||||
return typeDescription;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (typeDescription != null) {
|
||||
codeLength += typeDescription.encode(os);
|
||||
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);
|
||||
}
|
||||
|
||||
typeDescription = new TypeDescription();
|
||||
int choiceDecodeLength = typeDescription.decode(is, berTag);
|
||||
if (choiceDecodeLength != 0) {
|
||||
return codeLength + choiceDecodeLength;
|
||||
}
|
||||
else {
|
||||
typeDescription = null;
|
||||
}
|
||||
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (typeDescription != null) {
|
||||
sb.append("typeDescription: ");
|
||||
typeDescription.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,134 +1,140 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class UnconfirmedPDU implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private UnconfirmedService service = null;
|
||||
|
||||
public UnconfirmedPDU() {
|
||||
}
|
||||
|
||||
public UnconfirmedPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setService(UnconfirmedService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public UnconfirmedService getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
service = new UnconfirmedService();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private UnconfirmedService service = null;
|
||||
|
||||
public UnconfirmedPDU() {
|
||||
}
|
||||
|
||||
public UnconfirmedPDU(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setService(UnconfirmedService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public UnconfirmedService getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += service.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
service = new UnconfirmedService();
|
||||
subCodeLength += service.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (service != null) {
|
||||
sb.append("service: ");
|
||||
service.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("service: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,109 +1,116 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class UnconfirmedService implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private InformationReport informationReport = null;
|
||||
|
||||
public UnconfirmedService() {
|
||||
}
|
||||
|
||||
public UnconfirmedService(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInformationReport(InformationReport informationReport) {
|
||||
this.informationReport = informationReport;
|
||||
}
|
||||
|
||||
public InformationReport getInformationReport() {
|
||||
return informationReport;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (informationReport != null) {
|
||||
codeLength += informationReport.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
informationReport = new InformationReport();
|
||||
codeLength += informationReport.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (informationReport != null) {
|
||||
sb.append("informationReport: ");
|
||||
informationReport.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private InformationReport informationReport = null;
|
||||
|
||||
public UnconfirmedService() {
|
||||
}
|
||||
|
||||
public UnconfirmedService(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setInformationReport(InformationReport informationReport) {
|
||||
this.informationReport = informationReport;
|
||||
}
|
||||
|
||||
public InformationReport getInformationReport() {
|
||||
return informationReport;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (informationReport != null) {
|
||||
codeLength += informationReport.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
informationReport = new InformationReport();
|
||||
codeLength += informationReport.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (informationReport != null) {
|
||||
sb.append("informationReport: ");
|
||||
informationReport.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Unsigned16 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Unsigned16() {
|
||||
}
|
||||
public Unsigned16() {
|
||||
}
|
||||
|
||||
public Unsigned16(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Unsigned16(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Unsigned16(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned16(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Unsigned16(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned16(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Unsigned32 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Unsigned32() {
|
||||
}
|
||||
public Unsigned32() {
|
||||
}
|
||||
|
||||
public Unsigned32(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Unsigned32(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Unsigned32(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned32(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Unsigned32(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned32(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,30 +1,41 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerInteger;
|
||||
|
||||
public class Unsigned8 extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Unsigned8() {
|
||||
}
|
||||
public Unsigned8() {
|
||||
}
|
||||
|
||||
public Unsigned8(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
public Unsigned8(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Unsigned8(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned8(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Unsigned8(long value) {
|
||||
super(value);
|
||||
}
|
||||
public Unsigned8(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,33 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import org.openmuc.jasn1.ber.types.BerOctetString;
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
|
||||
public class UtcTime extends BerOctetString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UtcTime() {
|
||||
}
|
||||
public UtcTime() {
|
||||
}
|
||||
|
||||
public UtcTime(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
public UtcTime(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,144 +1,150 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class VariableAccessSpecification implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
private ObjectName variableListName = null;
|
||||
|
||||
public VariableAccessSpecification() {
|
||||
}
|
||||
|
||||
public VariableAccessSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public void setVariableListName(ObjectName variableListName) {
|
||||
this.variableListName = variableListName;
|
||||
}
|
||||
|
||||
public ObjectName getVariableListName() {
|
||||
return variableListName;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (variableListName != null) {
|
||||
sublength = variableListName.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (listOfVariable != null) {
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
codeLength += listOfVariable.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
variableListName = new ObjectName();
|
||||
codeLength += variableListName.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (variableListName != null) {
|
||||
sb.append("variableListName: ");
|
||||
variableListName.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableDefs listOfVariable = null;
|
||||
private ObjectName variableListName = null;
|
||||
|
||||
public VariableAccessSpecification() {
|
||||
}
|
||||
|
||||
public VariableAccessSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setListOfVariable(VariableDefs listOfVariable) {
|
||||
this.listOfVariable = listOfVariable;
|
||||
}
|
||||
|
||||
public VariableDefs getListOfVariable() {
|
||||
return listOfVariable;
|
||||
}
|
||||
|
||||
public void setVariableListName(ObjectName variableListName) {
|
||||
this.variableListName = variableListName;
|
||||
}
|
||||
|
||||
public ObjectName getVariableListName() {
|
||||
return variableListName;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (variableListName != null) {
|
||||
sublength = variableListName.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
os.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (listOfVariable != null) {
|
||||
codeLength += listOfVariable.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
listOfVariable = new VariableDefs();
|
||||
codeLength += listOfVariable.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
variableListName = new ObjectName();
|
||||
codeLength += variableListName.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (listOfVariable != null) {
|
||||
sb.append("listOfVariable: ");
|
||||
listOfVariable.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (variableListName != null) {
|
||||
sb.append("variableListName: ");
|
||||
variableListName.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,299 +1,300 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class VariableDefs implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class SEQUENCE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableSpecification variableSpecification = null;
|
||||
private AlternateAccess alternateAccess = null;
|
||||
|
||||
public SEQUENCE() {
|
||||
}
|
||||
|
||||
public SEQUENCE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableSpecification(VariableSpecification variableSpecification) {
|
||||
this.variableSpecification = variableSpecification;
|
||||
}
|
||||
|
||||
public VariableSpecification getVariableSpecification() {
|
||||
return variableSpecification;
|
||||
}
|
||||
|
||||
public void setAlternateAccess(AlternateAccess alternateAccess) {
|
||||
this.alternateAccess = alternateAccess;
|
||||
}
|
||||
|
||||
public AlternateAccess getAlternateAccess() {
|
||||
return alternateAccess;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (alternateAccess != null) {
|
||||
codeLength += alternateAccess.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += variableSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableSpecification = new VariableSpecification();
|
||||
subCodeLength += variableSpecification.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
alternateAccess = new AlternateAccess();
|
||||
subCodeLength += alternateAccess.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength
|
||||
+ ", actual sequence length: " + subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableSpecification != null) {
|
||||
sb.append("variableSpecification: ");
|
||||
variableSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (alternateAccess != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("alternateAccess: ");
|
||||
alternateAccess.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<SEQUENCE> seqOf = null;
|
||||
|
||||
public VariableDefs() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public VariableDefs(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<SEQUENCE> getSEQUENCE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
SEQUENCE element = new SEQUENCE();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<SEQUENCE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class SEQUENCE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableSpecification variableSpecification = null;
|
||||
private AlternateAccess alternateAccess = null;
|
||||
|
||||
public SEQUENCE() {
|
||||
}
|
||||
|
||||
public SEQUENCE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableSpecification(VariableSpecification variableSpecification) {
|
||||
this.variableSpecification = variableSpecification;
|
||||
}
|
||||
|
||||
public VariableSpecification getVariableSpecification() {
|
||||
return variableSpecification;
|
||||
}
|
||||
|
||||
public void setAlternateAccess(AlternateAccess alternateAccess) {
|
||||
this.alternateAccess = alternateAccess;
|
||||
}
|
||||
|
||||
public AlternateAccess getAlternateAccess() {
|
||||
return alternateAccess;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (alternateAccess != null) {
|
||||
codeLength += alternateAccess.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
os.write(0xA5);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += variableSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableSpecification = new VariableSpecification();
|
||||
subCodeLength += variableSpecification.decode(is, berTag);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
alternateAccess = new AlternateAccess();
|
||||
subCodeLength += alternateAccess.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableSpecification != null) {
|
||||
sb.append("variableSpecification: ");
|
||||
variableSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (alternateAccess != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("alternateAccess: ");
|
||||
alternateAccess.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<SEQUENCE> seqOf = null;
|
||||
|
||||
public VariableDefs() {
|
||||
seqOf = new ArrayList<SEQUENCE>();
|
||||
}
|
||||
|
||||
public VariableDefs(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<SEQUENCE> getSEQUENCE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<SEQUENCE>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
SEQUENCE element = new SEQUENCE();
|
||||
subCodeLength += element.decode(is, true);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<SEQUENCE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,115 +1,121 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
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 org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class VariableSpecification implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName name = null;
|
||||
|
||||
public VariableSpecification() {
|
||||
}
|
||||
|
||||
public VariableSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(ObjectName name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ObjectName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (name != null) {
|
||||
sublength = name.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
name = new ObjectName();
|
||||
codeLength += name.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (name != null) {
|
||||
sb.append("name: ");
|
||||
name.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private ObjectName name = null;
|
||||
|
||||
public VariableSpecification() {
|
||||
}
|
||||
|
||||
public VariableSpecification(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(ObjectName name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public ObjectName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (name != null) {
|
||||
sublength = name.encode(os);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(os, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
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.CONSTRUCTED, 0)) {
|
||||
codeLength += BerLength.skip(is);
|
||||
name = new ObjectName();
|
||||
codeLength += name.decode(is, null);
|
||||
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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (name != null) {
|
||||
sb.append("name: ");
|
||||
name.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,297 +1,298 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
|
||||
public class WriteRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<Data> seqOf = null;
|
||||
|
||||
public ListOfData() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ListOfData(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Data> getData() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
Data element = new Data();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength
|
||||
+ " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<Data> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfData listOfData = null;
|
||||
|
||||
public WriteRequest() {
|
||||
}
|
||||
|
||||
public WriteRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfData(ListOfData listOfData) {
|
||||
this.listOfData = listOfData;
|
||||
}
|
||||
|
||||
public ListOfData getListOfData() {
|
||||
return listOfData;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfData.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableAccessSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfData = new ListOfData();
|
||||
subCodeLength += listOfData.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfData != null) {
|
||||
sb.append("listOfData: ");
|
||||
listOfData.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfData: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class ListOfData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<Data> seqOf = null;
|
||||
|
||||
public ListOfData() {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
|
||||
public ListOfData(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Data> getData() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<Data>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
Data element = new Data();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<Data> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
public byte[] code = null;
|
||||
private VariableAccessSpecification variableAccessSpecification = null;
|
||||
private ListOfData listOfData = null;
|
||||
|
||||
public WriteRequest() {
|
||||
}
|
||||
|
||||
public WriteRequest(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVariableAccessSpecification(VariableAccessSpecification variableAccessSpecification) {
|
||||
this.variableAccessSpecification = variableAccessSpecification;
|
||||
}
|
||||
|
||||
public VariableAccessSpecification getVariableAccessSpecification() {
|
||||
return variableAccessSpecification;
|
||||
}
|
||||
|
||||
public void setListOfData(ListOfData listOfData) {
|
||||
this.listOfData = listOfData;
|
||||
}
|
||||
|
||||
public ListOfData getListOfData() {
|
||||
return listOfData;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += listOfData.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
os.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += variableAccessSpecification.encode(os);
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
|
||||
int totalLength = length.val;
|
||||
codeLength += totalLength;
|
||||
|
||||
subCodeLength += berTag.decode(is);
|
||||
variableAccessSpecification = new VariableAccessSpecification();
|
||||
subCodeLength += variableAccessSpecification.decode(is, berTag);
|
||||
subCodeLength += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
listOfData = new ListOfData();
|
||||
subCodeLength += listOfData.decode(is, false);
|
||||
if (subCodeLength == totalLength) {
|
||||
return codeLength;
|
||||
}
|
||||
}
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (variableAccessSpecification != null) {
|
||||
sb.append("variableAccessSpecification: ");
|
||||
variableAccessSpecification.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("variableAccessSpecification: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (listOfData != null) {
|
||||
sb.append("listOfData: ");
|
||||
listOfData.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("listOfData: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,269 +1,269 @@
|
||||
/**
|
||||
* This class file was automatically generated by jASN1 v1.9.0 (http://www.openmuc.org)
|
||||
* This class file was automatically generated by jASN1 v1.9.1-SNAPSHOT (http://www.openmuc.org)
|
||||
*/
|
||||
|
||||
package org.openmuc.openiec61850.internal.mms.asn1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import org.openmuc.jasn1.ber.*;
|
||||
import org.openmuc.jasn1.ber.types.*;
|
||||
import org.openmuc.jasn1.ber.types.string.*;
|
||||
|
||||
import org.openmuc.jasn1.ber.BerLength;
|
||||
import org.openmuc.jasn1.ber.BerTag;
|
||||
import org.openmuc.jasn1.ber.ReverseByteArrayOutputStream;
|
||||
import org.openmuc.jasn1.ber.types.BerNull;
|
||||
|
||||
public class WriteResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class CHOICE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private DataAccessError failure = null;
|
||||
private BerNull success = null;
|
||||
|
||||
public CHOICE() {
|
||||
}
|
||||
|
||||
public CHOICE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFailure(DataAccessError failure) {
|
||||
this.failure = failure;
|
||||
}
|
||||
|
||||
public DataAccessError getFailure() {
|
||||
return failure;
|
||||
}
|
||||
|
||||
public void setSuccess(BerNull success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public BerNull getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (success != null) {
|
||||
codeLength += success.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (failure != null) {
|
||||
codeLength += failure.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
failure = new DataAccessError();
|
||||
codeLength += failure.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
success = new BerNull();
|
||||
codeLength += success.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (failure != null) {
|
||||
sb.append("failure: ").append(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (success != null) {
|
||||
sb.append("success: ").append(success);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<CHOICE> seqOf = null;
|
||||
|
||||
public WriteResponse() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public WriteResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<CHOICE> getCHOICE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
CHOICE element = new CHOICE();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has "
|
||||
+ subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<CHOICE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class CHOICE implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public byte[] code = null;
|
||||
private DataAccessError failure = null;
|
||||
private BerNull success = null;
|
||||
|
||||
public CHOICE() {
|
||||
}
|
||||
|
||||
public CHOICE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFailure(DataAccessError failure) {
|
||||
this.failure = failure;
|
||||
}
|
||||
|
||||
public DataAccessError getFailure() {
|
||||
return failure;
|
||||
}
|
||||
|
||||
public void setSuccess(BerNull success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public BerNull getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (success != null) {
|
||||
codeLength += success.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
os.write(0x81);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (failure != null) {
|
||||
codeLength += failure.encode(os, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
os.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)) {
|
||||
failure = new DataAccessError();
|
||||
codeLength += failure.decode(is, false);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
success = new BerNull();
|
||||
codeLength += success.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 os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (failure != null) {
|
||||
sb.append("failure: ").append(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (success != null) {
|
||||
sb.append("success: ").append(success);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
public byte[] code = null;
|
||||
private List<CHOICE> seqOf = null;
|
||||
|
||||
public WriteResponse() {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
|
||||
public WriteResponse(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<CHOICE> getCHOICE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<CHOICE>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
public int encode(OutputStream os) throws IOException {
|
||||
return encode(os, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream os, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
for (int i = code.length - 1; i >= 0; i--) {
|
||||
os.write(code[i]);
|
||||
}
|
||||
if (withTag) {
|
||||
return tag.encode(os) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(os);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(os, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(os);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int codeLength = 0;
|
||||
int subCodeLength = 0;
|
||||
if (withTag) {
|
||||
codeLength += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
codeLength += length.decode(is);
|
||||
int totalLength = length.val;
|
||||
|
||||
while (subCodeLength < totalLength) {
|
||||
CHOICE element = new CHOICE();
|
||||
subCodeLength += element.decode(is, null);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (subCodeLength != totalLength) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + totalLength + " but has " + subCodeLength);
|
||||
|
||||
}
|
||||
codeLength += subCodeLength;
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(os, false);
|
||||
code = os.getArray();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<CHOICE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue