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


Java ConfigurationReport类代码示例

本文整理汇总了Java中cern.c2mon.shared.client.configuration.ConfigurationReport的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationReport类的具体用法?Java ConfigurationReport怎么用?Java ConfigurationReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testReports

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Test
public void testReports() {

  final int currentProgress = 1;
  final String errorMessage = "Serious Error. Matthias had too much food";

  ClientRequestResult progressReportResult = new ConfigurationReport(2, 1, 10, currentProgress, "In progress");

  assertTrue(((ClientRequestReport) progressReportResult).isProgressReport());
  assertTrue(currentProgress == ((ClientRequestReport) progressReportResult).getCurrentProgressPart());
  assertFalse(((ClientRequestReport) progressReportResult).isErrorReport());
  assertFalse(((ClientRequestReport) progressReportResult).isResult());

  ClientRequestResult errorReportResult = new ConfigurationReport(false, errorMessage);

  assertTrue(((ClientRequestReport) errorReportResult).isErrorReport());
  assertTrue(errorMessage.equals(((ClientRequestReport) errorReportResult).getErrorMessage()));
  assertFalse(((ClientRequestReport) errorReportResult).isProgressReport());
  assertFalse(((ClientRequestReport) errorReportResult).isResult());
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:21,代码来源:ClientRequestImplTest.java

示例2: testCreateAlarmWithExistingDatatag

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
/**
 * Test the creation, update and removal of alarm.
 */

@Test
public void testCreateAlarmWithExistingDatatag() {
  replay(mockManager);

  // we  expect to send the alarm as the datatag is initialized.
  C2monCacheListener<Alarm> checker = EasyMock.createMock(C2monCacheListener.class);
  checker.notifyElementUpdated(EasyMock.isA(Alarm.class));
  EasyMock.expectLastCall().once();
  EasyMock.replay(checker);

  alarmCache.registerSynchronousListener(checker);

  DataTagCacheObject toInit = (DataTagCacheObject)dataTagCache.getCopy(200003L);
  toInit.setValue(Boolean.TRUE);
  toInit.getDataTagQuality().validate();
  dataTagCache.putQuiet(toInit);

  ConfigurationReport report = configurationLoader.applyConfiguration(22);
  verify(checker);
  ((AbstractCache) alarmCache).getCacheListeners().remove(checker);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:26,代码来源:ConfigurationLoaderTest.java

示例3: createEquipment

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport createEquipment(String processName, List<Equipment> equipments) {

  // validate configuration
  validateIsCreate(equipments);

  // Set parent Ids to the configuration
  for (Equipment equipment : equipments) {
    equipment.setParentProcessName(processName);
  }

  // set fields for the server
  Configuration config = new Configuration();
  config.setEntities(equipments);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:18,代码来源:EquipmentConfigurationManagerImpl.java

示例4: testConcurrentConfigRequestRejected

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Test
@Ignore
public void testConcurrentConfigRequestRejected() throws InterruptedException, IllegalAccessException, InstantiationException, NoSuchFieldException,
    ParserConfigurationException, TransformerException, NoSimpleValueParseException {

  final ConfigurationReport report;

  clusterCache.acquireWriteLockOnKey(JmsContainerManager.CONFIG_LOCK_KEY);
  try {
    ConcurrentConfigRequestor ccr = new ConcurrentConfigRequestor();
    Thread t = new Thread(ccr);
    t.start();
    t.join();

    report = ccr.report;

    assertTrue(report.toXML().contains(Status.FAILURE.toString()));
    assertTrue(report.toXML().contains("rejected since another configuration is still running"));

  } finally {
    clusterCache.releaseWriteLockOnKey(JmsContainerManager.CONFIG_LOCK_KEY);
  }
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:24,代码来源:ConfigurationLoaderTest.java

示例5: getConfigurationReports

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
/**
 * Retrieves all full reports for a particular configuration.
 *
 * @param configurationId id of the configuration of the request
 * @return a map of full reports
 */
public List<ConfigurationReport> getConfigurationReports(final String configurationId) {
  List<ConfigurationReport> reports;

  if (configurationReports.containsKey(configurationId)) {
    reports = configurationReports.get(configurationId);
  }

  else {
    reports = new ArrayList<>(configurationService.getConfigurationReports(Long.valueOf(configurationId)));
    Collections.sort(reports);
  }

  if (reports == null) {
    logger.error("Could not retrieve Stored Configuration Report for configuration id:" + configurationId);
    throw new RuntimeException("Cannot find Configuration Report for configuration id:" + configurationId);
  }
  logger.debug("Successfully retrieved Stored Configuration Report for configuration id:" + configurationId);

  return reports;
}
 
开发者ID:c2mon,项目名称:c2mon-web-ui,代码行数:27,代码来源:ConfigLoaderService.java

示例6: removeAlarms

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport removeAlarms(Set<Long> ids) {

  List<Alarm> alarmsToDelete = new ArrayList<>();

  for (Long id : ids) {
    Alarm deleteAlarm = new Alarm();
    deleteAlarm.setId(id);
    deleteAlarm.setDeleted(true);

    alarmsToDelete.add(deleteAlarm);
  }

  Configuration config = new Configuration();
  config.setEntities(alarmsToDelete);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:19,代码来源:AlarmConfigurationManagerImpl.java

示例7: testRemoveDevice

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Test
public void testRemoveDevice() {
  Device device = deviceCache.get(300L);
  assertNotNull(device);
  assertTrue(deviceCache.hasKey(300L));
  assertNotNull(deviceMapper.getItem(300L));

  replay(mockManager);

  ConfigurationReport report = configurationLoader.applyConfiguration(35);

  assertFalse(report.toXML().contains(Status.FAILURE.toString()));
  assertFalse(deviceCache.hasKey(300L));
  assertNull(deviceMapper.getItem(300L));

  verify(mockManager);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:18,代码来源:ConfigurationLoaderTest.java

示例8: createCommandTags

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport createCommandTags(String equipmentName, List<CommandTag> tags) {

  // validate the Configuration object
  validateIsCreate(tags);

  // Set parent Ids to the configuration
  for (CommandTag tag : tags) {
    tag.setEquipmentName(equipmentName);
  }

  Configuration config = new Configuration();
  config.setEntities(tags);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:17,代码来源:CommandTagConfigurationManagerImpl.java

示例9: removeSubEquipment

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport removeSubEquipment(Set<String> subEquipmentNames) {

  List<SubEquipment> equipmentsToDelete = new ArrayList<>();

  for (String equipmentName : subEquipmentNames) {
    SubEquipment deleteSubEquipment = new SubEquipment();
    deleteSubEquipment.setName(equipmentName);
    deleteSubEquipment.setDeleted(true);

    equipmentsToDelete.add(deleteSubEquipment);
  }

  Configuration config = new Configuration();
  config.setEntities(equipmentsToDelete);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:19,代码来源:SubEquipmentConfigurationManagerImpl.java

示例10: removeProcess

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport removeProcess(String name) {

  Process deleteProcess = new Process();
  deleteProcess.setName(name);
  deleteProcess.setDeleted(true);

  Configuration config = new Configuration();
  config.setEntities(Collections.singletonList(deleteProcess));

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:13,代码来源:ProcessConfigurationManagerImpl.java

示例11: createDataTags

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport createDataTags(String equipmentName, List<DataTag> tags) {
  validateIsCreate(tags);

  for (DataTag tag : tags) {
    tag.setEquipmentName(equipmentName);
  }

  Configuration config = new Configuration();
  config.setEntities(tags);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:14,代码来源:DataTagConfigurationManagerImpl.java

示例12: updateRuleTags

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport updateRuleTags(List<RuleTag> tags) {

  // validate the Configuration object
  validateIsUpdate(tags);

  Configuration config = new Configuration();
  config.setEntities(tags);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:12,代码来源:RuleTagConfigurationManagerImpl.java

示例13: updateStatusTag

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport updateStatusTag(StatusTag tag) {

  List<StatusTag> dummyTagList = new ArrayList<>();
  dummyTagList.add(tag);

  return updateStatusTags(dummyTagList);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:9,代码来源:ControlTagConfigurationManagerImpl.java

示例14: getConfigurationReports

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public Collection<ConfigurationReport> getConfigurationReports(Long id) {
  try {
    return clientRequestHandler.getConfigurationReports(id);
  } catch (JMSException e) {
    log.error("getConfigurationReports() - JMS connection lost -> Could not retrieve configuration reports from the" +
        " C2MON server.", e);
  }
  return new ArrayList<>();
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:11,代码来源:ConfigurationServiceImpl.java

示例15: updateAliveTags

import cern.c2mon.shared.client.configuration.ConfigurationReport; //导入依赖的package包/类
@Override
public ConfigurationReport updateAliveTags(List<AliveTag> tags) {

  // validate the Configuration object
  validateIsUpdate(tags);

  Configuration config = new Configuration();
  config.setEntities(tags);

  return configurationRequestSender.applyConfiguration(config, null);
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:12,代码来源:ControlTagConfigurationManagerImpl.java


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