Added Built-In infonames

This commit is contained in:
Finn
2025-12-11 09:46:59 +01:00
parent 729a64b021
commit 05ec96981c
4 changed files with 75 additions and 16 deletions

View File

@@ -67,12 +67,12 @@ public abstract class ProtocolINSServer extends DefaultMethodsOverrider {
// Set default values for configuration properties if not already set
if (!configurationManager.isSet("server.site.info")) {
configurationManager.set("server.site.info", "INS-SERVER INFO SITE IP");
configurationManager.set("server.site.info", "INS-SERVER INFO SITE IP:PORT");
configurationManager.saveProperties();
}
if (!configurationManager.isSet("server.site.register")) {
configurationManager.set("server.site.register", "SERVER IP TO INS-FRONTEND WEBSITE");
if (!configurationManager.isSet("server.site.frontend")) {
configurationManager.set("server.site.frontend", "SERVER IP TO INS-FRONTEND:PORT");
configurationManager.saveProperties();
}
@@ -188,8 +188,7 @@ public abstract class ProtocolINSServer extends DefaultMethodsOverrider {
* @param sub An optional subname, or {@code null}.
* @param type The record type requested.
*/
public void onQueryReceived(String tln, String name, String sub, INSRecordType type) {
}
public void onQueryReceived(String tln, String name, String sub, INSRecordType type) {}
/**
* Callback fired after an INS response was successfully sent to the client.
@@ -200,8 +199,7 @@ public abstract class ProtocolINSServer extends DefaultMethodsOverrider {
* @param type The requested record type.
* @param results The records returned to the client.
*/
public void onResponseSent(String tln, String name, String sub, INSRecordType type, List<INSRecord> results) {
}
public void onResponseSent(String tln, String name, String sub, INSRecordType type, List<INSRecord> results) {}
/**
* Callback fired when an INS response could not be delivered to the client.
@@ -213,16 +211,47 @@ public abstract class ProtocolINSServer extends DefaultMethodsOverrider {
* @param results The records that would have been sent.
* @param exception The exception describing the failure.
*/
public void onResponseSentFailed(String tln, String name, String sub, INSRecordType type, List<INSRecord> results, Exception exception) {
}
public void onResponseSentFailed(String tln, String name, String sub, INSRecordType type, List<INSRecord> results, Exception exception) {}
/**
* Resolves the information endpoint for a given Top-Level Name (TLN).
*
* <p>This method is part of the INS server's internal resolution logic.
* Each TLN
* need to define a special "info site" which provides metadata, documentation,
* or administrative information for that TLN.
*
* <p>The returned string must always be in the format:
* <pre>
* host:port
* </pre>
*
* <p>This method is used automatically by the INS protocol handler when a client
* queries an InfoName of the form:
* <pre>
* info.&lt;tln&gt;
* </pre>
*
* <p>If no TLN-specific info endpoint exists or the TLN does not exist, the implementation can:
* <ul>
* <li>return <code>null</code> to signal that no info site is registered</li>
* </ul>
*
* @param tln the top-level name for which the info site should be resolved.
* Must not be null. Case-insensitive.
*
* @return a string in <code>"host:port"</code> format representing the TLN's info endpoint,
* or <code>null</code> if the TLN has no registered info site.
*/
public abstract String resolveTLNInfoSite(String tln);
/**
* Gets the INS registration site URL from the configuration.
*
* @return The INS registration site URL.
*/
public final String getINSRegisterSite() {
return configurationManager.getString("server.site.register");
public final String getINSFrontendSite() {
return configurationManager.getString("server.site.frontend");
}
/**