com.sap.conn.jco

## Interface JCoRepository

- All Known Subinterfaces:
    JCoCustomRepository

      public interface JCoRepository

  The meta data repositories are needed to get the technical description of functions and parameters used for fulfilling RFC calls. This interface covers the implementation of basic repository functionality such as caching and the persistence of meta data. The `JCoCustomRepository` serves as a base interface for more elaborate repositories.
  To fetch the meta data at runtime from a backend system use the `JCoRepository` instance returned by a JCoDestination. Keep in mind, that the functions and parameter definitions are always the same inside of one cluster of SAP application server hosts, but can differ from other clusters.
  See Also:
    `JCoCustomRepository`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear allows to empty both the function template cache as well as the record metadata cache completely.
    `String[]` | `getCachedClassMetaDataNames()` Returns the names of the cached classes as a string array.
    `String[]` | `getCachedFunctionTemplateNames()` Returns the names of the cached functions as a string array.
    `String[]` | `getCachedRecordMetaDataNames()` Returns the names of the cached structures as a string array.
    `JCoClassMetaData` | `getClassMetaData(String className)` Returns the meta data for the passed class/interface name.
    `JCoFunction` | `getFunction(String functionName)` Returns a JCoFunction with initial parameters for the passed function name.
    `JCoListMetaData` | `getFunctionInterface(String functionName)` Returns the meta data for the passed function.
    `JCoFunctionTemplate` | `getFunctionTemplate(String functionName)` Returns the template for the passed function.
    `JCoRepositoryMonitor` | `getMonitor()` Returns a new created or available monitor instance for the repository.
    `String` | `getName()` Returns the repository name.
    `JCoRecordMetaData` | `getRecordMetaData(String recordName)` Returns the meta data for the passed structure/table name.
    `JCoRequest` | `getRequest(String functionName)` Returns a JCoRequest with initial parameters for the passed function name.
    `JCoRecordMetaData` | `getStructureDefinition(String structureName)` Returns the meta data for the passed structure/table name.
    `boolean` | `isUnicode()` Returns whether the repository contains both Unicode and Non-Unicode metadata.
    `void` | `load(Reader reader)` Loads the repository from the given reader.
    `void` | `removeClassMetaDataFromCache(String className)` Removes a class meta data instance from the local cache.
    `void` | `removeFunctionTemplateFromCache(String functionName)` Removes a function template from the local cache.
    `void` | `removeRecordMetaDataFromCache(String recordName)` Removes a record meta data from the local cache.
    `void` | `save(Writer writer)` Saves this repository using the given writer. This method does not close the given writer.

- - ### Method Detail

    - #### getName

          String getName()

      Returns the repository name.
      Returns:
        the name of the repository

    - #### getFunctionTemplate

          JCoFunctionTemplate getFunctionTemplate(String functionName)
                                                  throws JCoException

      Returns the template for the passed function.
      Parameters:
        `functionName` - the name of the function for which the template is being returned.
      Returns:
        the template for the function or `null` if the function template could not be retrieved.
      Throws:
        `JCoException` - if another error occurred during the retrieval of the function interface with the group field set appropiately.

    - #### getFunction

          JCoFunction getFunction(String functionName)
                                  throws JCoException

      Returns a JCoFunction with initial parameters for the passed function name.
      Parameters:
        `functionName` - the name of the function for which the JCoFunction is being returned.
      Returns:
        the JCoFunction for the function name or `null` if the underlying function template could not be retrieved.
      Throws:
        `JCoException` - if another error occurred during the retrieval of the function interface with the group field set appropiately.

    - #### getRequest

          JCoRequest getRequest(String functionName)
                                throws JCoException

      Returns a JCoRequest with initial parameters for the passed function name.
      Parameters:
        `functionName` - the name of the function for which the request is being returned.
      Returns:
        the request for the function name or `null` if the underlying function template could not be retrieved.
      Throws:
        `JCoException` - if another error occurred during the retrieval of the function interface with the group field set appropiately.

    - #### getFunctionInterface

          JCoListMetaData getFunctionInterface(String functionName)
                                               throws JCoException

      Returns the meta data for the passed function.
      Parameters:
        `functionName` - the name of the function for which the meta data is being returned
      Returns:
        the meta data for the function or `null` if the function couldn't be found
      Throws:
        `JCoException` - if an error occurred during the retrieval of the function interface.

    - #### getRecordMetaData

          JCoRecordMetaData getRecordMetaData(String recordName)
                                              throws JCoException

      Returns the meta data for the passed structure/table name.
      Parameters:
        `recordName` - the name of the structure or table for which the meta data is being returned
      Returns:
        the meta data for the given name or `null` if the structure couldn't be found
      Throws:
        `JCoException` - if an error occurred during the retrieval of the data structure definition.

    - #### getStructureDefinition

          JCoRecordMetaData getStructureDefinition(String structureName)
                                                   throws JCoException

      Returns the meta data for the passed structure/table name.
      Parameters:
        `structureName` - the name of the structure or table for which the meta data is being returned
      Returns:
        the meta data for the given name or `null` if the structure couldn't be found
      Throws:
        `JCoException` - if an error occurred during the retrieval of the data structure definition.

    - #### getClassMetaData

          JCoClassMetaData getClassMetaData(String className)
                                            throws JCoException

      Returns the meta data for the passed class/interface name.
      Parameters:
        `className` - the name of the class or interface for which the meta data is being returned
      Returns:
        the meta data for the given name or `null` if the class couldn't be found
      Throws:
        `JCoException` - if an error occurred during the retrieval

    - #### removeFunctionTemplateFromCache

          void removeFunctionTemplateFromCache(String functionName)

      Removes a function template from the local cache.
      Parameters:
        `functionName` - the name of the function to be removed from the cache

    - #### removeRecordMetaDataFromCache

          void removeRecordMetaDataFromCache(String recordName)

      Removes a record meta data from the local cache.
      Parameters:
        `recordName` - the name of the structure to be removed from the cache

    - #### removeClassMetaDataFromCache

          void removeClassMetaDataFromCache(String className)

      Removes a class meta data instance from the local cache.
      Parameters:
        `className` - the name of the class to be removed from the cache

    - #### getCachedFunctionTemplateNames

          String[] getCachedFunctionTemplateNames()

      Returns the names of the cached functions as a string array.
      Returns:
        a string array of the cached functions (length 0 if the cache is empty)

    - #### getCachedRecordMetaDataNames

          String[] getCachedRecordMetaDataNames()

      Returns the names of the cached structures as a string array.
      Returns:
        a string array of the cached structures (length 0 if the cache is empty)

    - #### getCachedClassMetaDataNames

          String[] getCachedClassMetaDataNames()

      Returns the names of the cached classes as a string array.
      Returns:
        a string array of the cached classes (length 0 if the cache is empty)

    - #### isUnicode

          boolean isUnicode()

      Returns whether the repository contains both Unicode and Non-Unicode metadata. Repositories containing meta data for SAP systems running on Non-Unicode codepages cannot contain meta data for unicode structures.
      Returns:
        true, if the repository contains the metadata for Unicode representation of the contained metadata, false otherwise

    - #### clear

          void clear()

      Clear allows to empty both the function template cache as well as the record metadata cache completely. All metadata will be looked up again in the original source, which is generally much more expensive than looking it up in the cache. Therefore use this method carefully and avoid it in application code.

    - #### getMonitor

          JCoRepositoryMonitor getMonitor()

      Returns a new created or available monitor instance for the repository.
      Returns:
        JCoRepositoryMonitor instance

    - #### load

          void load(Reader reader)
                    throws IOException

      Loads the repository from the given reader. Note that the existing cache is cleared completely before reading. That is, after successful completion of the load operation this repository's cache contains only the meta data read. In case of an error the cache will be empty.
      This method does not close the given reader. Obsolete trailing characters are ignored and remain available for further reading.
      Parameters:
        `reader` - the reader to be used for loading this repository
      Throws:
        `IOException` - if an I/O error occurs
        `JCoRuntimeException` - with key JCO_ERROR_REPOSITORY_SERIALIZATION if the data read is syntactically or semantically incorrect
      Since:
        3.0.10

    - #### save

          void save(Writer writer)
                    throws IOException

      Saves this repository using the given writer.
      This method does not close the given writer.
      Parameters:
        `writer` - the writer used to save this repository
      Throws:
        `IOException` - if an I/O error occurs
      Since:
        3.0.10

Copyright © 2016 SAP. All Rights Reserved.