Home Documentation
Download Report a Bug/Github About Contact

Configuring a Not Implemented Servlet

In RedDog server you are allowed to configure a servlet in order to restrict its implementation and return a 501 error as stated in RFC7482

“… Server implementations are free to support only a subset of these features depending on local requirements. Servers MUST return an HTTP 501 (Not Implemented) [RFC7231] response to inform clients of unsupported query types.”

There are two ways to restrict unsupported query types :

Via web.xml file

The first way is to map an integrated servlet (NotImplementedServlet) to the servlet you want to avoid using the web.xml file. This way is intended for those who implement the reference provider (rdap-sql-provider) and do not want to modify the java code.

E.g. the next part of the configuration is what is added in the web.xml file to send the 501 error to the ip and autnum requests.

	.
	.
	.
	<servlet>
		<servlet-name>ip</servlet-name>
		<servlet-class>mx.nic.rdap.server.servlet.NotImplementedServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>ip</servlet-name>
		<url-pattern>/ip/*</url-pattern>
	</servlet-mapping>
	<servlet>
		<servlet-name>autnum</servlet-name>
		<servlet-class>mx.nic.rdap.server.servlet.NotImplementedServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>autnum</servlet-name>
		<url-pattern>/autnum/*</url-pattern>
	</servlet-mapping>
	.
	.
	.

Via Code

If you are programming your own data-access provider (See more at data-access-layer), in the implementation hub class you can throw a NotImplementedException in the respective DAO function to tell to the RedDog server to throw a 501 Error.

If you want to add a custom message, just put a message while throwing the NotImplementedException.

Where to go next