oracle.xml.binxml

## Class DBBinXMLMetadataProviderImpl

- java.lang.Object
- - oracle.xml.binxml.DBBinXMLMetadataProviderImpl

All Implemented Interfaces:
  BinXMLMetadataProvider, DBBinXMLMetadataProvider

    public class DBBinXMLMetadataProviderImpl
    extends java.lang.Object
    implements DBBinXMLMetadataProvider

Since:
  release specific (what release of product did this appear in)

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `associateDataConnection(java.sql.Connection dataconn)` Associates a data connection with DBBinXMLMetadataProvider.
`java.io.Reader` `getCompiledSchema(BinXMLVocabId schemaId)` Fetches the schema as a binary stream from the metadata repository based on the vocabulary id.
`java.io.Reader` `getCompiledSchema(java.lang.String schemaURL)` Fetches the schema as a binary stream from the metadata repository based on the schema URL.
`BinXMLStream` `getDTD(BinXMLVocabId dtdId)` Fetches the DTD as a binary stream from the metadata repository based on the vocabulary id.
`BinXMLStream` `getDTD(java.lang.String dtdURL)` Fetches the DTD as a binary stream from the metadata repository based on the DTD URL.
`BinXMLStream` `getTokenSet(long tokenId)` Fetches the Token Set as a binary stream in the metadata repository based on the input token id.
`BinXMLStream` `getTokenSet(long tokenId, boolean isNS)` Fetches the Token Set as a binary stream in the metadata repository based on the namespace of the input token Id.
`boolean` `isSchemaAnnotationAvailable()` Specifies whether the repository performs schema annotations or not.
`BinXMLVocabId` `saveCompiledSchema(java.lang.String schemaURL)` Saves the compiled schema as a binary stream in the metadata repository.
`BinXMLVocabId` `saveDTD(java.lang.String dtdURL)` Saves the DTD as a binary stream in the metadata repository.
`BinXMLVocabId` `saveSchema(java.lang.String sschema)` The repository accepts a non-annotated schema, annotates it and saves it as a binary stream in the metadata repository.
`BinXMLVocabId` `saveTokenSet(java.lang.String namespaceURL)` Saves the Token Set as a binary stream in the metadata repository.
`void` `setConnection(java.sql.Connection metadataconn)` Sets connection to be used by DBBinXMLMetaDataProvider
`void` `setConnectionPool(oracle.jdbc.pool.OracleDataSource connpool)` For OCI connection TODO: mv to Oracle DB subclass
`void` `setConnStr(java.lang.String connstr, java.lang.String usr, java.lang.String passwd)` For Thin connection
`void` `setDriver(java.sql.Driver driver)` Specify database driver to be used by DBBinXMLMetadataProvider
`void` `setGUID(byte[] guid)`
`void` `setURL(java.net.URL http, java.lang.String usrname, java.lang.String passwd)` For HTTP communication only or OCI driver?

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface oracle.xml.binxml.BinXMLMetadataProvider

`getTokenSet`

### Method Detail

#### setConnection

    public void setConnection(java.sql.Connection metadataconn)
                       throws BinXMLException,
                              java.sql.SQLException

Description copied from interface: `DBBinXMLMetadataProvider`
Sets connection to be used by DBBinXMLMetaDataProvider

Specified by:
  `setConnection` in interface `DBBinXMLMetadataProvider`
Parameters:
  `metadataconn` - This connection is used to store and retrieve metadata by a DBBinXMLMetadataProvider. If the associateDataConnection method is not called, this connection will also be used to store and retrieve binary data from the database.
Throws:
  `BinXMLException` - Raised for any non-SQL related errors
  `java.sql.SQLException` - Raised for any SQL related errors

#### setConnectionPool

    public void setConnectionPool(oracle.jdbc.pool.OracleDataSource connpool)
                           throws BinXMLException,
                                  java.sql.SQLException

For OCI connection TODO: mv to Oracle DB subclass

Specified by:
  `setConnectionPool` in interface `DBBinXMLMetadataProvider`
Parameters:
  `connpool` - OracleDataSource for metadata retrieval
Throws:
  `BinXMLException` - Raised for any non-SQL related errors
  `java.sql.SQLException` - Raised for any SQL related errors

#### setDriver

    public void setDriver(java.sql.Driver driver)

Description copied from interface: `DBBinXMLMetadataProvider`
Specify database driver to be used by DBBinXMLMetadataProvider

Specified by:
  `setDriver` in interface `DBBinXMLMetadataProvider`
Parameters:
  `driver` - user specified driver

#### setURL

    public void setURL(java.net.URL http,
                       java.lang.String usrname,
                       java.lang.String passwd)
                throws BinXMLException,
                       java.sql.SQLException

For HTTP communication only or OCI driver? Answer from XDB: Planned, for HTTP communication only Rename it to setOCIURL()? TODO: mv to Oracle DB subclass?

Specified by:
  `setURL` in interface `DBBinXMLMetadataProvider`
Parameters:
  `http` - URL for connection
  `usrname` - user name
  `passwd` - password for user
Throws:
  `BinXMLException` - Raised for any non-SQL related errors
  `java.sql.SQLException` - Raised for any SQL related errors

#### setConnStr

    public void setConnStr(java.lang.String connstr,
                           java.lang.String usr,
                           java.lang.String passwd)
                    throws BinXMLException,
                           java.sql.SQLException

For Thin connection

Specified by:
  `setConnStr` in interface `DBBinXMLMetadataProvider`
Parameters:
  `connstr` - connection string
  `usr` - user name
  `passwd` - password for user
Throws:
  `BinXMLException` - Raised for any non-SQL related errors
  `java.sql.SQLException` - Raised for any SQL related errors

#### associateDataConnection

    public void associateDataConnection(java.sql.Connection dataconn)
                                 throws BinXMLException

Description copied from interface: `DBBinXMLMetadataProvider`
Associates a data connection with DBBinXMLMetadataProvider. May be called more than once for associating multiple data connections. If this API is not called, then data is stored and retrieved using the Connection specified by setConnection().

Specified by:
  `associateDataConnection` in interface `DBBinXMLMetadataProvider`
Parameters:
  `dataconn` - JDBC connection used for storage and retrieval of Binary XML data.
Throws:
  `BinXMLException` - Raised for any errors encountered

#### isSchemaAnnotationAvailable

    public boolean isSchemaAnnotationAvailable()
                                        throws BinXMLException

Specifies whether the repository performs schema annotations or not. DBBinXMLMetadataProvider) will return true The Binary XML Processor calls this API to determine whether to call saveSchema for registering a schema in the repository where the annotations are performed by the repository or call saveCompiledSchema for saving a already annotated schema to the repository.

Specified by:
  `isSchemaAnnotationAvailable` in interface `BinXMLMetadataProvider`
Returns:
  always returns true since XDB supports schema annotations while saving
Throws:
  `BinXMLException`

#### getCompiledSchema

    public java.io.Reader getCompiledSchema(BinXMLVocabId schemaId)
                                     throws BinXMLException

Fetches the schema as a binary stream from the metadata repository based on the vocabulary id.

Specified by:
  `getCompiledSchema` in interface `BinXMLMetadataProvider`
Parameters:
  `schemaId` - - vocabulary id of the schema to be fetched
Returns:
  binary stream version of the compiled schema doc
Throws:
  `BinXMLException`

#### getCompiledSchema

    public java.io.Reader getCompiledSchema(java.lang.String schemaURL)
                                     throws BinXMLException

Fetches the schema as a binary stream from the metadata repository based on the schema URL.

Specified by:
  `getCompiledSchema` in interface `BinXMLMetadataProvider`
Parameters:
  `schemaURL` - - URL of the schema to be fetched
Returns:
  binary stream version of the compiled schema doc
Throws:
  `BinXMLException`

#### saveSchema

    public BinXMLVocabId saveSchema(java.lang.String sschema)
                             throws BinXMLException

The repository accepts a non-annotated schema, annotates it and saves it as a binary stream in the metadata repository.

Specified by:
  `saveSchema` in interface `BinXMLMetadataProvider`
Parameters:
  `sschema` - - String of the schema to be saved
Returns:
  the vocabulary id of the saved schema
Throws:
  `BinXMLException`

#### saveCompiledSchema

    public BinXMLVocabId saveCompiledSchema(java.lang.String schemaURL)
                                     throws BinXMLException

Saves the compiled schema as a binary stream in the metadata repository.

Specified by:
  `saveCompiledSchema` in interface `BinXMLMetadataProvider`
Parameters:
  `schemaURL` - - URL of the schema to be saved
Returns:
  the vocabulary id saved schema
Throws:
  `BinXMLException`

#### getDTD

    public BinXMLStream getDTD(BinXMLVocabId dtdId)
                        throws BinXMLException

Fetches the DTD as a binary stream from the metadata repository based on the vocabulary id.

Specified by:
  `getDTD` in interface `BinXMLMetadataProvider`
Parameters:
  `dtdId` - - vocabulary id of the DTD to be fetched
Returns:
  binary stream version of the DTD
Throws:
  `BinXMLException`

#### getDTD

    public BinXMLStream getDTD(java.lang.String dtdURL)
                        throws BinXMLException

Fetches the DTD as a binary stream from the metadata repository based on the DTD URL.

Specified by:
  `getDTD` in interface `BinXMLMetadataProvider`
Parameters:
  `dtdURL` - - URL of the DTD to be fetched
Returns:
  binary stream version of the DTD
Throws:
  `BinXMLException`

#### saveDTD

    public BinXMLVocabId saveDTD(java.lang.String dtdURL)
                          throws BinXMLException

Saves the DTD as a binary stream in the metadata repository.

Specified by:
  `saveDTD` in interface `BinXMLMetadataProvider`
Parameters:
  `dtdURL` - - URL of the DTD to be saved
Returns:
  the vocabulary id of the DTD to be saved
Throws:
  `BinXMLException`

#### getTokenSet

    public BinXMLStream getTokenSet(long tokenId)
                             throws BinXMLException

Description copied from interface: `BinXMLMetadataProvider`
Fetches the Token Set as a binary stream in the metadata repository based on the input token id.

Specified by:
  `getTokenSet` in interface `BinXMLMetadataProvider`
Parameters:
  `tokenId` - - token Id contained in the Token Set to be fetched
Returns:
  getTokenSet(tokenId, false);
Throws:
  `BinXMLException`

#### getTokenSet

    public BinXMLStream getTokenSet(long tokenId,
                                    boolean isNS)
                             throws BinXMLException

Fetches the Token Set as a binary stream in the metadata repository based on the namespace of the input token Id.

Specified by:
  `getTokenSet` in interface `BinXMLMetadataProvider`
Parameters:
  `tokenId` - - token Id contained in the Token Set to be fetched
  `isNS` - - if this token is a namespace decl, then true, otherwise false
Returns:
  binary stream version of the Token Set
Throws:
  `BinXMLException`

#### saveTokenSet

    public BinXMLVocabId saveTokenSet(java.lang.String namespaceURL)
                               throws BinXMLException

Saves the Token Set as a binary stream in the metadata repository.

Specified by:
  `saveTokenSet` in interface `BinXMLMetadataProvider`
Parameters:
  `namespaceURL` - - namespace URL of the Token Set to be saved
Returns:
  vocabulary id of the Token Set saved in the metadata repository
Throws:
  `BinXMLException`

#### setGUID

    public void setGUID(byte[] guid)

Copyright © 2003, 2020, Oracle and/or its affiliates.