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)
.
InboundRuntimeLookup
,
OutboundRuntimeLookup
Modifier and Type | Method and Description |
---|---|
LinkedList<CPAObject> |
getAllCachedCPAObjects()
Returns all CPA cache objects.
|
<E extends CPAObject> |
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)
Retrieves the
Binding objects for the given key values, either from the in memory cache, or from the
database, dependent on the initialization of the CacheManager . |
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> |
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.
|
<E extends CPAObject> E getCPAObject(CPAObjectType<E> cpaObjectType, String objectId) throws CPAException, CPAChannelStoppedException
CacheManager
.E
- An implementor of interface CPAObject. The type of the desired object.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.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the searched object type is a channel and the channel is currently stopped<E extends CPAObject> LinkedList<E> getAllCPAObjects(CPAObjectType<E> cpaObjectType) throws CPAException, CPAChannelStoppedException
CacheManager
.E
- An implementor of interface CPAObject. The type of the desired object.cpaObjectType
- The type of objects which are to be retrieved either from memory or from the DB.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the searched object type is a channel and the channel is currently stoppedLinkedList<Channel> getChannelsByAdapterType(String adapterType, String adapterNamespace) throws CPAException, CPAChannelStoppedException
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
.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.Channel
objects for the given adapter type as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedChannel getChannelByChannelName(String party, String service, String channelName, String adapterType, String adapterNamespace) throws CPAException, CPAChannelStoppedException
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
.party
- The XI Party
nameservice
- The XI Service
namechannelName
- The channel nameadapterType
- 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.Channel
objects for the given adapter type as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedBinding getBindingByChannelId(String channelId) throws CPAException, CPAChannelStoppedException
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).channelId
- The channelId for which the Binding
objects is to be retrieve either from memory or
from the DB.Binding
object.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<PartyIdentifier> getPartyIdentifiersByParty(Party party) throws CPAException
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
.party
- The XI Party
object for which all defined PartyIdentifier
objects are to
be retrieve either from memory or from the DB.PartyIdentifier
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheService getServiceByPartyService(String party, String service) throws CPAException
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
.party
- The XI Party
nameservice
- The XI Service
name for which all defined Service
objects are to be
retrieve either from memory or from the DB.Service
objects.CPAException
- In case no suitable object was found in the cpa cacheLinkedList<ServiceIdentifier> getServiceIdentifiersByService(Service service) throws CPAException
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
.service
- The XI Service
object for which all defined ServiceIdentifier
objects
are to be retrieve either from memory or from the DB.ServiceIdentifier
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheLinkedList<com.sap.aii.af.service.cpa.ModuleSequence> getModuleSequenceByChannelId(String channelId) throws CPAException, CPAChannelStoppedException
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.channelId
- The channel id for which all defined ModuleSequence
objects are to be retrieve
either from memory or from the DB.ModuleSequence
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<ModuleConfig> getModuleConfigByChannelId(String channelId) throws CPAException, CPAChannelStoppedException
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.channelId
- The channel id for which all defined ModuleConfig
objects are to be retrieve either
from memory or from the DB.ModuleConfig
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<ModuleConfig> getModuleConfigByNamespace(String channelId, String moduleNS) throws CPAException, CPAChannelStoppedException
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.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.ModuleConfig
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedBinding getBinding(String adapterType, String adapterNamespace, Direction direction, String fromParty, String fromService, String toParty, String toService, String interfaceName, String interfaceNamespace) throws CPAException, CPAChannelStoppedException
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.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.Binding
object.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<Binding> getBindings(String adapterType, String adapterNamespace, Direction direction, String fromParty, String toParty) throws CPAException, CPAChannelStoppedException
Binding
objects 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.adapterType
- The adapter type value.adapterNamespace
- The adapter namespace value.direction
- The direction value.fromParty
- The from party value.toParty
- The to party value.Binding
objects.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<ServiceUser> getServiceUserByPartyService(String party, String service) throws CPAException
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
.party
- The XI Party
nameservice
- The XI Service
name for which all defined ServiceUser
objects are to
be retrieved either from memory or from the DB.ServiceUser
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheLinkedList<ServiceUser> getServiceUserByService(Service service) throws CPAException
ServiceUser
objects for the given Service
object, either from the in
memory cache, or from the database, dependent on the initialization of the CacheManager
.service
- The XI Service
object for which all defined ServiceUser
objects are to
be retrieved either from memory or from the DB.ServiceUser
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheboolean userHasPermission(String user, Service service) throws CPAException
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
CPAException
- In case no suitable object was found in the cpa cacheboolean userHasPermission(String user, String party, String service) throws CPAException
user
- The runtime user.party
- The XI Party nameservice
- 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.
CPAException
- In case no suitable object was found in the cpa cacheLinkedList<BindingUser> getBindingUsersByBinding(Binding binding) throws CPAException, CPAChannelStoppedException
BindingUser
objects for the given Binding
either from the in memory
cache, or from the database, dependent on the initialization of the CacheManager
.binding
- The XI Binding
objectBindingUser
objects as LinkedList.CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedboolean userHasPermission(String user, Binding binding) throws CPAException, CPAChannelStoppedException
user
- The runtime user.binding
- 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.
CPAException
- In case no suitable object was found in the cpa cacheCPAChannelStoppedException
- In case the channel is currently stoppedLinkedList<CPAObject> getAllCachedCPAObjects() throws CPAException, CPAChannelStoppedException
CPAException
- In case no object is in the cpa cache or the cache isn't initializedCPAChannelStoppedException
- Will never be thrown from inside this method. Ignore it. Stopped channels are not part of the return list.Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.af.svc.facade
|
api
|
BC-XI
|
Copyright 2019 SAP AG Complete Copyright Notice