Examples of MleData


Examples of com.intel.mtwilson.datatypes.MleData

                                    if (tblMleList != null) {
                                            log.info(String.format("Found [%d] mle results for search criteria [%s]", tblMleList.size(), searchCriteria));

                                            for (TblMle tblMle : tblMleList) {
                                                    MleData mleData = createMleDataFromDatabaseRecord(tblMle, false);
                                                    mleDataList.add(mleData);
                                            }
                                    } else {
                                            log.info(String.format("Found [%d] mle results for search criteria [%s]", 0,searchCriteria));
                                    }
View Full Code Here

Examples of com.intel.mtwilson.datatypes.MleData

    mleVo.setMleType(data.getMleType());
    return mleVo;
  }
 
  public static MleData getMleApiClientObject(MLEDataVO dataVO) {
    MleData data = new MleData();
    data.setName(dataVO.getMleName());
    data.setVersion(dataVO.getMleVersion());
    data.setMleType(dataVO.getMleType());
    data.setOemName(dataVO.getOemName());
    data.setOsName(dataVO.getOsName());
    data.setOsVersion(dataVO.getOsVersion());
    data.setAttestationType(dataVO.getAttestation_Type());
    data.setDescription(dataVO.getMleDescription());
   
    data.setManifestList(getApiClientManifestData(dataVO.getManifestList()));
    return data;
  }
View Full Code Here

Examples of com.intel.mtwilson.datatypes.MleData

  @Override
  public String getMleSourceHost(MLEDataVO dataVO,WhitelistService apiClientServices) throws WLMPortalException {
                        log.info("MLEClientServiceImpl.getMleSourceHost >>");
                        String hostName;
                        try {
                                MleData mleDataObj = ConverterUtil.getMleApiClientObject(dataVO);
                                if (dataVO.getOemName() != null) {
                                        mleDataObj.setOemName(dataVO.getOemName());
                                        mleDataObj.setOsName("");
                                        mleDataObj.setOsVersion("");
                                }else{
                                        mleDataObj.setOsName(dataVO.getOsName());
                                        mleDataObj.setOsVersion(dataVO.getOsVersion());
                                        mleDataObj.setOemName("");
                                }
                                hostName = apiClientServices.getMleSource(mleDataObj);
                        }catch (Exception e) {
                                throw ConnectionUtil.handleException(e);
                        }
View Full Code Here

Examples of com.intel.mtwilson.datatypes.MleData

                                        if (tblMle == null) {
                                            throw new ASException(ErrorCode.WS_MLE_DOES_NOT_EXIST, mleName, mleVersion);                       
                                        }

                                        MleData mleData = createMleDataFromDatabaseRecord(tblMle, true);
                                        return mleData;

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

Examples of com.intel.mtwilson.datatypes.MleData

                                String osName = (tblMle.getOsId() == null) ? null : tblMle.getOsId().getName();
                                String osVersion = (tblMle.getOsId() == null) ? null : tblMle.getOsId().getVersion();
                                String oemName = (tblMle.getOemId() == null) ? null : tblMle.getOemId().getName();

                                MleData s = new MleData(tblMle.getName(), tblMle.getVersion(), MleData.MleType.valueOf(tblMle.getMLEType()),
                                                MleData.AttestationType.valueOf(tblMle.getAttestationType()),
                                                manifestList, tblMle.getDescription(), osName, osVersion, oemName);

                                return s;
  }
View Full Code Here

Examples of com.intel.mtwilson.datatypes.MleData

         * @param mleSourceObj : Object containing the details of the host and the MLE.
         * @return True or False
         */
        public String addMleSource(MleSource mleSourceObj) {
                                TblMle tblMle;
                                MleData mleData = null;
                                try {

                                    try {
                                        mleData = mleSourceObj.getMleData();
                                        // Verify if the MLE exists in the system.
                                        tblMle = getMleDetails(mleData.getName(), mleData.getVersion(), mleData.getOsName(),
                                                        mleData.getOsVersion(), mleData.getOemName());
                                    } catch (NoResultException nre){
                                        throw new ASException(nre,ErrorCode.WS_MLE_DOES_NOT_EXIST, mleData.getName(), mleData.getVersion());
                                    }

                                    MwMleSourceJpaController mleSourceJpaController = new MwMleSourceJpaController(getEntityManagerFactory());

                                    // Let us check if there is a mapping entry already for this MLE. If it does, then we need to return
                                    // back appropriate error.
                                    MwMleSource mleSourceCurrentObj = mleSourceJpaController.findByMleId(tblMle.getId());

                                    if (mleSourceCurrentObj != null) {
                                        log.error("White List host is already mapped to the MLE - " + tblMle.getName());
                                        throw new ASException(ErrorCode.WS_MLE_SOURCE_MAPPING_ALREADY_EXISTS, mleData.getName());
                                    }

                                    // Else create a new entry in the DB.
                                    MwMleSource mleSourceData = new MwMleSource();
                                    mleSourceData.setMleId(tblMle);
View Full Code Here

Examples of com.intel.mtwilson.datatypes.MleData

         * @param mleSourceObj
         * @return
         */
        public String updateMleSource(MleSource mleSourceObj) {
            TblMle tblMle;
            MleData mleData = null;
            try {

                try {
                    mleData = mleSourceObj.getMleData();
                    // Verify if the MLE exists in the system.
                    tblMle = getMleDetails(mleData.getName(), mleData.getVersion(), mleData.getOsName(),
                                    mleData.getOsVersion(), mleData.getOemName());
                } catch (NoResultException nre){
                    throw new ASException(nre,ErrorCode.WS_MLE_DOES_NOT_EXIST, mleData.getName(), mleData.getVersion());
                }
                               
                MwMleSourceJpaController mleSourceJpaController = new MwMleSourceJpaController(getEntityManagerFactory());
                // If the mapping does not exist already in the db, then we need to return back error.
                MwMleSource mwMleSource = mleSourceJpaController.findByMleId(tblMle.getId());
                if (mwMleSource == null) {
                    throw new ASException(ErrorCode.WS_MLE_SOURCE_MAPPING_DOES_NOT_EXIST, mleData.getName());
                }
               
                mwMleSource.setHostName(mleSourceObj.getHostName());       
                mleSourceJpaController.edit(mwMleSource);
               
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.