Index

dkAttrMapping

Purpose:

dkAttrMapping is a virtual class to define an associative mapping between mapped or federated attributes and map-to or native attributes. It maps one or more mapped or federated attributes with one or more map-to or native attributes. It supports Mapped-to-Native attribute mapping with optional conversion methods. It can be used to define mapping with native attributes within one datastore (without the federation).

Note: Each instance of this class defines one associative attribute mapping, which could be a 1-to-1, 1-to-Native, Mapped-to-1, or Mapped-to-Native mapping.

Class summary:

 class dkAttrMapping
 {
   public:
    virtual ~dkAttrMapping();
    virtual DKString getName();
    virtual void setName(const char* name);
  
    // (LHS) - the federated or mapped attributes : M-to-? mapping
    virtual void addMappedAttr(dkAttrDef* attr);
    virtual void removeMappedAttr(const char* name);
    virtual short numberOfMappedAttr();
    virtual dkAttrDef* getMappedAttr();
    virtual dkAttrDef* getMappedAttr(short index);
    virtual DKString getMappedAttrName();
    virtual DKString getMappedAttrName(short index);
    virtual DKString* listMappedAttrNames(long& arraySize);
    
    // (RHS) - the native attributes : ?-to-N mapping
    virtual void addMapToAttr(dkAttrDef* attr);
    virtual void removeMapToAttr(const char* name);
    virtual short numberOfMapToAttr();
    virtual dkAttrDef* getMapToAttr();
    virtual dkAttrDef* getMapToAttr(short index);
    virtual DKString getMapToAttrName();
    virtual DKString getMapToAttrName(short index);
    virtual DKString* listMapToAttrNames(long& arraySize);
    
 
    // conversion methods:
    virtual void   setToNative(const char* fcn);
    virtual DKString getToNative();
    virtual void   setFromNative(const char* fcn);
    virtual DKString getFromNative();
    virtual void   setDLLName(const char* dllName);
    virtual DKString getDLLName();
    virtual void   setToDLLName(const char* dllName);
    virtual DKString getToDLLName();
	 virtual void   setFromDLLName(const char* dllName);
	 virtual DKString getFromDLLName();
    
    // checking conversion requirements
    virtual short  checkConversion();
  
   protected:
    dkAttrMapping();
  
 };

Members:

Member functions

getName
Gets the name of this schema mapping object.
virtual DKString getName();

setName
Sets the name of this schema mapping object.
virtual void setName(const char* name);

addMappedAttr
Adds a new mapped or federated attribute to the current mapping to native attribute(s).

Parameters

attr
An attribute definition object.
virtual void addMappedAttr(dkAttrDef* attr);

removeMappedAttr
Removes an existing mapped or federated attribute from the current mapping to native attribute(s).
virtual void removeMappedAttr(const char* name);

numberOfMappedAttr
Returns the number of mapped or federated attribute(s) (in the LHS) in the current mapping to native attribute(s).
virtual short numberOfMappedAttr();

getMappedAttr
Returns the definition of the mapped or federated attribute (in the LHS) in the current mapping to native attribute(s). The second form returns the definition of the n-th mapped or federated attribute (in the LHS) in the current mapping to native attribute(s).

Parameters

index
The index of the mapped or federated attribute when there are more than one mapped attribute specified (in M-to-?) mapping.


--

virtual dkAttrDef* getMappedAttr();
virtual dkAttrDef* getMappedAttr(short index);

getMappedAttrName
Returns the name of the mapped or federated attribute (in the LHS) in the current mapping to native attribute(s). The second form returns the name of the n-th mapped or federated attribute (in the LHS) in the current mapping to native attribute(s).
virtual DKString getMappedAttrName();
virtual DKString getMappedAttrName(short index);

listMappedAttrNames
Lists the names of all mapped or federated attribute defined in the current mapping.
virtual DKString* listMappedAttrNames(long& arraySize);

addMapToAttr
Adds a new native attribute to the current mapping to mapped or federated attribute(s).

Parameters
attr -- An attribute definition object.

virtual void addMapToAttr(dkAttrDef* attr);

removeMapToAttr
Removes an existing native attribute from the current mapping to mapped or federated attribute(s).
virtual removeMapToAttr(const char* name);

numberOfMapToAttr
Returns the number native attribute(s) (in the RHS) in the current mapping to mapped or federated attribute(s).
virtual short numberOfMapToAttr();

getMapToAttr
Returns the definition of the native attribute (in the RHS) in the current mapping to mapped or federated attribute(s). The second form returns the definition of the n-th native attribute (in the RHS) in the current mapping to mapped or federated attribute(s).

Parameters

index
The index of the native attribute when there are more than one native attribute specified (in ?-to-N) mapping.
virtual dkAttrDef* getMapToAttr();
virtual dkAttrDef* getMapToAttr(short index);

getMapToAttrName
Returns the name of the native attribute (in the RHS) in the current mapping to mapped or federated attribute(s). The second form returns the name of the n-th map-to or native attribute (in the RHS) in the current mapping to mapped or federated attribute(s).
virtual DKString getMapToAttrName();
virtual DKString getMapToAttrName(short index);

listMapToAttrNames
Lists the names of all native attributes defined in the current mapping.
virtual DKString* listMapToAttrNames(long& arraySize);

setToNative
Sets the name of the Java conversion function from federated to native attribute(s).

Parameters

fcn
The name of the Java conversion function, including the class path.
virtual void setToNative(const char* fcn);

getToNative
Gets the name of the Java conversion function from federated to native attribute(s).
virtual DKString getToNative();

setFromNative
Sets the name of the Java conversion function from native to federated attribute(s).

Parameters

fcn
The name of the Java conversion function, including the class path.
virtual void setFromNative(const char* fcn);

getFromNative
Gets the name of the Java conversion function from native to federated attribute(s).
virtual DKString getFromNative();

setDLLName
Sets the DLL name containing the conversion function. Set this value if you want the mapping to be usable by C++ programs.

Parameters

dllName
The name of the DLL containing the conversion function.
virtual void setDLLName(const char* dllName);

getDLLName
Gets the DLL name containing the conversion function.
virtual DKString getDLLName();

checkConversion
Checks the kind of data conversion required for this mapping. Returns a short with the following possible values:
dkAttributeMapping.NO_CONVERSION 
     dkAttributeMapping.CONVERSION_1_1 
     dkAttributeMapping.CONVERSION_1_M 
     dkAttributeMapping.CONVERSION_M_1 

There is no practical use for M-to-N conversion.

virtual short checkConversion();

getToDLLName
Gets the DLL name containing the conversion function.
virtual DKString getToDLLName();

getFromDLLName
Gets the DLL name containing the conversion function.
virtual DKString getFromDLLName();

setToDLLName
Sets the DLL name containing the conversion function. Set this value if you want the mapping to be usable by C++ programs.
virtual void setToDLLName(const char* dllName);

setFromDLLName
Sets the DLL name containing the conversion function. Set this value if you want the mapping to be usable by C++ programs.
virtual void setFromDLLName(const char* dllName);

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.