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

com.mobius.software.mqttsn.parser.packet.impl.Encapsulated Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.mobius.software.mqttsn.parser.packet.impl;

import com.mobius.software.mqttsn.parser.avps.Radius;
import com.mobius.software.mqttsn.parser.avps.SNType;
import com.mobius.software.mqttsn.parser.packet.api.SNDevice;
import com.mobius.software.mqttsn.parser.packet.api.SNMessage;

public class Encapsulated extends SNMessage
{
	private Radius radius;
	private String wirelessNodeID;
	private SNMessage message;

	public Encapsulated()
	{
		super();
	}

	public Encapsulated(Radius radius, String wirelessNodeID, SNMessage message)
	{
		this.radius = radius;
		this.wirelessNodeID = wirelessNodeID;
		this.message = message;
	}

	public Encapsulated reInit(Radius radius, String wirelessNodeID, SNMessage message)
	{
		this.radius = radius;
		this.wirelessNodeID = wirelessNodeID;
		this.message = message;
		return this;
	}

	@Override
	public int getLength()
	{
		int length = 3;
		if (wirelessNodeID != null)
			length += wirelessNodeID.length();
		return length;
	}

	@Override
	public SNType getType()
	{
		return SNType.ENCAPSULATED;
	}

	public Radius getRadius()
	{
		return radius;
	}

	public void setRadius(Radius radius)
	{
		this.radius = radius;
	}

	public String getWirelessNodeID()
	{
		return wirelessNodeID;
	}

	public void setWirelessNodeID(String wirelessNodeID)
	{
		this.wirelessNodeID = wirelessNodeID;
	}

	public SNMessage getMessage()
	{
		return message;
	}

	public void setMessage(SNMessage message)
	{
		this.message = message;
	}

	@Override
	public void processBy(SNDevice device)
	{
		message.processBy(device);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy