com.sap.netweaver.bc.rf.mi.variant

Interface IVariantManager

All Known Subinterfaces:
IMutableVariantManager

public interface IVariantManager

Read-only interface defining a repository sub-manager for resource variants. It provides access to logical and physical variant resources. A repository manager may support variant and non-variant resources in the same repository instance - this means isA(ILogicalVariantResource.class) might not return true for all resources.

The manager has access to the variant context as a map of properties which is attached to the access context (IAccessContext.getVariantContext()). To support applications not aware of variants the repository should be able to work with a default context if the variant context is missing. The repository should also be able to use default values for missing properties. Alternative in both cased: throw an InvalidVariantContextException . Because the variant context may contain properties of other repository types, unknown properties have to be ignored. If a property name is known but the type does not match or the value is not allowed, an InvalidVariantContextException has to be thrown.

See Also:
ILogicalVariantResource, IPhysicalVariantResource

Method Summary
 List findPhysicalResources(IResourceHandle logicalResourceHandle, Map contextProperties)
          Returns a list of all physical resources which match the given map of context-relevant properties.
 Map getAllInvariantProperties(IResourceHandle logicalResourceHandle)
          Returns a map of all invariant properties of the logical resource.
 IProperty getInvariantProperty(IResourceHandle logicalResourceHandle, IPropertyName propertyName)
          Returns the specified invariant property or null if it does not exist.
 Map getListedInvariantProperties(IResourceHandle logicalResourceHandle, List propertyNameList)
          Returns a map of invariant properties with the specified names.
 IResourceHandle getLogicalResource(IResourceHandle physicalResourceHandle)
          Returns the logical resource handle the physical resource handle belongs to - must not be null.
 IResourceHandle getPhysicalResource(IResourceHandle logicalResourceHandle)
          Returns the physical resource handle that was the result of the context resolution for the given logical resource handle (at the time when the logical resource handle was created).
 boolean isLogicalResource(IResourceHandle handle)
          Returns true if the given handle refers to a logical resource.
 boolean isPhysicalResource(IResourceHandle handle)
          Returns true if the given handle refers to a physical resource.
 

Method Detail

isPhysicalResource

boolean isPhysicalResource(IResourceHandle handle)
                           throws ResourceException
Returns true if the given handle refers to a physical resource.

Parameters:
handle - A resource handle
Returns:
true if the given handle refers to a physical resource.
Throws:
ResourceException

isLogicalResource

boolean isLogicalResource(IResourceHandle handle)
                          throws ResourceException
Returns true if the given handle refers to a logical resource.

Parameters:
handle - A resource handle
Returns:
true if the given handle refers to a logical resource.
Throws:
ResourceException

getPhysicalResource

IResourceHandle getPhysicalResource(IResourceHandle logicalResourceHandle)
                                    throws ResourceException
Returns the physical resource handle that was the result of the context resolution for the given logical resource handle (at the time when the logical resource handle was created). Note: A repository should implement this behaviour by attaching a ready-made PR handle to the LR handle when it is created and just returning the attached handle in this method.

Parameters:
logicalResourceHandle -
Returns:
the physical resource handle that was the result of the context resolution for the given logical resource handle.
Throws:
ResourceException

getLogicalResource

IResourceHandle getLogicalResource(IResourceHandle physicalResourceHandle)
                                   throws ResourceException
Returns the logical resource handle the physical resource handle belongs to - must not be null.

Parameters:
physicalResourceHandle -
Returns:
the logical resource handle the physical resource handle belongs to - must not be null.
Throws:
ResourceException

findPhysicalResources

List findPhysicalResources(IResourceHandle logicalResourceHandle,
                           Map contextProperties)
                           throws ResourceException,
                                  OperationNotSupportedException
Returns a list of all physical resources which match the given map of context-relevant properties. A resources matches if the values of all properties in the map are equal to the values of the resource properties. Properties that exist at the resource but are not contained in the map are used as "wildcard" properties, that means they match any value. If the property map is empty or null the list must contain all existing physical resources (at least one). If one of the properties in the map is not a known context property an exception has to be thrown.

Parameters:
logicalResourceHandle - The handle of a logical resource.
contextProperties - A map of context properties to be used as a search condition. Map keys: IPropertyName Map values IProperty
Returns:
Returns a list of physical resource handles - may be empty but not null.
Throws:
ResourceException - If one of the properties in the map is not a known context property.
OperationNotSupportedException

getAllInvariantProperties

Map getAllInvariantProperties(IResourceHandle logicalResourceHandle)
                              throws ResourceException
Returns a map of all invariant properties of the logical resource.

Parameters:
logicalResourceHandle -
Returns:
a map of invariant properties: keys = IPropertyName, values = IProperty. The map may be empty but not null.
Throws:
ResourceException

getListedInvariantProperties

Map getListedInvariantProperties(IResourceHandle logicalResourceHandle,
                                 List propertyNameList)
                                 throws ResourceException
Returns a map of invariant properties with the specified names.

Parameters:
logicalResourceHandle -
propertyNameList - A list of property names - must not be null. Names of non-invariant properties are ignored.
Returns:
a map of invariant properties: keys = IPropertyName, values = IProperty. The map may be empty but not null.
Throws:
ResourceException

getInvariantProperty

IProperty getInvariantProperty(IResourceHandle logicalResourceHandle,
                               IPropertyName propertyName)
                               throws ResourceException
Returns the specified invariant property or null if it does not exist.

Parameters:
logicalResourceHandle -
propertyName -
Returns:
the specified invariant property or null if it does not exist.
Throws:
ResourceException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice