当前位置: 首页>>代码示例>>Java>>正文


Java ManagerDeviceElement类代码示例

本文整理汇总了Java中org.osc.sdk.manager.element.ManagerDeviceElement的典型用法代码示例。如果您正苦于以下问题:Java ManagerDeviceElement类的具体用法?Java ManagerDeviceElement怎么用?Java ManagerDeviceElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ManagerDeviceElement类属于org.osc.sdk.manager.element包,在下文中一共展示了ManagerDeviceElement类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateVSSDevice

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
@Override
public void updateVSSDevice(ManagerDeviceElement device) throws Exception {
    this.txControl.required(() -> {
        DeviceEntity result = IsmDeviceApi.this.em.find(DeviceEntity.class, Long.parseLong(device.getId()));

        if (result == null) {
            String msg = String.format("Cannot find the device id: %s", device.getId());
            LOG.error(msg);
            throw new IllegalArgumentException(msg);
        }

        result.setName(device.getName());
        IsmDeviceApi.this.em.merge(result);

        return null;
    });
}
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-sample-plugin,代码行数:18,代码来源:IsmDeviceApi.java

示例2: deleteDevice

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
private void deleteDevice(ManagerDeviceApi mgrApi) throws Exception {
    if (this.vs.getMgrId() == null) {
        return;
    }

    try {
        mgrApi.deleteVSSDevice();

    } catch (Exception ex) {

        try {
            ManagerDeviceElement device = mgrApi.getDeviceById(this.vs.getMgrId());
            if (device != null) {
                throw ex;
            }
        } catch (Exception e) {
            log.info("Fail to load Device: " + this.vs.getMgrId() + ". Assume already deleted.");
        }
    }
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:21,代码来源:MgrDeleteVSSDeviceTask.java

示例3: getDeviceIds

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
@GET
public List<String> getDeviceIds() throws Exception {
    LOG.info("Listing device ids'");
    List<? extends ManagerDeviceElement> devices = this.api.listDevices();
    List<String> deviceList = new ArrayList<String>();
    if (devices.isEmpty()) {
        return deviceList;
    }
    deviceList = devices.stream().map(ManagerDeviceElement::getId).collect(Collectors.toList());
    return deviceList;
}
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-sample-plugin,代码行数:12,代码来源:DeviceApis.java

示例4: listDevices

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
@Override
public List<? extends ManagerDeviceElement> listDevices() throws Exception {
    return this.txControl.supports(() -> {
        CriteriaBuilder criteriaBuilder = IsmDeviceApi.this.em.getCriteriaBuilder();
        CriteriaQuery<DeviceEntity> query = criteriaBuilder.createQuery(DeviceEntity.class);
        Root<DeviceEntity> r = query.from(DeviceEntity.class);
        query.select(r);

        return IsmDeviceApi.this.em.createQuery(query).getResultList();
    });
}
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-sample-plugin,代码行数:12,代码来源:IsmDeviceApi.java

示例5: getDeviceById

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
@Override
public ManagerDeviceElement getDeviceById(String id) throws Exception {
    return this.txControl.supports(() -> IsmDeviceApi.this.em.find(DeviceEntity.class, Long.valueOf(id)));
}
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-sample-plugin,代码行数:5,代码来源:IsmDeviceApi.java

示例6: getDeviceById

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
/**
 * Retrieves a device (group) from the security manager by its identifier.
 *
 * @param id  the unique identifier of the device
 * @return the device, null if not found
 * @throws Exception upon failure
 */
ManagerDeviceElement getDeviceById(String id) throws Exception;
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-api,代码行数:9,代码来源:ManagerDeviceApi.java

示例7: listDevices

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
/**
 * Retrieves all device (group) elements.
 *
 * @return the collection of all device elements
 * @throws Exception upon failure
 */
List<? extends ManagerDeviceElement> listDevices() throws Exception;
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-api,代码行数:8,代码来源:ManagerDeviceApi.java

示例8: updateVSSDevice

import org.osc.sdk.manager.element.ManagerDeviceElement; //导入依赖的package包/类
/**
 * Updates the device for the current virtual system.
 *
 * @param device the device with fields to be updated
 * @throws Exception upon failure
 */
void updateVSSDevice(ManagerDeviceElement device) throws Exception;
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-api,代码行数:8,代码来源:ManagerDeviceApi.java


注:本文中的org.osc.sdk.manager.element.ManagerDeviceElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。