public String getDocument(String uri) throws BagriException { // get it as Map? DocumentAccessor doc = xRepo.getDocumentManagement().getDocument(uri, null); return doc.getContent(); }
public boolean removeDocument(String uri) { try { xRepo.getDocumentManagement().removeDocument(uri, null); return true; } catch (BagriException ex) { return false; } }
@Override public void close() throws Exception { for (ResultCursor<T> rc: results) { rc.close(); } //index = 0; // close iterators? }
private String storeDocument(String uri, String xml) { try { Properties props = new Properties(); props.setProperty(pn_document_data_format, "XML"); DocumentAccessor doc = xRepo.getDocumentManagement().storeDocument(uri, xml, props); //logger.trace("storeDocument.exit; result: {}", result); return doc.getUri(); } catch (BagriException ex) { return null; } }
private int storeDocument(String uri, String content) throws BagriException { Properties props = new Properties(); props.setProperty(pn_document_data_format, "XML"); DocumentAccessor xDoc = xRepo.getDocumentManagement().storeDocument(uri, content, props); return xDoc.getVersion(); }
DocumentAccessor storeDocument(String uri, String xml) throws Exception { return xRepo.getDocumentManagement().storeDocument(uri, xml, props); }
public void setTransactionTimeout(long timeout) throws BagriException { if (timeout < 0) { throw new BagriException("negative timeout value is not supported", BagriException.ecTransaction); } this.txTimeout = timeout; }
/** * * @return document management implementation */ public DocumentManagement getDocumentManagement() { return xRepo.getDocumentManagement(); }
/** * * @return query management implementation */ public QueryManagement getQueryManagement() { return xRepo.getQueryManagement(); }
@Override public Boolean call() throws Exception { txMgr.commitTransaction(txId); return true; }
@Override public Boolean call() throws Exception { txMgr.rollbackTransaction(txId); return true; }
IterableXQSequence(BagriXQDataFactory xqFactory, XQProcessor xqProcessor, ResultCursor<XQItemAccessor> cursor) { super(xqFactory, xqProcessor); this.cursor = cursor; this.iter = cursor.iterator(); accessed = false; }
protected void checkPermission(Permission.Value perm) throws BagriException { //repo.getXQProcessor(clientId); ((SchemaRepositoryBase) repo).setClientId(clientId); repo.getAccessManagement().checkPermission(clientId, perm); }
@Override public boolean isEmpty() { for (ResultCursor<T> cursor: results) { if (!cursor.isEmpty()) { return false; } } return true; }
void setRepository(SchemaRepository xdmRepo) { this.xdmRepo = xdmRepo; this.hState = xdmRepo.getHealthManagement().getHealthState(); xdmRepo.getHealthManagement().addHealthChangeListener(this); ((SchemaRepositoryImpl) xdmRepo).setStaticRepository(); }
@Override public boolean isComplete() { for (ResultCursor<T> cursor: results) { if (!cursor.isComplete()) { return false; } } return true; }
@Override public Integer getPartitionKey() { //if (repo != null) { // return repo.getDistributionStrategy().getDistributionHash(uri); //} return distributor.getDistributionHash(uri); }
@Override public boolean isAsynch() { for (ResultCursor<T> cursor: results) { if (cursor.isAsynch()) { return true; } } return false; }
@Override public String readDocument(String uri) throws BagriException { DocumentAccessor doc = xRepo.getDocumentManagement().getDocument(uri, null); if (doc == null) { return null; } return doc.getContent(); }
@Override public void deleteDocument(String uri) throws BagriException { xRepo.getDocumentManagement().removeDocument(uri, null); }