Interface Verifier

All Known Subinterfaces:
Verifier.OfBuffer, Verifier.OfStream

public interface Verifier
A Verifier verifies the proper form of content written to a Datum.

This is necessary only when the correctness of the written stream may be doubtful, as when an API spec requires exposing a method for client code to write arbitrary bytes. If a type implementation exposes only type-appropriate operations to client code, and always controls the byte stream written to the varlena, the NOOP verifier can be used.

There are no methods accepting an unextended Verifier, only those accepting one of its contained functional interfaces OfBuffer and OfStream.

A type-specific verifier must supply a verify method that reads all of the content and completes normally if it is a complete and well-formed representation of the type. Otherwise, it must throw an exception.

An OfBuffer verifier must leave the buffer's position equal to the value of the buffer's limit when the verifier was entered. An OfStream verifier must leave the stream at end of input. An OfStream verifier may assume that the supplied InputStream supports mark and reset efficiently.

An OfStream verifier may execute in another thread concurrently with the writing of the content by the adapter. Its verify method must not interact with PostgreSQL.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A verifier interface to be used when the ByteBuffer API provides the most natural interface for manipulating the content.
    static interface 
    A verifier interface to be used when the InputStream API provides the most natural interface for manipulating the content.