@Test public void shred() throws TTException { final InputStream input = DatabaseRepresentationTest.class .getResourceAsStream(XMLFILE); assertTrue(ASSTRUE, treetank.shred(input, CoreTestHelper.RESOURCENAME + "88")); treetank.deleteResource(CoreTestHelper.RESOURCENAME + "88"); }
public final boolean shred(final InputStream xmlInput, final String resource) throws TTException { boolean allOk; INodeWriteTrx wtx = null; IBucketWriteTrx pWtx = null; ISession session = null; boolean abort = false; try { if (!mDatabase.existsResource(resource)) { Properties properties = StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource); mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision, NODEFACTORY, METAFAC)); } session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY)); pWtx = session.beginBucketWtx(); wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling); wtx.moveTo(ROOT_NODE); final XMLShredder shredder = new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD); shredder.call(); allOk = true; } catch (final Exception exce) { abort = true; throw new JaxRxException(exce); } finally { WorkerHelper.closeWTX(abort, wtx, session); } return allOk; }
DatabaseRepresentation { public final boolean shred(final InputStream xmlInput, final String resource) throws TTException { boolean allOk; INodeWriteTrx wtx = null; IBucketWriteTrx pWtx = null; ISession session = null; boolean abort = false; try { if (!mDatabase.existsResource(resource)) { Properties properties = StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource); mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision, NODEFACTORY, METAFAC)); } session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY)); pWtx = session.beginBucketWtx(); wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling); wtx.moveTo(ROOT_NODE); final XMLShredder shredder = new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD); shredder.call(); allOk = true; } catch (final Exception exce) { abort = true; throw new JaxRxException(exce); } finally { WorkerHelper.closeWTX(abort, wtx, session); } return allOk; } }
DatabaseRepresentation { public final boolean shred(final InputStream xmlInput, final String resource) throws TTException { boolean allOk; INodeWriteTrx wtx = null; IBucketWriteTrx pWtx = null; ISession session = null; boolean abort = false; try { if (!mDatabase.existsResource(resource)) { Properties properties = StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource); mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision, NODEFACTORY, METAFAC)); } session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY)); pWtx = session.beginBucketWtx(); wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling); wtx.moveTo(ROOT_NODE); final XMLShredder shredder = new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD); shredder.call(); allOk = true; } catch (final Exception exce) { abort = true; throw new JaxRxException(exce); } finally { WorkerHelper.closeWTX(abort, wtx, session); } return allOk; } DatabaseRepresentation(final IStorage pDatabase, final IBackendFactory pStorageFac,
        final IRevisioning pRevision); }
DatabaseRepresentation { public final boolean shred(final InputStream xmlInput, final String resource) throws TTException { boolean allOk; INodeWriteTrx wtx = null; IBucketWriteTrx pWtx = null; ISession session = null; boolean abort = false; try { if (!mDatabase.existsResource(resource)) { Properties properties = StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource); mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision, NODEFACTORY, METAFAC)); } session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY)); pWtx = session.beginBucketWtx(); wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling); wtx.moveTo(ROOT_NODE); final XMLShredder shredder = new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD); shredder.call(); allOk = true; } catch (final Exception exce) { abort = true; throw new JaxRxException(exce); } finally { WorkerHelper.closeWTX(abort, wtx, session); } return allOk; } DatabaseRepresentation(final IStorage pDatabase, final IBackendFactory pStorageFac,
        final IRevisioning pRevision); void createResource(final InputStream inputStream, final String resourceName); StreamingOutput getResource(final String resourceName,
        final Map<QueryParameter, String> queryParams); StreamingOutput performQueryOnResource(final String resource, final String query,
        final Map<QueryParameter, String> otherParams); StreamingOutput getResourcesNames(); void add(final InputStream input, final String resource); void deleteResource(final String resourceName); final boolean shred(final InputStream xmlInput, final String resource); long getLastRevision(final String resourceName); OutputStream getModificHistory(final String resourceName, // NOPMD this method needs alls these
        // functions
        final String revisionRange, final boolean nodeid, final OutputStream output, final boolean wrap); void revertToRevision(final String resourceName, final long backToRevision); }
DatabaseRepresentation { public final boolean shred(final InputStream xmlInput, final String resource) throws TTException { boolean allOk; INodeWriteTrx wtx = null; IBucketWriteTrx pWtx = null; ISession session = null; boolean abort = false; try { if (!mDatabase.existsResource(resource)) { Properties properties = StandardSettings.getProps(mDatabase.getLocation().getAbsolutePath(), resource); mDatabase.createResource(new ResourceConfiguration(properties, mStorageFac, mRevision, NODEFACTORY, METAFAC)); } session = mDatabase.getSession(new SessionConfiguration(resource, StandardSettings.KEY)); pWtx = session.beginBucketWtx(); wtx = new NodeWriteTrx(session, pWtx, HashKind.Rolling); wtx.moveTo(ROOT_NODE); final XMLShredder shredder = new XMLShredder(wtx, RESTXMLShredder.createReader(xmlInput), EShredderInsert.ADDASFIRSTCHILD); shredder.call(); allOk = true; } catch (final Exception exce) { abort = true; throw new JaxRxException(exce); } finally { WorkerHelper.closeWTX(abort, wtx, session); } return allOk; } DatabaseRepresentation(final IStorage pDatabase, final IBackendFactory pStorageFac,
        final IRevisioning pRevision); void createResource(final InputStream inputStream, final String resourceName); StreamingOutput getResource(final String resourceName,
        final Map<QueryParameter, String> queryParams); StreamingOutput performQueryOnResource(final String resource, final String query,
        final Map<QueryParameter, String> otherParams); StreamingOutput getResourcesNames(); void add(final InputStream input, final String resource); void deleteResource(final String resourceName); final boolean shred(final InputStream xmlInput, final String resource); long getLastRevision(final String resourceName); OutputStream getModificHistory(final String resourceName, // NOPMD this method needs alls these
        // functions
        final String revisionRange, final boolean nodeid, final OutputStream output, final boolean wrap); void revertToRevision(final String resourceName, final long backToRevision);  }