com.ibm.mm.sdk.common

Class DKProjectionListICM

  • java.lang.Object
    • com.ibm.mm.sdk.common.DKProjectionListICM


  • public class DKProjectionListICM
    extends java.lang.Object
    Manages attribute projections for optimized data retrieval in CM8.

    This class provides a projection list mechanism to filter which attributes are retrieved from the datastore. By specifying only the attributes you need, you can significantly improve performance by reducing network traffic, memory usage, and database query complexity.

    Key Features:

    • Per-type attribute filtering for optimized retrieval
    • Support for special keywords (DK_ICM_SYSTEM_ATTRS, DK_ICM_ALL_ATTRS)
    • Reduces network traffic and memory consumption
    • Works with DKRetrieveOptionsICM for comprehensive retrieval control

    Performance Benefits:

    • Filters out large CLOB/BLOB attributes when not needed
    • Reduces table joins in database queries
    • Minimizes memory allocation for large result sets
    • Improves response time for queries returning many objects

    Example usage:

     // Create projection list
     DKProjectionListICM projections = DKProjectionListICM.createInstance(datastore);
    
     // Request only specific attributes for Document type
     projections.addProjection("Document", new String[]{"DocumentTitle", "DateCreated", "Creator"});
    
     // Request only system attributes for Folder type (for existence checks)
     projections.addProjection("Folder", new String[]{DKConstantICM.DK_ICM_SYSTEM_ATTRS});
    
     // Use with retrieve options
     DKRetrieveOptionsICM options = DKRetrieveOptionsICM.createInstance(datastore);
     options.baseAttributes(true);
     options.attributeFilters(projections);
    
     // Retrieve with filtered attributes
     DKDDO doc = datastore.createDDO("Document", DKConstant.DK_CM_DOCUMENT);
     doc.retrieve(options.dkNVPair());
     
    See Also:
    DKRetrieveOptionsICM, DKConstantICM.DK_ICM_SYSTEM_ATTRS, DKConstantICM.DK_ICM_ALL_ATTRS
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addProjection(java.lang.String itemTypeName, java.lang.String[] attributeNames)
      Adds a projection for the specified item type.
      void clear()
      Removes all projections.
      static DKProjectionListICM createInstance(DKDatastoreICM datastore)
      Factory method to create a new projection list instance.
      DKDatastoreICM getDatastore()
      Gets the associated datastore.
      java.lang.String[] getItemTypeNames()
      Gets all item type names that have projections defined.
      java.lang.String[] getProjection(java.lang.String itemTypeName)
      Gets the projection for the specified item type.
      boolean hasProjection(java.lang.String itemTypeName)
      Checks if a projection exists for the specified item type.
      boolean isEmpty()
      Checks if this projection list is empty.
      void removeProjection(java.lang.String itemTypeName)
      Removes the projection for the specified item type.
      int size()
      Gets the number of projections defined.
      java.lang.String toString()
      Returns a string representation of this projection list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • createInstance

        public static DKProjectionListICM createInstance(DKDatastoreICM datastore)
        Factory method to create a new projection list instance.
        Parameters:
        datastore - the datastore to associate with this projection list
        Returns:
        a new DKProjectionListICM instance
      • addProjection

        public void addProjection(java.lang.String itemTypeName,
                                  java.lang.String[] attributeNames)
        Adds a projection for the specified item type.

        Specifies which attributes should be retrieved for objects of the given type. If a projection already exists for this type, it will be replaced.

        Special attribute names:

        Parameters:
        itemTypeName - the item type name (e.g., "Document", "Folder")
        attributeNames - array of attribute names to retrieve, or null to remove projection
      • removeProjection

        public void removeProjection(java.lang.String itemTypeName)
        Removes the projection for the specified item type.

        After removal, all attributes will be retrieved for this type (subject to other retrieve options).

        Parameters:
        itemTypeName - the item type name to remove projection for
      • getProjection

        public java.lang.String[] getProjection(java.lang.String itemTypeName)
        Gets the projection for the specified item type.
        Parameters:
        itemTypeName - the item type name
        Returns:
        array of attribute names, or null if no projection exists for this type
      • hasProjection

        public boolean hasProjection(java.lang.String itemTypeName)
        Checks if a projection exists for the specified item type.
        Parameters:
        itemTypeName - the item type name
        Returns:
        true if a projection exists, false otherwise
      • getItemTypeNames

        public java.lang.String[] getItemTypeNames()
        Gets all item type names that have projections defined.
        Returns:
        array of item type names
      • clear

        public void clear()
        Removes all projections.
      • size

        public int size()
        Gets the number of projections defined.
        Returns:
        the number of item types with projections
      • isEmpty

        public boolean isEmpty()
        Checks if this projection list is empty.
        Returns:
        true if no projections are defined, false otherwise
      • getDatastore

        public DKDatastoreICM getDatastore()
        Gets the associated datastore.
        Returns:
        the datastore instance
      • toString

        public java.lang.String toString()
        Returns a string representation of this projection list.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string showing all projections in format "DKProjectionListICM{type1=[attr1,attr2], type2=[attr3,attr4]}"
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.