use of org.openntf.domino.graph2.impl.DGraph in project org.openntf.domino by OpenNTF.
the class DFramedTransactionalGraph method getFilteredElementsPartial.
public <F> Iterable<F> getFilteredElementsPartial(final String classname, final List<CharSequence> keys, final List<CaseInsensitiveString> values) {
// System.out.println("Getting a filtered list of elements of type " + classname);
org.openntf.domino.graph2.DElementStore store = null;
DGraph base = (DGraph) this.getBaseGraph();
Class<?> chkClass = getClassFromName(classname);
if (chkClass != null) {
store = base.findElementStore(chkClass);
if (store != null) {
List<String> keystrs = CaseInsensitiveString.toStrings(keys);
List<Object> valobj = new ArrayList<Object>(values);
String formulaFilter = org.openntf.domino.graph2.DGraph.Utils.getFramedElementPartialFormula(keystrs, valobj, chkClass);
Iterable<Element> elements = (org.openntf.domino.graph2.impl.DElementIterable) store.getElements(formulaFilter);
return this.frameElements(elements, null);
} else {
return null;
}
} else {
throw new IllegalArgumentException("Class " + classname + " not registered in graph");
}
}
use of org.openntf.domino.graph2.impl.DGraph in project org.openntf.domino by OpenNTF.
the class DFramedTransactionalGraph method removeEdge.
// protected <F> F getCachedElement(final Element element, final Class<F> kind) {
// if (element == null)
// return null;
// // System.out.println("TEMP DEBUG checking cache for element " + element.getId().toString());
// Object chk = getFramedElementCache().get(element);
// if (chk != null) {
// if (kind.isAssignableFrom(chk.getClass())) {
// // System.out.println("TEMP DEBUG returning from cache for element " + element.getId().toString());
// return (F) chk;
// } else {
// throw new IllegalStateException("Requested id of " + String.valueOf(element) + " is already in cache but is a "
// + chk.getClass().getName());
// }
// }
// return null;
// }
@Override
public void removeEdge(final Edge edge) {
IndexScanner is = getIndexScanner();
if (is != null) {
String mid = String.valueOf(edge.getId());
is.removeDocument(mid);
}
removeCache(edge);
((DGraph) getBaseGraph()).removeEdge(edge);
}
use of org.openntf.domino.graph2.impl.DGraph in project org.openntf.domino by OpenNTF.
the class DFramedTransactionalGraph method getKeyResolver.
public DKeyResolver getKeyResolver(final Class<?> type) {
DGraph base = (DGraph) this.getBaseGraph();
DKeyResolver result = base.getKeyResolver(type);
if (result == null) {
DConfiguration config = (DConfiguration) getConfig();
result = base.getKeyResolver(config.getDefaultVertexFrameType());
if (result == null) {
result = new DefaultKeyResolver(this);
base.addKeyResolver(result);
}
}
return result;
}
use of org.openntf.domino.graph2.impl.DGraph in project org.openntf.domino by OpenNTF.
the class DFramedTransactionalGraph method removeVertex.
@Override
public void removeVertex(final Vertex vertex) {
IndexScanner is = getIndexScanner();
if (is != null) {
String mid = String.valueOf(vertex.getId());
is.removeDocument(mid);
}
removeCache(vertex);
((DGraph) getBaseGraph()).removeVertex(vertex);
}
use of org.openntf.domino.graph2.impl.DGraph in project org.openntf.domino by OpenNTF.
the class DFramedTransactionalGraph method getVertex.
public <F> F getVertex(final Class<F> kind, final Object context, final Object... args) {
DGraph base = (DGraph) this.getBaseGraph();
org.openntf.domino.graph2.DElementStore store = base.findElementStore(kind);
Object id = store.getIdentity(kind, context, args);
return getVertex(id, kind);
}
Aggregations