Cool documentation

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

All Superinterfaces:
IStructure

public interface IAspectRow
extends IStructure

realizes an interface for a row of an Aspect The data of a ServiceModule is accessible at runtime in form of various Aspects. Each Aspect contains a collection of AspectRow's, which all have the same structure.

An AspectRow always has a unique Key, where Key, itself is derived from AspectRow.

Likewise the Aspect, it has methods to navigate to related Aspects and AspectRows. Additionally AspectRow implements ICMIGenericModelClass.

This is necessary to use it as ModelClass from Web Dynpro. Web Dynpro framework only knows this interfaces.

See Also:
IAspect

Method Summary
 IAspect getAspect()
          returns the Aspect this AspectRow belongs to
 IAspectRow getAspectRow(java.lang.String aspectName)
          returns the AspectRow with the given aspectName to the Key of this AspectRow.
 IAspectRow getAspectRow(java.lang.String aspectName, LockStrategy lockStrategy)
          Returns the AspectRow for the given aspectName to the Key of this AspectRow.
 IKey getKey()
          returns the unique IKey, of this AspectRow
 ILockState getLockState()
          returns the lock state of this AspectRow
 IMessageList getMessages()
          Returns the list of messages attached to this AspectRow.
 IAspect getRelatedAspect(java.lang.String relationName)
          Returns the related Aspect dependent of the Relation with given relationName.
 IAspect getRelatedAspect(java.lang.String relationName, LockStrategy lockStrategy)
          Returns the related Aspect dependent of the Relation with given relationName.
 IAspect getRelatedAspect(java.lang.String relationName, LockStrategy lockStrategy, SortingCriteria sorting)
          Returns the related Aspect dependent of the Relation with given relationName.
 IAspect getRelatedAspect(java.lang.String relationName, java.lang.String targetAspectName)
          navigates to the Aspect with given targetAspectName according to the relation with given relation name and the given targetAspectName.
 IAspect getRelatedAspect(java.lang.String relationName, java.lang.String targetAspectName, LockStrategy lockStrategy)
          navigates to the Aspect with given targetAspectName according to the relation with given relation name and the given targetAspectName.
 IAspectRow getRelatedAspectRow(java.lang.String relationName)
          Returns the related AspectRow dependent of the Relation with given relationName or null, if no related AspectRow exists.
 IAspectRow getRelatedAspectRow(java.lang.String relationName, LockStrategy lockStrategy)
          Returns the related AspectRow dependent of the Relation with given relationName or null, if no related AspectRow exists.
 IAspectRow getRelatedAspectRow(java.lang.String relationName, java.lang.String targetAspectName)
          navigates to the AspectRow with given targetAspectName according to the relation with given relation name and the given targetAspectName.
 IAspectRow getRelatedAspectRow(java.lang.String relationName, java.lang.String targetAspectName, LockStrategy lockStrategy)
          navigates to the AspectRow with given targetAspectName according to the relation with given relation name and the given targetAspectName.
 java.lang.String getRelativeKeyUrl()
          Returns the key of this row in relative Url format.
 boolean isDirty()
          Returns true if this AspectRow was changed in the current transaction.
 boolean isValid()
          Returns true if this AspectRow is valid, otherwise false.
 void lock(LockStrategy lockStrategy)
          Locks this AspectRow dependent of given parameter lockStrategy and refreshes it after lock is received successfully.
 void promoteLock()
          Promote a SHARED_PROMOTABLE lock to an EXCLUSIVE lock.
 void unlock()
          Release any lock previously acquired for this aspect row.
 
Methods inherited from interface com.sap.tc.col.client.generic.api.IStructure
getAttributeAsString, getAttributeAsString, getAttributeValue, getAttributeValue, getDescriptor, isAttributeInitial, isAttributeInitial, setAttributeValue, setAttributeValue, size, toString
 

Method Detail

getKey

public IKey getKey()
returns the unique IKey, of this AspectRow
Returns:
IKey the unique Key of this AspectRow

getRelatedAspect

public IAspect getRelatedAspect(java.lang.String relationName)
Returns the related Aspect dependent of the Relation with given relationName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key, otherwise an IllegalArgumentException is thrown.

If this method has been called earlier and if no invalidation occured in the meantime, then a cached instance of this Aspect will be returned.

Parameters:
relationName - the name of the relation
Returns:
IAspect the related Aspect or null, if no related aspect exists
Throws:
java.lang.IllegalArgumentException - relationName is no valid one.

getRelatedAspect

public IAspect getRelatedAspect(java.lang.String relationName,
                                LockStrategy lockStrategy)
Returns the related Aspect dependent of the Relation with given relationName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key, otherwise an IllegalArgumentException is thrown.

if lockStrategy other than
null
is set, locking is only possible, if target Aspect is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the Aspect is read or refreshed with this lock.

Cause locking is also possible on AspectRow level, the method checks the consistency of the AspectRows lock states and strategies and if there are inconsistencies found, an IllegalStateException is thrown.

Parameters:
relationName - the name of the relation
lockStrategy - indicates which lock strategy is used to lock the target aspect rows
Returns:
IAspect the related Aspect
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this Aspect or its Key
IllegalStateException - Aspect has no valid state for locking or lock state of the different AspectRows is inconsistent.

getRelatedAspect

public IAspect getRelatedAspect(java.lang.String relationName,
                                LockStrategy lockStrategy,
                                SortingCriteria sorting)
Returns the related Aspect dependent of the Relation with given relationName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key, otherwise an IllegalArgumentException is thrown.

if lockStrategy other than
null
is set, locking is only possible, if target Aspect is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the Aspect is read or refreshed with this lock.

Cause locking is also possible on AspectRow level, the method checks the consistency of the AspectRows lock states and strategies and if there are inconsistencies found, an IllegalStateException is thrown.

if sorting criteria are set, the target Aspect is sorted (in backend) according to these sorting criteria, but this is only valid, if the target is not taken from cache. In particular this means, that the sorting parameter only affects the target Aspect, when the relation is done the first time.

Parameters:
relationName - the name of the relation
lockMode - indicates how the target aspect rows should be locked
sorting - the sorting criteria for the target Aspect
Returns:
IAspect the related Aspect or null, if no related aspect exists
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this Aspect or its Key
IllegalStateException - Aspect has no valid state for locking or lock state of the different AspectRows is inconsistent.

getRelatedAspect

public IAspect getRelatedAspect(java.lang.String relationName,
                                java.lang.String targetAspectName)
navigates to the Aspect with given targetAspectName according to the relation with given relation name and the given targetAspectName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key Aspect, otherwise an IllegalArgumentException is thrown.

The targetAspect given in method call, may not be the targetAspect of the relation, but could be a sibling Aspect of this target. Sibling means, that it has the same Key and a 1:1 association.

The method is a convenience method, which replaces the following calls
   IAspect targetOfRelation = this.getRelatedAspect(relationName):
   IAspect targetAspect = targetOfRelation.getAspect(targetAspectName);
 
Parameters:
relationName - the name of the relation
targetAspectName - the name of the targetAspect to navigate to
Returns:
IAspect the target Aspect of the relation
Throws:
throws - IllegalArgumentException, if relationName is no valid one.

getRelatedAspect

public IAspect getRelatedAspect(java.lang.String relationName,
                                java.lang.String targetAspectName,
                                LockStrategy lockStrategy)
navigates to the Aspect with given targetAspectName according to the relation with given relation name and the given targetAspectName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key, otherwise an IllegalArgumentException is thrown.

The targetAspect given in method call, may not be the targetAspect of the relation, but could be a sibling Aspect of this target. Sibling means, that it has the same Key and a 1:1 association.

The method is a convenience method, which replaces the following calls
   IAspect targetOfRelation = this.getRelatedAspect(relationName):
   IAspect targetAspect = targetOfRelation.getAspect(targetAspectName);
 
if lockStrategy other than
null
is set, locking is only possible, if target Aspect is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the Aspect is read or refreshed with this lock.

Cause locking is also possible on AspectRow level, the method checks the consistency of the AspectRows lock states and strategies and if there are inconsistencies found, an IllegalStateException is thrown.

Parameters:
relationName - the name of the relation
targetAspectName - the name of the targetAspect to navigate to
lockMode - indicates how the target aspect rows should be locked
Returns:
IAspect the target Aspect of the relation
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this Aspect or its Key
IllegalStateException - Aspect has no valid state for locking or lock state of the different AspectRows is inconsistent.

getRelatedAspectRow

public IAspectRow getRelatedAspectRow(java.lang.String relationName)
Returns the related AspectRow dependent of the Relation with given relationName or null, if no related AspectRow exists.

It throws an IllegalArgumentException, if relationName is no valid one for this AspectRow or Key, or Relation has cardinality not equal 0..1 or 1. If this method has been called earlier and if no invalidation occured in the meantime, then a cached instance of this AspectRow will be returned.

Parameters:
relationName - the name of the relation
Returns:
IAspectRow the related AspectRow or null, if no
Throws:
throws - IllegalArgumentException, if relationName is no valid one.

getRelatedAspectRow

public IAspectRow getRelatedAspectRow(java.lang.String relationName,
                                      LockStrategy lockStrategy)
Returns the related AspectRow dependent of the Relation with given relationName or null, if no related AspectRow exists.

It throws an IllegalArgumentException, if relationName is no valid one for this AspectRow or Key, or Relation has cardinality not equal 0..1 or 1. if lockStrategy other than

null
is set, locking is only possible, if target AspectRow is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the AspectRow is read or refreshed with this lock.

Parameters:
relationName - the name of the relation
lockMode - indicates how the target aspect rows should be locked
Returns:
IAspectRow the related AspectRow or null, if no
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this AspectRow or its Key
IllegalStateException - AspectRow has no valid state for locking.

getRelatedAspectRow

public IAspectRow getRelatedAspectRow(java.lang.String relationName,
                                      java.lang.String targetAspectName)
navigates to the AspectRow with given targetAspectName according to the relation with given relation name and the given targetAspectName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key Aspect, otherwise an IllegalArgumentException is thrown.

The targetAspect given in method call, may not be the targetAspect of the relation, but could be a sibling Aspect of this target. Sibling means, that it has the same Key and a 1:1 association.

The method is a convenience method, which replaces the following calls
   IAspectRow targetOfRelation = this.getRelatedAspectRow(relationName):
   IAspectRow targetAspectRow = targetOfRelation.getAspectRow(targetAspectName);
 
Parameters:
relationName - the name of the relation
targetAspectName - the name of the targetAspect to navigate to
Returns:
IAspect the target Aspect of the relation
Throws:
throws - IllegalArgumentException, if relationName is no valid one.

getRelatedAspectRow

public IAspectRow getRelatedAspectRow(java.lang.String relationName,
                                      java.lang.String targetAspectName,
                                      LockStrategy lockStrategy)
navigates to the AspectRow with given targetAspectName according to the relation with given relation name and the given targetAspectName.

The relationName has to be the name of a relation, starting from this AspectRow or its Key, otherwise an IllegalArgumentException is thrown.

The targetAspect given in method call, may not be the targetAspect of the relation, but could be a sibling Aspect of this target. Sibling means, that it has the same Key and a 1:1 association.

The method is a convenience method, which replaces the following calls
   IAspectRow targetOfRelation = this.getRelatedAspectRow(relationName):
   IAspectRow targetAspectRow = targetOfRelation.getAspectRow(targetAspectName);
 
It throws an IllegalArgumentException, if relationName is no valid one for this AspectRow or Key, or Relation has cardinality not equal 0..1 or 1. if lockStrategy other than
null
is set, locking is only possible, if target AspectRow is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the AspectRow is read or refreshed with this lock.

Parameters:
relationName - the name of the relation
targetAspectName - the name of the targetAspect to navigate to
lockMode - indicates how the target aspect rows should be locked
Returns:
IAspect the target Aspect of the relation
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this AspectRow or its Key
IllegalStateException - AspectRow has no valid state for locking.

getAspectRow

public IAspectRow getAspectRow(java.lang.String aspectName)
returns the AspectRow with the given aspectName to the Key of this AspectRow.

If this method has been called earlier and if no invalidation occured in the meantime, then a cached instance of this AspectRow will be returned.

Parameters:
aspectName - the name of the Aspect
Returns:
IAspectRow the AspectRow in the given Aspect with this Key

getAspectRow

public IAspectRow getAspectRow(java.lang.String aspectName,
                               LockStrategy lockStrategy)
Returns the AspectRow for the given aspectName to the Key of this AspectRow.

if lockStrategy other than
null
is set, locking is only possible, if target AspectRow is in state CLEAN (target Aspect is buffered ) or HOLLOW ( not yet read ). Otherwise it throws an IllegalStateException. The lock (Shared, SP or Exclusive) resulting from lock strategy is promoted to backend and the AspectRow is read or refreshed with this lock.

Parameters:
aspectName - the name of the Aspect
lockStrategy - indicates, which lock strategy should be used to lock the target aspect rows.
Returns:
IAspectRow the AspectRow in the given Aspect with this Key
Throws:
java.lang.IllegalArgumentException - relationName is no valid Relation for this AspectRow or its Key
IllegalStateException - AspectRow has no valid state for locking.

getAspect

public IAspect getAspect()
returns the Aspect this AspectRow belongs to
Returns:
IAspect the Aspect this AspectRow belongs to

getMessages

public IMessageList getMessages()
Returns the list of messages attached to this AspectRow. To remove these messages explicitly you can call the clear() method of IMessageList
Returns:
IMessageList the list of messages attached to this AspectRow

promoteLock

public void promoteLock()
Promote a SHARED_PROMOTABLE lock to an EXCLUSIVE lock.

Lock Mode Promotion is processed in the queue as well, therefore the result of the lock promotion is only available after flushing the queue.


lock

public void lock(LockStrategy lockStrategy)
Locks this AspectRow dependent of given parameter lockStrategy and refreshes it after lock is received successfully.
Parameters:
lockStrategy - the lock strategy for this AspectRow

unlock

public void unlock()
Release any lock previously acquired for this aspect row.

getLockState

public ILockState getLockState()
returns the lock state of this AspectRow
Returns:
ILockState the lock state of this AspectRow

isValid

public boolean isValid()
Returns true if this AspectRow is valid, otherwise false. If this AspectRow is not valid, accessing the AspectRow leads to an IllegalStateException.


isDirty

public boolean isDirty()
Returns true if this AspectRow was changed in the current transaction.

considered changes are: update, insert, delete and not readonly Actions, not considered are changes, resulting from side effects.

Returns:
boolean true, if this AspectRow was changed in the current transaction.


getRelativeKeyUrl

public java.lang.String getRelativeKeyUrl()
Returns the key of this row in relative Url format. The returned value doesn't contain any system data (like SID, service module) etc. but only the buisness data that make the key (fields of IKey).

The returned value can be used to retrieve row related meta data, e.g. with methods IAspectDescriptor#getFieldAttributeNames(String,String), IAspectDescriptor#getFieldAttributeStringValue(String,String,String), IRelationDescriptor#getAttributeStringValue(String,String) etc.

Throws:
IllegalStateException - if the key of this row is a local key.

Cool documentation

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