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


Java ForeignSource.isDefault方法代码示例

本文整理汇总了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);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:23,代码来源:FusedForeignSourceRepository.java

示例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;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:9,代码来源:DefaultForeignSourceService.java

示例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;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:30,代码来源:ProvisioningGroupsController.java

示例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;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:ForeignSourceRestService.java


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