Search in sources :

Example 1 with OemData

use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.

the class OemBOTest method testGetAllOem.

@Test
public void testGetAllOem() {
    List<TblOem> allRecords = new ArrayList<TblOem>();
    TblOem tblOem1 = new TblOem(OEM_ID1);
    TblOem tblOem2 = new TblOem(OEM_ID2);
    allRecords.add(tblOem1);
    allRecords.add(tblOem2);
    doReturn(allRecords).when(tblOemJpaController).findTblOemEntities();
    List<OemData> allData = oemBO.getAllOem();
    assertNotNull(allData);
    assertEquals(2, allData.size());
}
Also used : TblOem(com.intel.mtwilson.as.data.TblOem) OemData(com.intel.mtwilson.datatypes.OemData) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with OemData

use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.

the class OEMClientServiceImpl method addOEMInfo.

/**
	 * Method to add OEM Type into a Rest Services
	 * 
	 * @param dataVO
	 * @param apiClientServices
	 * @return Boolean variable e.g true if OEM is added successfully 
	 * @throws WLMPortalException
	 */
@Override
public boolean addOEMInfo(OEMDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
    log.info("OEMClientServiceImpl.addOEMInfo >>");
    boolean result = false;
    try {
        apiClientServices.addOEM(new OemData(dataVO.getOemName(), dataVO.getOemDescription()));
        result = true;
    } catch (Exception e) {
        log.error(e.getMessage());
        throw ConnectionUtil.handleException(e);
    }
    log.info("OEMClientServiceImpl.addOEMInfo <<");
    return result;
}
Also used : OemData(com.intel.mtwilson.datatypes.OemData) WLMPortalException(com.intel.mountwilson.common.WLMPortalException)

Example 3 with OemData

use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.

the class OEMClientServiceImpl method updateOEMInfo.

/**
	 * Method to update OEM into a Rest Services
	 * 
	 * @param dataVO
	 * @param apiClientServices
	 * @return Boolean variable e.g true if OEM is updated successfully 
	 * @throws WLMPortalException
	 */
@Override
public boolean updateOEMInfo(OEMDataVO dataVO, WhitelistService apiClientServices) throws WLMPortalException {
    log.info("OEMClientServiceImpl.updateOEMInfo >>");
    boolean result = false;
    try {
        apiClientServices.updateOEM(new OemData(dataVO.getOemName(), dataVO.getOemDescription()));
        result = true;
    } catch (Exception e) {
        log.error(e.getMessage());
        throw ConnectionUtil.handleException(e);
    }
    log.info("OEMClientServiceImpl.updateOEMInfo <<");
    return result;
}
Also used : OemData(com.intel.mtwilson.datatypes.OemData) WLMPortalException(com.intel.mountwilson.common.WLMPortalException)

Example 4 with OemData

use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.

the class ConverterUtil method getListToOEMDataVO.

public static List<OEMDataVO> getListToOEMDataVO(List<OemData> oemList) {
    List<OEMDataVO> list = new ArrayList<OEMDataVO>();
    for (OemData data : oemList) {
        OEMDataVO osVo = new OEMDataVO();
        osVo.setOemName(data.getName());
        osVo.setOemDescription(data.getDescription());
        list.add(osVo);
    }
    return list;
}
Also used : OemData(com.intel.mtwilson.datatypes.OemData) ArrayList(java.util.ArrayList) OEMDataVO(com.intel.mountwilson.datamodel.OEMDataVO)

Example 5 with OemData

use of com.intel.mtwilson.datatypes.OemData in project OpenAttestation by OpenAttestation.

the class OemBO method getAllOem.

/**
     * 
     * @return 
     */
public List<OemData> getAllOem() {
    List<OemData> allOemData = new ArrayList<OemData>();
    try {
        List<TblOem> allRecords = tblOemJpaController.findTblOemEntities();
        for (TblOem tblOem : allRecords) {
            OemData oemData = new OemData(tblOem.getName(), tblOem.getDescription());
            allOemData.add(oemData);
        }
    } catch (ASException ase) {
        throw ase;
    } catch (Exception e) {
        throw new ASException(e);
    }
    return allOemData;
}
Also used : OemData(com.intel.mtwilson.datatypes.OemData) TblOem(com.intel.mtwilson.as.data.TblOem) ArrayList(java.util.ArrayList) ASException(com.intel.mountwilson.as.common.ASException) ASException(com.intel.mountwilson.as.common.ASException)

Aggregations

OemData (com.intel.mtwilson.datatypes.OemData)7 TblOem (com.intel.mtwilson.as.data.TblOem)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 WLMPortalException (com.intel.mountwilson.common.WLMPortalException)2 Matchers.anyString (org.mockito.Matchers.anyString)2 ASException (com.intel.mountwilson.as.common.ASException)1 OEMDataVO (com.intel.mountwilson.datamodel.OEMDataVO)1