本文整理汇总了Java中org.opennms.netmgt.provision.persist.foreignsource.ForeignSource.isDefault方法的典型用法代码示例。如果您正苦于以下问题:Java ForeignSource.isDefault方法的具体用法?Java ForeignSource.isDefault怎么用?Java ForeignSource.isDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.provision.persist.foreignsource.ForeignSource
的用法示例。
在下文中一共展示了ForeignSource.isDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanUpDeployedForeignSources
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
private synchronized void cleanUpDeployedForeignSources(String foreignSourceName) {
ForeignSource deployed = m_deployedForeignSourceRepository.getForeignSource(foreignSourceName);
ForeignSource pending = m_pendingForeignSourceRepository.getForeignSource(foreignSourceName);
if (pending.isDefault()) {
// if pending is default, assume deployed is valid, be it default or otherwise
m_pendingForeignSourceRepository.delete(pending);
} else {
if (deployed.isDefault()) {
// if pending is not default, and deployed is, assume pending should override deployed
m_deployedForeignSourceRepository.save(pending);
} else {
// otherwise, compare dates, pending updates deployed if it's timestamp is newer
Date pendingDate = pending.getDateStampAsDate();
Date deployedDate = deployed.getDateStampAsDate();
if (!deployedDate.after(pendingDate)) {
m_deployedForeignSourceRepository.save(pending);
}
}
}
m_pendingForeignSourceRepository.delete(pending);
}
示例2: getForeignSource
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/** {@inheritDoc} */
public ForeignSource getForeignSource(String name) {
ForeignSource fs = m_pendingForeignSourceRepository.getForeignSource(name);
if (fs.isDefault()) {
return m_deployedForeignSourceRepository.getForeignSource(name);
}
return fs;
}
示例3: referenceData
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected Map<String,Object> referenceData(HttpServletRequest request) throws Exception {
Map<String, Object> refData = new HashMap<String, Object>();
Set<String> names = new TreeSet<String>();
Map<String,Requisition> groups = new TreeMap<String,Requisition>();
Map<String,ForeignSource> foreignSources = new TreeMap<String,ForeignSource>();
for (Requisition mi : m_provisioningService.getAllGroups()) {
if(mi != null){
names.add(mi.getForeignSource());
groups.put(mi.getForeignSource(), mi);
}
}
for (ForeignSource fs : m_foreignSourceService.getAllForeignSources()) {
if (!fs.isDefault()) {
names.add(fs.getName());
foreignSources.put(fs.getName(), fs);
}
}
refData.put("foreignSourceNames", names);
refData.put("groups", groups);
refData.put("foreignSources", foreignSources);
refData.put("dbNodeCounts", m_provisioningService.getGroupDbNodeCounts());
return refData;
}
示例4: getActiveForeignSource
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
private ForeignSource getActiveForeignSource(String foreignSourceName) {
ForeignSource fs = m_pendingForeignSourceRepository.getForeignSource(foreignSourceName);
if (fs.isDefault()) {
return m_deployedForeignSourceRepository.getForeignSource(foreignSourceName);
}
return fs;
}