private void checkForDuplicate(TxtHost host) throws CryptographyException {
TblHostsJpaController tblHostsJpaController = new TblHostsJpaController(
getEntityManagerFactory());
TblHosts tblHosts1 = tblHostsJpaController.findByName(host.getHostName()
.toString()); // datatype.Hostname
TblHosts tblHosts2 = tblHostsJpaController.findByIPAddress(host.getIPAddress()
.toString());
if (tblHosts1 != null) {
throw new ASException(
ErrorCode.AS_HOST_EXISTS,
host.getHostName());