Compare commits

..

No commits in common. 'master' and 'v1.6.0' have entirely different histories.

32
.gitignore vendored

@ -1,16 +1,26 @@
# Gradle
.gradle/
\#*
.\#*
*~
target/
bin/
build/
gradle.properties
# IntelliJ IDEA
.idea
out/
# Eclipse
tmp/
*.class
.gradle/
.svn/
.settings/
.project
.classpath
.metadata/
**/bin/main/
**/bin/test/
.externalToolBuilders/
gradle.properties
doc/userguide/*.html
doc/userguide/*.pdf
*.hprof
gradle-app.setting
.factorypath
.apt_generated/
#created by openiec61850 clientgui:
lastconnection.properties
.idea
out/

@ -1,4 +0,0 @@
# IEC61850bean
IEC61850bean (previously known as OpenIEC61850) is a library implementing the IEC 61850 standard based on the MMS mapping for client and server communication.
For detailed information on IEC61850bean visit https://www.beanit.com/iec-61850/.

@ -1,12 +0,0 @@
#!/bin/bash
cd `dirname $0`
rm ../src/main/java-gen/com/beanit/josistack/internal/acse/asn1/*
asn1bean-compiler -o "../src/main/java-gen/" -p "com.beanit.josistack.internal.acse" -f iso-acse-layer.asn -dv
rm ../src/main/java-gen/com/beanit/josistack/internal/presentation/asn1/*
asn1bean-compiler -o "../src/main/java-gen/" -p "com.beanit.josistack.internal.presentation" -f iso-presentation-layer.asn -dv
rm -r ../src/main/java-gen/com/beanit/iec61850bean/internal/mms/asn1/*
asn1bean-compiler -o "../src/main/java-gen" -p "com.beanit.iec61850bean.internal.mms" -f mms.asn -dv

@ -0,0 +1,5 @@
#!/bin/sh
rm ../../src/main/java-gen/org/openmuc/josistack/internal/acse/asn1/*
jasn1-compiler -o "../../src/main/java-gen/" -p "org.openmuc.josistack.internal.acse" -f iso-acse-layer.asn

@ -0,0 +1,5 @@
#!/bin/sh
rm ../../src/main/java-gen/org/openmuc/josistack/internal/presentation/asn1/*.java
jasn1-compiler -o ../../src/main/java-gen/ -p org.openmuc.josistack.internal.presentation -f iso-presentation-layer.asn

@ -0,0 +1,5 @@
#!/bin/sh
rm -r ../../src/main/java-gen/org/openmuc/openiec61850/internal/mms/asn1/*
jasn1-compiler -o "../../src/main/java-gen" -p "org.openmuc.openiec61850.internal.mms" -f mms.asn

@ -1,10 +0,0 @@
steps to follow:
1) compile classes by executing compile.sh
2) format everything using IntelliJ
3) execute replace-berboolean.sh (this step does not work if step 2
is not executed)
4) again format everyting using IntelliJ

@ -1,6 +0,0 @@
#!/bin/bash
cd `dirname $0`
# replace BerBoolean from ASN1bean with special one for IEC 61850 so that true is coded as 0x01 instead of 0xff
find ../ -iname "*.java" | xargs sed -i 's/import com\.beanit\.asn1bean\.ber\.types\.BerBoolean/import com\.beanit\.iec61850bean\.internal\.BerBoolean/g'

@ -1,38 +0,0 @@
#!/bin/bash
JARS_LOCATION="build/libs-all"
MAIN_CLASS="com.beanit.iec61850bean.app.ConsoleClient"
SYSPROPS=""
PARAMS=""
# Attempt to set APP_HOME (from Gradle start script)
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
PARAMS=( )
SYSPROPS=( )
for i in "$@"; do
if [[ $i == -D* ]]; then
SYSPROPS+=( "$i" )
else
PARAMS+=( "$i" )
fi
done
java "${SYSPROPS[@]}" -cp "$CLASSPATH" $MAIN_CLASS "${PARAMS[@]}"

@ -1,7 +0,0 @@
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleClient %*

@ -1,8 +0,0 @@
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -Dlogback.configurationFile=logback.xml -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleServer %*

@ -1,38 +0,0 @@
#!/bin/bash
JARS_LOCATION="build/libs-all"
MAIN_CLASS="com.beanit.iec61850bean.clientgui.ClientGui"
SYSPROPS=""
PARAMS=""
# Attempt to set APP_HOME (from Gradle start script)
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
PARAMS=( )
SYSPROPS=( )
for i in "$@"; do
if [[ $i == -D* ]]; then
SYSPROPS+=( "$i" )
else
PARAMS+=( "$i" )
fi
done
java "${SYSPROPS[@]}" -cp "$CLASSPATH" $MAIN_CLASS "${PARAMS[@]}"

@ -1,7 +0,0 @@
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -cp %LIBDIR% com.beanit.iec61850bean.clientgui.ClientGui %*

@ -0,0 +1,287 @@
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: "org.asciidoctor", name: "asciidoctorj-pdf", version: "1.5.0-alpha.16"
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.0.0"
}
}
plugins {
id "org.asciidoctor.convert" version "1.5.6"
id "net.saliman.cobertura" version "2.5.1"
}
apply plugin: "org.asciidoctor.convert"
apply from: "configuration.gradle"
asciidoctor {
backends = ["pdf", "html5"]
attributes "stylesheet": "openmuc-asciidoc.css",
"toc2": "left",
"sampleSrc": file("src/sample/java"),
"source-highlighter" : "coderay",
"pdf-stylesdir": "./",
"pdf-style": "pdf"
resources {
from("$sourceDir") {
include "images/**"
}
}
}
configure(allprojects) {
version = cfgVersion
}
configure(javaProjects) {
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "osgi"
apply plugin: "maven"
apply plugin: "signing"
apply plugin: "biz.aQute.bnd.builder"
apply plugin: 'net.saliman.cobertura'
uploadArchives.enabled = false
group = cfgGroup
if (!project.properties.containsKey('cfgJavaVersion')) {
project.ext {
cfgJavaVersion = '1.7'
}
}
sourceCompatibility = cfgJavaVersion
targetCompatibility = cfgJavaVersion
repositories {
mavenCentral()
mavenLocal()
}
sourceSets {
sample
itest {
compileClasspath += sourceSets.main.runtimeClasspath
}
}
dependencies {
testCompile group: "junit", name: "junit", version: "4.12"
itestCompile group: "junit", name: "junit", version: "4.12"
}
jar {
manifest {
version = project.version.replace("-",".");
}
}
cobertura {
dependencies {
testCompile 'org.slf4j:slf4j-simple:1.6.1'
}
coverageFormats = ['html', 'xml']
coverageIgnoreTrivial = false
coverageIgnores = ['org.slf4j.Logger.*']
coverageExcludes = ['.*\\.app\\..*', '.*\\.cli-app\\..*', '.*\\.sample\\..*']
coverageReportDir = new File("$buildDir/reports/cobertura")
coverageTestTasks {
project.tasks.withType(Test).matching {it.name == 'test'}
}
}
task jarAll(type: Copy) {
dependsOn(configurations.default.getAllArtifacts().getBuildDependencies())
//only the jar file created:
from configurations.default.getAllArtifacts().getFiles()
if (cfgCopyDependencies) {
if (cfgCopyToRoot) {
into rootDir.getPath() + "/build/libs-all"
}
else {
into "build/libs-all"
}
//includes all the dependencies:
from configurations.default
}
else {
if (cfgCopyToRoot) {
into rootDir.getPath() + "/build/libs-all"
}
else {
into "build/libs-all"
}
}
}
build.dependsOn {asciidoctor}
build.dependsOn {jarAll}
eclipse.pathVariables([GRADLE_USER_HOME:file(gradle.gradleUserHomeDir)])
tasks.eclipse.dependsOn(cleanEclipse)
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
javadoc {
exclude "**/internal/**"
exclude "**/java-gen/**"
exclude "**/app/**"
}
}
configure(repositoryProjects) {
uploadArchives.enabled = true
if (cfgSignPom) {
signing {
if ( project.hasProperty("signing.keyId") ) {
sign configurations.archives
}
}
}
uploadArchives {
repositories {
mavenDeployer {
if (cfgSignPom) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: cfgRepository) {
authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass)
if (cfgRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgRepository.contains(System.getProperty("https.nonProxyHosts")))) {
proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https")
}
}
snapshotRepository(url: cfgSnapshotRepository) {
authentication(userName: cfgRepositoryUser, password: cfgRepositoryPass)
if (cfgSnapshotRepository != null && System.getProperty("https.proxyHost") != null && ((System.getProperty("https.nonProxyHosts") == null) || !cfgSnapshotRepository.contains(System.getProperty("https.nonProxyHosts")))) {
proxy(host: System.getProperty("https.proxyHost"), port: Integer.parseInt(System.getProperty("https.proxyPort")), type: "https")
}
}
pom.project {
//additional pom information can be found in subproject build.gradle files
packaging "jar"
url "http://www.openmuc.org/"
scm {
url "none"
connection "none"
}
developers {
developer {
id "openmuc"
name "OpenMUC Team"
}
}
}
}
}
}
}
task javadocAll(type: Javadoc) {
source docProjects.collect {
project -> project.sourceSets.main.allJava
}
exclude "**/internal/**"
exclude "**/java-gen/**"
exclude "**/app/**"
destinationDir = new File(buildDir, "docs/javadoc-all")
classpath = files(distributionProjects.collect { project ->
project.sourceSets.main.compileClasspath })
classpath += files(distributionProjects.collect { project ->
project.sourceSets.main.output })
}
task writeSettings {
doLast {
Writer out = new OutputStreamWriter(new FileOutputStream("build/settings.gradle"));
out.write("include ");
boolean first = true;
for (Project myproject: distributionProjects) {
if (!myproject.getProjectDir().equals(getProjectDir())) {
if (first == true) {
first = false;
}
else {
out.write ", ";
}
out.write '"' + myproject.name + '"'
}
}
out .write "\n\n";
for (Project myproject: distributionProjects) {
if (myproject.getProjectDir().equals(getProjectDir())) {
continue;
}
println myproject.name
out.write 'project(":' + myproject.name + '").projectDir = file("' + myproject.getProjectDir().toString().substring((int)(getProjectDir().toString().size() + 1)) + '")\n';
}
out.close();
}
}
task buildDistProjects {
dependsOn(distributionProjects.build)
}
tasks.withType(Tar) {
dependsOn(writeSettings)
dependsOn(distributionProjects.build)
dependsOn(javadocAll)
dependsOn(asciidoctor)
compression = Compression.GZIP
destinationDir = file("build/distributions/")
}
task (tar, type: Tar) {
archiveName = project.name + "-" + project.version + ".tgz"
}
task (tarFull, type: Tar) {
dependsOn(tar)
archiveName = project.name + "-" + project.version + "_full.tgz"
}

@ -1,317 +0,0 @@
import net.ltgt.gradle.errorprone.errorprone
plugins {
`java-library`
`maven-publish`
signing
eclipse
id("biz.aQute.bnd.builder") version "5.1.1"
id("com.diffplug.spotless") version "5.9.0"
id("io.codearte.nexus-staging") version "0.22.0"
id("net.ltgt.errorprone") version "1.3.0"
}
var cfgJavaVersion = JavaVersion.VERSION_1_8
val sonatypeRepository: String? by project
val sonatypeSnapshotRepository: String? by project
val sonatypeUser: String? by project
val sonatypePass: String? by project
val sonatypeStagingProfileId: String? by project
//----------- project specific configuration start --------------------
val cfgVersion = "1.9.1-SNAPSHOT"
val cfgGroup = "com.beanit"
val cfgCopyToRoot = false
val cfgSignPom = true
val cfgRepository: String? = sonatypeRepository
val cfgSnapshotRepository: String? = sonatypeSnapshotRepository
val cfgRepositoryUser: String? = sonatypeUser
val cfgRepositoryPass: String? = sonatypePass
val cfgStagingProfileId: String? = sonatypeStagingProfileId
val javaProjects: Set<Project> = allprojects
val distributionProjects = javaProjects
val docProjects = javaProjects
val repositoryProjects = javaProjects
val cfgModuleName = "com.beanit.iec61850bean"
tasks.register<Tar>("tar") {
into(project.name) {
from("./") {
include("build.gradle.kts")
include("LICENSE.txt")
include("doc/**")
include("bin/**")
exclude("bin/main/")
exclude("bin/test/")
include("gradle/wrapper/**")
include("gradlew")
include("gradlew.bat")
include("build/libs-all/**")
include("src/**")
include("asn1/**")
}
}
into(project.name + "/doc/") {
from("./build/docs/") {
include("javadoc/**")
}
}
}
//-----java root project configurations
dependencies {
implementation("com.beanit:asn1bean:1.12.0")
implementation("org.slf4j:slf4j-api:1.7.25")
runtimeOnly("ch.qos.logback:logback-classic:1.2.3")
}
project.extra["cfgModuleName"] = "com.beanit.iec61850bean"
tasks["jar"].withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
bnd("""
Bundle-Name: IEC61850bean
Bundle-SymbolicName: ${project.extra["cfgModuleName"]}
-exportcontents: !*.internal.*,*
Import-Package: com.beanit.asn1bean.*,javax.net,*;resolution:=optional
""")
}
sourceSets {
main {
java {
setSrcDirs(listOf("src/main/java", "src/main/java-gen"))
}
}
}
publishing {
publications {
maybeCreate<MavenPublication>("mavenJava").pom {
name.set("IEC61850bean")
description.set("IEC61850bean is a Java library implementing the IEC 61850 MMS communication standard for clients and servers.")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
}
}
}
//----------- project specific configuration end ---------------------
configure(allprojects) {
version = cfgVersion
group = cfgGroup
}
nexusStaging {
packageGroup = cfgGroup
username = cfgRepositoryUser
password = cfgRepositoryPass
stagingProfileId = cfgStagingProfileId
}
configure(javaProjects) {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "eclipse")
apply(plugin = "biz.aQute.bnd.builder")
apply(plugin = "com.diffplug.spotless")
apply(plugin = "net.ltgt.errorprone")
tasks.publish {
enabled = false
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = cfgJavaVersion
targetCompatibility = cfgJavaVersion
withSourcesJar()
withJavadocJar()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("com.tngtech.archunit:archunit-junit5:0.15.0")
errorprone("com.google.errorprone:error_prone_core:2.5.1")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<JavaCompile>().configureEach {
options.errorprone.excludedPaths.set(".*java-gen.*")
if (!JavaVersion.current().isJava9Compatible) {
options.errorprone.isEnabled.set(false)
}
}
afterEvaluate {
tasks.jar {
manifest {
attributes["Automatic-Module-Name"] = project.extra["cfgModuleName"]
}
}
}
spotless {
java {
googleJavaFormat()
}
}
tasks.register<Copy>("jarAll") {
from(configurations.runtimeClasspath) // all runtime dependencies
from(tasks.jar) // the jar file created
if (cfgCopyToRoot) {
into(rootDir.path + "/build/libs-all")
} else {
into("build/libs-all")
}
}
tasks.build {
dependsOn("jarAll")
}
eclipse.pathVariables(mapOf("GRADLE_USER_HOME" to file(gradle.gradleUserHomeDir)))
tasks.eclipse { dependsOn(tasks.cleanEclipse) }
tasks.javadoc {
exclude("**/internal/**")
exclude("**/java-gen/**")
exclude("**/app/**")
//linking Javadoc in version prior 9 does not work well because Javadoc uses html frames.
if (cfgJavaVersion.isJava9Compatible) {
if (cfgJavaVersion.isJava11Compatible) {
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/en/java/javase/${cfgJavaVersion.majorVersion}/docs/api/")
} else {
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/javase/${cfgJavaVersion.majorVersion}/docs/api/")
}
}
}
}
configure(repositoryProjects) {
tasks.publish {
enabled = true
}
}
configure(repositoryProjects) {
publishing {
publications {
val mvnPublication: MavenPublication = maybeCreate<MavenPublication>("mavenJava")
mvnPublication.from(components["java"])
mvnPublication.versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
mvnPublication.pom {
url.set("http://www.beanit.com/")
developers {
developer {
id.set("beanit")
name.set("Beanit GmbH")
}
}
scm {
connection.set("none")
url.set("none")
}
}
}
repositories {
maven {
val releasesRepoUrl = uri(cfgRepository ?: "")
val snapshotsRepoUrl = uri(cfgSnapshotRepository ?: "")
// val releasesRepoUrl = uri("$buildDir/repos/releases")
// val snapshotsRepoUrl = uri("$buildDir/repos/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = cfgRepositoryUser
password = cfgRepositoryPass
}
}
}
}
if (cfgSignPom) {
signing {
sign(publishing.publications["mavenJava"])
}
}
}
tasks.register<Javadoc>("javadocAll") {
source(docProjects.map { project ->
project.sourceSets["main"].allJava
})
exclude("**/internal/**")
exclude("**/java-gen/**")
exclude("**/app/**")
setDestinationDir(File(buildDir, "docs/javadoc-all"))
classpath = files(distributionProjects.map { project ->
project.sourceSets["main"].compileClasspath
})
classpath += files(distributionProjects.map { project ->
project.sourceSets["main"].output
})
//linking Javadoc in version prior 9 does not work well because Javadoc uses html frames.
if (cfgJavaVersion.isJava9Compatible) {
if (cfgJavaVersion.isJava11Compatible) {
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/en/java/javase/${cfgJavaVersion.majorVersion}/docs/api/")
} else {
(options as StandardJavadocDocletOptions).links?.add("https://docs.oracle.com/javase/${cfgJavaVersion.majorVersion}/docs/api/")
}
}
}
tasks.named<Tar>("tar") {
archiveFileName.set(project.name + "-" + project.version + ".tgz")
dependsOn(distributionProjects.map { "${it.path}:build" })
distributionProjects.forEach {
println("project: "
+ it.path)
}
dependsOn(tasks.named("javadocAll"))
compression = Compression.GZIP
destinationDirectory.set(File("build/distributions/"))
}

@ -0,0 +1,125 @@
project.ext {
cfgVersion = "1.6.0"
cfgGroup = "org.openmuc"
cfgCopyDependencies = true
cfgCopyToRoot = false
cfgSignPom = true
cfgRepository = project.properties.sonatypeRepository
cfgSnapshotRepository = project.properties.sonatypeSnapshotRepository
cfgRepositoryUser = project.properties.sonatypeUser
cfgRepositoryPass = project.properties.sonatypePass
javaProjects = allprojects
distributionProjects = javaProjects
docProjects = javaProjects
repositoryProjects = javaProjects
}
tasks.withType(Tar) {
into(project.name) {
from("./") {
include "build.gradle"
include "configuration.gradle"
include "license/**"
include "doc/CHANGELOG.txt"
include "run-scripts/**"
include "gradle/wrapper/**"
include "gradlew"
include "gradlew.bat"
include "build/libs-all/**"
include "src/**"
include "asn1/**"
}
if (name.equals("tar") ){
exclude "**/dependencies/**/src"
}
}
into(project.name + "/doc/user-guide/") {
from("./build/asciidoc/html5/") {
include "**"
}
from("./build/asciidoc/pdf/") {
include "*.pdf"
}
}
into(project.name + "/doc/") {
from("./build/docs/") {
include "javadoc/**"
}
}
}
//------------------project specific configurations--------------------
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "osgi"
apply plugin: "maven"
apply plugin: "signing"
def projectName = 'OpenIEC61850'
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.openmuc', name: 'jasn1', version: '1.10.0'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile group: 'com.toedter', name: 'jcalendar', version: '1.4'
}
jar {
manifest {
name = projectName
instruction 'Export-Package', '!*.internal.*,*'
instruction 'Import-Package', 'org.openmuc.jasn1.*,javax.net,*;resolution:=optional'
}
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'src/main/java-gen']
}
}
uploadArchives {
repositories {
mavenDeployer {
pom.project {
name projectName
packaging 'jar'
description 'OpenIEC61850 is a library implementing the IEC 61850 MMS communication standard (client and server).'
url 'http://www.openmuc.org/'
licenses {
license {
name 'Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0'
distribution 'repo'
}
}
}
}
}
}

@ -1,46 +1,3 @@
v1.9.0 30-Jun-2020
--------------------
- renamed OpenIEC61850 to IEC61850bean
- moved from Java 7 to 8
- run scripts support white space in paths
- BdaTimestamp's getters and setters take Instant instead of Date now
- significant code clean up
v1.8.0 22-Mar-2019
--------------------
- library now published on maven central in the com.beanit namespace
- changed package names from org.openmuc.* to com.beanit.*
- changed back to depend on the regular jasn1 library. Coding boolean
true values as 0x01 is now done by internal openiec61850 class.
v1.7.0 06-Nov-2018
------------------
- refactored SCL parser to return List<ServerModel> instead of
List<ServerSap> so that parser can be used more flexible by
applications that do not want to start a server but just parse an
SCL file.
- SCL parser can now handle multiple IEDs defined in a single SCL file
- changed jasn1 dependency to to jasn1-iec61850mod because at least
one known IEC 61850 device expects boolean true values to be coded
as 0x01 instead of the default BER, CER and DER code of 0xFF.
- fixed shutting down server's thread pool correctly
- fixed a concurrency bug
v1.6.0 26-Jun-2018
------------------

@ -1,83 +0,0 @@
# IEC61850bean User Guide
* unnumbered toc
{:toc}
## Intro
IEC61850bean (previously known as OpenIEC61850) is a library implementing the IEC 61850 standard based on the MMS mapping for client and server communication. It is licensed under the Apache 2.0 license. IEC61850bean includes a console client and server as well as a GUI client.
### Distribution
After extracting the distribution tar file, the IEC61850bean library can be found in the folder *build/libs-all*.
#### Dependencies
Besides the IEC61850bean library the folder *build/libs-all/* contains the following external libraries:
* *asn1bean* - the ASN.1 BER encoding/decoding library by beanit, license: Apache 2.0, https://www.beanit.com
* *slf4j-api* - a popular logging API. It is only needed if iec61850bean is used to implement a server. The client part does not log anything. License: MIT, http://www.slf4j.org
* *logback-core/logback-classic* - an actual logger implementation of the slf4-api. It is used by the console server application to output log information. It can be replaced by a logger of your choice that supports the slf4j API. Like slf4j it is only needed for server implementations. License: EPLv1.0 and LGPLv2.1, http://logback.qos.ch
### Console & GUI Applications
You can execute the console client and server through the scripts found in the *bin* folder. Executing the scripts without any parameters will print help information to the screen. Note that under Unix/Linux you need root privileges if you want the server to listen on any port lower than 1000.
### OSI Stack
The IEC61850bean library includes an OSI stack implementation as it is needed by the IEC 61850 MMS mapping. The API of the OSI stack and the OSI transport layers are made public so that they can be used by other projects.
* *josistack* - implements the Application Control Service Element (ACSE) protocol as defined by ISO 8650 or ITU X.217/X.227, the lower ISO Presentation Layer as defined by ISO 8823/ITU X226, and the ISO Session Layer as defined by 8327/ITU X.225.
* *jositransport* - implements RFC 1006 and the OSI Transport Service Layer.
## Using IEC61850bean
The easiest way to learn how IEC61850bean works is by running and analyzing the console client and server applications. You might want to look at the source code of the console applications to get an understanding of how they work. They can be used as a basis for you to code your individual client or server applications. An IEC 61850 device that is to be controlled or monitored is called an IEC 61850 server. An IEC 61850 server normally listens on port 102 for incoming connection requests by IEC 61850 clients.
### Client
If you want to connect to an IEC 61850 server, you should first create an instance of ClientSap (SAP = Service Access Point) and configure it to your needs. Then you build up the association to the server using the associate() method.
### Server
First get a List of ServerSaps using the method ServerSap.getSapsFromSclFile(). This method reads in the SAP from the given ICD file. Take the ServerSap you want to run and configure it to your needs (e.g. set the port to listen on). The ServerSap includes the complete device model defined in the ICD file. Retrieve a copy of it using the method getModelCopy(). Tell the ServerSap to start to listen on the configured port using startListening(). This is a non-blocking function.
### Data Model
An IEC 61850 server contains a treelike data model that contains at its leafs the data (integers, boolean, strings etc) that can be accessed by clients. Clients can also retrieve the whole data model from the server.
The upper most model node is called "server". In IEC61850bean it is an object of type ServerModel. The server node contains 1..n logical devices (LD). A logical device may contain 1..n logical nodes (LN). A logical node may contain 1..n data objects. In IEC61850bean the logical nodes do not contain complete data objects but instead contain so called functionally constraint data objects (FCDO). An FCDO is a data object that is split up by functional constraint. An FCDO can contain a combination of other FCDOs, arrays, constructed data attributes and/or basic data attributes.
All nodes of the server model in IEC61850bean are of one of the following seven types:
* ServerModel
* LogicalDevice
* LogicalNode
* FcDataObject
* Array
* ConstructedDataAttribute
* BasicDataAttribute
They all implement the ModelNode interface. The nodes FcDataObject, Array, ConstructedDataAttribute and BasicDataAttribute also implement the interface called FcModelNode because they are considered functionally constraint data in the standard. Many of the services of IEC 61850 can only be applied to functionally constraint data (e.g. GetDataValues and SetDataValues).
When programming a client you get a copy of the server model either through ClientAssociation.retrieveModel from the server device or through SclParser.parse from an SCL file. When using the second approach, the model has to be set in the client association using ClientAssociation.setServerModel. When programming a server you get a copy of the server model through the ServerSap.getModelCopy() function.
You can then navigate through the model using several functions:
* ServerModel.findModelNode(ObjectReference objectReference, Fc fc) will search for the subnode with the given reference and functional constraint.
* ModelNode.getChild(String name, Fc fc) will return the child node with the given name and functional constraint.
* ModelNode.getBasicDataAttributes() will return a list of all leaf nodes (basic data attributes) of the model node.
## Modifying and Compiling IEC61850bean
We use the Gradle build automation tool. The distribution contains a fully functional gradle build file (*build.gradle*). Thus if you changed code and want to rebuild a library you can do it easily with Gradle.

Binary file not shown.

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

53
gradlew vendored

@ -1,21 +1,5 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
@ -44,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@ -82,7 +66,6 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -126,11 +109,10 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@ -156,19 +138,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
i=$((i+1))
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@ -177,9 +159,14 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

22
gradlew.bat vendored

@ -1,19 +1,3 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@ -29,11 +13,8 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@ -84,7 +65,6 @@ set CMD_LINE_ARGS=%*
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

@ -1,5 +0,0 @@
#Tue Jun 30 15:11:36 CEST 2020
tselLocal=0,0
serverAddress=127.0.0.1
tselRemote=0,1
serverPort=10002

@ -0,0 +1,16 @@
/*
* Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

@ -0,0 +1,20 @@
#!/bin/bash
JARS_LOCATION="../../build/libs-all"
MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleClient"
SYSPROPS=""
PARAMS=""
SCRIPT_HOME=`dirname $0`
CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
for i in $@; do
if [[ $i == -D* ]]; then
SYSPROPS="$SYSPROPS $i";
else
PARAMS="$PARAMS $i";
fi
done
java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS

@ -0,0 +1,6 @@
::BATCH file for windows
set BATDIR=%~dp0
set LIBDIR=%BATDIR%..\..\build\libs-all
java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleClient %*

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
@ -10,7 +10,7 @@
</appender>
<root level="debug">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STDOUT" />
</root>
</configuration>

@ -1,10 +1,11 @@
#!/bin/bash
JARS_LOCATION="build/libs-all"
MAIN_CLASS="com.beanit.iec61850bean.app.ConsoleServer"
JARS_LOCATION="../../build/libs-all"
MAIN_CLASS="org.openmuc.openiec61850.app.ConsoleServer"
SYSPROPS="-Dlogback.configurationFile=logback.xml"
# Attempt to set APP_HOME (from Gradle start script)
# from gradle start script:
# Attempt to set SCRIPT_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
@ -18,20 +19,19 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >/dev/null
APP_HOME="`pwd -P`"
cd "`dirname \"$PRG\"`/" >/dev/null
SCRIPT_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
PARAMS=( )
SYSPROPS=( )
for i in "$@"; do
CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
for i in $@; do
if [[ $i == -D* ]]; then
SYSPROPS+=( "$i" )
SYSPROPS="$SYSPROPS $i";
else
PARAMS+=( "$i" )
PARAMS="$PARAMS $i";
fi
done
java "${SYSPROPS[@]}" -cp "$CLASSPATH" $MAIN_CLASS "${PARAMS[@]}"
java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS

@ -0,0 +1,6 @@
::BATCH file to windows
set BATDIR=%~dp0
set LIBDIR=%BATDIR%..\..\build\libs-all
java -Dlogback.configurationFile=logback.xml -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.app.ConsoleServer %*

@ -0,0 +1,39 @@
#!/bin/bash
JARS_LOCATION="../../build/libs-all"
MAIN_CLASS="org.openmuc.openiec61850.clientgui.ClientGui"
SYSPROPS=""
PARAMS=""
# from gradle start script:
# Attempt to set SCRIPT_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
SCRIPT_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}")
for i in $@; do
if [[ $i == -D* ]]; then
SYSPROPS="$SYSPROPS $i";
else
PARAMS="$PARAMS $i";
fi
done
java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS

@ -0,0 +1,6 @@
::BATCH file to windows
set BATDIR=%~dp0
set LIBDIR=%BATDIR%..\..\build\libs-all
java -Djava.ext.dirs=%LIBDIR% org.openmuc.openiec61850.clientgui.ClientGui %*

@ -0,0 +1,33 @@
ifndef::imagesdir[:imagesdir: images]
ifdef::backend-pdf[]
Fraunhofer Institute for Solar Energy Systems ISE
openmuc.org
//:doctype: book
// Settings:
:compat-mode:
:experimental:
:icons: font
:listing-caption: Listing
:sectnums:
:toc:
:toclevels: 3
:title-logo-image: image:banner.png[pdfwidth=90%,align=center]
:frame: none
:width100: 750
:width80: 600
:width60: 450
:width40: 300
:width20: 150
endif::[]
ifndef::backend-pdf[]
:width100: "100%"
:width80: "80%"
:width60: "60%"
:width40: "40%"
:width20: "20%"
endif::[]

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

@ -0,0 +1,441 @@
= OpenIEC61850 User Guide
include::common-settings.txt[]
:numbered:
== Intro
OpenIEC61850 is a library implementing the IEC 61850 standard based on
the MMS mapping for client and server communication. It is licensed
under the Apache 2.0 license. OpenIEC61850 includes a console client
and server as well as a gui client.
=== Distribution
After extracting the distribution tar file the OpenIEC61850 library
can be found in the build/libs-all folder. For license information
check the _license_ directory in the distribution.
==== Dependencies
Besides the OpenIEC61850 library the folder _build/libs-all/_ contains the
following external libraries:
* *jasn1* - a library from the jASN1 project doing BER
encoding/decoding, Copyright 2011-17 Fraunhofer ISE, Author: Stefan
Feuerhahn, License: LGPLv2.1 or later, http://www.openmuc.org
* *slf4j-api* - a popular logging API. It is only needed if
openiec61850 is used to implement a server. The client part does
not log anything. License: MIT, http://www.slf4j.org
* *logback-core/logback-classic* - an actual logger implementation of
the slf4-api. It is used by the console server application to
output log information. It can be replaced by a logger of your
choice that supports the slf4j API. Like slf4j it is only needed
for server implementations. License: EPLv1.0 and LGPLv2.1,
http://logback.qos.ch
* *jcalendar* - a calendar library needed by the client GUI. You don't
need this dependency if you don't use the client gui. (C)
1999-2011 Kai Toedter, License: LGPLv3,
http://toedter.com/jcalendar/
=== Console & GUI Applications
You can execute the console client and server through the scripts
found in the folder _run-scripts_. Executing the scripts without any
parameters will print help information to the screen. Note that under
Unix/Linux you need root privilages if you want the server to listen
on any port lower than 1000.
Instead of running the applications from the terminal you can create
Eclipse project files as explained in our
link:https://www.openmuc.org/faq/gradle_getting_started/[FAQs] and run
them from within Eclipse.
=== OSI Stack
The OpenIEC61850 library includes an OSI stack implementation as it is
needed by the IEC 61850 MMS mapping. The API of the OSI stack and the
OSI transport layers are made public so that they can be used by other
projects.
* *josistack* - implements the Application Control Service Element
(ACSE) protocol as defined by ISO 8650 or ITU X.217/X.227, the
lower ISO Presentation Layer as defined by ISO 8823/ITU X226, and
the ISO Session Layer as defined by 8327/ITU X.225.
* *jositransport* - implements RFC 1006 and the OSI Transport Service
Layer.
== Using OpenIEC61850
The easiest way to learn how OpenIEC61850 works is by running and
analyzing the console client and server applications. You might want
to look at the source code of the console applications to get an
understanding of how they work. They can be used as a basis for you to
code your individual client or server applications.
An IEC 61850 device that is to be controlled or monitored is called an
IEC 61850 server. An IEC 61850 server normally listens on port 102 for
incoming connection requests by IEC 61850 clients.
=== Client
If you want to connect to an IEC 61850 server, you should first create
an instance of ClientSap (SAP = Service Access Point) and configure it
to your needs. Then you build up the association to the server using
the associate() method.
=== Server
First get a List of ServerSaps using the method
ServerSap.getSapsFromSclFile(). This method reads in the SAP from the
given ICD file. Take the ServerSap you want to run and configure it to
your needs (e.g. set the port to listen on). The ServerSap includes
the complete device model defined in the ICD file. Retrieve a copy of
it using the method getModelCopy(). Tell the ServerSap to start
to listen on the configured port using startListening(). This is a
non-blocking function.
=== Data Model
An IEC 61850 server contains a treelike data model that contains at
its leafs the data (integers, boolean, strings etc) that can be
accessed by clients. Clients can also retrieve the whole data model
from the server.
The upper most model node ist called "server". In OpenIEC61850 it is
an object of type ServerModel. The server node contains 1..n logical
devices (LD). A logical device may contain 1..n logical nodes (LN). A
logical node may contain 1..n data objects. In OpenIEC61850 the
logical nodes do not contain complete data objects but instead contain
so called functionally constraint data objects (FCDO). An FCDO is a
data object that is split up by functional constraint. An FCDO can
contain a combination of other FCDOs, arrays, constructed data
attributes and/or basic data attributes.
All nodes of the server model in OpenIEC61850 are of one of the
following seven types:
* ServerModel
* LogicalDevice
* LogicalNode
* FcDataObject
* Array
* ConstructedDataAttribute
* BasicDataAttribute
They all implement the ModelNode interface. The nodes FcDataObject,
Array, ConstructedDataAttribute and BasicDataAttribute also implement
the interface called FcModelNode because they are considered
functionally constraint data in the standard. Many of the services of
IEC 61850 can only be applied to functionally constraint data
(e.g. GetDataValues and SetDataValues).
When programming a client you get a copy of the server model either
through ClientAssociation.retrieveModel() or
ClientAssociation.getModelFromSclFile(). When programming a server you
get a copy of the server model through the ServerSap.getModelCopy()
function.
You can then navigate through the model using several functions:
* ServerModel.findModelNode(ObjectReference objectReference, Fc fc)
will search for the subnode with the given reference and functional
constraint.
* ModelNode.getChild(String name, Fc fc) will return the child node
with the given name and functional constraint.
* ModelNode.getBasicDataAttributes() will return a list of all leaf
nodes (basic data attributes) of the model node.
== Modifying and Compiling OpenIEC61850
We use the Gradle build automation tool. The distribution contains a
fully functional gradle build file (_build.gradle_). Thus if you
changed code and want to rebuild a library you can do it easily with
Gradle. Also if you want to import our software into Eclipse you can
easily create Eclipse project files using Gradle. Just follow the
instructions on our
link:https://www.openmuc.org/faq/gradle_getting_started/[FAQ site].
== IEC 61850 Concepts
=== Data Sets
Data sets (DS) form a group/set of data. Data sets can be used to read
or write several data objects/data attributes at once using a single
request/response message exchange. The service used for this are
GetDataSetValues and SetDataSetValues. Besides the data set
services the reporting, logging, GOOSE and sampled value services also
use the data set concept.
The data attributes or data objects that are part of a data set are
called the members of a data set. Only functionally constraint data
may be a member of a data set.
The IEC 61850 standard defines five ASCI services related to data sets:
* *GetDataSetValues* to get the value of all members of the data set.
* *SetDataSetValues* to set the value of all members of the data set.
* *CreateDataSet* to create a new data set dynamically.
* *DeleteDataSet* to delete a data set that was created.
* *GetDataSetDirectory* to get the list of all existing data sets in
the server
Two types of data sets exist:
* *Persistent data sets* - they have a reference of the format
LDName/LNName.DataSetName . They are visible to all
clients. Persistent data sets can be preconfigured in the SCL
file. In this case they cannot be deleted. Persistent data sets can
also be dynamicall created by clients. In this case they may be
deleted again later. Dynamically created data sets will be
automatically deleted once the server stops.
* *Non-persistent data sets* - they have a reference of the format
@datasetname . They are only visible to the client that created it
through the CreateDataSet service. These data sets only exist as
long as the association is open.
=== Reporting
Reporting allows a server to send data based on events and without
explict request by the client. What data is sent and the events that
cause reports are configured through so called report control blocks
(RCB).
The standard distinguishes between two types of reporting: buffered
reporting and unbuffered reporting. With buffered reporting reports
are buffered by the server in case a connection to the client is
interrupted. This way reports can be sent after the client has
connected again. Buffered reporting is configured through buffered
report control blocks (BRCB). Unbuffered reporting is configured
through unbuffered report control blocks (URCB).
RCBs are located within logical nodes of the server's data model
(i.e. the server's ICD/SCL file). They are fixed and cannot be deleted
or added at runtime. An RCB is blocked once a client has registered to
receive reports (by enabling it). That means a single RCB cannot send
reports to several clients in parallel.
RCBs are always associated with a specific <<_data_sets,data set>>
that must be located in the same logical node as the RCB. A subset of
the data set's members will be reported if any of the configured
events occures. The associated data set of the RCB can be
dynamically changed by a client at run-time.
RCBs are located in logical nodes in the server's model tree. Therefor
the reference of an RCB is of the form
LogicalDeviceName/LogicalNodeName.RCBName . Even though RCBs can only
reference data sets located in the same logical node as the RCB
itself, they can still monitor data from other logical nodes because
the data set's members can be located in other logical nodes.
The following events can cause a server to send a report:
. The client issues a general interrogation.
. A data attribute that is part of the associated data set changes or
is updated.
. Periodic sending of reports has been enabled by setting the
integrity period of an RCB.
Whether one of these events really causes a report to be sent is
configured through the RCB.
A report control block contains the following fields:
* Configuration fields. They can only be written if the RCB has not
been enabled nor reserved by another client:
** *RptID* - The report ID identifies the RCB. If not set, it equals
the RCB reference. The RptID will be sent with every report so that
the client can identify the RCB responsible for the report.
** *DatSet* - The reference of the data set associated with this
RCB. It must be located in the same logical node as the
RCB. Members of this data set will be reported whenever the
configured events occure. The data set reference as it is set in an
RCB must contain a dollar sign instead of a dot to separate the
logical node from the data set name, e.g.:
'LDevice1/LNode$DataSetName'
** *OptFlds* - A bitstring where each bit indicates whether an
optional field is included in the reports caused by this RCB. The
following optional fields exist: sequence-number, report-
timestamp, reason-for-inclusion, data-set-name, data-reference,
buffer-overflow, entryID, segmentation, and conf-revision. For
URCBs the values of buffer-overflow and entryID are ignored.
** *BufTm* - In case of an event that causes a report the server will
wait for _BufTm_ ms for other events. All data that is to be
reported because of events in this time span is sent in a single
report.
** *TrgOps* - Specifies which events will trigger reports. Possible
events are:
*** data change (dchg)
*** quality change (qchg)
*** data update (dupd)
*** integrity - if enabled the server will send periodic integrity
reports to the client. Integrity reports will contain the current
values of all members of the referenced data set.
*** general interrogation (GI).
** *IntgPd* - The integrity period specifies an interval in ms for the
periodic sending of intergrity reports.
** *PurgeBuf* (only part of BRCBs not URCBs) -
** *EntryID* (only part of BRCBs not URCBs) -
* Information fields: can only be read:
** *SqNum* - the current sequence number of the RCB. After sending a
report the RCB will increment the sequence number by one.
** *ConfRev* - The configuration revision is a counter representing the number of
times the referenced data set was changed.
** *Owner* - Shall be equal to the IP of the client that reserved the
RCB. Shall be NULL (i.e. the empty string) if the RCB is not
reserved.
** *TimeOfEntry* (only part of BRCBs not URCBs)
* Functional fields: The following fields of the RCB can be read or
written to execute functions:
** *Resv* (only part of URCBs not BRCBs) - Before doing anything with
an RCB a client should reserve it by setting this field to
true. If the setting was successful the RCB will be reserved
exclusively for this client. Enabling an RCB that has not been
reserved implicitly reserves it.
** *ResvTms* (only part of BRCBs not URCBs) - This attribute of BRCBs
is optional. If not present the control block is reserved by
simply enabling it. A ResvTms value of -1 indicates that the
control block was reserved by configuration for a certain set of
clients. A value of 0 indicates that the BRCB is not reserved. A
client can reserve the control block by writing a value largen
than 0. The value represents the number of seconds that the
reservation shall be maintained after the association was closed
or interrupted.
** *RptEna* - By setting this variable to true reporting will be
enabled. Note that changing/writing and configuration fields of
the RCB will fail as long as reporting is enabled.
** *GI* - General Interrogation. Setting this parameter to true will
initiate a report to be sent to the client. This report will
contain all the data of the associated data set. The GI parameter
will be reset to false automatically by the server once the report
has been sent.
A report always contains the following information fields:
* *RptID* - The report ID identifies the RCB that has caused the
generation of the report. It equals the RptID field of the RCB.
* *OptFlds* - It is equal to the OptFlds field of the corresponding
RCB.
* *SqNum* (optional, included if OptFlds.SequenceNumber is true) - The
sequence number of the report. It is equal to the SqNum field of
the corresponding RCB by the time it was sent.
* *TimeOfEntry* (optional, included if OptFlds.report-timestamp is
true) - specifies the time when the Entry ID was created.
* *DatSet* (optional, included if OptFlds.dataset-name is true) - The
reference of the data set whose data is sent in this report.
* *BufOvfl* (optional, only included if it is a buffered report and
OptFlds.buffer-overflow is true) - Indicates the server lost report
entries due to a buffer overflow. Only applies to buffered
reporting.
* *EntryID* (optional, only included if it is a buffered report and
OptFlds.entryID is true) - Entry identification ToDo
* *ConfRev* (optional, only included if OptFlds.conf-rev is true) - It
is equal to the ConfRev field of the corresponding RCB.
* *SubSqNum* (optional, included if OptFlds.segmentation is true) - In
case that a long report does not fit into one message, a single
report shall be divided into subreports. Each subreport shall have
the same sequence number and a unique SubSqNum.
* *MoreSegmentsFollow* (optional, included if OptFlds.segmentation is
true) - indicates that more subreports with the same SqNum follow.
* *Inclusion Bitstring* - A bit string whose length equals the number
of data members of the referenced data set. Each bit indicates
whether the corresponding data member is included in the report or
not.
* *Data-references* (optional, included if OptFlds.data-reference is
true) - The references of the reported data set members.
* *Values* - The values of the reported data set members.
* *Reason Codes* (optional, included if OptFlds.reason-for-inclusion
is true) - The reason codes indicate for each reported value, the
reason why it was reported. Possible reasons are data change,
quality change, data update, integrity, general interrogation,
and application trigger. Several reasons can be true for a single
reported value.
A client that wants to receive reports from a certain RCB would
usually first attempt to reserve the RCB. If successful he would then
configure the RCB as he wishes. Finally he would enable reporting.
== Terminology
* *BRCB* - Buffered Report Control Block
* *DS* - Data Set
* *LD* - Logical Device
* *LN* - Logical Node
* *SAP* - Service Access Point
* *URCB* - Unbuffered Report Control Block
== Authors
Developers:
* Stefan Feuerhahn
Former developers:
* Claus Brunzema
* Bertram Lückehe
* Chau Do
* Tobias Weidelt
* Michael Zillgith

@ -0,0 +1,398 @@
/*
* AsciiDoc 'volnitsky' theme for xhtml11 and html5 backends.
* Based on css from http://volnitsky.com, which was in turn based on default
* theme from AsciiDoc
*
* FIXME: The styling is still a bit rough in places.
*
*/
/* Default font. */
body {
font-family: Helvetica, sans-serif;
max-width:62.5em;
margin: auto;
}
/* Title font. */
h1, h2, h3, h4, h5, h6 {
clear: both;
font-family: Helvetica, serif;
line-height: 1.3;
}
a {
border-bottom: 1px dotted #999999;
color: #378f03 !important;
text-decoration: none !important;
}
a:hover {
border-bottom: 1px solid #378f03;
color: #378f03 !important;
text-decoration: none !important;
}
em {
font-style: italic;
color: #4E4E4E;
}
strong {
font-weight: bold;
color: #000000;
}
div.sectionbody {
/* margin-left: 0;*/
}
hr {
border: 1px solid #575757;
}
pre {
padding: 0;
margin: 0;
}
#author {
color: #575757;
font-weight: bold;
font-size: 1.1em;
}
#footer {
font-size: small;
padding-top: 0.5em;
margin-top: 4.0em;
}
#footer-text {
float: left;
padding-bottom: 0.5em;
}
#footer-badges {
float: right;
padding-bottom: 0.5em;
}
#preamble {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
color: #575757;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock {
padding-left: 2.0em;
margin-right: 10%;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
div.verseblock {
padding-left: 2.0em;
margin-right: 10%;
}
div.verseblock > pre.content {
font-family: inherit;
}
div.verseblock > div.attribution {
padding-top: 0.75em;
text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
text-align: left;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #575757;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: normal;
color: #575757;
}
dd > *:first-child {
margin-top: 0.1em;
}
ul, ol {
list-style-position: outside;
}
ol.arabic {
list-style-type: decimal;
}
ol.loweralpha {
list-style-type: lower-alpha;
}
ol.upperalpha {
list-style-type: upper-alpha;
}
ol.lowerroman {
list-style-type: lower-roman;
}
ol.upperroman {
list-style-type: upper-roman;
}
div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
margin-top: 0.1em;
margin-bottom: 0.1em;
}
div.tableblock > table {
border: 3px solid #575757;
}
thead {
font-weight: bold;
color: #575757;
}
tfoot {
font-weight: bold;
}
td > div.verse {
white-space: pre;
}
p.table {
margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
div.tableblock > table[frame="hsides"] {
border-left-style: none;
border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
border-top-style: none;
border-bottom-style: none;
}
div.hdlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
div.hdlist tr {
padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
font-weight: bold;
}
td.hdlist1 {
vertical-align: top;
font-style: normal;
padding-right: 0.8em;
color: #575757;
}
td.hdlist2 {
vertical-align: top;
}
div.hdlist.compact tr {
margin: 0;
padding-bottom: 0;
}
.comment {
background: yellow;
}
@media print {
#footer-badges { display: none; }
}
#toctitle {
color: #575757;
font-size: 1.2em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 0.1em;
}
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { margin-top: 0; margin-bottom: 0; }
div.toclevel1 { margin-top: 0.3em; margin-left: 0; font-size: 1.0em; }
div.toclevel2 { margin-top: 0.25em; margin-left: 2em; font-size: 0.9em; }
div.toclevel3 { margin-left: 4em; font-size: 0.8em; }
div.toclevel4 { margin-left: 6em; font-size: 0.8em; }
.monospaced, tt, div.listingblock > div.content {
font-family: Consolas, "Andale Mono", "Courier New", monospace;
color: #004400;
background: #f4f4f4;
max-width: 80em;
line-height: 1.2em;
}
.paragraph p {
line-height: 1.5em;
margin-top: 1em;
}
/*.paragraph p, li, dd, .content { max-width: 85em; }
.admonitionblock { max-width: 35em; }*/
div.sectionbody div.ulist > ul > li {
list-style-type: square;
color: #aaa;
}
div.sectionbody div.ulist > ul > li > * {
color: black;
/*font-size: 50%;*/
}
div.sectionbody div.ulist > ul > li div.ulist > ul > li {
color: #ccd ;
}
div.sectionbody div.ulist > ul > li div.ulist > ul > li > * {
color: black ;
}
/*
* html5 specific
*
* */
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
}
thead, p.tableblock.header {
font-weight: bold;
color: #575757;
}
p.tableblock {
margin-top: 0;
}
table.tableblock {
border-width: 3px;
border-spacing: 0px;
border-style: solid;
border-color: #575757;
border-collapse: collapse;
}
th.tableblock, td.tableblock {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #575757;
}
table.tableblock.frame-topbot {
border-left-style: hidden;
border-right-style: hidden;
}
table.tableblock.frame-sides {
border-top-style: hidden;
border-bottom-style: hidden;
}
table.tableblock.frame-none {
border-style: hidden;
}
th.tableblock.halign-left, td.tableblock.halign-left {
text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
text-align: right;
}
th.tableblock.valign-top, td.tableblock.valign-top {
vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
vertical-align: bottom;
}

@ -0,0 +1,54 @@
title_page:
align: right
page:
layout: portrait
# margin: [0.75in, 1in, 0.75in, 1in]
size: A4
base:
font_family: Times-Roman
font_color: #333333
font_size: 11
line_height_length: 17
line_height: $base_line_height_length / $base_font_size
vertical_rhythm: $base_line_height_length
heading:
font_color: #0000
font_size: 14
font_style: bold
line_height: 1.2
margin_bottom: $vertical_rhythm
link:
font_color: #939393
outline_list:
indent: $base_font_size * 1.5
header:
height: 0.75in
line_height: 1
recto_content:
center: '{document-title}'
verso_content:
center: '{document-title}'
footer:
height: 0.75in
line_height: 1
recto_content:
right: '*{page-number}*'
verso_content:
left: '*{page-number}*'
caption:
align: left
font_color: #000000
font_size: 9
code:
border_color: #cccccc

@ -1,136 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class AccessResult implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private DataAccessError failure = null;
private Data success = null;
public AccessResult() {}
public AccessResult(byte[] code) {
this.code = code;
}
public DataAccessError getFailure() {
return failure;
}
public void setFailure(DataAccessError failure) {
this.failure = failure;
}
public Data getSuccess() {
return success;
}
public void setSuccess(Data success) {
this.success = success;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (success != null) {
codeLength += success.encode(reverseOS);
return codeLength;
}
if (failure != null) {
codeLength += failure.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
int numDecodedBytes;
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
failure = new DataAccessError();
tlvByteCount += failure.decode(is, false);
return tlvByteCount;
}
success = new Data();
numDecodedBytes = success.decode(is, berTag);
if (numDecodedBytes != 0) {
return tlvByteCount + numDecodedBytes;
} else {
success = null;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

@ -1,250 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class AlternateAccess implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
CHOICE element = new CHOICE();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 static class CHOICE implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private AlternateAccessSelection unnamed = null;
public CHOICE() {}
public CHOICE(byte[] code) {
this.code = code;
}
public AlternateAccessSelection getUnnamed() {
return unnamed;
}
public void setUnnamed(AlternateAccessSelection unnamed) {
this.unnamed = unnamed;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (unnamed != null) {
codeLength += unnamed.encode(reverseOS);
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
int numDecodedBytes;
unnamed = new AlternateAccessSelection();
numDecodedBytes = unnamed.decode(is, berTag);
if (numDecodedBytes != 0) {
return tlvByteCount + numDecodedBytes;
} else {
unnamed = null;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
public class BasicIdentifier extends BerVisibleString {
private static final long serialVersionUID = 1L;
public BasicIdentifier() {}
public BasicIdentifier(byte[] value) {
super(value);
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerNull;
public class ConcludeRequestPDU extends BerNull {
private static final long serialVersionUID = 1L;
public ConcludeRequestPDU() {}
public ConcludeRequestPDU(byte[] code) {
super(code);
}
}

@ -1,204 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ConfirmedErrorPDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 Unsigned32 getInvokeID() {
return invokeID;
}
public void setInvokeID(Unsigned32 invokeID) {
this.invokeID = invokeID;
}
public Unsigned32 getModifierPosition() {
return modifierPosition;
}
public void setModifierPosition(Unsigned32 modifierPosition) {
this.modifierPosition = modifierPosition;
}
public ServiceError getServiceError() {
return serviceError;
}
public void setServiceError(ServiceError serviceError) {
this.serviceError = serviceError;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += serviceError.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
reverseOS.write(0xA2);
codeLength += 1;
if (modifierPosition != null) {
codeLength += modifierPosition.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
codeLength += invokeID.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
invokeID = new Unsigned32();
vByteCount += invokeID.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
modifierPosition = new Unsigned32();
vByteCount += modifierPosition.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
serviceError = new ServiceError();
vByteCount += serviceError.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,169 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ConfirmedRequestPDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Unsigned32 invokeID = null;
private ConfirmedServiceRequest service = null;
public ConfirmedRequestPDU() {}
public ConfirmedRequestPDU(byte[] code) {
this.code = code;
}
public Unsigned32 getInvokeID() {
return invokeID;
}
public void setInvokeID(Unsigned32 invokeID) {
this.invokeID = invokeID;
}
public ConfirmedServiceRequest getService() {
return service;
}
public void setService(ConfirmedServiceRequest service) {
this.service = service;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += service.encode(reverseOS);
codeLength += invokeID.encode(reverseOS, true);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(Unsigned32.tag)) {
invokeID = new Unsigned32();
vByteCount += invokeID.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
service = new ConfirmedServiceRequest();
numDecodedBytes = service.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,169 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ConfirmedResponsePDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Unsigned32 invokeID = null;
private ConfirmedServiceResponse service = null;
public ConfirmedResponsePDU() {}
public ConfirmedResponsePDU(byte[] code) {
this.code = code;
}
public Unsigned32 getInvokeID() {
return invokeID;
}
public void setInvokeID(Unsigned32 invokeID) {
this.invokeID = invokeID;
}
public ConfirmedServiceResponse getService() {
return service;
}
public void setService(ConfirmedServiceResponse service) {
this.service = service;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += service.encode(reverseOS);
codeLength += invokeID.encode(reverseOS, true);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(Unsigned32.tag)) {
invokeID = new Unsigned32();
vByteCount += invokeID.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
service = new ConfirmedServiceResponse();
numDecodedBytes = service.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,444 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ConfirmedServiceRequest implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private 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 FileOpenRequest fileOpen = null;
private FileReadRequest fileRead = null;
private FileCloseRequest fileClose = null;
private FileDeleteRequest fileDelete = null;
private FileDirectoryRequest fileDirectory = null;
public ConfirmedServiceRequest() {}
public ConfirmedServiceRequest(byte[] code) {
this.code = code;
}
public GetNameListRequest getGetNameList() {
return getNameList;
}
public void setGetNameList(GetNameListRequest getNameList) {
this.getNameList = getNameList;
}
public ReadRequest getRead() {
return read;
}
public void setRead(ReadRequest read) {
this.read = read;
}
public WriteRequest getWrite() {
return write;
}
public void setWrite(WriteRequest write) {
this.write = write;
}
public GetVariableAccessAttributesRequest getGetVariableAccessAttributes() {
return getVariableAccessAttributes;
}
public void setGetVariableAccessAttributes(
GetVariableAccessAttributesRequest getVariableAccessAttributes) {
this.getVariableAccessAttributes = getVariableAccessAttributes;
}
public DefineNamedVariableListRequest getDefineNamedVariableList() {
return defineNamedVariableList;
}
public void setDefineNamedVariableList(DefineNamedVariableListRequest defineNamedVariableList) {
this.defineNamedVariableList = defineNamedVariableList;
}
public GetNamedVariableListAttributesRequest getGetNamedVariableListAttributes() {
return getNamedVariableListAttributes;
}
public void setGetNamedVariableListAttributes(
GetNamedVariableListAttributesRequest getNamedVariableListAttributes) {
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
}
public DeleteNamedVariableListRequest getDeleteNamedVariableList() {
return deleteNamedVariableList;
}
public void setDeleteNamedVariableList(DeleteNamedVariableListRequest deleteNamedVariableList) {
this.deleteNamedVariableList = deleteNamedVariableList;
}
public FileOpenRequest getFileOpen() {
return fileOpen;
}
public void setFileOpen(FileOpenRequest fileOpen) {
this.fileOpen = fileOpen;
}
public FileReadRequest getFileRead() {
return fileRead;
}
public void setFileRead(FileReadRequest fileRead) {
this.fileRead = fileRead;
}
public FileCloseRequest getFileClose() {
return fileClose;
}
public void setFileClose(FileCloseRequest fileClose) {
this.fileClose = fileClose;
}
public FileDeleteRequest getFileDelete() {
return fileDelete;
}
public void setFileDelete(FileDeleteRequest fileDelete) {
this.fileDelete = fileDelete;
}
public FileDirectoryRequest getFileDirectory() {
return fileDirectory;
}
public void setFileDirectory(FileDirectoryRequest fileDirectory) {
this.fileDirectory = fileDirectory;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
int sublength;
if (fileDirectory != null) {
codeLength += fileDirectory.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
reverseOS.write(0x4D);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (fileDelete != null) {
codeLength += fileDelete.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 76
reverseOS.write(0x4C);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (fileClose != null) {
codeLength += fileClose.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 74
reverseOS.write(0x4A);
reverseOS.write(0x9F);
codeLength += 2;
return codeLength;
}
if (fileRead != null) {
codeLength += fileRead.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 73
reverseOS.write(0x49);
reverseOS.write(0x9F);
codeLength += 2;
return codeLength;
}
if (fileOpen != null) {
codeLength += fileOpen.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 72
reverseOS.write(0x48);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (deleteNamedVariableList != null) {
codeLength += deleteNamedVariableList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
reverseOS.write(0xAD);
codeLength += 1;
return codeLength;
}
if (getNamedVariableListAttributes != null) {
sublength = getNamedVariableListAttributes.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
reverseOS.write(0xAC);
codeLength += 1;
return codeLength;
}
if (defineNamedVariableList != null) {
codeLength += defineNamedVariableList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 11
reverseOS.write(0xAB);
codeLength += 1;
return codeLength;
}
if (getVariableAccessAttributes != null) {
sublength = getVariableAccessAttributes.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
reverseOS.write(0xA6);
codeLength += 1;
return codeLength;
}
if (write != null) {
codeLength += write.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
reverseOS.write(0xA5);
codeLength += 1;
return codeLength;
}
if (read != null) {
codeLength += read.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
reverseOS.write(0xA4);
codeLength += 1;
return codeLength;
}
if (getNameList != null) {
codeLength += getNameList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
getNameList = new GetNameListRequest();
tlvByteCount += getNameList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
read = new ReadRequest();
tlvByteCount += read.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
write = new WriteRequest();
tlvByteCount += write.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
BerLength length = new BerLength();
tlvByteCount += length.decode(is);
getVariableAccessAttributes = new GetVariableAccessAttributesRequest();
tlvByteCount += getVariableAccessAttributes.decode(is, null);
tlvByteCount += length.readEocIfIndefinite(is);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 11)) {
defineNamedVariableList = new DefineNamedVariableListRequest();
tlvByteCount += defineNamedVariableList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
BerLength length = new BerLength();
tlvByteCount += length.decode(is);
getNamedVariableListAttributes = new GetNamedVariableListAttributesRequest();
tlvByteCount += getNamedVariableListAttributes.decode(is, null);
tlvByteCount += length.readEocIfIndefinite(is);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
deleteNamedVariableList = new DeleteNamedVariableListRequest();
tlvByteCount += deleteNamedVariableList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 72)) {
fileOpen = new FileOpenRequest();
tlvByteCount += fileOpen.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 73)) {
fileRead = new FileReadRequest();
tlvByteCount += fileRead.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 74)) {
fileClose = new FileCloseRequest();
tlvByteCount += fileClose.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 76)) {
fileDelete = new FileDeleteRequest();
tlvByteCount += fileDelete.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
fileDirectory = new FileDirectoryRequest();
tlvByteCount += fileDirectory.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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;
}
if (fileOpen != null) {
sb.append("fileOpen: ");
fileOpen.appendAsString(sb, indentLevel + 1);
return;
}
if (fileRead != null) {
sb.append("fileRead: ").append(fileRead);
return;
}
if (fileClose != null) {
sb.append("fileClose: ").append(fileClose);
return;
}
if (fileDelete != null) {
sb.append("fileDelete: ");
fileDelete.appendAsString(sb, indentLevel + 1);
return;
}
if (fileDirectory != null) {
sb.append("fileDirectory: ");
fileDirectory.appendAsString(sb, indentLevel + 1);
return;
}
sb.append("<none>");
}
}

@ -1,430 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ConfirmedServiceResponse implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private 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 FileOpenResponse fileOpen = null;
private FileReadResponse fileRead = null;
private FileCloseResponse fileClose = null;
private FileDeleteResponse fileDelete = null;
private FileDirectoryResponse fileDirectory = null;
public ConfirmedServiceResponse() {}
public ConfirmedServiceResponse(byte[] code) {
this.code = code;
}
public GetNameListResponse getGetNameList() {
return getNameList;
}
public void setGetNameList(GetNameListResponse getNameList) {
this.getNameList = getNameList;
}
public ReadResponse getRead() {
return read;
}
public void setRead(ReadResponse read) {
this.read = read;
}
public WriteResponse getWrite() {
return write;
}
public void setWrite(WriteResponse write) {
this.write = write;
}
public GetVariableAccessAttributesResponse getGetVariableAccessAttributes() {
return getVariableAccessAttributes;
}
public void setGetVariableAccessAttributes(
GetVariableAccessAttributesResponse getVariableAccessAttributes) {
this.getVariableAccessAttributes = getVariableAccessAttributes;
}
public DefineNamedVariableListResponse getDefineNamedVariableList() {
return defineNamedVariableList;
}
public void setDefineNamedVariableList(DefineNamedVariableListResponse defineNamedVariableList) {
this.defineNamedVariableList = defineNamedVariableList;
}
public GetNamedVariableListAttributesResponse getGetNamedVariableListAttributes() {
return getNamedVariableListAttributes;
}
public void setGetNamedVariableListAttributes(
GetNamedVariableListAttributesResponse getNamedVariableListAttributes) {
this.getNamedVariableListAttributes = getNamedVariableListAttributes;
}
public DeleteNamedVariableListResponse getDeleteNamedVariableList() {
return deleteNamedVariableList;
}
public void setDeleteNamedVariableList(DeleteNamedVariableListResponse deleteNamedVariableList) {
this.deleteNamedVariableList = deleteNamedVariableList;
}
public FileOpenResponse getFileOpen() {
return fileOpen;
}
public void setFileOpen(FileOpenResponse fileOpen) {
this.fileOpen = fileOpen;
}
public FileReadResponse getFileRead() {
return fileRead;
}
public void setFileRead(FileReadResponse fileRead) {
this.fileRead = fileRead;
}
public FileCloseResponse getFileClose() {
return fileClose;
}
public void setFileClose(FileCloseResponse fileClose) {
this.fileClose = fileClose;
}
public FileDeleteResponse getFileDelete() {
return fileDelete;
}
public void setFileDelete(FileDeleteResponse fileDelete) {
this.fileDelete = fileDelete;
}
public FileDirectoryResponse getFileDirectory() {
return fileDirectory;
}
public void setFileDirectory(FileDirectoryResponse fileDirectory) {
this.fileDirectory = fileDirectory;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (fileDirectory != null) {
codeLength += fileDirectory.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 77
reverseOS.write(0x4D);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (fileDelete != null) {
codeLength += fileDelete.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 76
reverseOS.write(0x4C);
reverseOS.write(0x9F);
codeLength += 2;
return codeLength;
}
if (fileClose != null) {
codeLength += fileClose.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 74
reverseOS.write(0x4A);
reverseOS.write(0x9F);
codeLength += 2;
return codeLength;
}
if (fileRead != null) {
codeLength += fileRead.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 73
reverseOS.write(0x49);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (fileOpen != null) {
codeLength += fileOpen.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 72
reverseOS.write(0x48);
reverseOS.write(0xBF);
codeLength += 2;
return codeLength;
}
if (deleteNamedVariableList != null) {
codeLength += deleteNamedVariableList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
reverseOS.write(0xAD);
codeLength += 1;
return codeLength;
}
if (getNamedVariableListAttributes != null) {
codeLength += getNamedVariableListAttributes.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
reverseOS.write(0xAC);
codeLength += 1;
return codeLength;
}
if (defineNamedVariableList != null) {
codeLength += defineNamedVariableList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
reverseOS.write(0x8B);
codeLength += 1;
return codeLength;
}
if (getVariableAccessAttributes != null) {
codeLength += getVariableAccessAttributes.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
reverseOS.write(0xA6);
codeLength += 1;
return codeLength;
}
if (write != null) {
codeLength += write.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
reverseOS.write(0xA5);
codeLength += 1;
return codeLength;
}
if (read != null) {
codeLength += read.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
reverseOS.write(0xA4);
codeLength += 1;
return codeLength;
}
if (getNameList != null) {
codeLength += getNameList.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
getNameList = new GetNameListResponse();
tlvByteCount += getNameList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
read = new ReadResponse();
tlvByteCount += read.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
write = new WriteResponse();
tlvByteCount += write.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
getVariableAccessAttributes = new GetVariableAccessAttributesResponse();
tlvByteCount += getVariableAccessAttributes.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
defineNamedVariableList = new DefineNamedVariableListResponse();
tlvByteCount += defineNamedVariableList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
getNamedVariableListAttributes = new GetNamedVariableListAttributesResponse();
tlvByteCount += getNamedVariableListAttributes.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
deleteNamedVariableList = new DeleteNamedVariableListResponse();
tlvByteCount += deleteNamedVariableList.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 72)) {
fileOpen = new FileOpenResponse();
tlvByteCount += fileOpen.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 73)) {
fileRead = new FileReadResponse();
tlvByteCount += fileRead.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 74)) {
fileClose = new FileCloseResponse();
tlvByteCount += fileClose.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 76)) {
fileDelete = new FileDeleteResponse();
tlvByteCount += fileDelete.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 77)) {
fileDirectory = new FileDirectoryResponse();
tlvByteCount += fileDirectory.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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;
}
if (fileOpen != null) {
sb.append("fileOpen: ");
fileOpen.appendAsString(sb, indentLevel + 1);
return;
}
if (fileRead != null) {
sb.append("fileRead: ");
fileRead.appendAsString(sb, indentLevel + 1);
return;
}
if (fileClose != null) {
sb.append("fileClose: ").append(fileClose);
return;
}
if (fileDelete != null) {
sb.append("fileDelete: ").append(fileDelete);
return;
}
if (fileDirectory != null) {
sb.append("fileDirectory: ");
fileDirectory.appendAsString(sb, indentLevel + 1);
return;
}
sb.append("<none>");
}
}

@ -1,701 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerBitString;
import com.beanit.asn1bean.ber.types.BerInteger;
import com.beanit.asn1bean.ber.types.BerOctetString;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Data implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Array array = null;
private Structure structure = null;
private BerBoolean bool = null;
private BerBitString bitString = null;
private BerInteger integer = null;
private BerInteger unsigned = null;
private FloatingPoint floatingPoint = null;
private BerOctetString octetString = null;
private BerVisibleString visibleString = null;
private TimeOfDay binaryTime = null;
private MMSString mMSString = null;
private UtcTime utcTime = null;
public Data() {}
public Data(byte[] code) {
this.code = code;
}
public Array getArray() {
return array;
}
public void setArray(Array array) {
this.array = array;
}
public Structure getStructure() {
return structure;
}
public void setStructure(Structure structure) {
this.structure = structure;
}
public BerBoolean getBool() {
return bool;
}
public void setBool(BerBoolean bool) {
this.bool = bool;
}
public BerBitString getBitString() {
return bitString;
}
public void setBitString(BerBitString bitString) {
this.bitString = bitString;
}
public BerInteger getInteger() {
return integer;
}
public void setInteger(BerInteger integer) {
this.integer = integer;
}
public BerInteger getUnsigned() {
return unsigned;
}
public void setUnsigned(BerInteger unsigned) {
this.unsigned = unsigned;
}
public FloatingPoint getFloatingPoint() {
return floatingPoint;
}
public void setFloatingPoint(FloatingPoint floatingPoint) {
this.floatingPoint = floatingPoint;
}
public BerOctetString getOctetString() {
return octetString;
}
public void setOctetString(BerOctetString octetString) {
this.octetString = octetString;
}
public BerVisibleString getVisibleString() {
return visibleString;
}
public void setVisibleString(BerVisibleString visibleString) {
this.visibleString = visibleString;
}
public TimeOfDay getBinaryTime() {
return binaryTime;
}
public void setBinaryTime(TimeOfDay binaryTime) {
this.binaryTime = binaryTime;
}
public MMSString getMMSString() {
return mMSString;
}
public void setMMSString(MMSString mMSString) {
this.mMSString = mMSString;
}
public UtcTime getUtcTime() {
return utcTime;
}
public void setUtcTime(UtcTime utcTime) {
this.utcTime = utcTime;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (utcTime != null) {
codeLength += utcTime.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 17
reverseOS.write(0x91);
codeLength += 1;
return codeLength;
}
if (mMSString != null) {
codeLength += mMSString.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 16
reverseOS.write(0x90);
codeLength += 1;
return codeLength;
}
if (binaryTime != null) {
codeLength += binaryTime.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 12
reverseOS.write(0x8C);
codeLength += 1;
return codeLength;
}
if (visibleString != null) {
codeLength += visibleString.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 10
reverseOS.write(0x8A);
codeLength += 1;
return codeLength;
}
if (octetString != null) {
codeLength += octetString.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 9
reverseOS.write(0x89);
codeLength += 1;
return codeLength;
}
if (floatingPoint != null) {
codeLength += floatingPoint.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 7
reverseOS.write(0x87);
codeLength += 1;
return codeLength;
}
if (unsigned != null) {
codeLength += unsigned.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 6
reverseOS.write(0x86);
codeLength += 1;
return codeLength;
}
if (integer != null) {
codeLength += integer.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 5
reverseOS.write(0x85);
codeLength += 1;
return codeLength;
}
if (bitString != null) {
codeLength += bitString.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 4
reverseOS.write(0x84);
codeLength += 1;
return codeLength;
}
if (bool != null) {
codeLength += bool.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
reverseOS.write(0x83);
codeLength += 1;
return codeLength;
}
if (structure != null) {
codeLength += structure.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
reverseOS.write(0xA2);
codeLength += 1;
return codeLength;
}
if (array != null) {
codeLength += array.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
array = new Array();
tlvByteCount += array.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
structure = new Structure();
tlvByteCount += structure.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
bool = new BerBoolean();
tlvByteCount += bool.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
bitString = new BerBitString();
tlvByteCount += bitString.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
integer = new BerInteger();
tlvByteCount += integer.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) {
unsigned = new BerInteger();
tlvByteCount += unsigned.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) {
floatingPoint = new FloatingPoint();
tlvByteCount += floatingPoint.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) {
octetString = new BerOctetString();
tlvByteCount += octetString.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) {
visibleString = new BerVisibleString();
tlvByteCount += visibleString.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) {
binaryTime = new TimeOfDay();
tlvByteCount += binaryTime.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 16)) {
mMSString = new MMSString();
tlvByteCount += mMSString.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 17)) {
utcTime = new UtcTime();
tlvByteCount += utcTime.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
appendAsString(sb, 0);
return sb.toString();
}
public void appendAsString(StringBuilder sb, int indentLevel) {
if (array != null) {
sb.append("array: ");
array.appendAsString(sb, indentLevel + 1);
return;
}
if (structure != null) {
sb.append("structure: ");
structure.appendAsString(sb, indentLevel + 1);
return;
}
if (bool != null) {
sb.append("bool: ").append(bool);
return;
}
if (bitString != null) {
sb.append("bitString: ").append(bitString);
return;
}
if (integer != null) {
sb.append("integer: ").append(integer);
return;
}
if (unsigned != null) {
sb.append("unsigned: ").append(unsigned);
return;
}
if (floatingPoint != null) {
sb.append("floatingPoint: ").append(floatingPoint);
return;
}
if (octetString != null) {
sb.append("octetString: ").append(octetString);
return;
}
if (visibleString != null) {
sb.append("visibleString: ").append(visibleString);
return;
}
if (binaryTime != null) {
sb.append("binaryTime: ").append(binaryTime);
return;
}
if (mMSString != null) {
sb.append("mMSString: ").append(mMSString);
return;
}
if (utcTime != null) {
sb.append("utcTime: ").append(utcTime);
return;
}
sb.append("<none>");
}
public static class Array implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private List<Data> seqOf = null;
public Array() {
seqOf = new ArrayList<Data>();
}
public Array(byte[] code) {
this.code = code;
}
public List<Data> getData() {
if (seqOf == null) {
seqOf = new ArrayList<Data>();
}
return seqOf;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
Data element = new Data();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 class Structure implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private List<Data> seqOf = null;
public Structure() {
seqOf = new ArrayList<Data>();
}
public Structure(byte[] code) {
this.code = code;
}
public List<Data> getData() {
if (seqOf == null) {
seqOf = new ArrayList<Data>();
}
return seqOf;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
Data element = new Data();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,27 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerInteger;
import java.math.BigInteger;
public class DataAccessError extends BerInteger {
private static final long serialVersionUID = 1L;
public DataAccessError() {}
public DataAccessError(byte[] code) {
super(code);
}
public DataAccessError(BigInteger value) {
super(value);
}
public DataAccessError(long value) {
super(value);
}
}

@ -1,173 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class DefineNamedVariableListRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private ObjectName variableListName = null;
private VariableDefs listOfVariable = null;
public DefineNamedVariableListRequest() {}
public DefineNamedVariableListRequest(byte[] code) {
this.code = code;
}
public ObjectName getVariableListName() {
return variableListName;
}
public void setVariableListName(ObjectName variableListName) {
this.variableListName = variableListName;
}
public VariableDefs getListOfVariable() {
return listOfVariable;
}
public void setListOfVariable(VariableDefs listOfVariable) {
this.listOfVariable = listOfVariable;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += listOfVariable.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += variableListName.encode(reverseOS);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
variableListName = new ObjectName();
numDecodedBytes = variableListName.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
listOfVariable = new VariableDefs();
vByteCount += listOfVariable.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerNull;
public class DefineNamedVariableListResponse extends BerNull {
private static final long serialVersionUID = 1L;
public DefineNamedVariableListResponse() {}
public DefineNamedVariableListResponse(byte[] code) {
super(code);
}
}

@ -1,456 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerInteger;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class DeleteNamedVariableListRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 BerInteger getScopeOfDelete() {
return scopeOfDelete;
}
public void setScopeOfDelete(BerInteger scopeOfDelete) {
this.scopeOfDelete = scopeOfDelete;
}
public ListOfVariableListName getListOfVariableListName() {
return listOfVariableListName;
}
public void setListOfVariableListName(ListOfVariableListName listOfVariableListName) {
this.listOfVariableListName = listOfVariableListName;
}
public DomainName getDomainName() {
return domainName;
}
public void setDomainName(DomainName domainName) {
this.domainName = domainName;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
if (domainName != null) {
sublength = domainName.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
reverseOS.write(0xA2);
codeLength += 1;
}
if (listOfVariableListName != null) {
codeLength += listOfVariableListName.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
}
if (scopeOfDelete != null) {
codeLength += scopeOfDelete.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
if (lengthVal == 0) {
return tlByteCount;
}
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
scopeOfDelete = new BerInteger();
vByteCount += scopeOfDelete.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
listOfVariableListName = new ListOfVariableListName();
vByteCount += listOfVariableListName.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
vByteCount += length.decode(is);
domainName = new DomainName();
vByteCount += domainName.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class ListOfVariableListName implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
ObjectName element = new ObjectName();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BasicIdentifier basic = null;
public DomainName() {}
public DomainName(byte[] code) {
this.code = code;
}
public BasicIdentifier getBasic() {
return basic;
}
public void setBasic(BasicIdentifier basic) {
this.basic = basic;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (basic != null) {
codeLength += basic.encode(reverseOS, true);
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BasicIdentifier.tag)) {
basic = new BasicIdentifier();
tlvByteCount += basic.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}
}

@ -1,173 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class DeleteNamedVariableListResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Unsigned32 numberMatched = null;
private Unsigned32 numberDeleted = null;
public DeleteNamedVariableListResponse() {}
public DeleteNamedVariableListResponse(byte[] code) {
this.code = code;
}
public Unsigned32 getNumberMatched() {
return numberMatched;
}
public void setNumberMatched(Unsigned32 numberMatched) {
this.numberMatched = numberMatched;
}
public Unsigned32 getNumberDeleted() {
return numberDeleted;
}
public void setNumberDeleted(Unsigned32 numberDeleted) {
this.numberDeleted = numberDeleted;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += numberDeleted.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
codeLength += numberMatched.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
numberMatched = new Unsigned32();
vByteCount += numberMatched.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
numberDeleted = new Unsigned32();
vByteCount += numberDeleted.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,175 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class DirectoryEntry implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private FileName fileName = null;
private FileAttributes fileAttributes = null;
public DirectoryEntry() {}
public DirectoryEntry(byte[] code) {
this.code = code;
}
public FileName getFileName() {
return fileName;
}
public void setFileName(FileName fileName) {
this.fileName = fileName;
}
public FileAttributes getFileAttributes() {
return fileAttributes;
}
public void setFileAttributes(FileAttributes fileAttributes) {
this.fileAttributes = fileAttributes;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += fileAttributes.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
codeLength += fileName.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
fileName = new FileName();
vByteCount += fileName.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
fileAttributes = new FileAttributes();
vByteCount += fileAttributes.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (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("}");
}
}

@ -1,175 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerGeneralizedTime;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class FileAttributes implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Unsigned32 sizeOfFile = null;
private BerGeneralizedTime lastModified = null;
public FileAttributes() {}
public FileAttributes(byte[] code) {
this.code = code;
}
public Unsigned32 getSizeOfFile() {
return sizeOfFile;
}
public void setSizeOfFile(Unsigned32 sizeOfFile) {
this.sizeOfFile = sizeOfFile;
}
public BerGeneralizedTime getLastModified() {
return lastModified;
}
public void setLastModified(BerGeneralizedTime lastModified) {
this.lastModified = lastModified;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
if (lastModified != null) {
codeLength += lastModified.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
codeLength += sizeOfFile.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
sizeOfFile = new Unsigned32();
vByteCount += sizeOfFile.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
lastModified = new BerGeneralizedTime();
vByteCount += lastModified.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (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("}");
}
}

@ -1,26 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import java.math.BigInteger;
public class FileCloseRequest extends Integer32 {
private static final long serialVersionUID = 1L;
public FileCloseRequest() {}
public FileCloseRequest(byte[] code) {
super(code);
}
public FileCloseRequest(BigInteger value) {
super(value);
}
public FileCloseRequest(long value) {
super(value);
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerNull;
public class FileCloseResponse extends BerNull {
private static final long serialVersionUID = 1L;
public FileCloseResponse() {}
public FileCloseResponse(byte[] code) {
super(code);
}
}

@ -1,16 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
public class FileDeleteRequest extends FileName {
private static final long serialVersionUID = 1L;
public FileDeleteRequest() {}
public FileDeleteRequest(byte[] code) {
super(code);
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerNull;
public class FileDeleteResponse extends BerNull {
private static final long serialVersionUID = 1L;
public FileDeleteResponse() {}
public FileDeleteResponse(byte[] code) {
super(code);
}
}

@ -1,182 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class FileDirectoryRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private FileName fileSpecification = null;
private FileName continueAfter = null;
public FileDirectoryRequest() {}
public FileDirectoryRequest(byte[] code) {
this.code = code;
}
public FileName getFileSpecification() {
return fileSpecification;
}
public void setFileSpecification(FileName fileSpecification) {
this.fileSpecification = fileSpecification;
}
public FileName getContinueAfter() {
return continueAfter;
}
public void setContinueAfter(FileName continueAfter) {
this.continueAfter = continueAfter;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
if (continueAfter != null) {
codeLength += continueAfter.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
}
if (fileSpecification != null) {
codeLength += fileSpecification.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
if (lengthVal == 0) {
return tlByteCount;
}
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
fileSpecification = new FileName();
vByteCount += fileSpecification.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
continueAfter = new FileName();
vByteCount += continueAfter.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (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("}");
}
}

@ -1,321 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class FileDirectoryResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private ListOfDirectoryEntry listOfDirectoryEntry = null;
private BerBoolean moreFollows = null;
public FileDirectoryResponse() {}
public FileDirectoryResponse(byte[] code) {
this.code = code;
}
public ListOfDirectoryEntry getListOfDirectoryEntry() {
return listOfDirectoryEntry;
}
public void setListOfDirectoryEntry(ListOfDirectoryEntry listOfDirectoryEntry) {
this.listOfDirectoryEntry = listOfDirectoryEntry;
}
public BerBoolean getMoreFollows() {
return moreFollows;
}
public void setMoreFollows(BerBoolean moreFollows) {
this.moreFollows = moreFollows;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
if (moreFollows != null) {
codeLength += moreFollows.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
sublength = listOfDirectoryEntry.encode(reverseOS, true);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
vByteCount += length.decode(is);
listOfDirectoryEntry = new ListOfDirectoryEntry();
vByteCount += listOfDirectoryEntry.decode(is, true);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
moreFollows = new BerBoolean();
vByteCount += moreFollows.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (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("}");
}
public static class ListOfDirectoryEntry implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS, true);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
if (!berTag.equals(DirectoryEntry.tag)) {
throw new IOException("Tag does not match mandatory sequence of/set of component.");
}
DirectoryEntry element = new DirectoryEntry();
vByteCount += element.decode(is, false);
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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<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("}");
}
}
}

@ -1,154 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.asn1bean.ber.types.string.BerGraphicString;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class FileName implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS, true);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
if (!berTag.equals(BerGraphicString.tag)) {
throw new IOException("Tag does not match mandatory sequence of/set of component.");
}
BerGraphicString element = new BerGraphicString();
vByteCount += element.decode(is, false);
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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<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,174 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class FileOpenRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private FileName fileName = null;
private Unsigned32 initialPosition = null;
public FileOpenRequest() {}
public FileOpenRequest(byte[] code) {
this.code = code;
}
public FileName getFileName() {
return fileName;
}
public void setFileName(FileName fileName) {
this.fileName = fileName;
}
public Unsigned32 getInitialPosition() {
return initialPosition;
}
public void setInitialPosition(Unsigned32 initialPosition) {
this.initialPosition = initialPosition;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += initialPosition.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
codeLength += fileName.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
fileName = new FileName();
vByteCount += fileName.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
initialPosition = new Unsigned32();
vByteCount += initialPosition.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (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 (initialPosition != null) {
sb.append("initialPosition: ").append(initialPosition);
} else {
sb.append("initialPosition: <empty-required-field>");
}
sb.append("\n");
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
sb.append("}");
}
}

@ -1,174 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class FileOpenResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Integer32 frsmID = null;
private FileAttributes fileAttributes = null;
public FileOpenResponse() {}
public FileOpenResponse(byte[] code) {
this.code = code;
}
public Integer32 getFrsmID() {
return frsmID;
}
public void setFrsmID(Integer32 frsmID) {
this.frsmID = frsmID;
}
public FileAttributes getFileAttributes() {
return fileAttributes;
}
public void setFileAttributes(FileAttributes fileAttributes) {
this.fileAttributes = fileAttributes;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += fileAttributes.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
codeLength += frsmID.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
frsmID = new Integer32();
vByteCount += frsmID.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
fileAttributes = new FileAttributes();
vByteCount += fileAttributes.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (frsmID != null) {
sb.append("frsmID: ").append(frsmID);
} else {
sb.append("frsmID: <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("}");
}
}

@ -1,26 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import java.math.BigInteger;
public class FileReadRequest extends Integer32 {
private static final long serialVersionUID = 1L;
public FileReadRequest() {}
public FileReadRequest(byte[] code) {
super(code);
}
public FileReadRequest(BigInteger value) {
super(value);
}
public FileReadRequest(long value) {
super(value);
}
}

@ -1,176 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerOctetString;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class FileReadResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerOctetString fileData = null;
private BerBoolean moreFollows = null;
public FileReadResponse() {}
public FileReadResponse(byte[] code) {
this.code = code;
}
public BerOctetString getFileData() {
return fileData;
}
public void setFileData(BerOctetString fileData) {
this.fileData = fileData;
}
public BerBoolean getMoreFollows() {
return moreFollows;
}
public void setMoreFollows(BerBoolean moreFollows) {
this.moreFollows = moreFollows;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
if (moreFollows != null) {
codeLength += moreFollows.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
codeLength += fileData.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
fileData = new BerOctetString();
vByteCount += fileData.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
moreFollows = new BerBoolean();
vByteCount += moreFollows.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (fileData != null) {
sb.append("fileData: ").append(fileData);
} else {
sb.append("fileData: <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 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerOctetString;
public class FloatingPoint extends BerOctetString {
private static final long serialVersionUID = 1L;
public FloatingPoint() {}
public FloatingPoint(byte[] value) {
super(value);
}
}

@ -1,368 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerNull;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class GetNameListRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 ObjectClass getObjectClass() {
return objectClass;
}
public void setObjectClass(ObjectClass objectClass) {
this.objectClass = objectClass;
}
public ObjectScope getObjectScope() {
return objectScope;
}
public void setObjectScope(ObjectScope objectScope) {
this.objectScope = objectScope;
}
public Identifier getContinueAfter() {
return continueAfter;
}
public void setContinueAfter(Identifier continueAfter) {
this.continueAfter = continueAfter;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
if (continueAfter != null) {
codeLength += continueAfter.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
}
sublength = objectScope.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
sublength = objectClass.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
vByteCount += length.decode(is);
objectClass = new ObjectClass();
vByteCount += objectClass.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
vByteCount += length.decode(is);
objectScope = new ObjectScope();
vByteCount += objectScope.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
continueAfter = new Identifier();
vByteCount += continueAfter.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class ObjectScope implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private 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 BerNull getVmdSpecific() {
return vmdSpecific;
}
public void setVmdSpecific(BerNull vmdSpecific) {
this.vmdSpecific = vmdSpecific;
}
public Identifier getDomainSpecific() {
return domainSpecific;
}
public void setDomainSpecific(Identifier domainSpecific) {
this.domainSpecific = domainSpecific;
}
public BerNull getAaSpecific() {
return aaSpecific;
}
public void setAaSpecific(BerNull aaSpecific) {
this.aaSpecific = aaSpecific;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (aaSpecific != null) {
codeLength += aaSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
return codeLength;
}
if (domainSpecific != null) {
codeLength += domainSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
return codeLength;
}
if (vmdSpecific != null) {
codeLength += vmdSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
vmdSpecific = new BerNull();
tlvByteCount += vmdSpecific.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
domainSpecific = new Identifier();
tlvByteCount += domainSpecific.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
aaSpecific = new BerNull();
tlvByteCount += aaSpecific.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}
}

@ -1,315 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GetNameListResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private ListOfIdentifier listOfIdentifier = null;
private BerBoolean moreFollows = null;
public GetNameListResponse() {}
public GetNameListResponse(byte[] code) {
this.code = code;
}
public ListOfIdentifier getListOfIdentifier() {
return listOfIdentifier;
}
public void setListOfIdentifier(ListOfIdentifier listOfIdentifier) {
this.listOfIdentifier = listOfIdentifier;
}
public BerBoolean getMoreFollows() {
return moreFollows;
}
public void setMoreFollows(BerBoolean moreFollows) {
this.moreFollows = moreFollows;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
if (moreFollows != null) {
codeLength += moreFollows.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
codeLength += listOfIdentifier.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
listOfIdentifier = new ListOfIdentifier();
vByteCount += listOfIdentifier.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
moreFollows = new BerBoolean();
vByteCount += moreFollows.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class ListOfIdentifier implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS, true);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
if (!berTag.equals(Identifier.tag)) {
throw new IOException("Tag does not match mandatory sequence of/set of component.");
}
Identifier element = new Identifier();
vByteCount += element.decode(is, false);
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,16 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
public class GetNamedVariableListAttributesRequest extends ObjectName {
private static final long serialVersionUID = 1L;
public GetNamedVariableListAttributesRequest() {}
public GetNamedVariableListAttributesRequest(byte[] code) {
super(code);
}
}

@ -1,175 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class GetNamedVariableListAttributesResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerBoolean mmsDeletable = null;
private VariableDefs listOfVariable = null;
public GetNamedVariableListAttributesResponse() {}
public GetNamedVariableListAttributesResponse(byte[] code) {
this.code = code;
}
public BerBoolean getMmsDeletable() {
return mmsDeletable;
}
public void setMmsDeletable(BerBoolean mmsDeletable) {
this.mmsDeletable = mmsDeletable;
}
public VariableDefs getListOfVariable() {
return listOfVariable;
}
public void setListOfVariable(VariableDefs listOfVariable) {
this.listOfVariable = listOfVariable;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += listOfVariable.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
codeLength += mmsDeletable.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
mmsDeletable = new BerBoolean();
vByteCount += mmsDeletable.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
listOfVariable = new VariableDefs();
vByteCount += listOfVariable.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,115 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class GetVariableAccessAttributesRequest implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private ObjectName name = null;
public GetVariableAccessAttributesRequest() {}
public GetVariableAccessAttributesRequest(byte[] code) {
this.code = code;
}
public ObjectName getName() {
return name;
}
public void setName(ObjectName name) {
this.name = name;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
int sublength;
if (name != null) {
sublength = name.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
BerLength length = new BerLength();
tlvByteCount += length.decode(is);
name = new ObjectName();
tlvByteCount += name.decode(is, null);
tlvByteCount += length.readEocIfIndefinite(is);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

@ -1,181 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class GetVariableAccessAttributesResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerBoolean mmsDeletable = null;
private TypeDescription typeDescription = null;
public GetVariableAccessAttributesResponse() {}
public GetVariableAccessAttributesResponse(byte[] code) {
this.code = code;
}
public BerBoolean getMmsDeletable() {
return mmsDeletable;
}
public void setMmsDeletable(BerBoolean mmsDeletable) {
this.mmsDeletable = mmsDeletable;
}
public TypeDescription getTypeDescription() {
return typeDescription;
}
public void setTypeDescription(TypeDescription typeDescription) {
this.typeDescription = typeDescription;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
sublength = typeDescription.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
reverseOS.write(0xA2);
codeLength += 1;
codeLength += mmsDeletable.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
mmsDeletable = new BerBoolean();
vByteCount += mmsDeletable.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
vByteCount += length.decode(is);
typeDescription = new TypeDescription();
vByteCount += typeDescription.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
public class Identifier extends BerVisibleString {
private static final long serialVersionUID = 1L;
public Identifier() {}
public Identifier(byte[] value) {
super(value);
}
}

@ -1,315 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class InformationReport implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private VariableAccessSpecification variableAccessSpecification = null;
private ListOfAccessResult listOfAccessResult = null;
public InformationReport() {}
public InformationReport(byte[] code) {
this.code = code;
}
public VariableAccessSpecification getVariableAccessSpecification() {
return variableAccessSpecification;
}
public void setVariableAccessSpecification(
VariableAccessSpecification variableAccessSpecification) {
this.variableAccessSpecification = variableAccessSpecification;
}
public ListOfAccessResult getListOfAccessResult() {
return listOfAccessResult;
}
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
this.listOfAccessResult = listOfAccessResult;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += listOfAccessResult.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += variableAccessSpecification.encode(reverseOS);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
variableAccessSpecification = new VariableAccessSpecification();
numDecodedBytes = variableAccessSpecification.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
listOfAccessResult = new ListOfAccessResult();
vByteCount += listOfAccessResult.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class ListOfAccessResult implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
AccessResult element = new AccessResult();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,16 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
public class InitiateErrorPDU extends ServiceError {
private static final long serialVersionUID = 1L;
public InitiateErrorPDU() {}
public InitiateErrorPDU(byte[] code) {
super(code);
}
}

@ -1,464 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class InitiateRequestPDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 Integer32 getLocalDetailCalling() {
return localDetailCalling;
}
public void setLocalDetailCalling(Integer32 localDetailCalling) {
this.localDetailCalling = localDetailCalling;
}
public Integer16 getProposedMaxServOutstandingCalling() {
return proposedMaxServOutstandingCalling;
}
public void setProposedMaxServOutstandingCalling(Integer16 proposedMaxServOutstandingCalling) {
this.proposedMaxServOutstandingCalling = proposedMaxServOutstandingCalling;
}
public Integer16 getProposedMaxServOutstandingCalled() {
return proposedMaxServOutstandingCalled;
}
public void setProposedMaxServOutstandingCalled(Integer16 proposedMaxServOutstandingCalled) {
this.proposedMaxServOutstandingCalled = proposedMaxServOutstandingCalled;
}
public Integer8 getProposedDataStructureNestingLevel() {
return proposedDataStructureNestingLevel;
}
public void setProposedDataStructureNestingLevel(Integer8 proposedDataStructureNestingLevel) {
this.proposedDataStructureNestingLevel = proposedDataStructureNestingLevel;
}
public InitRequestDetail getInitRequestDetail() {
return initRequestDetail;
}
public void setInitRequestDetail(InitRequestDetail initRequestDetail) {
this.initRequestDetail = initRequestDetail;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += initRequestDetail.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
reverseOS.write(0xA4);
codeLength += 1;
if (proposedDataStructureNestingLevel != null) {
codeLength += proposedDataStructureNestingLevel.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
reverseOS.write(0x83);
codeLength += 1;
}
codeLength += proposedMaxServOutstandingCalled.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
codeLength += proposedMaxServOutstandingCalling.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
if (localDetailCalling != null) {
codeLength += localDetailCalling.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
localDetailCalling = new Integer32();
vByteCount += localDetailCalling.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
proposedMaxServOutstandingCalling = new Integer16();
vByteCount += proposedMaxServOutstandingCalling.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
proposedMaxServOutstandingCalled = new Integer16();
vByteCount += proposedMaxServOutstandingCalled.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
proposedDataStructureNestingLevel = new Integer8();
vByteCount += proposedDataStructureNestingLevel.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
initRequestDetail = new InitRequestDetail();
vByteCount += initRequestDetail.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class InitRequestDetail implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 Integer16 getProposedVersionNumber() {
return proposedVersionNumber;
}
public void setProposedVersionNumber(Integer16 proposedVersionNumber) {
this.proposedVersionNumber = proposedVersionNumber;
}
public ParameterSupportOptions getProposedParameterCBB() {
return proposedParameterCBB;
}
public void setProposedParameterCBB(ParameterSupportOptions proposedParameterCBB) {
this.proposedParameterCBB = proposedParameterCBB;
}
public ServiceSupportOptions getServicesSupportedCalling() {
return servicesSupportedCalling;
}
public void setServicesSupportedCalling(ServiceSupportOptions servicesSupportedCalling) {
this.servicesSupportedCalling = servicesSupportedCalling;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += servicesSupportedCalling.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
codeLength += proposedParameterCBB.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
codeLength += proposedVersionNumber.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
proposedVersionNumber = new Integer16();
vByteCount += proposedVersionNumber.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
proposedParameterCBB = new ParameterSupportOptions();
vByteCount += proposedParameterCBB.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
servicesSupportedCalling = new ServiceSupportOptions();
vByteCount += servicesSupportedCalling.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: "
+ lengthVal
+ ", bytes decoded: "
+ vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,467 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class InitiateResponsePDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 Integer32 getLocalDetailCalled() {
return localDetailCalled;
}
public void setLocalDetailCalled(Integer32 localDetailCalled) {
this.localDetailCalled = localDetailCalled;
}
public Integer16 getNegotiatedMaxServOutstandingCalling() {
return negotiatedMaxServOutstandingCalling;
}
public void setNegotiatedMaxServOutstandingCalling(
Integer16 negotiatedMaxServOutstandingCalling) {
this.negotiatedMaxServOutstandingCalling = negotiatedMaxServOutstandingCalling;
}
public Integer16 getNegotiatedMaxServOutstandingCalled() {
return negotiatedMaxServOutstandingCalled;
}
public void setNegotiatedMaxServOutstandingCalled(Integer16 negotiatedMaxServOutstandingCalled) {
this.negotiatedMaxServOutstandingCalled = negotiatedMaxServOutstandingCalled;
}
public Integer8 getNegotiatedDataStructureNestingLevel() {
return negotiatedDataStructureNestingLevel;
}
public void setNegotiatedDataStructureNestingLevel(Integer8 negotiatedDataStructureNestingLevel) {
this.negotiatedDataStructureNestingLevel = negotiatedDataStructureNestingLevel;
}
public InitResponseDetail getInitResponseDetail() {
return initResponseDetail;
}
public void setInitResponseDetail(InitResponseDetail initResponseDetail) {
this.initResponseDetail = initResponseDetail;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += initResponseDetail.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
reverseOS.write(0xA4);
codeLength += 1;
if (negotiatedDataStructureNestingLevel != null) {
codeLength += negotiatedDataStructureNestingLevel.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
reverseOS.write(0x83);
codeLength += 1;
}
codeLength += negotiatedMaxServOutstandingCalled.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
codeLength += negotiatedMaxServOutstandingCalling.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
if (localDetailCalled != null) {
codeLength += localDetailCalled.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
localDetailCalled = new Integer32();
vByteCount += localDetailCalled.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
negotiatedMaxServOutstandingCalling = new Integer16();
vByteCount += negotiatedMaxServOutstandingCalling.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
negotiatedMaxServOutstandingCalled = new Integer16();
vByteCount += negotiatedMaxServOutstandingCalled.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
negotiatedDataStructureNestingLevel = new Integer8();
vByteCount += negotiatedDataStructureNestingLevel.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
initResponseDetail = new InitResponseDetail();
vByteCount += initResponseDetail.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class InitResponseDetail implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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 Integer16 getNegotiatedVersionNumber() {
return negotiatedVersionNumber;
}
public void setNegotiatedVersionNumber(Integer16 negotiatedVersionNumber) {
this.negotiatedVersionNumber = negotiatedVersionNumber;
}
public ParameterSupportOptions getNegotiatedParameterCBB() {
return negotiatedParameterCBB;
}
public void setNegotiatedParameterCBB(ParameterSupportOptions negotiatedParameterCBB) {
this.negotiatedParameterCBB = negotiatedParameterCBB;
}
public ServiceSupportOptions getServicesSupportedCalled() {
return servicesSupportedCalled;
}
public void setServicesSupportedCalled(ServiceSupportOptions servicesSupportedCalled) {
this.servicesSupportedCalled = servicesSupportedCalled;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += servicesSupportedCalled.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
codeLength += negotiatedParameterCBB.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
codeLength += negotiatedVersionNumber.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
negotiatedVersionNumber = new Integer16();
vByteCount += negotiatedVersionNumber.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
negotiatedParameterCBB = new ParameterSupportOptions();
vByteCount += negotiatedParameterCBB.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
servicesSupportedCalled = new ServiceSupportOptions();
vByteCount += servicesSupportedCalled.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: "
+ lengthVal
+ ", bytes decoded: "
+ vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,27 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerInteger;
import java.math.BigInteger;
public class Integer16 extends BerInteger {
private static final long serialVersionUID = 1L;
public Integer16() {}
public Integer16(byte[] code) {
super(code);
}
public Integer16(BigInteger value) {
super(value);
}
public Integer16(long value) {
super(value);
}
}

@ -1,27 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerInteger;
import java.math.BigInteger;
public class Integer32 extends BerInteger {
private static final long serialVersionUID = 1L;
public Integer32() {}
public Integer32(byte[] code) {
super(code);
}
public Integer32(BigInteger value) {
super(value);
}
public Integer32(long value) {
super(value);
}
}

@ -1,27 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerInteger;
import java.math.BigInteger;
public class Integer8 extends BerInteger {
private static final long serialVersionUID = 1L;
public Integer8() {}
public Integer8(byte[] code) {
super(code);
}
public Integer8(BigInteger value) {
super(value);
}
public Integer8(long value) {
super(value);
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
public class MMSString extends BerVisibleString {
private static final long serialVersionUID = 1L;
public MMSString() {}
public MMSString(byte[] value) {
super(value);
}
}

@ -1,338 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class MMSpdu implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private 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 ConfirmedRequestPDU getConfirmedRequestPDU() {
return confirmedRequestPDU;
}
public void setConfirmedRequestPDU(ConfirmedRequestPDU confirmedRequestPDU) {
this.confirmedRequestPDU = confirmedRequestPDU;
}
public ConfirmedResponsePDU getConfirmedResponsePDU() {
return confirmedResponsePDU;
}
public void setConfirmedResponsePDU(ConfirmedResponsePDU confirmedResponsePDU) {
this.confirmedResponsePDU = confirmedResponsePDU;
}
public ConfirmedErrorPDU getConfirmedErrorPDU() {
return confirmedErrorPDU;
}
public void setConfirmedErrorPDU(ConfirmedErrorPDU confirmedErrorPDU) {
this.confirmedErrorPDU = confirmedErrorPDU;
}
public UnconfirmedPDU getUnconfirmedPDU() {
return unconfirmedPDU;
}
public void setUnconfirmedPDU(UnconfirmedPDU unconfirmedPDU) {
this.unconfirmedPDU = unconfirmedPDU;
}
public RejectPDU getRejectPDU() {
return rejectPDU;
}
public void setRejectPDU(RejectPDU rejectPDU) {
this.rejectPDU = rejectPDU;
}
public InitiateRequestPDU getInitiateRequestPDU() {
return initiateRequestPDU;
}
public void setInitiateRequestPDU(InitiateRequestPDU initiateRequestPDU) {
this.initiateRequestPDU = initiateRequestPDU;
}
public InitiateResponsePDU getInitiateResponsePDU() {
return initiateResponsePDU;
}
public void setInitiateResponsePDU(InitiateResponsePDU initiateResponsePDU) {
this.initiateResponsePDU = initiateResponsePDU;
}
public InitiateErrorPDU getInitiateErrorPDU() {
return initiateErrorPDU;
}
public void setInitiateErrorPDU(InitiateErrorPDU initiateErrorPDU) {
this.initiateErrorPDU = initiateErrorPDU;
}
public ConcludeRequestPDU getConcludeRequestPDU() {
return concludeRequestPDU;
}
public void setConcludeRequestPDU(ConcludeRequestPDU concludeRequestPDU) {
this.concludeRequestPDU = concludeRequestPDU;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (concludeRequestPDU != null) {
codeLength += concludeRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
reverseOS.write(0x8B);
codeLength += 1;
return codeLength;
}
if (initiateErrorPDU != null) {
codeLength += initiateErrorPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 10
reverseOS.write(0xAA);
codeLength += 1;
return codeLength;
}
if (initiateResponsePDU != null) {
codeLength += initiateResponsePDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 9
reverseOS.write(0xA9);
codeLength += 1;
return codeLength;
}
if (initiateRequestPDU != null) {
codeLength += initiateRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 8
reverseOS.write(0xA8);
codeLength += 1;
return codeLength;
}
if (rejectPDU != null) {
codeLength += rejectPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
reverseOS.write(0xA4);
codeLength += 1;
return codeLength;
}
if (unconfirmedPDU != null) {
codeLength += unconfirmedPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
reverseOS.write(0xA3);
codeLength += 1;
return codeLength;
}
if (confirmedErrorPDU != null) {
codeLength += confirmedErrorPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
reverseOS.write(0xA2);
codeLength += 1;
return codeLength;
}
if (confirmedResponsePDU != null) {
codeLength += confirmedResponsePDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
return codeLength;
}
if (confirmedRequestPDU != null) {
codeLength += confirmedRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
confirmedRequestPDU = new ConfirmedRequestPDU();
tlvByteCount += confirmedRequestPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
confirmedResponsePDU = new ConfirmedResponsePDU();
tlvByteCount += confirmedResponsePDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
confirmedErrorPDU = new ConfirmedErrorPDU();
tlvByteCount += confirmedErrorPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
unconfirmedPDU = new UnconfirmedPDU();
tlvByteCount += unconfirmedPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
rejectPDU = new RejectPDU();
tlvByteCount += rejectPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 8)) {
initiateRequestPDU = new InitiateRequestPDU();
tlvByteCount += initiateRequestPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 9)) {
initiateResponsePDU = new InitiateResponsePDU();
tlvByteCount += initiateResponsePDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 10)) {
initiateErrorPDU = new InitiateErrorPDU();
tlvByteCount += initiateErrorPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
concludeRequestPDU = new ConcludeRequestPDU();
tlvByteCount += concludeRequestPDU.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

@ -1,107 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerInteger;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ObjectClass implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerInteger basicObjectClass = null;
public ObjectClass() {}
public ObjectClass(byte[] code) {
this.code = code;
}
public BerInteger getBasicObjectClass() {
return basicObjectClass;
}
public void setBasicObjectClass(BerInteger basicObjectClass) {
this.basicObjectClass = basicObjectClass;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (basicObjectClass != null) {
codeLength += basicObjectClass.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
basicObjectClass = new BerInteger();
tlvByteCount += basicObjectClass.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

@ -1,320 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ObjectName implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Identifier vmdSpecific = null;
private DomainSpecific domainSpecific = null;
private Identifier aaSpecific = null;
public ObjectName() {}
public ObjectName(byte[] code) {
this.code = code;
}
public Identifier getVmdSpecific() {
return vmdSpecific;
}
public void setVmdSpecific(Identifier vmdSpecific) {
this.vmdSpecific = vmdSpecific;
}
public DomainSpecific getDomainSpecific() {
return domainSpecific;
}
public void setDomainSpecific(DomainSpecific domainSpecific) {
this.domainSpecific = domainSpecific;
}
public Identifier getAaSpecific() {
return aaSpecific;
}
public void setAaSpecific(Identifier aaSpecific) {
this.aaSpecific = aaSpecific;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (aaSpecific != null) {
codeLength += aaSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
return codeLength;
}
if (domainSpecific != null) {
codeLength += domainSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
return codeLength;
}
if (vmdSpecific != null) {
codeLength += vmdSpecific.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
vmdSpecific = new Identifier();
tlvByteCount += vmdSpecific.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
domainSpecific = new DomainSpecific();
tlvByteCount += domainSpecific.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
aaSpecific = new Identifier();
tlvByteCount += aaSpecific.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
public static class DomainSpecific implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Identifier domainID = null;
private Identifier itemID = null;
public DomainSpecific() {}
public DomainSpecific(byte[] code) {
this.code = code;
}
public Identifier getDomainID() {
return domainID;
}
public void setDomainID(Identifier domainID) {
this.domainID = domainID;
}
public Identifier getItemID() {
return itemID;
}
public void setItemID(Identifier itemID) {
this.itemID = itemID;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += itemID.encode(reverseOS, true);
codeLength += domainID.encode(reverseOS, true);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(Identifier.tag)) {
domainID = new Identifier();
vByteCount += domainID.decode(is, false);
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(Identifier.tag)) {
itemID = new Identifier();
vByteCount += itemID.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: "
+ lengthVal
+ ", bytes decoded: "
+ vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,26 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerBitString;
public class ParameterSupportOptions extends BerBitString {
private static final long serialVersionUID = 1L;
public ParameterSupportOptions() {}
public ParameterSupportOptions(byte[] code) {
super(code);
}
public ParameterSupportOptions(byte[] value, int numBits) {
super(value, numBits);
}
public ParameterSupportOptions(boolean[] value) {
super(value);
}
}

@ -1,184 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.iec61850bean.internal.BerBoolean;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ReadRequest implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerBoolean specificationWithResult = null;
private VariableAccessSpecification variableAccessSpecification = null;
public ReadRequest() {}
public ReadRequest(byte[] code) {
this.code = code;
}
public BerBoolean getSpecificationWithResult() {
return specificationWithResult;
}
public void setSpecificationWithResult(BerBoolean specificationWithResult) {
this.specificationWithResult = specificationWithResult;
}
public VariableAccessSpecification getVariableAccessSpecification() {
return variableAccessSpecification;
}
public void setVariableAccessSpecification(
VariableAccessSpecification variableAccessSpecification) {
this.variableAccessSpecification = variableAccessSpecification;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
sublength = variableAccessSpecification.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
if (specificationWithResult != null) {
codeLength += specificationWithResult.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
specificationWithResult = new BerBoolean();
vByteCount += specificationWithResult.decode(is, false);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
vByteCount += length.decode(is);
variableAccessSpecification = new VariableAccessSpecification();
vByteCount += variableAccessSpecification.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,325 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ReadResponse implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private VariableAccessSpecification variableAccessSpecification = null;
private ListOfAccessResult listOfAccessResult = null;
public ReadResponse() {}
public ReadResponse(byte[] code) {
this.code = code;
}
public VariableAccessSpecification getVariableAccessSpecification() {
return variableAccessSpecification;
}
public void setVariableAccessSpecification(
VariableAccessSpecification variableAccessSpecification) {
this.variableAccessSpecification = variableAccessSpecification;
}
public ListOfAccessResult getListOfAccessResult() {
return listOfAccessResult;
}
public void setListOfAccessResult(ListOfAccessResult listOfAccessResult) {
this.listOfAccessResult = listOfAccessResult;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
codeLength += listOfAccessResult.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
reverseOS.write(0xA1);
codeLength += 1;
if (variableAccessSpecification != null) {
sublength = variableAccessSpecification.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
vByteCount += length.decode(is);
variableAccessSpecification = new VariableAccessSpecification();
vByteCount += variableAccessSpecification.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
listOfAccessResult = new ListOfAccessResult();
vByteCount += listOfAccessResult.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
public static class ListOfAccessResult implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private 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;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(reverseOS);
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
while (vByteCount < lengthVal || lengthVal < 0) {
vByteCount += berTag.decode(is);
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
vByteCount += BerLength.readEocByte(is);
break;
}
AccessResult element = new AccessResult();
numDecodedBytes = element.decode(is, berTag);
if (numDecodedBytes == 0) {
throw new IOException("Tag did not match");
}
vByteCount += numDecodedBytes;
seqOf.add(element);
}
if (lengthVal >= 0 && vByteCount != lengthVal) {
throw new IOException(
"Decoded SequenceOf or SetOf has wrong length. Expected "
+ lengthVal
+ " but has "
+ vByteCount);
}
return tlByteCount + vByteCount;
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}
}

@ -1,548 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerInteger;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class RejectPDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private Unsigned32 originalInvokeID = null;
private RejectReason rejectReason = null;
public RejectPDU() {}
public RejectPDU(byte[] code) {
this.code = code;
}
public Unsigned32 getOriginalInvokeID() {
return originalInvokeID;
}
public void setOriginalInvokeID(Unsigned32 originalInvokeID) {
this.originalInvokeID = originalInvokeID;
}
public RejectReason getRejectReason() {
return rejectReason;
}
public void setRejectReason(RejectReason rejectReason) {
this.rejectReason = rejectReason;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += rejectReason.encode(reverseOS);
if (originalInvokeID != null) {
codeLength += originalInvokeID.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
}
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
originalInvokeID = new Unsigned32();
vByteCount += originalInvokeID.decode(is, false);
vByteCount += berTag.decode(is);
}
rejectReason = new RejectReason();
numDecodedBytes = rejectReason.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (originalInvokeID != null) {
sb.append("\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
sb.append("originalInvokeID: ").append(originalInvokeID);
firstSelectedElement = false;
}
if (!firstSelectedElement) {
sb.append(",\n");
}
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
if (rejectReason != null) {
sb.append("rejectReason: ");
rejectReason.appendAsString(sb, indentLevel + 1);
} else {
sb.append("rejectReason: <empty-required-field>");
}
sb.append("\n");
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
sb.append("}");
}
public static class RejectReason implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerInteger confirmedRequestPDU = null;
private BerInteger confirmedResponsePDU = null;
private BerInteger confirmedErrorPDU = null;
private BerInteger unconfirmedPDU = null;
private BerInteger pduError = null;
private BerInteger cancelRequestPDU = null;
private BerInteger cancelResponsePDU = null;
private BerInteger cancelErrorPDU = null;
private BerInteger concludeRequestPDU = null;
private BerInteger concludeResponsePDU = null;
private BerInteger concludeErrorPDU = null;
public RejectReason() {}
public RejectReason(byte[] code) {
this.code = code;
}
public BerInteger getConfirmedRequestPDU() {
return confirmedRequestPDU;
}
public void setConfirmedRequestPDU(BerInteger confirmedRequestPDU) {
this.confirmedRequestPDU = confirmedRequestPDU;
}
public BerInteger getConfirmedResponsePDU() {
return confirmedResponsePDU;
}
public void setConfirmedResponsePDU(BerInteger confirmedResponsePDU) {
this.confirmedResponsePDU = confirmedResponsePDU;
}
public BerInteger getConfirmedErrorPDU() {
return confirmedErrorPDU;
}
public void setConfirmedErrorPDU(BerInteger confirmedErrorPDU) {
this.confirmedErrorPDU = confirmedErrorPDU;
}
public BerInteger getUnconfirmedPDU() {
return unconfirmedPDU;
}
public void setUnconfirmedPDU(BerInteger unconfirmedPDU) {
this.unconfirmedPDU = unconfirmedPDU;
}
public BerInteger getPduError() {
return pduError;
}
public void setPduError(BerInteger pduError) {
this.pduError = pduError;
}
public BerInteger getCancelRequestPDU() {
return cancelRequestPDU;
}
public void setCancelRequestPDU(BerInteger cancelRequestPDU) {
this.cancelRequestPDU = cancelRequestPDU;
}
public BerInteger getCancelResponsePDU() {
return cancelResponsePDU;
}
public void setCancelResponsePDU(BerInteger cancelResponsePDU) {
this.cancelResponsePDU = cancelResponsePDU;
}
public BerInteger getCancelErrorPDU() {
return cancelErrorPDU;
}
public void setCancelErrorPDU(BerInteger cancelErrorPDU) {
this.cancelErrorPDU = cancelErrorPDU;
}
public BerInteger getConcludeRequestPDU() {
return concludeRequestPDU;
}
public void setConcludeRequestPDU(BerInteger concludeRequestPDU) {
this.concludeRequestPDU = concludeRequestPDU;
}
public BerInteger getConcludeResponsePDU() {
return concludeResponsePDU;
}
public void setConcludeResponsePDU(BerInteger concludeResponsePDU) {
this.concludeResponsePDU = concludeResponsePDU;
}
public BerInteger getConcludeErrorPDU() {
return concludeErrorPDU;
}
public void setConcludeErrorPDU(BerInteger concludeErrorPDU) {
this.concludeErrorPDU = concludeErrorPDU;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (concludeErrorPDU != null) {
codeLength += concludeErrorPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
reverseOS.write(0x8B);
codeLength += 1;
return codeLength;
}
if (concludeResponsePDU != null) {
codeLength += concludeResponsePDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 10
reverseOS.write(0x8A);
codeLength += 1;
return codeLength;
}
if (concludeRequestPDU != null) {
codeLength += concludeRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 9
reverseOS.write(0x89);
codeLength += 1;
return codeLength;
}
if (cancelErrorPDU != null) {
codeLength += cancelErrorPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 8
reverseOS.write(0x88);
codeLength += 1;
return codeLength;
}
if (cancelResponsePDU != null) {
codeLength += cancelResponsePDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 7
reverseOS.write(0x87);
codeLength += 1;
return codeLength;
}
if (cancelRequestPDU != null) {
codeLength += cancelRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 6
reverseOS.write(0x86);
codeLength += 1;
return codeLength;
}
if (pduError != null) {
codeLength += pduError.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 5
reverseOS.write(0x85);
codeLength += 1;
return codeLength;
}
if (unconfirmedPDU != null) {
codeLength += unconfirmedPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 4
reverseOS.write(0x84);
codeLength += 1;
return codeLength;
}
if (confirmedErrorPDU != null) {
codeLength += confirmedErrorPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
reverseOS.write(0x83);
codeLength += 1;
return codeLength;
}
if (confirmedResponsePDU != null) {
codeLength += confirmedResponsePDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
return codeLength;
}
if (confirmedRequestPDU != null) {
codeLength += confirmedRequestPDU.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
confirmedRequestPDU = new BerInteger();
tlvByteCount += confirmedRequestPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
confirmedResponsePDU = new BerInteger();
tlvByteCount += confirmedResponsePDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
confirmedErrorPDU = new BerInteger();
tlvByteCount += confirmedErrorPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
unconfirmedPDU = new BerInteger();
tlvByteCount += unconfirmedPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
pduError = new BerInteger();
tlvByteCount += pduError.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) {
cancelRequestPDU = new BerInteger();
tlvByteCount += cancelRequestPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) {
cancelResponsePDU = new BerInteger();
tlvByteCount += cancelResponsePDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) {
cancelErrorPDU = new BerInteger();
tlvByteCount += cancelErrorPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) {
concludeRequestPDU = new BerInteger();
tlvByteCount += concludeRequestPDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) {
concludeResponsePDU = new BerInteger();
tlvByteCount += concludeResponsePDU.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
concludeErrorPDU = new BerInteger();
tlvByteCount += concludeErrorPDU.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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: ").append(confirmedRequestPDU);
return;
}
if (confirmedResponsePDU != null) {
sb.append("confirmedResponsePDU: ").append(confirmedResponsePDU);
return;
}
if (confirmedErrorPDU != null) {
sb.append("confirmedErrorPDU: ").append(confirmedErrorPDU);
return;
}
if (unconfirmedPDU != null) {
sb.append("unconfirmedPDU: ").append(unconfirmedPDU);
return;
}
if (pduError != null) {
sb.append("pduError: ").append(pduError);
return;
}
if (cancelRequestPDU != null) {
sb.append("cancelRequestPDU: ").append(cancelRequestPDU);
return;
}
if (cancelResponsePDU != null) {
sb.append("cancelResponsePDU: ").append(cancelResponsePDU);
return;
}
if (cancelErrorPDU != null) {
sb.append("cancelErrorPDU: ").append(cancelErrorPDU);
return;
}
if (concludeRequestPDU != null) {
sb.append("concludeRequestPDU: ").append(concludeRequestPDU);
return;
}
if (concludeResponsePDU != null) {
sb.append("concludeResponsePDU: ").append(concludeResponsePDU);
return;
}
if (concludeErrorPDU != null) {
sb.append("concludeErrorPDU: ").append(concludeErrorPDU);
return;
}
sb.append("<none>");
}
}
}

@ -1,645 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerInteger;
import com.beanit.asn1bean.ber.types.BerType;
import com.beanit.asn1bean.ber.types.string.BerVisibleString;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class ServiceError implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private ErrorClass errorClass = null;
private BerInteger additionalCode = null;
private BerVisibleString additionalDescription = null;
public ServiceError() {}
public ServiceError(byte[] code) {
this.code = code;
}
public ErrorClass getErrorClass() {
return errorClass;
}
public void setErrorClass(ErrorClass errorClass) {
this.errorClass = errorClass;
}
public BerInteger getAdditionalCode() {
return additionalCode;
}
public void setAdditionalCode(BerInteger additionalCode) {
this.additionalCode = additionalCode;
}
public BerVisibleString getAdditionalDescription() {
return additionalDescription;
}
public void setAdditionalDescription(BerVisibleString additionalDescription) {
this.additionalDescription = additionalDescription;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
int sublength;
if (additionalDescription != null) {
codeLength += additionalDescription.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
}
if (additionalCode != null) {
codeLength += additionalCode.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
}
sublength = errorClass.encode(reverseOS);
codeLength += sublength;
codeLength += BerLength.encodeLength(reverseOS, sublength);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
vByteCount += length.decode(is);
errorClass = new ErrorClass();
vByteCount += errorClass.decode(is, null);
vByteCount += length.readEocIfIndefinite(is);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
additionalCode = new BerInteger();
vByteCount += additionalCode.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
additionalDescription = new BerVisibleString();
vByteCount += additionalDescription.decode(is, false);
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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 (errorClass != null) {
sb.append("errorClass: ");
errorClass.appendAsString(sb, indentLevel + 1);
} else {
sb.append("errorClass: <empty-required-field>");
}
if (additionalCode != null) {
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
sb.append("additionalCode: ").append(additionalCode);
}
if (additionalDescription != null) {
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
sb.append("additionalDescription: ").append(additionalDescription);
}
sb.append("\n");
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
sb.append("}");
}
public static class ErrorClass implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private BerInteger vmdState = null;
private BerInteger applicationReference = null;
private BerInteger definition = null;
private BerInteger resource = null;
private BerInteger service = null;
private BerInteger servicePreempt = null;
private BerInteger timeResolution = null;
private BerInteger access = null;
private BerInteger initiate = null;
private BerInteger conclude = null;
private BerInteger cancel = null;
private BerInteger file = null;
private BerInteger others = null;
public ErrorClass() {}
public ErrorClass(byte[] code) {
this.code = code;
}
public BerInteger getVmdState() {
return vmdState;
}
public void setVmdState(BerInteger vmdState) {
this.vmdState = vmdState;
}
public BerInteger getApplicationReference() {
return applicationReference;
}
public void setApplicationReference(BerInteger applicationReference) {
this.applicationReference = applicationReference;
}
public BerInteger getDefinition() {
return definition;
}
public void setDefinition(BerInteger definition) {
this.definition = definition;
}
public BerInteger getResource() {
return resource;
}
public void setResource(BerInteger resource) {
this.resource = resource;
}
public BerInteger getService() {
return service;
}
public void setService(BerInteger service) {
this.service = service;
}
public BerInteger getServicePreempt() {
return servicePreempt;
}
public void setServicePreempt(BerInteger servicePreempt) {
this.servicePreempt = servicePreempt;
}
public BerInteger getTimeResolution() {
return timeResolution;
}
public void setTimeResolution(BerInteger timeResolution) {
this.timeResolution = timeResolution;
}
public BerInteger getAccess() {
return access;
}
public void setAccess(BerInteger access) {
this.access = access;
}
public BerInteger getInitiate() {
return initiate;
}
public void setInitiate(BerInteger initiate) {
this.initiate = initiate;
}
public BerInteger getConclude() {
return conclude;
}
public void setConclude(BerInteger conclude) {
this.conclude = conclude;
}
public BerInteger getCancel() {
return cancel;
}
public void setCancel(BerInteger cancel) {
this.cancel = cancel;
}
public BerInteger getFile() {
return file;
}
public void setFile(BerInteger file) {
this.file = file;
}
public BerInteger getOthers() {
return others;
}
public void setOthers(BerInteger others) {
this.others = others;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (others != null) {
codeLength += others.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 12
reverseOS.write(0x8C);
codeLength += 1;
return codeLength;
}
if (file != null) {
codeLength += file.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 11
reverseOS.write(0x8B);
codeLength += 1;
return codeLength;
}
if (cancel != null) {
codeLength += cancel.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 10
reverseOS.write(0x8A);
codeLength += 1;
return codeLength;
}
if (conclude != null) {
codeLength += conclude.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 9
reverseOS.write(0x89);
codeLength += 1;
return codeLength;
}
if (initiate != null) {
codeLength += initiate.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 8
reverseOS.write(0x88);
codeLength += 1;
return codeLength;
}
if (access != null) {
codeLength += access.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 7
reverseOS.write(0x87);
codeLength += 1;
return codeLength;
}
if (timeResolution != null) {
codeLength += timeResolution.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 6
reverseOS.write(0x86);
codeLength += 1;
return codeLength;
}
if (servicePreempt != null) {
codeLength += servicePreempt.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 5
reverseOS.write(0x85);
codeLength += 1;
return codeLength;
}
if (service != null) {
codeLength += service.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 4
reverseOS.write(0x84);
codeLength += 1;
return codeLength;
}
if (resource != null) {
codeLength += resource.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
reverseOS.write(0x83);
codeLength += 1;
return codeLength;
}
if (definition != null) {
codeLength += definition.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
reverseOS.write(0x82);
codeLength += 1;
return codeLength;
}
if (applicationReference != null) {
codeLength += applicationReference.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
reverseOS.write(0x81);
codeLength += 1;
return codeLength;
}
if (vmdState != null) {
codeLength += vmdState.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
reverseOS.write(0x80);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
vmdState = new BerInteger();
tlvByteCount += vmdState.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
applicationReference = new BerInteger();
tlvByteCount += applicationReference.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
definition = new BerInteger();
tlvByteCount += definition.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
resource = new BerInteger();
tlvByteCount += resource.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
service = new BerInteger();
tlvByteCount += service.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
servicePreempt = new BerInteger();
tlvByteCount += servicePreempt.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 6)) {
timeResolution = new BerInteger();
tlvByteCount += timeResolution.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 7)) {
access = new BerInteger();
tlvByteCount += access.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 8)) {
initiate = new BerInteger();
tlvByteCount += initiate.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 9)) {
conclude = new BerInteger();
tlvByteCount += conclude.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 10)) {
cancel = new BerInteger();
tlvByteCount += cancel.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 11)) {
file = new BerInteger();
tlvByteCount += file.decode(is, false);
return tlvByteCount;
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 12)) {
others = new BerInteger();
tlvByteCount += others.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
appendAsString(sb, 0);
return sb.toString();
}
public void appendAsString(StringBuilder sb, int indentLevel) {
if (vmdState != null) {
sb.append("vmdState: ").append(vmdState);
return;
}
if (applicationReference != null) {
sb.append("applicationReference: ").append(applicationReference);
return;
}
if (definition != null) {
sb.append("definition: ").append(definition);
return;
}
if (resource != null) {
sb.append("resource: ").append(resource);
return;
}
if (service != null) {
sb.append("service: ").append(service);
return;
}
if (servicePreempt != null) {
sb.append("servicePreempt: ").append(servicePreempt);
return;
}
if (timeResolution != null) {
sb.append("timeResolution: ").append(timeResolution);
return;
}
if (access != null) {
sb.append("access: ").append(access);
return;
}
if (initiate != null) {
sb.append("initiate: ").append(initiate);
return;
}
if (conclude != null) {
sb.append("conclude: ").append(conclude);
return;
}
if (cancel != null) {
sb.append("cancel: ").append(cancel);
return;
}
if (file != null) {
sb.append("file: ").append(file);
return;
}
if (others != null) {
sb.append("others: ").append(others);
return;
}
sb.append("<none>");
}
}
}

@ -1,26 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerBitString;
public class ServiceSupportOptions extends BerBitString {
private static final long serialVersionUID = 1L;
public ServiceSupportOptions() {}
public ServiceSupportOptions(byte[] code) {
super(code);
}
public ServiceSupportOptions(byte[] value, int numBits) {
super(value, numBits);
}
public ServiceSupportOptions(boolean[] value) {
super(value);
}
}

@ -1,18 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.types.BerOctetString;
public class TimeOfDay extends BerOctetString {
private static final long serialVersionUID = 1L;
public TimeOfDay() {}
public TimeOfDay(byte[] value) {
super(value);
}
}

@ -1,108 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class TypeSpecification implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private TypeDescription typeDescription = null;
public TypeSpecification() {}
public TypeSpecification(byte[] code) {
this.code = code;
}
public TypeDescription getTypeDescription() {
return typeDescription;
}
public void setTypeDescription(TypeDescription typeDescription) {
this.typeDescription = typeDescription;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (typeDescription != null) {
codeLength += typeDescription.encode(reverseOS);
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
int numDecodedBytes;
typeDescription = new TypeDescription();
numDecodedBytes = typeDescription.decode(is, berTag);
if (numDecodedBytes != 0) {
return tlvByteCount + numDecodedBytes;
} else {
typeDescription = null;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

@ -1,140 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerLength;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class UnconfirmedPDU implements BerType, Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
private byte[] code = null;
private UnconfirmedService service = null;
public UnconfirmedPDU() {}
public UnconfirmedPDU(byte[] code) {
this.code = code;
}
public UnconfirmedService getService() {
return service;
}
public void setService(UnconfirmedService service) {
this.service = service;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
return encode(reverseOS, true);
}
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
if (code != null) {
reverseOS.write(code);
if (withTag) {
return tag.encode(reverseOS) + code.length;
}
return code.length;
}
int codeLength = 0;
codeLength += service.encode(reverseOS);
codeLength += BerLength.encodeLength(reverseOS, codeLength);
if (withTag) {
codeLength += tag.encode(reverseOS);
}
return codeLength;
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, true);
}
public int decode(InputStream is, boolean withTag) throws IOException {
int tlByteCount = 0;
int vByteCount = 0;
int numDecodedBytes;
BerTag berTag = new BerTag();
if (withTag) {
tlByteCount += tag.decodeAndCheck(is);
}
BerLength length = new BerLength();
tlByteCount += length.decode(is);
int lengthVal = length.val;
vByteCount += berTag.decode(is);
service = new UnconfirmedService();
numDecodedBytes = service.decode(is, berTag);
if (numDecodedBytes != 0) {
vByteCount += numDecodedBytes;
if (lengthVal >= 0 && vByteCount == lengthVal) {
return tlByteCount + vByteCount;
}
vByteCount += berTag.decode(is);
} else {
throw new IOException("Tag does not match mandatory sequence component.");
}
if (lengthVal < 0) {
if (!berTag.equals(0, 0, 0)) {
throw new IOException("Decoded sequence has wrong end of contents octets");
}
vByteCount += BerLength.readEocByte(is);
return tlByteCount + vByteCount;
}
throw new IOException(
"Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS, false);
code = reverseOS.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("}");
}
}

@ -1,107 +0,0 @@
/*
* This class file was automatically generated by ASN1bean (http://www.beanit.com)
*/
package com.beanit.iec61850bean.internal.mms.asn1;
import com.beanit.asn1bean.ber.BerTag;
import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
import com.beanit.asn1bean.ber.types.BerType;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
public class UnconfirmedService implements BerType, Serializable {
private static final long serialVersionUID = 1L;
private byte[] code = null;
private InformationReport informationReport = null;
public UnconfirmedService() {}
public UnconfirmedService(byte[] code) {
this.code = code;
}
public InformationReport getInformationReport() {
return informationReport;
}
public void setInformationReport(InformationReport informationReport) {
this.informationReport = informationReport;
}
@Override
public int encode(OutputStream reverseOS) throws IOException {
if (code != null) {
reverseOS.write(code);
return code.length;
}
int codeLength = 0;
if (informationReport != null) {
codeLength += informationReport.encode(reverseOS, false);
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
reverseOS.write(0xA0);
codeLength += 1;
return codeLength;
}
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
}
@Override
public int decode(InputStream is) throws IOException {
return decode(is, null);
}
public int decode(InputStream is, BerTag berTag) throws IOException {
int tlvByteCount = 0;
boolean tagWasPassed = (berTag != null);
if (berTag == null) {
berTag = new BerTag();
tlvByteCount += berTag.decode(is);
}
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
informationReport = new InformationReport();
tlvByteCount += informationReport.decode(is, false);
return tlvByteCount;
}
if (tagWasPassed) {
return 0;
}
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
}
public void encodeAndSave(int encodingSizeGuess) throws IOException {
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
encode(reverseOS);
code = reverseOS.getArray();
}
@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>");
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save