com.sap.conn.jco
Interface JCoCustomRepository

All Superinterfaces:
JCoRepository

public interface JCoCustomRepository
extends JCoRepository

JCoCustomRepository is designed to be used for static/custom meta data. So, if an application works with its own definition of meta data, it can store them in a JCoCustomRepository.
Each JCoCustomRepository has its own cache that won't be shared with other repository instances as it is the case with JCoRepository cache. Hence, the custom definition of meta data is available in one instance of JCoCustomRepository only.

Furthermore, JCoCustomRepository allows to query data types containing generic structures (generic boxed components). Since the generic boxes vary depending on the SAP client, a standard JCoRepository always treats the generic structures as empty structures. The only way to handle generic boxed components via lookups is to use a JCoCustomRepository.

Note: it is strongly recommended to make use of a repository connected to a backend system to ensure the consistency of meta data. Only if you need to avoid additional repository connections or are working with a very limited set of function modules you should consider using a JCoCustomRepository.

It is possible to define a destination and enable dynamic DDIC queries. The meta data fetched from an ABAP system is stored in the own cache of the JCoCustomRepository, and hence is mixed with the custom meta data already stored in the cache. The application may change the query type to achieve a specific behavior required in special scenarios.


Nested Class Summary
static class JCoCustomRepository.QueryMode
          Enumeration that describes all modes to control the remote queries of a custom repository.
 
Method Summary
 void addClassMetaDataToCache(JCoClassMetaData meta)
          Adds a class definition to the local cache.
 void addFunctionTemplateToCache(JCoFunctionTemplate meta)
          Adds a function interface to the local cache.
 void addRecordMetaDataToCache(JCoRecordMetaData meta)
          Adds a structure definition to the local cache.
 void setDestination(JCoDestination destination)
          Set the destination for the remote queries.
 void setQueryMode(JCoCustomRepository.QueryMode queryMode)
          Allow the application to control the repository query.
 
Methods inherited from interface com.sap.conn.jco.JCoRepository
clear, getCachedClassMetaDataNames, getCachedFunctionTemplateNames, getCachedRecordMetaDataNames, getClassMetaData, getFunction, getFunctionInterface, getFunctionTemplate, getMonitor, getName, getRecordMetaData, getRequest, getStructureDefinition, isUnicode, load, removeClassMetaDataFromCache, removeFunctionTemplateFromCache, removeRecordMetaDataFromCache, save
 

Method Detail

addFunctionTemplateToCache

void addFunctionTemplateToCache(JCoFunctionTemplate meta)
Adds a function interface to the local cache. Implementations that do not use a cache just provide an empty method.

Parameters:
meta - the meta data of the interface to add to the cache

addRecordMetaDataToCache

void addRecordMetaDataToCache(JCoRecordMetaData meta)
Adds a structure definition to the local cache. Implementations that do not use a cache just provide an empty method.

Parameters:
meta - the meta data of a structure to add to the cache

addClassMetaDataToCache

void addClassMetaDataToCache(JCoClassMetaData meta)
Adds a class definition to the local cache. Implementations that do not use a cache just provide an empty method.

Parameters:
meta - the meta data of an ABAP class to add to the cache
Since:
JCo 3.0.10

setDestination

void setDestination(JCoDestination destination)
                    throws JCoException,
                           JCoRuntimeException
Set the destination for the remote queries. If the requested meta data objects are not available in the repository cache, i.e. not set by the application, the remote query to the specified destination will be started.
Default value is null meaning the remote queries are not allowed.
Note: As soon the destination is provided, the repository can contain mixed meta data - set statically by the application and requested dynamically from the ABAP backend.

Parameters:
destination - ABAP destination for remote queries
Throws:
JCoException - if the destination can not be initiated.
JCoRuntimeException - on an illegal usage, see exception text

setQueryMode

void setQueryMode(JCoCustomRepository.QueryMode queryMode)
                  throws JCoRuntimeException
Allow the application to control the repository query. ABAP Systems from 6.10 onwards store meta data in unicode and non-unicode layout. A standard repository executes 2 remote queries to get the non-unicode and unicode enabled layout by default. If in a specific scenario the unicode layout is not required, it can be turned off by using the NON_UNICODE_LAYOUT_ONLY mode. Default value is ALL_AVAILABLE_LAYOUTS. Note: query mode affects subsequent queries only. The cached meta data won't be changed. Use the remove APIs or clear the cache to force a new query. In very specific situations it is allowed to open maximal one connection. In such a situation repository must not use dedicated connections for queries. Set DISABLE_REPOSITORY_POOL mode in this case, before the destination is set.

Parameters:
queryMode - mode to control the remote queries
Throws:
JCoRuntimeException - on an illegal usage, see exception text


Copyright © 2015 SAP. All Rights Reserved.