Package org.postgresql.pljava.internal
Class VarlenaWrapper.Verifier.NoOp
java.lang.Object
org.postgresql.pljava.internal.VarlenaWrapper.Verifier
org.postgresql.pljava.internal.VarlenaWrapper.Verifier.NoOp
- Enclosing class:
VarlenaWrapper.Verifier
A Verifier that accepts any content, cheaply.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.postgresql.pljava.internal.VarlenaWrapper.Verifier
VarlenaWrapper.Verifier.Base, VarlenaWrapper.Verifier.NoOp
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancel this verifier.void
finish()
Wait for the verify task and rethrow any exception it might have thrown.schedule()
Set up theverify
method to be executed in another thread.void
update
(InputStream is) Send the nextInputStream
of content to be verified.void
update
(org.postgresql.pljava.internal.VarlenaWrapper.Output.State state, ByteBuffer bb) Convenience method that callsflip()
on a byte buffer, wraps it in aBufferWrapper
, and passes it toVarlenaWrapper.Verifier.update(java.io.InputStream)
.Methods inherited from class org.postgresql.pljava.internal.VarlenaWrapper.Verifier
call, verify
-
Field Details
-
INSTANCE
-
-
Method Details
-
schedule
Description copied from class:VarlenaWrapper.Verifier
Set up theverify
method to be executed in another thread.- Overrides:
schedule
in classVarlenaWrapper.Verifier
- Returns:
- This
Verifier
object.
-
update
Description copied from class:VarlenaWrapper.Verifier
Send the nextInputStream
of content to be verified.It is assumed, but not checked here, that any
InputStream
supplied to this method supportsmark
andreset
efficiently.If the verifier has already thrown an exception, it will be rethrown here in the current thread.
- Overrides:
update
in classVarlenaWrapper.Verifier
- Parameters:
is
- InputStream representing the next range of bytes to be verified.- Throws:
SQLException
- if a verification error has already been detected, the verifier has been cancelled, etc.
-
update
public void update(org.postgresql.pljava.internal.VarlenaWrapper.Output.State state, ByteBuffer bb) throws SQLException Description copied from class:VarlenaWrapper.Verifier
Convenience method that callsflip()
on a byte buffer, wraps it in aBufferWrapper
, and passes it toVarlenaWrapper.Verifier.update(java.io.InputStream)
.Note that the
NoOp
version of this method does none of that; in particular, the byte buffer will not have been flipped. This should not be a problem, as the thread passing the buffer to this method had better make no further use of it anyway.- Overrides:
update
in classVarlenaWrapper.Verifier
- Parameters:
state
- The state object protecting the native memory.bb
- Byte buffer containing next range of content to verify.- Throws:
SQLException
- if a verification error has already been detected, the verifier has been cancelled, etc.
-
finish
Description copied from class:VarlenaWrapper.Verifier
Wait for the verify task and rethrow any exception it might have thrown.- Overrides:
finish
in classVarlenaWrapper.Verifier
- Throws:
SQLException
- any exception thrown by the verify method, or for unexpected conditions such as interruption while waiting.
-
cancel
Description copied from class:VarlenaWrapper.Verifier
Cancel this verifier.- Overrides:
cancel
in classVarlenaWrapper.Verifier
- Throws:
SQLException
-