Examples of TblHostsJpaController


Examples of com.intel.mtwilson.as.controller.TblHostsJpaController


        try {
            HostsTrustReportType hostsTrustReportType = new HostsTrustReportType();
            for (Hostname host : hostNames) {
                TblHosts tblHosts = new TblHostsJpaController(getEntityManagerFactory()).findByName(host.toString()); // datatype.Hostname


                if (tblHosts == null) {
                    throw new ASException(ErrorCode.AS_HOST_NOT_FOUND, host);
                }
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

         * + " is empty."); }
         *
         */
        TblHosts tblHosts = null;
        try {
            tblHosts = new TblHostsJpaController(getEntityManagerFactory()).findByName(hostName.toString()); // datatype.Hostname
        } catch (CryptographyException e) {
            throw new ASException(e, ErrorCode.AS_ENCRYPTION_ERROR, e.getCause() == null ? e.getMessage() : e.getCause().getMessage());
        }

        if (tblHosts == null) {
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

        TblHosts tblHosts = null;
        String attestationReport = "";

        try {

            tblHosts = new TblHostsJpaController(getEntityManagerFactory()).findByName(hostName.toString());

            if (tblHosts == null) {
                throw new ASException(ErrorCode.AS_HOST_NOT_FOUND, hostName.toString());
            }
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

        AttestationReport attestationReport = new AttestationReport();

        TblHosts tblHosts = null;
        try {
            tblHosts = new TblHostsJpaController(getEntityManagerFactory()).findByName(hostName.toString()); // datatype.Hostname
        } catch (CryptographyException e) {
            throw new ASException(e, ErrorCode.AS_ENCRYPTION_ERROR, e.getCause() == null ? e.getMessage() : e.getCause().getMessage());
        }

        if (tblHosts == null) {
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

                                                tblHosts.setIPAddress(host.getIPAddress().toString()); // datatype.IPAddress
                                        tblHosts.setPort(host.getPort());
                                        tblHosts.setVmmMleId(vmmMleId);

                                        log.info("Updating Host in database");
                                        new TblHostsJpaController(getEntityManagerFactory()).edit(tblHosts);



                                } catch (ASException ase) {
                                        throw ase;
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController


                                        deleteTALogs(tblHosts.getId());


                                        new TblHostsJpaController(getEntityManagerFactory())
                                                        .destroy(tblHosts.getId());
                                } catch (ASException ase) {
                                        throw ase;
                                }
                                catch(CryptographyException e) {
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

                                //Building objects and validating that manifests are created ahead of create of host
                                TblHosts tblHosts = newRecordWithTlsPolicyAndKeystore; // new TblHosts();
                                log.info("saveHostInDatabase with tls policy {} and keystore size {}", tblHosts.getTlsPolicyName(), tblHosts.getTlsKeystore() == null ? "null" : tblHosts.getTlsKeystore().length);
                                log.error("saveHostInDatabase with tls policy {} and keystore size {}", tblHosts.getTlsPolicyName(), tblHosts.getTlsKeystore() == null ? "null" : tblHosts.getTlsKeystore().length);

                                TblHostsJpaController hostController = new TblHostsJpaController(
                                                getEntityManagerFactory());
                                tblHosts.setAddOnConnectionInfo(host.getAddOn_Connection_String());
                                tblHosts.setBiosMleId(biosMleId);
                                tblHosts.setDescription(host.getDescription());
                                tblHosts.setEmail(host.getEmail());
                                if (host.getIPAddress() != null) {
                                        tblHosts.setIPAddress(host.getIPAddress().toString()); // datatype.IPAddress
                                }
                                tblHosts.setName(host.getHostName().toString()); // datatype.Hostname

                                if (host.getPort() != null) {
                                        tblHosts.setPort(host.getPort());
                                }
                                tblHosts.setVmmMleId(vmmMleId);
                                tblHosts.setAIKCertificate(certificate); // null is ok

                                if (location != null) {
                                    tblHosts.setLocation(location);
                                }

                                // create the host
                                log.debug("COMMITING NEW HOST DO DATABASE");
                                hostController.create(tblHosts);

  }
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

  }


  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);
                                    if (tblHosts != null) {
                                            return new HostResponse(ErrorCode.OK); // host IP address exists in
                                                                                                                            // database
                                    }
                                    return new HostResponse(ErrorCode.AS_HOST_NOT_FOUND);
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

                                    throw new ASException( e);
                                    }
  }

  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());
View Full Code Here

Examples of com.intel.mtwilson.as.controller.TblHostsJpaController

         * @param hostName
         * @return
         * @throws CryptographyException
         */
  public TblHosts getHostByName(Hostname hostName) throws CryptographyException { // datatype.Hostname
    TblHosts tblHosts = new TblHostsJpaController(getEntityManagerFactory())
        .findByName(hostName.toString());
    return tblHosts;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.