use of org.jowidgets.cap.common.api.bean.IBeanKey in project jo-client-platform by jo-source.
the class SyncNeo4JSimpleTraversalReaderServiceImpl method getAllRelatedBeans.
private Set<? extends BEAN_TYPE> getAllRelatedBeans(final List<? extends IBeanKey> parentBeans, final PARAM_TYPE parameter, final IExecutionCallback executionCallback) {
final Set<BEAN_TYPE> result = new LinkedHashSet<BEAN_TYPE>();
for (final IBeanKey beanKey : parentBeans) {
CapServiceToolkit.checkCanceled(executionCallback);
final Node parentNode = NodeAccess.findNode(parentBeanTypeId, beanKey.getId());
if (parentNode != null) {
for (final TraversalDescription traversalDescription : traversalDescriptions) {
for (final Node resultNode : traversalDescription.traverse(parentNode).nodes()) {
CapServiceToolkit.checkCanceled(executionCallback);
if (resultNode.hasProperty(beanTypePropertyName) && beanTypeIdString.equals(resultNode.getProperty(beanTypePropertyName))) {
result.add(beanFactory.createNodeBean(beanType, beanTypeId, resultNode));
}
}
}
}
}
return result;
}
use of org.jowidgets.cap.common.api.bean.IBeanKey in project jo-client-platform by jo-source.
the class Neo4JBeanAccessImpl method getBeans.
@Override
public List<BEAN_TYPE> getBeans(final Collection<? extends IBeanKey> keys, final IExecutionCallback executionCallback) {
Assert.paramNotNull(keys, "keys");
final List<BEAN_TYPE> result = new LinkedList<BEAN_TYPE>();
for (final IBeanKey key : keys) {
CapServiceToolkit.checkCanceled(executionCallback);
final BEAN_TYPE bean = findBean(key.getId());
if (bean != null) {
result.add(bean);
}
}
return result;
}
use of org.jowidgets.cap.common.api.bean.IBeanKey in project jo-client-platform by jo-source.
the class SyncDeleterService method delete.
@Override
public void delete(final Collection<? extends IBeanKey> keys, final IExecutionCallback executionCallback) {
for (final IBeanKey key : keys) {
final IBean bean = data.getData(key.getId());
if (!allowDeletedData && bean == null) {
throw new DeletedBeanException(key.getId());
}
if (!allowStaleData && bean != null && bean.getVersion() != key.getVersion()) {
throw new StaleBeanException(key.getId());
}
data.deleteData(key.getId());
}
}
use of org.jowidgets.cap.common.api.bean.IBeanKey in project jo-client-platform by jo-source.
the class BeanRepositoryBeanAccess method getBeans.
@Override
public List<BEAN_TYPE> getBeans(final Collection<? extends IBeanKey> keys, final IExecutionCallback executionCallback) {
final List<BEAN_TYPE> result = new LinkedList<BEAN_TYPE>();
for (final IBeanKey key : keys) {
final BEAN_TYPE bean = repository.find(key.getId(), executionCallback);
if (bean != null) {
result.add(bean);
}
CapServiceToolkit.checkCanceled(executionCallback);
}
return result;
}
use of org.jowidgets.cap.common.api.bean.IBeanKey in project jo-client-platform by jo-source.
the class CachedBeanListReaderService method addBeans.
void addBeans(final List<? extends IBeanKey> parentBeanKeys, final Set<IBeanProxy<BEAN_TYPE>> beans) {
if (!useCache) {
return;
}
final IBeanKey parentBeanKey = getParentBeanKey(parentBeanKeys);
ReadCacheEntry readCacheEntry = readCache.get(parentBeanKey);
if (readCacheEntry == null) {
readCacheEntry = new ReadCacheEntry(beans);
readCache.put(parentBeanKey, readCacheEntry);
} else {
readCacheEntry.addBeans(beans);
}
}
Aggregations