}
public void start(HttpServer httpServer, SecurityRealm securityRealm) {
HttpContext context = httpServer.createContext(DOMAIN_API_CONTEXT, this);
if (securityRealm != null) {
DomainCallbackHandler callbackHandler = securityRealm.getCallbackHandler();
Class[] supportedCallbacks = callbackHandler.getSupportedCallbacks();
if (DigestAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
context.setAuthenticator(new DigestAuthenticator(callbackHandler, securityRealm.getName()));
} else if (BasicAuthenticator.requiredCallbacksSupported(supportedCallbacks)) {
context.setAuthenticator(new BasicAuthenticator(callbackHandler, securityRealm.getName()));
}