本文整理汇总了Java中javax.jcr.Session.refresh方法的典型用法代码示例。如果您正苦于以下问题:Java Session.refresh方法的具体用法?Java Session.refresh怎么用?Java Session.refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.jcr.Session
的用法示例。
在下文中一共展示了Session.refresh方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasNodePropertyValue
import javax.jcr.Session; //导入方法依赖的package包/类
/**
* Checks if specified node property has specified value
*
* @param session Jcr session.
* @param nodePath Absolute path to node.
* @param propertyName Property name.
* @param propertyValue Property value.
* @return True if node property has specified value.
*/
public static ExpectedCondition<Boolean> hasNodePropertyValue(final Session session,
final String nodePath, final String propertyName, final String propertyValue) {
LOG.debug("Checking if node '{}' has property '{}' with value '{}'", nodePath, propertyName,
propertyValue);
return input -> {
Boolean result = null;
try {
session.refresh(true);
result = session.getNode(nodePath).getProperty(propertyName).getValue().getString()
.equals(propertyValue);
} catch (RepositoryException e) {
LOG.error(JCR_ERROR, e);
}
return result;
};
}
示例2: resetSilently
import javax.jcr.Session; //导入方法依赖的package包/类
private void resetSilently(final Session session) {
try {
session.refresh(false);
} catch (RepositoryException e) {
log.debug("Ignoring that session.refresh(false) failed", e);
}
}
示例3: nodeExist
import javax.jcr.Session; //导入方法依赖的package包/类
/**
* Checks if specified node exist.
*
* @param session Jcr session.
* @param nodePath Absolute path to node.
* @return True if node exist.
*/
public static ExpectedCondition<Boolean> nodeExist(final Session session, final String nodePath) {
LOG.debug("Checking if node '{}' exists", nodePath);
return input -> {
Boolean result = null;
try {
session.refresh(true);
result = session.nodeExists(nodePath);
} catch (RepositoryException e) {
LOG.error(JCR_ERROR, e);
}
return result;
};
}
示例4: hasNodeProperty
import javax.jcr.Session; //导入方法依赖的package包/类
/**
* Checks if node has specified property
*
* @param session Jcr session.
* @param nodePath Absolute path to node.
* @param propertyName Property name.
* @return True if node has property.
*/
public static ExpectedCondition<Boolean> hasNodeProperty(final Session session,
final String nodePath, final String propertyName) {
LOG.debug("Checking if node '{}' has property '{}'", nodePath, propertyName);
return input -> {
Boolean result = null;
try {
session.refresh(true);
result = session.getNode(nodePath).hasProperty(propertyName);
} catch (RepositoryException e) {
LOG.error(JCR_ERROR, e);
}
return result;
};
}