psdi.security.vmm

Class DefaultVMMSyncAdapter

  • All Implemented Interfaces:
    VMMSyncListener


    public class DefaultVMMSyncAdapter
    extends VMMSyncAdapter
    A default adapter class that synchronizes the VMM data with configured MAXIMO database table mappings. An object of this class is registered as a listener to the synchronizer object and receives notification events whenever VMM user or group data need to be synchronized.
    • Field Detail

      • cachedPreparedStatements

        protected java.util.HashMap cachedPreparedStatements
        A cache of prepared statements to improve the performance of the repeatedly executed SQL statements.
    • Constructor Detail

      • DefaultVMMSyncAdapter

        public DefaultVMMSyncAdapter()
    • Method Detail

      • deleteMemberRecords

        protected void deleteMemberRecords(java.sql.Connection con,
                                           VMMSyncData syncData,
                                           MemberDataMap memberVMMDataMap)
                                    throws java.sql.SQLException
        Deletes member records based on the data provided.
        Parameters:
        con - database connection to be used
        syncData - synchronization data obtained from VMM
        memberVMMDataMap - member data mapping to be used
        Throws:
        java.sql.SQLException - if fails to delete members
      • addMemberRecords

        protected void addMemberRecords(java.sql.Connection con,
                                        VMMSyncData syncData,
                                        MemberDataMap memberVMMDataMap,
                                        java.util.Set members)
                                 throws VMMSyncException,
                                        java.sql.SQLException
        Adds member records based on the data provided.
        Parameters:
        con - database connection to be used
        syncData - synchronization data obtained from VMM server
        memberVMMDataMap - member data mapping to be used
        members - list of user account names
        Throws:
        java.sql.SQLException - if fails to add members
        VMMSyncException
      • getMemberDataMapKeyColumnValue

        protected java.lang.Object getMemberDataMapKeyColumnValue(java.lang.String keyColumn,
                                                                  VMMSyncData syncData,
                                                                  MemberDataMap memberVMMDataMap)
        Returns the key value for the given key column from the member data mapping.
        Parameters:
        keyColumn - key column
        syncData - synchronization data from VMM Server
        memberVMMDataMap - member data map
        Returns:
        key value for the given key column
      • getMemberDataMapColumnValue

        protected java.lang.Object getMemberDataMapColumnValue(java.sql.Connection con,
                                                               java.lang.String column,
                                                               VMMSyncData syncData,
                                                               MemberDataMap memberVMMDataMap)
                                                        throws VMMSyncException
        Returns the column value for the given column from the member data mapping.
        Parameters:
        column - column name
        syncData - synchronization data from VMM Server
        memberVMMDataMap - member data map
        Returns:
        key value for the given key column
        Throws:
        VMMSyncException
      • cachePreparedStatement

        protected void cachePreparedStatement(java.lang.String query,
                                              java.sql.PreparedStatement stmt)
        Puts the statement in the cache based on the query.
        Parameters:
        query - query to be used as a key.
        stmt - statement to be cached.
      • getCachedPreparedStatement

        protected java.sql.PreparedStatement getCachedPreparedStatement(java.lang.String query)
        Returns a cached statement object for the given query.
        Parameters:
        query - query to be used to retrieve the cached statement.
        Returns:
        a cached statement object for the given query, if exists, otherwise null.
      • closeCachedPreparedStatements

        protected void closeCachedPreparedStatements()
        Closes all the cached prepared statements. This is done when the synchronizer indicates that the synchronization operation is completed.
      • getDataMapValue

        protected java.lang.Object getDataMapValue(java.sql.Connection con,
                                                   java.lang.String tableId,
                                                   java.lang.String columnName,
                                                   VMMSyncData syncData,
                                                   VMMDataMap VMMDataMap)
                                            throws VMMSyncException
        Returns the value to be used to for the given table and column based on the data mapping. If the data mapping contains an VMM attribute, the appropriate data obtained from VMM server is returned. If the data mapping contains special attributes that need processing, the processing is completed and the resulted value is returned.
        Parameters:
        con - database connection to be used
        tableId - table id
        columnName - column name
        syncData - data from the VMM server
        VMMDataMap - data mapping
        Returns:
        the value to be used.
        Throws:
        VMMSyncException - if fails to get the data value.
      • insertRecord

        protected MboRemote insertRecord(java.sql.Connection con,
                                         java.lang.String tableId,
                                         MboSetRemote mboSet,
                                         VMMSyncData syncData,
                                         VMMDataMap dataMap)
                                  throws VMMSyncException,
                                         MXException,
                                         java.rmi.RemoteException
        Inserts a record into MboSet based on the information provided.
        Parameters:
        con - connection to be used
        tableId - table id
        mboSet - The MboSet to get the new record.
        syncData - data from LDAP Server
        dataMap - data mapping
        Returns:
        The new Mbo.
        Throws:
        VMMSyncException
        MXException
        java.rmi.RemoteException
      • updateRecord

        protected void updateRecord(java.sql.Connection con,
                                    java.lang.String tableId,
                                    MboRemote mbo,
                                    VMMSyncData syncData,
                                    VMMDataMap dataMap)
                             throws VMMSyncException,
                                    MXException,
                                    java.rmi.RemoteException
        Updates an existing mbo based on the information provided.
        Parameters:
        con - connection to be used
        tableId - table id
        mbo - The Mbo
        syncData - data from LDAP Server
        dataMap - data mapping
        Throws:
        VMMSyncException
        MXException
        java.rmi.RemoteException
      • deleteRecord

        protected void deleteRecord(MboRemote mbo)
                             throws MXException,
                                    java.rmi.RemoteException
        Deletes an existing mbo.
        Parameters:
        mbo - The mbo to be deleted.
        Throws:
        MXException
        java.rmi.RemoteException
      • logBindValue

        protected void logBindValue(java.lang.String bindColumnName,
                                    java.lang.Object bindValue)
        Logs the bind column name and its value.