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