com.sap.aii.af.service.administration.api.cpa

Interface CPALookupManager


public interface CPALookupManager

The CPA cache service offers two kinds of lookup mechanisms. One is offered for such adapters, which need to start an own instance, for each Channel configuration. Such adapters use the LookupManager singleton class to read all known Channel configurations for their own adapter type from the cache at startup, to start an instance of the adapter for each Channel. These adapter types should also register themselves to the CallbackController, in order to be informed about new and deleted Channel configurations.

The other type of adapters has only one running instance, which can handle all messages, Channel-independent. These adapters need to retrieve the Channel configuration per Message at runtime, based on the addressing information in the header of the currently processed message. This is documented with the InboundRuntimeLookup and InboundRuntimeLookup objects.

The LookupManager allows to retrieve the CPA configuration objects either individually by the object type key (if known), or all CPA object of a given type, as a LinkedList. It also offers more advanced CPA object retrieval methods like getBindingByChannelId() and getChannelsByAdapterType(String adapterType).

Version:
$Id: //tc/xpi.af/NW711_03_COR/src/_af_service/psrv/api/com/sap/aii/af/service/administration/api/cpa/CPALookupManager.java#1 $
See Also:
InboundRuntimeLookup, OutboundRuntimeLookup

Method Summary
 LinkedList<CPAObject> getAllCachedCPAObjects()
           
<E extends CPAObject>
LinkedList<E>
getAllCPAObjects(CPAObjectType<E> cpaObjectType)
          Retrieves all CPAObjects of the given type, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 Binding getBinding(String adapterType, String adapterNamespace, Direction direction, String fromParty, String fromService, String toParty, String toService, String interfaceName, String interfaceNamespace)
          Retrieves the Binding object for the given key values, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 Binding getBindingByChannelId(String channelId)
          Retrieves the Binding object for the given channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<Binding> getBindings(String adapterType, String adapterNamespace, Direction direction, String fromParty, String toParty)
           
 LinkedList<BindingUser> getBindingUsersByBinding(Binding binding)
          Retrieves all BindingUser objects for the given Binding either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 Channel getChannelByChannelName(String party, String service, String channelName, String adapterType, String adapterNamespace)
          Retrieves all Channel objects for a given adapter type (and namespace), either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<Channel> getChannelsByAdapterType(String adapterType, String adapterNamespace)
          Retrieves all Channel objects for a given adapter type (and namespace), either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
<E extends CPAObject>
E
getCPAObject(CPAObjectType<E> cpaObjectType, String objectId)
          Retrieves a CPAObject by type and objectId, either from the memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<ModuleConfig> getModuleConfigByChannelId(String channelId)
          Retrieves all ModuleConfig objects for the given XI channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<ModuleConfig> getModuleConfigByNamespace(String channelId, String moduleNS)
          Retrieves all ModuleConfig objects for the given XI channelId and module namespace, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<com.sap.aii.af.service.cpa.ModuleSequence> getModuleSequenceByChannelId(String channelId)
          Retrieves all ModuleSequence objects for the given XI channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<PartyIdentifier> getPartyIdentifiersByParty(Party party)
          Retrieves all PartyIdentifier objects for the given XI Party object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 Service getServiceByPartyService(String party, String service)
          Retrieves the Service object for the given XI Party name and Service name, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<ServiceIdentifier> getServiceIdentifiersByService(Service service)
          Retrieves all ServiceIdentifier objects for the given XI Service object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<ServiceUser> getServiceUserByPartyService(String party, String service)
          Retrieves all ServiceUser objects for the given Party and Service names, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 LinkedList<ServiceUser> getServiceUserByService(Service service)
          Retrieves all ServiceUser objects for the given Service object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.
 boolean userHasPermission(String user, Binding binding)
          Checks whether the given user has the permission to perform the given binding.
 boolean userHasPermission(String user, Service service)
          Checks whether the given user has the permission to perform the given service.
 boolean userHasPermission(String user, String party, String service)
          Checks whether the given user has the permission to perform the given service.
 

Method Detail

getCPAObject

<E extends CPAObject> E getCPAObject(CPAObjectType<E> cpaObjectType,
                                     String objectId)
                                 throws CPAException,
                                        CPAChannelStoppedException
Retrieves a CPAObject by type and objectId, either from the memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
cpaObjectType - The type of the cpa object to be retrieved either from memory or from the DB.
objectId - The objectId of the cpa object to be retrieved either from memory or from the DB.
Returns:
The retrieved CPAObject object.
Throws:
CPAException
CPAChannelStoppedException

getAllCPAObjects

<E extends CPAObject> LinkedList<E> getAllCPAObjects(CPAObjectType<E> cpaObjectType)
                                                 throws CPAException,
                                                        CPAChannelStoppedException
Retrieves all CPAObjects of the given type, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
cpaObjectType - The type of objects which are to be retrieved either from memory or from the DB.
Returns:
All retrieved CPAObjects of the given type as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getChannelsByAdapterType

LinkedList<Channel> getChannelsByAdapterType(String adapterType,
                                             String adapterNamespace)
                                             throws CPAException,
                                                    CPAChannelStoppedException
Retrieves all Channel objects for a given adapter type (and namespace), either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
adapterType - The adapter type for which all Channel objects are to be retrieved either from memory or from the DB.
adapterNamespace - The adapter namespace for which all Channel objects are to be retrieved either from memory or from the DB.
Returns:
All retrieved Channel objects for the given adapter type as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getChannelByChannelName

Channel getChannelByChannelName(String party,
                                String service,
                                String channelName,
                                String adapterType,
                                String adapterNamespace)
                                throws CPAException,
                                       CPAChannelStoppedException
Retrieves all Channel objects for a given adapter type (and namespace), either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
adapterType - The adapter type for which all Channel objects are to be retrieved either from memory or from the DB.
adapterNamespace - The adapter namespace for which all Channel objects are to be retrieved either from memory or from the DB.
Returns:
All retrieved Channel objects for the given adapter type as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getBindingByChannelId

Binding getBindingByChannelId(String channelId)
                              throws CPAException,
                                     CPAChannelStoppedException
Retrieves the Binding object for the given channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager. This method is only useful, when the searched Binding rule is fully specified and doesn't contain wildcards (and if a Channel is only assigned to exactly one Binding, which should be ensured by the configuration UIs).

Parameters:
channelId - The channelId for which the Binding objects is to be retrieve either from memory or from the DB.
Returns:
The retrieved Binding object.
Throws:
CPAException
CPAChannelStoppedException

getPartyIdentifiersByParty

LinkedList<PartyIdentifier> getPartyIdentifiersByParty(Party party)
                                                       throws CPAException
Retrieves all PartyIdentifier objects for the given XI Party object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
party - The XI Party object for which all defined PartyIdentifier objects are to be retrieve either from memory or from the DB.
Returns:
All retrieved PartyIdentifier objects as LinkedList.
Throws:
CPAException

getServiceByPartyService

Service getServiceByPartyService(String party,
                                 String service)
                                 throws CPAException
Retrieves the Service object for the given XI Party name and Service name, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
party - The XI Party name
service - The XI Service name for which all defined Service objects are to be retrieve either from memory or from the DB.
Returns:
The Service objects.
Throws:
CPAException

getServiceIdentifiersByService

LinkedList<ServiceIdentifier> getServiceIdentifiersByService(Service service)
                                                             throws CPAException
Retrieves all ServiceIdentifier objects for the given XI Service object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
service - The XI Service object for which all defined ServiceIdentifier objects are to be retrieve either from memory or from the DB.
Returns:
All retrieved ServiceIdentifier objects as LinkedList.
Throws:
CPAException

getModuleSequenceByChannelId

LinkedList<com.sap.aii.af.service.cpa.ModuleSequence> getModuleSequenceByChannelId(String channelId)
                                                                                   throws CPAException,
                                                                                          CPAChannelStoppedException
Retrieves all ModuleSequence objects for the given XI channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager. The adapter implementations should never need to lookup such module specific configuration data, since the module processor reads this config data and passes it into the Module, when invoking its process method.

Parameters:
channelId - The channel id for which all defined ModuleSequence objects are to be retrieve either from memory or from the DB.
Returns:
All retrieved ModuleSequence objects as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getModuleConfigByChannelId

LinkedList<ModuleConfig> getModuleConfigByChannelId(String channelId)
                                                    throws CPAException,
                                                           CPAChannelStoppedException
Retrieves all ModuleConfig objects for the given XI channelId, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager. The adapter implementations should never need to lookup such module specific configuration data, since the module processor reads this config data and passes it into the Module, when invoking its process method.

Parameters:
channelId - The channel id for which all defined ModuleConfig objects are to be retrieve either from memory or from the DB.
Returns:
All retrieved ModuleConfig objects as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getModuleConfigByNamespace

LinkedList<ModuleConfig> getModuleConfigByNamespace(String channelId,
                                                    String moduleNS)
                                                    throws CPAException,
                                                           CPAChannelStoppedException
Retrieves all ModuleConfig objects for the given XI channelId and module namespace, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager. The adapter implementations should never need to lookup such module specific configuration data, since the module processor reads this config data and passes it into the Module, when invoking its process method.

Parameters:
channelId - The channel id for which all defined ModuleConfig objects are to be retrieve either from memory or from the DB.
moduleNS - The module namespace for which all defined ModuleConfig objects are to be retrieve either from memory or from the DB.
Returns:
All retrieved ModuleConfig objects as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

getBinding

Binding getBinding(String adapterType,
                   String adapterNamespace,
                   Direction direction,
                   String fromParty,
                   String fromService,
                   String toParty,
                   String toService,
                   String interfaceName,
                   String interfaceNamespace)
                   throws CPAException,
                          CPAChannelStoppedException
Retrieves the Binding object for the given key values, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager. Utilizes the getMostSpecific method, provided by the aii_util_misc package. Wildcards (*) are not allowed for the lookup of Binding objects (sender and receiver agreements) and can therefore not be used in this method. Null values are only allowed for the Party parameters in case of party-less services.

Parameters:
adapterType - The adapter type value.
adapterNamespace - The adapter namespace value.
direction - The direction value.
fromParty - The from party value.
fromService - The from service value.
toParty - The to party value.
toService - The to service value.
interfaceNamespace - The interface namespace value.
interfaceName - The interface name value.
Returns:
The retrieved Binding object.
Throws:
CPAException
CPAChannelStoppedException

getBindings

LinkedList<Binding> getBindings(String adapterType,
                                String adapterNamespace,
                                Direction direction,
                                String fromParty,
                                String toParty)
                                throws CPAException,
                                       CPAChannelStoppedException
Throws:
CPAException
CPAChannelStoppedException

getServiceUserByPartyService

LinkedList<ServiceUser> getServiceUserByPartyService(String party,
                                                     String service)
                                                     throws CPAException
Retrieves all ServiceUser objects for the given Party and Service names, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
party - The XI Party name
service - The XI Service name for which all defined ServiceUser objects are to be retrieved either from memory or from the DB.
Returns:
All retrieved ServiceUser objects as LinkedList.
Throws:
CPAException

getServiceUserByService

LinkedList<ServiceUser> getServiceUserByService(Service service)
                                                throws CPAException
Retrieves all ServiceUser objects for the given Service object, either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
service - The XI Service object for which all defined ServiceUser objects are to be retrieved either from memory or from the DB.
Returns:
All retrieved ServiceUser objects as LinkedList.
Throws:
CPAException

userHasPermission

boolean userHasPermission(String user,
                          Service service)
                          throws CPAException
Checks whether the given user has the permission to perform the given service.

Parameters:
user - The runtime user.
service - The XI Service

If the Service has a non-empty list of ServiceUser-names a check will be performed whether the runtime user is contained in the list; if the user is found, the method returns Boolean.TRUE otherwise the result is Boolean.FALSE. If the list of ServiceUser-names is empty, the method returns Boolean.TRUE.

Throws:
CPAException

userHasPermission

boolean userHasPermission(String user,
                          String party,
                          String service)
                          throws CPAException
Checks whether the given user has the permission to perform the given service.

Parameters:
user - The runtime user.
service - The XI Service name

If the Service has a non-empty list of ServiceUser-names a check will be performed whether the runtime user is contained in the list; if the user is found, the method returns Boolean.TRUE otherwise the result is Boolean.FALSE. If the list of ServiceUser-names is empty, the method returns Boolean.TRUE. A check is made, whether the Service service for the Party party exists. If not, a CPAException is thrown.

Throws:
CPAException

getBindingUsersByBinding

LinkedList<BindingUser> getBindingUsersByBinding(Binding binding)
                                                 throws CPAException,
                                                        CPAChannelStoppedException
Retrieves all BindingUser objects for the given Binding either from the in memory cache, or from the database, dependent on the initialization of the CacheManager.

Parameters:
party - The XI Binding object
Returns:
All retrieved BindingUser objects as LinkedList.
Throws:
CPAException
CPAChannelStoppedException

userHasPermission

boolean userHasPermission(String user,
                          Binding binding)
                          throws CPAException,
                                 CPAChannelStoppedException
Checks whether the given user has the permission to perform the given binding.

Parameters:
user - The runtime user.
service - The XI binding object

If the Binding has a non-empty list of BindingUser objects a check will be performed whether the runtime user is contained in the list. If the user is found, the method returns true, otherwise the result is false. If the list of BindingUser objects is empty, the method returns true.

Throws:
CPAException
CPAChannelStoppedException

getAllCachedCPAObjects

LinkedList<CPAObject> getAllCachedCPAObjects()
                                             throws CPAException,
                                                    CPAChannelStoppedException
Throws:
CPAException
CPAChannelStoppedException


Copyright 2009 SAP AG Complete Copyright Notice