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


Java ForeignSource.updateDateStamp方法代码示例

本文整理汇总了Java中org.opennms.netmgt.provision.persist.foreignsource.ForeignSource.updateDateStamp方法的典型用法代码示例。如果您正苦于以下问题:Java ForeignSource.updateDateStamp方法的具体用法?Java ForeignSource.updateDateStamp怎么用?Java ForeignSource.updateDateStamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opennms.netmgt.provision.persist.foreignsource.ForeignSource的用法示例。


在下文中一共展示了ForeignSource.updateDateStamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDetector

import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
 * <p>addDetector</p>
 *
 * @param foreignSource a {@link java.lang.String} object.
 * @param detector a {@link org.opennms.netmgt.provision.persist.foreignsource.DetectorWrapper} object.
 * @return a {@link javax.ws.rs.core.Response} object.
 */
@POST
@Path("{foreignSource}/detectors")
@Consumes(MediaType.APPLICATION_XML)
@Transactional
public Response addDetector(@PathParam("foreignSource") String foreignSource, DetectorWrapper detector) {
    writeLock();
    try {
        debug("addDetector: Adding detector " + detector.getName());
        ForeignSource fs = getActiveForeignSource(foreignSource);
        fs.updateDateStamp();
        fs.addDetector(detector);
        m_pendingForeignSourceRepository.save(fs);
        return Response.seeOther(getRedirectUri(m_uriInfo, detector.getName())).build();
    } finally {
        writeUnlock();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:25,代码来源:ForeignSourceRestService.java

示例2: addPolicy

import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
 * <p>addPolicy</p>
 *
 * @param foreignSource a {@link java.lang.String} object.
 * @param policy a {@link org.opennms.netmgt.provision.persist.foreignsource.PolicyWrapper} object.
 * @return a {@link javax.ws.rs.core.Response} object.
 */
@POST
@Path("{foreignSource}/policies")
@Consumes(MediaType.APPLICATION_XML)
@Transactional
public Response addPolicy(@PathParam("foreignSource") String foreignSource, PolicyWrapper policy) {
    writeLock();
    try {
        debug("addPolicy: Adding policy %s", policy.getName());
        ForeignSource fs = getActiveForeignSource(foreignSource);
        fs.updateDateStamp();
        fs.addPolicy(policy);
        m_pendingForeignSourceRepository.save(fs);
        return Response.seeOther(getRedirectUri(m_uriInfo, policy.getName())).build();
    } finally {
        writeUnlock();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:25,代码来源:ForeignSourceRestService.java

示例3: deleteDetector

import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
 * <p>deleteDetector</p>
 *
 * @param foreignSource a {@link java.lang.String} object.
 * @param detector a {@link java.lang.String} object.
 * @return a {@link javax.ws.rs.core.Response} object.
 */
@DELETE
@Path("{foreignSource}/detectors/{detector}")
@Transactional
public Response deleteDetector(@PathParam("foreignSource") String foreignSource, @PathParam("detector") String detector) {
    writeLock();
    try {
        ForeignSource fs = getActiveForeignSource(foreignSource);
        List<PluginConfig> detectors = fs.getDetectors();
        PluginConfig removed = removeEntry(detectors, detector);
        if (removed != null) {
            fs.updateDateStamp();
            fs.setDetectors(detectors);
            m_pendingForeignSourceRepository.save(fs);
            return Response.ok().build();
        }
        return Response.notModified().build();
    } finally {
        writeUnlock();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:28,代码来源:ForeignSourceRestService.java

示例4: deletePolicy

import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
 * <p>deletePolicy</p>
 *
 * @param foreignSource a {@link java.lang.String} object.
 * @param policy a {@link java.lang.String} object.
 * @return a {@link javax.ws.rs.core.Response} object.
 */
@DELETE
@Path("{foreignSource}/policies/{policy}")
@Transactional
public Response deletePolicy(@PathParam("foreignSource") String foreignSource, @PathParam("policy") String policy) {
    writeLock();
    try {
        ForeignSource fs = getActiveForeignSource(foreignSource);
        List<PluginConfig> policies = fs.getPolicies();
        PluginConfig removed = removeEntry(policies, policy);
        if (removed != null) {
            fs.updateDateStamp();
            fs.setPolicies(policies);
            m_pendingForeignSourceRepository.save(fs);
            return Response.ok().build();
        }
        return Response.notModified().build();
    } finally {
        writeUnlock();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:28,代码来源:ForeignSourceRestService.java

示例5: updateForeignSource

import org.opennms.netmgt.provision.persist.foreignsource.ForeignSource; //导入方法依赖的package包/类
/**
 * <p>updateForeignSource</p>
 *
 * @param foreignSource a {@link java.lang.String} object.
 * @param params a {@link org.opennms.web.rest.MultivaluedMapImpl} object.
 * @return a {@link javax.ws.rs.core.Response} object.
 */
@PUT
@Path("{foreignSource}")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Transactional
public Response updateForeignSource(@PathParam("foreignSource") String foreignSource, MultivaluedMapImpl params) {
    writeLock();
    try {
        ForeignSource fs = getActiveForeignSource(foreignSource);
        debug("updateForeignSource: updating foreign source %s", foreignSource);
        
        if (params.isEmpty()) return Response.seeOther(getRedirectUri(m_uriInfo)).build();

        final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(fs);
        wrapper.registerCustomEditor(Duration.class, new StringIntervalPropertyEditor());
        for(final String key : params.keySet()) {
            if (wrapper.isWritableProperty(key)) {
                Object value = null;
                String stringValue = params.getFirst(key);
                value = wrapper.convertIfNecessary(stringValue, (Class<?>)wrapper.getPropertyType(key));
                wrapper.setPropertyValue(key, value);
            }
        }
        debug("updateForeignSource: foreign source %s updated", foreignSource);
        fs.updateDateStamp();
        m_pendingForeignSourceRepository.save(fs);
        return Response.seeOther(getRedirectUri(m_uriInfo)).build();
    } finally {
        writeUnlock();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:38,代码来源:ForeignSourceRestService.java


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