001/**
002 * Copyright 2005-2015 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.devtools.pdle;
017
018import java.util.List;
019import java.util.Map;
020
021
022/**
023 * This interface defines the DB access methods required by the PostDataLoadEncryptionService
024 */
025public interface PostDataLoadEncryptionDao {
026    
027    final int UNENCRYPTED_VALUE_INDEX = 0;
028    final int ENCRYPTED_VALUE_INDEX = 1;
029    
030    void createBackupTable(String tableName);
031
032    void truncateTable(String tableName);
033
034    void restoreTableFromBackup(String tableName);
035
036    void dropBackupTable(String tableName);
037          
038    boolean doesBackupTableExist(String tableName);
039
040    void addEncryptionIndicatorToBackupTable(String tableName);
041
042    void dropEncryptionIndicatorFromBackupTable(String tableName);
043
044    void updateColumnValuesInBackupTable(String tableName, Map<String, List<String>> columnNameOldNewValuesMap);
045
046    List<Map<String, String>> retrieveUnencryptedColumnValuesFromBackupTable(String tableName, final List<String> columnNames, int numberOfRowsToCommitAfter);
047
048    String getUpdateBackupTableColumnsSql(String tableName, Map<String, List<String>> columnNameOldNewValuesMap);
049
050    boolean performEncryption(final String tableName, final List<Map<String, List<String>>> rowsToEncryptColumnNameOldNewValuesMap) throws Exception;
051        
052}