summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/ipfix4java/ipfix-model-generator/src/main/resources/de/fhg/fokus/net/ipfix/mojo/mgen/tmpl/IpfixIeTmpl.tmpl
blob: 223b5811d08d68d697b508e638aa956e2dc14b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package %{TARGET_PACKAGE}%;
// === ipfix-model-generator: auto-generated file - do not edit! ===
import de.fhg.fokus.net.ipfix.api.IpfixFieldSpecifier;
import de.fhg.fokus.net.ipfix.api.IpfixIe;
import de.fhg.fokus.net.ipfix.api.IpfixIeSemantics;
import de.fhg.fokus.net.ipfix.api.IpfixIeStatus;
import de.fhg.fokus.net.ipfix.api.IpfixIeUnits;
import de.fhg.fokus.net.ipfix.api.codec.%{IE_CODEC}%;

%{IMPORTS}%

/**
 * %{CLASS_DOCUMENTATION}% 
 * 
 */
public final class %{IE_CLASS_NAME}% extends %{IE_CODEC}% implements IpfixIe {
	// -- model --
	private final IpfixFieldSpecifier fieldSpecifier;

	@Override
	public IpfixFieldSpecifier getFieldSpecifier() {
		return fieldSpecifier;
	}

	public %{IE_CLASS_NAME}%() {
		this.fieldSpecifier = new IpfixFieldSpecifier(%{IE_ENTERPRISE_NUMBER}%).setId(%{IE_ID}%)
				.setFieldLength(this.fieldLength);
	}
	public %{IE_CLASS_NAME}%( int length ) {
		this.fieldLength = length;
		this.fieldSpecifier = new IpfixFieldSpecifier(%{IE_ENTERPRISE_NUMBER}%).setId(%{IE_ID}%)
				.setFieldLength(this.fieldLength);
	}
	public %{IE_CLASS_NAME}%( int length, long enterpriseNumber, boolean isScope ) {
		this.fieldLength = length;
		this.fieldSpecifier = new IpfixFieldSpecifier(enterpriseNumber).setId(%{IE_ID}%)
				.setFieldLength(this.fieldLength).setScope(isScope);
	}


	@Override
	public IpfixIeSemantics getSemantics() {
		return IpfixIeSemantics.%{IE_SEMANTICS}%;
	}

	@Override
	public IpfixIeStatus getStatus() {
		return IpfixIeStatus.%{IE_STATUS}%;
	}

	@Override
	public String getName() {
		return "%{IE_NAME}%";
	}

	@Override
	public int getLength() {
		return fieldSpecifier.getIeLength();
	}

	@Override
	public IpfixIeUnits getUnits() {
		return IpfixIeUnits.%{IE_UNITS}%;
	}
}