SAP NetWeaver '04

com.sapportals.wcm.service.relation
Interface IRelationType

[contained in: com.sap.netweaver.bc.rf.service.par - bc.rf.global.service.relation_api.jar]
All Superinterfaces:
IName
All Known Subinterfaces:
IOrderedRelationType

public interface IRelationType
extends IName

The type of a relation.
The IRelationType is an abstraction of the 'relation-operation' (e.g. 'member-of') and. It implies also the types of the source- and target-operands (IRelationOperandType ). A RelationType is always registered to a unique namespace.


Method Summary
 boolean areAttributesMutable()
          Check if setAttributes(IRelationTypeAttributes) can be called or would throw an AccessDeniedException .
 IRelation createRelation(IOrderedRelationPosition position, IRelationOperand source, IRelationOperand target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IOrderedRelationPosition position, IRelationOperand source, IRelationOperand target, IPropertyMap properties)
          Create a new ordered relation from wrapped operands.
 IRelation createRelation(IOrderedRelationPosition position, java.lang.Object source, java.lang.Object target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IOrderedRelationPosition position, java.lang.Object source, java.lang.Object target, IPropertyMap properties)
          Create a ordered relation from operand values.
 IRelation createRelation(IRelationOperand source, IRelationOperand target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IRelationOperand source, IRelationOperand target, IPropertyMap properties)
          Create a new relation from wrapped operands.
 IRelation createRelation(java.lang.Object source, java.lang.Object target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(java.lang.Object source, java.lang.Object target, IPropertyMap properties)
          Create a relation from operand values.
 void delete()
          Deregister this relation type and delete all of it's relations.
 IRelationTypeAttributes getAttributes()
          Get the effective attributes of this relation type.
 IResourceContext getContext()
          Get the context of this relation type.
 java.lang.String getDescription()
          Get a description for this relation type.
 java.lang.String getDescription(java.util.Locale locale)
          Get a description for this relation type for a given locale.
 java.lang.String getName()
          Get the name of this relation type as used for registration.
 java.lang.String getNamespace()
          Get the namespace for this relation type as used for registration.
 IRelation getRelation(IRelationOperand source, IRelationOperand target)
          Get the relation for a given wrapped source and target.
 IRelation getRelation(java.lang.Object source, java.lang.Object target)
          Get the relation for a given source and target value.
 IRelation getRelation(java.lang.String id)
          Get a specific relation for a given type and id.
 IRelationList getRelations()
          Get all availabe relations for this type.
 IRelationList getRelations(IRelationOperand source)
          Deprecated. as of NW04. Please use getRelationsBySource instead Get all the relations of this type for the given source operand.
 IRelationList getRelations(IRelationQuery query)
          Get the relations for this type, which match a given query expression.
 IRelationList getRelations(IRelationQuery query, IRelationQueryOrder order)
          Get the relations for this type, which match a given query expression.
 IRelationList getRelations(java.lang.Object source)
          Deprecated. as of NW04. Please use gteRelationsBySource instead Get all the relations of this type for the given source operand value.
 IRelationList getRelationsBySource(IRelationOperand source)
          Get all the relations of this type for the given source operand.
 IRelationList getRelationsBySource(java.lang.Object source)
          Get all the relations of this type for the given source operand value.
 IRelationList getRelationsByTarget(IRelationOperand target)
          Get all the relations of this type for the given target operand.
 IRelationList getRelationsByTarget(java.lang.Object target)
          Get all the relations of this type for the given target operand value.
 IRelationOperandType getSourceType()
          Get the source operand's type.
 IRelationOperandType getTargetType()
          Get the target operand's type.
 void reorder(IOrderedRelationPositioningList ordering)
          Reorder the relations for this type.
 IRelationTypeAttributes setAttributes(IRelationTypeAttributes attributes)
          Change the effective attributes of this relation type.
 void startWatching(IRelationWatcher watcher)
          Register a watcher to this relation type.
 void stopWatching(IRelationWatcher watcher)
          Deregister a watcher from this relation type.
 
Methods inherited from interface com.sapportals.wcm.util.name.IName
getNamespaceOrNull
 

Method Detail

getNamespace

public java.lang.String getNamespace()
Get the namespace for this relation type as used for registration.
Specified by:
getNamespace in interface IName
Returns:
a String with the namespace of the relation type.

getName

public java.lang.String getName()
Get the name of this relation type as used for registration.
Specified by:
getName in interface IName
Returns:
a String with the name of the relation type.

getDescription

public java.lang.String getDescription()
Get a description for this relation type.
Returns:
a String with the description of the relation type for the context of the relation type.

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Get a description for this relation type for a given locale.
Parameters:
locale - TBD: Description of the incoming method parameter
Returns:
a String with the description of the relation type for the given locale.

getSourceType

public IRelationOperandType getSourceType()
Get the source operand's type.
Returns:
the IRelationOperandType of this relation type's source operand type.

getTargetType

public IRelationOperandType getTargetType()
Get the target operand's type.
Returns:
the IRelationOperand of this relation type's target operand type.

getContext

public IResourceContext getContext()
Get the context of this relation type.
Returns:
a IResourceContext with the context for this relation type (which was used when retrieving this relation type).

getAttributes

public IRelationTypeAttributes getAttributes()
Get the effective attributes of this relation type.
Returns:
a IRelationTypeAttributes with the attributes for this relation type.

areAttributesMutable

public boolean areAttributesMutable()
Check if setAttributes(IRelationTypeAttributes) can be called or would throw an AccessDeniedException .
Returns:
TBD: Description of the outgoing return value

setAttributes

public IRelationTypeAttributes setAttributes(IRelationTypeAttributes attributes)
                                      throws InvalidArgumentException,
                                             AccessDeniedException,
                                             ResourceException
Change the effective attributes of this relation type.
Parameters:
attributes - the IRelationTypeAttributes to use.
Returns:
a IRelationTypeAttributes with the effective attributes for this relation type. Note: the returned attributes might differ from the passed attributes if not all attributes could be changed.
Throws:
InvalidArgumentException - if the given attributes were null .
AccessDeniedException - if the relation type was not accessible from the types given context or if the relation type's attributes are marked as not changeable.
ResourceException - if there was an internal error in the relation manager.

startWatching

public void startWatching(IRelationWatcher watcher)
                   throws InvalidArgumentException,
                          AccessDeniedException,
                          ResourceException
Register a watcher to this relation type.
Parameters:
watcher - a IRelationWatcher which will be able to handle callbacks from the triggers of a relation.
Throws:
InvalidArgumentException - if the watcher was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

stopWatching

public void stopWatching(IRelationWatcher watcher)
                  throws InvalidArgumentException,
                         AccessDeniedException,
                         ResourceException
Deregister a watcher from this relation type.
Parameters:
watcher - a IRelationWatcher which has to be deregistered.
Throws:
InvalidArgumentException - if the watcher was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

delete

public void delete()
            throws AccessDeniedException,
                   ResourceException
Deregister this relation type and delete all of it's relations.
Throws:
AccessDeniedException - if the relation type could not be deleted within the given types context.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(IRelationOperand source,
                                IRelationOperand target,
                                IPropertyMap properties)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a new relation from wrapped operands.
Parameters:
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(IRelationOperand source,
                                IRelationOperand target)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Parameters:
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

createRelation

public IRelation createRelation(java.lang.Object source,
                                java.lang.Object target,
                                IPropertyMap properties)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a relation from operand values.
Parameters:
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(java.lang.Object source,
                                java.lang.Object target)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Parameters:
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

getRelations

public IRelationList getRelations()
                           throws AccessDeniedException,
                                  ResourceException
Get all availabe relations for this type.
Returns:
a IRelationList with all the relations.
Throws:
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

public IRelationList getRelations(IRelationOperand source)
                           throws InvalidArgumentException,
                                  AccessDeniedException,
                                  ResourceException
Deprecated. as of NW04. Please use getRelationsBySource instead Get all the relations of this type for the given source operand.

Parameters:
source - a IRelationOperand which defines the source operand to get the relations for.
Returns:
a IRelationList with all the relations for the given source.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsBySource

public IRelationList getRelationsBySource(IRelationOperand source)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given source operand.
Parameters:
source - a IRelationOperand which defines the source operand to get the relations for.
Returns:
a IRelationList with all the relations for the given source.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

public IRelationList getRelations(java.lang.Object source)
                           throws InvalidArgumentException,
                                  AccessDeniedException,
                                  ResourceException
Deprecated. as of NW04. Please use gteRelationsBySource instead Get all the relations of this type for the given source operand value.

Parameters:
source - a Object which defines the source operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given source value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsBySource

public IRelationList getRelationsBySource(java.lang.Object source)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given source operand value.
Parameters:
source - a Object which defines the source operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given source value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsByTarget

public IRelationList getRelationsByTarget(IRelationOperand target)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given target operand.
Parameters:
target - a IRelationOperand which defines the target operand to get the relations for.
Returns:
a IRelationList with all the relations for the given target.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the target was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsByTarget

public IRelationList getRelationsByTarget(java.lang.Object target)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given target operand value.
Parameters:
target - a Object which defines the target operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given target value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the target value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

public IRelationList getRelations(IRelationQuery query)
                           throws AccessDeniedException,
                                  RelationQueryException,
                                  ResourceException
Get the relations for this type, which match a given query expression.
Parameters:
query - the IRelationQuery the searched relations should match or null if all relations should be returned.
Returns:
a IRelationList with all the relations of the given type. the list might be empty if no relations are found for the given type which match the given query.
Throws:
AccessDeniedException - Exception raised in failure situation
RelationQueryException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
RelationQueryException - if the relation query was not understood.
ResourceException - if there was an internal error in the relation manager.

getRelations

public IRelationList getRelations(IRelationQuery query,
                                  IRelationQueryOrder order)
                           throws AccessDeniedException,
                                  RelationQueryException,
                                  ResourceException
Get the relations for this type, which match a given query expression.
Not yet supported!
Parameters:
query - the IRelationQuery the searched relations should match or null if all relations should be returned.
order - the IRelationQueryOrder the searched relation list should be sorted by. if null the list is not ordered.
Returns:
a IRelationList with all the relations of the given type. the list might be empty if no relations are found for the given type which match the given query.
Throws:
AccessDeniedException - Exception raised in failure situation
RelationQueryException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
RelationQueryException - if the relation query was not understood.
ResourceException - if there was an internal error in the relation manager.

getRelation

public IRelation getRelation(java.lang.String id)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get a specific relation for a given type and id.
Parameters:
id - the id to get the relation for.
Returns:
the IRelation for the given type and id or null if no relation exists for this id.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the type or the id was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelation

public IRelation getRelation(IRelationOperand source,
                             IRelationOperand target)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get the relation for a given wrapped source and target.
Parameters:
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
Returns:
an IRelation with the relation for this type and the given source and target or null if no such relation exist.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if one of the source or the target parameters was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelation

public IRelation getRelation(java.lang.Object source,
                             java.lang.Object target)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get the relation for a given source and target value.
Parameters:
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
Returns:
an IRelation with the relation for this type and the given source and target or null if no such relation exist.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if one of the source or the target parameters was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(IOrderedRelationPosition position,
                                IRelationOperand source,
                                IRelationOperand target,
                                IPropertyMap properties)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a new ordered relation from wrapped operands.
Not yet supported!
Parameters:
position - the IOrderedRelationPosition which defines where to put the newly created relation to. if null is given, a OrderedRelationPosition.LAST is used.
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(IOrderedRelationPosition position,
                                IRelationOperand source,
                                IRelationOperand target)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Not yet supported!
Parameters:
position - TBD: Description of the incoming method parameter
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

createRelation

public IRelation createRelation(IOrderedRelationPosition position,
                                java.lang.Object source,
                                java.lang.Object target,
                                IPropertyMap properties)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a ordered relation from operand values.
Not yet supported!
Parameters:
position - the IOrderedRelationPosition which defines where to put the newly created relation to. if null is given, a OrderedRelationPosition.LAST is used.
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

public IRelation createRelation(IOrderedRelationPosition position,
                                java.lang.Object source,
                                java.lang.Object target)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Not yet supported!
Parameters:
position - TBD: Description of the incoming method parameter
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

reorder

public void reorder(IOrderedRelationPositioningList ordering)
             throws NotSupportedException,
                    InvalidArgumentException,
                    AccessDeniedException,
                    ResourceException
Reorder the relations for this type.
Not yet supported!
Parameters:
ordering - TBD: Description of the incoming method parameter
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if there is a pair of relation/relative IDs which are not compatible with respect to their type and source operand.
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.