Class MemorySailStore.MemorySailSink

    • Field Detail

      • closed

        private volatile boolean closed
      • explicit

        private final boolean explicit
      • serializable

        private final int serializable
      • nextSnapshot

        private int nextSnapshot
      • txnLock

        private volatile boolean txnLock
      • requireCleanup

        private boolean requireCleanup
    • Constructor Detail

    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • close

        public void close()
        Description copied from interface: SailClosable
        Closes this resource, relinquishing any underlying resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface SailClosable
      • releaseLock

        private void releaseLock()
      • setNamespace

        public void setNamespace​(java.lang.String prefix,
                                 java.lang.String name)
        Description copied from interface: SailSink
        Sets the prefix for a namespace.
        Specified by:
        setNamespace in interface SailSink
        Parameters:
        prefix - The new prefix, or an empty string in case of the default namespace.
        name - The namespace name that the prefix maps to.
      • removeNamespace

        public void removeNamespace​(java.lang.String prefix)
        Description copied from interface: SailSink
        Removes a namespace declaration by removing the association between a prefix and a namespace name.
        Specified by:
        removeNamespace in interface SailSink
        Parameters:
        prefix - The namespace prefix, or an empty string in case of the default namespace.
      • clearNamespaces

        public void clearNamespaces()
        Description copied from interface: SailSink
        Removes all namespace declarations from this SailSource.
        Specified by:
        clearNamespaces in interface SailSink
      • observe

        public void observe​(Resource subj,
                            IRI pred,
                            Value obj,
                            Resource... contexts)
                     throws SailException
        Description copied from interface: SailSink
        Called to indicate matching statements have been observed and must not change their state until after this SailSink is committed, iff this was opened in an isolation level compatible with IsolationLevels.SERIALIZABLE.
        Specified by:
        observe in interface SailSink
        Parameters:
        subj - A Resource specifying the subject, or null for a wildcard.
        pred - A IRI specifying the predicate, or null for a wildcard.
        obj - A Value specifying the object, or null for a wildcard.
        contexts - The context(s) of the observed statements. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on all contexts.
        Throws:
        SailException - If the triple source failed to observe these statements.
      • clear

        public void clear​(Resource... contexts)
        Description copied from interface: SailSink
        Removes all statements from the specified/all contexts. If no contexts are specified the method operates on the entire repository.
        Specified by:
        clear in interface SailSink
        Parameters:
        contexts - The context(s) from which to remove the statements. Note that this parameter is a vararg and as such is optional. If no contexts are specified the method operates on the entire repository. A null value can be used to match context-less statements.
      • approve

        public void approve​(Resource subj,
                            IRI pred,
                            Value obj,
                            Resource ctx)
        Description copied from interface: SailSink
        Adds a statement to the store.
        Specified by:
        approve in interface SailSink
        Parameters:
        subj - The subject of the statement to add.
        pred - The predicate of the statement to add.
        obj - The object of the statement to add.
        ctx - The context to add the statement to.
      • deprecate

        public void deprecate​(Statement statement)
                       throws SailException
        Description copied from interface: SailSink
        Removes a statement.
        Specified by:
        deprecate in interface SailSink
        Parameters:
        statement - The statement that should be removed
        Throws:
        SailException - If the statement could not be removed, for example because no transaction is active.
      • innerDeprecate

        private void innerDeprecate​(Statement statement,
                                    int nextSnapshot)
      • statementAlreadyExists

        private boolean statementAlreadyExists​(boolean explicit,
                                               MemResource memSubj,
                                               MemIRI memPred,
                                               MemValue memObj,
                                               MemResource memContext,
                                               int nextSnapshot)
                                        throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • deprecateByQuery

        public boolean deprecateByQuery​(Resource subj,
                                        IRI pred,
                                        Value obj,
                                        Resource[] contexts)
        Description copied from interface: SailSink
        Removes all statements with the specified subject, predicate, object, and context. All four parameters may be null.
        Specified by:
        deprecateByQuery in interface SailSink