diff --git a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/objects/Classic_Domain.java b/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/objects/Classic_Domain.java index ec04e29..eecbeb8 100644 --- a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/objects/Classic_Domain.java +++ b/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/objects/Classic_Domain.java @@ -36,27 +36,20 @@ public class Classic_Domain implements Serializable { * The destination of the domain, typically the full URL or address. */ @Deprecated(forRemoval = false, since = "1.0.0-BETA.3") - private final String destination; + public final String destination; /** * The ProtocolBridge reference. */ @Deprecated(forRemoval = false, since = "1.0.0-BETA.3") - private final ProtocolBridge protocolBridge; - - /** - * The encapsulated Domain object for modern usage. - */ - @Getter - private final InfoName infoName; + public final ProtocolBridge protocolBridge; public Classic_Domain(String name, String topLevelDomain, String destination, String path, ProtocolBridge bridge) { this.protocolBridge = bridge; - this.infoName = new InfoName(name + "." + topLevelDomain + "/" + (path.startsWith("/") ? path : "/" + path)); - this.name = infoName.getName(); - this.topLevelDomain = infoName.getTopLevelName(); - this.destination = infoName.getDestination(bridge); - this.path = infoName.getPath(); + this.name = name; + this.topLevelDomain = topLevelDomain; + this.destination = destination; + this.path = path; } @Override diff --git a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/ClassicConverter.java b/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/ClassicConverter.java deleted file mode 100644 index a5bc495..0000000 --- a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/ClassicConverter.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openautonomousconnection.protocol.versions.v1_0_0.classic.utils; - -import org.openautonomousconnection.protocol.ProtocolBridge; -import org.openautonomousconnection.protocol.versions.ProtocolVersion; -import org.openautonomousconnection.protocol.versions.v1_0_0.classic.objects.Classic_Domain; - -/** - * Utility class for converting between Classic protocol objects and new protocol objects. - */ -public final class ClassicConverter { - - /** - * Converts a Classic_Domain object to a InfoName object. - * - * @param classicDomain the Classic_Domain object to convert - * @return the converted InfoName object - */ - @SuppressWarnings(value = "deprecation") - public static InfoName classicDomainToInfoName(Classic_Domain classicDomain) { - return new InfoName(classicDomain.name + "." + classicDomain.topLevelDomain + (classicDomain.path.startsWith("/") ? classicDomain.path : "/" + classicDomain.path)); - } - - /** - * Converts a InfoName object to a Classic_Domain object. - * - * @param newInfoName the InfoName object to convert - * @param protocolBridge The reference to the ProtocolBridge object. - * @return the converted Classic_Domain object - */ - @SuppressWarnings(value = "deprecation") - public static Classic_Domain infoNameToClassicDomain(InfoName newInfoName, ProtocolBridge protocolBridge) { - return new Classic_Domain(newInfoName.getName(), newInfoName.getTopLevelName(), newInfoName.getDestination(protocolBridge), newInfoName.getPath(), protocolBridge); - } - - /** - * Converts a Classic_ProtocolVersion to a ProtocolVersion. - * - * @param classicProtocolVersion the Classic_ProtocolVersion to convert - * @return the converted ProtocolVersion - */ - @SuppressWarnings(value = "deprecation") - public static ProtocolVersion classicProtocolVersionToNewProtocolVersion(Classic_ProtocolVersion classicProtocolVersion) { - if (classicProtocolVersion == Classic_ProtocolVersion.PV_1_0_0) return ProtocolVersion.PV_1_0_0_CLASSIC; - return null; - } - - /** - * Converts a ProtocolVersion to a Classic_ProtocolVersion. - * - * @param newProtocolVersion the ProtocolVersion to convert - * @return the converted Classic_ProtocolVersion - */ - @SuppressWarnings(value = "deprecation") - public static Classic_ProtocolVersion newProtocolVersionToClassicProtocolVersion(ProtocolVersion newProtocolVersion) { - return Classic_ProtocolVersion.PV_1_0_0; - } - -} diff --git a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/Classic_ClientListener.java b/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/Classic_ClientListener.java index abe51fd..592fb6d 100644 --- a/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/Classic_ClientListener.java +++ b/src/main/java/org/openautonomousconnection/protocol/versions/v1_0_0/classic/utils/Classic_ClientListener.java @@ -82,7 +82,7 @@ public final class Classic_ClientListener extends EventListener { public void onPing(Classic_PingPacketReceivedEvent event) { // If the domain is reachable, fetch the HTML content if (event.reachable) { - String destination = event.domain.getInfoName().getDestination(protocolBridge); + String destination = event.domain.destination; try { // Create a URL object @@ -102,7 +102,7 @@ public final class Classic_ClientListener extends EventListener { } catch (IOException exception) { // Handle any exceptions that occur during the process protocolBridge.getClassicHandlerClient().handleHTMLContent(Classic_SiteType.PROTOCOL, new Classic_LocalDomain("error-occurred", "html", "", protocolBridge), - Classic_WebsitesContent.ERROR_OCCURRED(exception.getMessage().replace(event.domain.getInfoName().getDestination(protocolBridge), event.domain + "/" + event.domain.path))); + Classic_WebsitesContent.ERROR_OCCURRED(exception.getMessage().replace(event.domain.destination, event.domain + "/" + event.domain.path))); } } else // If the domain is not reachable, handle the error