本文整理汇总了Java中org.opennms.netmgt.provision.persist.foreignsource.ForeignSource.setDefault方法的典型用法代码示例。如果您正苦于以下问题:Java ForeignSource.setDefault方法的具体用法?Java ForeignSource.setDefault怎么用?Java ForeignSource.setDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.provision.persist.foreignsource.ForeignSource
的用法示例。
在下文中一共展示了ForeignSource.setDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cloneForeignSource
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/** {@inheritDoc} */
public ForeignSource cloneForeignSource(String name, String target) {
ForeignSource fs = getForeignSource(name);
fs.setDefault(false);
fs.setName(target);
m_deployedForeignSourceRepository.save(fs);
m_pendingForeignSourceRepository.delete(fs);
return m_deployedForeignSourceRepository.getForeignSource(target);
}
示例2: getDefaultForeignSource
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
* <p>getDefaultForeignSource</p>
*
* @return a {@link org.opennms.netmgt.provision.persist.foreignsource.ForeignSource} object.
* @throws org.opennms.netmgt.provision.persist.ForeignSourceRepositoryException if any.
*/
public ForeignSource getDefaultForeignSource() throws ForeignSourceRepositoryException {
Resource defaultForeignSource = new ClassPathResource("/default-foreign-source.xml");
if (!defaultForeignSource.exists()) {
defaultForeignSource = new ClassPathResource("/org/opennms/netmgt/provision/persist/default-foreign-source.xml");
}
final ForeignSource fs = JaxbUtils.unmarshal(ForeignSource.class, defaultForeignSource);
fs.setDefault(true);
return fs;
}
示例3: putDefaultForeignSource
import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
public void putDefaultForeignSource(final ForeignSource foreignSource) throws ForeignSourceRepositoryException {
if (foreignSource == null) {
throw new ForeignSourceRepositoryException("foreign source was null");
}
foreignSource.setDefault(true);
foreignSource.setName("default");
save(foreignSource);
}