Cool documentation

com.sap.tc.col.client.generic.api
Interface IServiceModule


public interface IServiceModule

Realizes interface for ServiceModule.

The backend architecture requires structuring of application logic in smaller units, the ServiceModules.

Examples for such service modules are business partners, employees, sales order,..

The main tasks of ServiceModule are:

Additionally ServiceModule implements ICMIModel.

This is necessary to use it as Model from Web Dynpro.


Method Summary
 IAspect createAspect(java.lang.String aspectName)
          Creates an IAspect by getting meta data from ServiceModuleDescriptor.
 IKey createKey(java.lang.String keyName, java.lang.String[] keyFields)
          Creates a IKey by getting meta data from ServiceModuleDescriptor.
 IKeyList createKeyList(java.lang.String keyName)
          Creates an empty IKeyList by getting meta data from ServiceModuleDescriptor.
 IQuery createQuery(java.lang.String queryName)
          Creates a new IQuery, by getting meta data from ServiceModuleDescriptor
 IAspect getAspect(java.lang.String aspectName, IKeyList keyList)
          Creates an IAspect by navigating from Keys of the given KeyList to the targetAspect with given aspectName.
 IAspect getAspect(java.lang.String aspectName, IKeyList keyList, LockStrategy lockStrategy)
          Creates an IAspect by navigating from Keys of the given KeyList to the targetAspect with given name.
 IAspect getAspect(java.lang.String aspectName, java.lang.String[] urlOfKeys)
          Creates an Aspect by navigating from Keys of the given array of Key URL's to the targetAspect with given name.
 IAspect getAspect(java.lang.String aspectName, java.lang.String[] urlOfKeys, LockStrategy lockStrategy)
          Creates an Aspect by navigating from Keys of the given array of Key URL's to the targetAspect with given name.
 IServiceModuleDescriptor getDescriptor()
          Returns the meta data of this ServiceModule
 void sendChanges()
          Sends all pending changes of all Aspects to service layer.
 void setDebug(boolean enabled, java.lang.String guiHost)
          Enables or disables backend debugging.
 

Method Detail

createQuery

public IQuery createQuery(java.lang.String queryName)
Creates a new IQuery, by getting meta data from ServiceModuleDescriptor

the method throws an IllegalArgumentException, if queryName is no valid name for a Query.

Parameters:
queryName - the name of the Query
Returns:
IQuery the new created Query
Throws:
java.lang.IllegalArgumentException - queryName is no valid name for a Query.

createAspect

public IAspect createAspect(java.lang.String aspectName)
Creates an IAspect by getting meta data from ServiceModuleDescriptor.

This new created Aspect is root object of a new Aspect hierarchy, which is cached in GCP (GenericClientProxy) and can be released by an explicit invalidate() or implicitly by GCP, when changes on Aspects in cache are executed in backend.

The method throws an IllegalArgumentException, if aspectName is no valid name for a Aspect.

Parameters:
aspectName - the name of the Aspect to create
Returns:
IAspect the new created Aspect
Throws:
java.lang.IllegalArgumentException - aspectName is no valid name for an Aspect.

createKeyList

public IKeyList createKeyList(java.lang.String keyName)
Creates an empty IKeyList by getting meta data from ServiceModuleDescriptor.

The method throws an IllegalArgumentException, if keyName is no valid name for a Key.

Parameters:
keyName - the name of the KeyList to create
Returns:
IKeyList the new created KeyList
Throws:
java.lang.IllegalArgumentException - keyName is no valid name for a Key.

createKey

public IKey createKey(java.lang.String keyName,
                      java.lang.String[] keyFields)
Creates a IKey by getting meta data from ServiceModuleDescriptor.

The method throws an IllegalArgumentException, if keyName is no valid name for a Key.

Parameters:
keyName - the name of the Key to create
keyFields - the key fields of the Key to create
Returns:
IKey the new created Key
Throws:
java.lang.IllegalArgumentException - keyName is no valid name for a Key or key fielda array is null.

getAspect

public IAspect getAspect(java.lang.String aspectName,
                         IKeyList keyList)
Creates an IAspect by navigating from Keys of the given KeyList to the targetAspect with given aspectName.

This new created Aspect is root object of a new Aspect hierarchy, which is cached in GCP (GenericClientProxy) and can be released by an explicit invalidate() or implicitly by GCP, when changes on Aspects in cache are executed in backend.

The method throws an IllegalArgumentException, if aspectName is no valid name for an Aspect or KeyList is null or of size 0

Parameters:
aspectName - the name of the Aspect to create
keyList - the input Key list
Returns:
IAspect the new created Aspect
Throws:
java.lang.IllegalArgumentException - aspectName is no valid name for an Aspect or KeyList is null or of size 0


getAspect

public IAspect getAspect(java.lang.String aspectName,
                         IKeyList keyList,
                         LockStrategy lockStrategy)
Creates an IAspect by navigating from Keys of the given KeyList to the targetAspect with given name.

This new created Aspect is root object of a new Aspect hierarchy, which is cached in GCP (GenericClientProxy) and can be released by an explicit invalidate() or implicitly by GCP, when changes on Aspects in cache are executed in backend.

The method throws an IllegalArgumentException, if aspectName is no valid name for an Aspect or KeyList is null or of size 0

if lockStrategy other than

null
is set, the lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the Aspect is read with this lock.

Parameters:
aspectName - the name of the Aspect to create
keyList - the input Key list
lockStrategy - indicates how the target aspect rows should be locked
Returns:
IAspect the new created Aspect
Throws:
IllegalArgumentException, - if aspectName is no valid name for an Aspect or KeyList is null or of size 0


getAspect

public IAspect getAspect(java.lang.String aspectName,
                         java.lang.String[] urlOfKeys)
Creates an Aspect by navigating from Keys of the given array of Key URL's to the targetAspect with given name.

This new created Aspect is root object of a new Aspect hierarchy, which is cached in GCP (GenericClientProxy) and can be released by an explicit invalidate() or implicitly by GCP, when changes on Aspects in cache are executed in backend.

The method throws an IllegalArgumentException, if aspectName is no valid name for an Aspect or urlOfKeys is null or of size 0

Parameters:
aspectName - the name of the Aspect to create
urlOfKeys - the URL's of the Keys to use as input of the select operation
Returns:
IAspect the new created Aspect
Throws:
IllegalArgumentException, - if aspectName is no valid name for an Aspect or urlOfKeys is null or of size 0


getAspect

public IAspect getAspect(java.lang.String aspectName,
                         java.lang.String[] urlOfKeys,
                         LockStrategy lockStrategy)
Creates an Aspect by navigating from Keys of the given array of Key URL's to the targetAspect with given name.

This new created Aspect is root object of a new Aspect hierarchy, which is cached in GCP (GenericClientProxy) and can be released by an explicit invalidate() or refresh() or implicitly by GCP, when changes on Aspects in cache are executed in backend.

The method throws an IllegalArgumentException, if aspectName is no valid name for an Aspect or urlOfKeys is null or of size 0

if lockStrategy other than

null
is set, the lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the Aspect is read with this lock.

Parameters:
aspectName - the name of the Aspect to create
urlOfKeys - the URL's of the Keys to use as input of the select operation
lockStrategy - indicates how the target aspect rows should be locked
Returns:
IAspect the new created Aspect
Throws:
IllegalArgumentException, - if aspectName is no valid name for an Aspect or urlOfKeys is null or of size 0


getDescriptor

public IServiceModuleDescriptor getDescriptor()
Returns the meta data of this ServiceModule
Returns:
IServiceModuleDescriptor the meta data of ServiceModule

sendChanges

public void sendChanges()
Sends all pending changes of all Aspects to service layer.

There are no special services for insert, update, delete, cause of performance reasons, we bundle and manage all local changes until this method is called. Then all changes are sent to service layer in one step. Example:

   aspect.removeAspectRow( myRow );
   myUpdatedRow = aspect1.getAspectRow( myKey );
   myUpdatedRow.setAttributeValue("NAME1", "BLABLA");
   ...
   serviceModule.sendChanges();
   ..
 

setDebug

public void setDebug(boolean enabled,
                     java.lang.String guiHost)
Enables or disables backend debugging. Debug the current service module The GUI for debugging can run on another host than the default computer. The default computer is the one where SAPJCO is running if SAPJCO is using.
Parameters:
enabled - if set to true, the debugging is switched on, otherwise debugging is switched off.
guiHost - the host name of the computer where the GUI should run or NULL for the default computer.

Cool documentation

Copyright © 2002 SAP AG. Automatically generated Thu Mar 3 2005, 21:55