package org.opendaylight.controller.sal.restconf.impl
-import javax.ws.rs.WebApplicationException
import javax.ws.rs.core.Response
import org.opendaylight.controller.md.sal.common.api.data.DataReader
import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession
private DataBrokerService dataService;
private new() {
- if (INSTANCE != null) {
+ if (INSTANCE !== null) {
throw new IllegalStateException("Already instantiated");
}
}
}
private def void checkPreconditions() {
- if (context == null || dataService == null) {
- throw new WebApplicationException(Response.status(Response.Status.SERVICE_UNAVAILABLE)
- .entity(RestconfProvider::NOT_INITALIZED_MSG).build())
+ if (context === null || dataService === null) {
+ throw new ResponseException(Response.Status.SERVICE_UNAVAILABLE, RestconfProvider::NOT_INITALIZED_MSG)
}
}