public HostResponse isHostRegistered(String hostnameOrAddress) {
try {
TblHostsJpaController tblHostsJpaController = new TblHostsJpaController(
getEntityManagerFactory());
TblHosts tblHosts = tblHostsJpaController.findByName(hostnameOrAddress);
if (tblHosts != null) {
return new HostResponse(ErrorCode.OK); // host name exists in
// database
}
tblHosts = tblHostsJpaController.findByIPAddress(hostnameOrAddress);