本文整理汇总了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());
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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<>();
}
示例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);
}