Reformatted code using IntelliJ
This commit is contained in:
@@ -29,6 +29,7 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Constructor for OACPacket.
|
||||
*
|
||||
* @param id The unique identifier for the packet.
|
||||
* @param protocolVersion The protocol version associated with this packet.
|
||||
*/
|
||||
@@ -39,6 +40,7 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Gets the response code for the packet.
|
||||
*
|
||||
* @return The DNSResponseCode associated with the packet.
|
||||
*/
|
||||
protected final DNSResponseCode getResponseCode() {
|
||||
@@ -47,6 +49,7 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Sets the response code for the packet.
|
||||
*
|
||||
* @param responseCode The DNSResponseCode to set for the packet.
|
||||
*/
|
||||
protected final void setResponseCode(DNSResponseCode responseCode) {
|
||||
@@ -55,6 +58,7 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Writes the packet data to the output stream.
|
||||
*
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectOutputStream The output stream to write the packet data to.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
@@ -75,7 +79,8 @@ public abstract class OACPacket extends Packet {
|
||||
onRead(packetHandler, objectInputStream);
|
||||
|
||||
// Read the response code if the protocol version is not classic
|
||||
if (protocolVersion != ProtocolVersion.PV_1_0_0_CLASSIC) responseCode = (DNSResponseCode) objectInputStream.readObject();
|
||||
if (protocolVersion != ProtocolVersion.PV_1_0_0_CLASSIC)
|
||||
responseCode = (DNSResponseCode) objectInputStream.readObject();
|
||||
else responseCode = DNSResponseCode.RESPONSE_NOT_REQUIRED;
|
||||
|
||||
// Call the response code read handler
|
||||
@@ -84,6 +89,7 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Abstract method to be implemented by subclasses for writing specific packet data.
|
||||
*
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectOutputStream The output stream to write the packet data to.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
@@ -93,8 +99,9 @@ public abstract class OACPacket extends Packet {
|
||||
|
||||
/**
|
||||
* Abstract method to be implemented by subclasses for reading specific packet data.
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectInputStream The input stream to read the packet data from.
|
||||
*
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectInputStream The input stream to read the packet data from.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
* @throws ClassNotFoundException If a class cannot be found during deserialization.
|
||||
*/
|
||||
@@ -103,8 +110,10 @@ public abstract class OACPacket extends Packet {
|
||||
/**
|
||||
* Method called after the response code has been read from the input stream.
|
||||
* Subclasses can override this method to handle any additional logic based on the response code.
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectInputStream The input stream from which the response code was read.
|
||||
*
|
||||
* @param packetHandler The packet handler managing the packet.
|
||||
* @param objectInputStream The input stream from which the response code was read.
|
||||
*/
|
||||
protected void onResponseCodeRead(PacketHandler packetHandler, ObjectInputStream objectInputStream) {}
|
||||
protected void onResponseCodeRead(PacketHandler packetHandler, ObjectInputStream objectInputStream) {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user