Examples of TblLocationPcr


Examples of com.intel.mtwilson.as.data.TblLocationPcr

    public Boolean addHostLocation(HostLocation hlObj) {

        TblLocationPcrJpaController locJpaController = new TblLocationPcrJpaController(getEntityManagerFactory());
        try {
            if (hlObj != null && !hlObj.white_list_value.isEmpty()) {
                TblLocationPcr locPCR = locJpaController.findTblLocationPcrByPcrValueEx(hlObj.white_list_value);
                if (locPCR != null) {
                    log.info(String.format("An entry already existing in the location table for the white list specified [%s | %s]"
                            , locPCR.getLocation(), hlObj.white_list_value));
                    if (locPCR.getLocation().equals(hlObj.location)) {
                        // No need to do anything. Just exit.
                        return true;
                    }
                    else {
                        // Need to update the entry
                        log.info(String.format("Updating the location value for the white list specified to %s.", hlObj.location));
                        locPCR.setLocation(hlObj.location);
                        locJpaController.edit(locPCR);
                    }
                } else {
                    // Add a new entry for the location mapping table.
                    locPCR = new TblLocationPcr();
                    locPCR.setLocation(hlObj.location);
                    locPCR.setPcrValue(hlObj.white_list_value);
                    locJpaController.create(locPCR);
                    log.info(String.format("Successfully added a new location value %s with white list %s.", hlObj.location, hlObj.white_list_value));
                }
            }
        } catch (ASException e) {
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblLocationPcr

    public void destroy(Integer id) throws NonexistentEntityException {
        EntityManager em = getEntityManager();
        try {
            em.getTransaction().begin();
            TblLocationPcr tblLocationPcr;
            try {
                tblLocationPcr = em.getReference(TblLocationPcr.class, id);
                tblLocationPcr.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The tblLocationPcr with id " + id + " no longer exists.", enfe);
            }
            em.remove(tblLocationPcr);
            em.getTransaction().commit();
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblLocationPcr

            query.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache);

           
            try {
             
              TblLocationPcr locationPcr = (TblLocationPcr) query.getSingleResult();
                String location = locationPcr.getLocation();
               
                log.info("PCR Value  " + pcrValue + " location " + location );
               
                return location;
               
View Full Code Here

Examples of com.intel.mtwilson.as.data.TblLocationPcr

            query.setHint(QueryHints.REFRESH, HintValues.TRUE);
            query.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache);
          
            try {
            
              TblLocationPcr locationPcr = (TblLocationPcr) query.getSingleResult();
                return locationPcr;
               
            } catch (NoResultException e) {
                log.info( "NoResultException: Location does not exist for pcr value {} ",
                        pcrValue);
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.