srcanaapps/depexplorer/com.nokia.s60tools.appdep/src/com/nokia/s60tools/appdep/core/data/ICacheDataManager.java
author noe\swadi
Sat, 09 Jan 2010 10:04:11 +0530
changeset 0 a02c979e8dfd
permissions -rw-r--r--
1. Copyrights changed to EPL 2. Feature updates mentioned in release notes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     1
/*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     3
* All rights reserved.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     4
* This component and the accompanying materials are made available
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     6
* which accompanies this distribution, and is available
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     8
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     9
* Initial Contributors:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    11
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    12
* Contributors:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    13
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    14
* Description:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    15
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    16
*/
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    17
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    18
package com.nokia.s60tools.appdep.core.data;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    19
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    20
import java.io.IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    21
import java.util.ArrayList;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    22
import java.util.Collection;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    23
import java.util.List;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    24
import java.util.Map;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    25
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    26
import com.nokia.s60tools.appdep.core.ITargetPlatform;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    27
import com.nokia.s60tools.appdep.core.job.IJobProgressStatus;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    28
import com.nokia.s60tools.appdep.core.model.AbstractFunctionData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    29
import com.nokia.s60tools.appdep.core.model.ComponentPropertiesData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    30
import com.nokia.s60tools.appdep.core.model.ExportFunctionData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    31
import com.nokia.s60tools.appdep.core.model.ImportFunctionData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    32
import com.nokia.s60tools.appdep.core.model.UsedComponentData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    33
import com.nokia.s60tools.appdep.exceptions.CacheIndexNotReadyException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    34
import com.nokia.s60tools.appdep.search.MatchType;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    35
import com.nokia.s60tools.appdep.search.SearchConstants.SearchType;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    36
import com.nokia.s60tools.util.exceptions.JobCancelledByUserException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    37
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    38
/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    39
 * Interface for accessing cache data manager object itself.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    40
 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    41
public interface ICacheDataManager {
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    42
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    43
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    44
	 * Searches from cache with wanted parameters.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    45
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    46
	 * @param searchString String to search for.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    47
	 * @param searchType what kind of information wanted to search.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    48
	 * @param matchType how searchString must be occur in results.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    49
	 * @return Map of matching results or empty list if none found. Map contains component names as keys
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    50
	 * and function data list as values. Values are <code>null</code>s when search type is {@link SearchType.SEARCH_COMPONENTS}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    51
	 * and instances of {@link ExportFunctionData} when search type is {@link SearchType.SEARCH_EXPORTED_FUNCTION}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    52
	 * and instances of {@link ImportFunctionData} when search type is {@link SearchType.SEARCH_IMPORTED_FUNCTIONS}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    53
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    54
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    55
	public Map<String, List<AbstractFunctionData>> searchCache(String searchString, SearchType searchType, MatchType matchType);
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    56
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    57
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    58
	 * Searches concrete component implementations for generic component name. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    59
	 * Results will be a list of component that has given component names
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    60
	 * as suffix.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    61
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    62
	 * E.g. if given generic component name is <code>hal.dll</code> returned list can be:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    63
	 * <code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    64
	 *   _h2_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    65
	 *   _h4hrp_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    66
	 *   _integrator_cm1136_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    67
	 *   _template_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    68
	 * </code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    69
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    70
	 * @param genericComponentName Name of the generic component
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    71
	 * @return a String array of concrete component names found in used SDK, or empty array if none found. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    72
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    73
	public String [] searchConcreteComponentsByGenericComponent(String genericComponentName);
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    74
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    75
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    76
	 * Gets the name of the concrete implementation by generic component name and prefix list.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    77
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    78
	 * E.g. if prefix list is: 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    79
	 * <code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    80
	 *   _h2_
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    81
	 *   _h4hrp_
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    82
	 *   _integrator_cm1136_
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    83
	 *   _template_
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    84
	 * </code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    85
	 * And wanted component name name is <code>hal.dll</code>. When in used <code>sdk</code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    86
	 * there is components with prefixes given and component name as suffix:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    87
	 * <code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    88
	 *   _h2_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    89
	 *   _h4hrp_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    90
	 *   _integrator_cm1136_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    91
	 *   _template_hal.dll
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    92
	 * </code>
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    93
	 * Result will be <code>_h2_hal.dll</code> because <code>_h2_</code> prefix was first in prefix list.  
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    94
	 * 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    95
	 * @param prefixList Prefix list.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    96
	 * @param componentName Component name.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    97
	 * @return First component matching prefix list by in order they appear or <code>null</code> if can't found any.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    98
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    99
	public String searchComponentWithPrefix(List<String> prefixList, String componentName);
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   100
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   101
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   102
	 * Gets the component properties for the given component name.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   103
	 * Delegates call further to corresponding method in <code>ITargetCacher</code> interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   104
	 * @param cmpName The name of the component.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   105
	 * @param targetPlatformRestriction Component must belong to the given target platform (armv5, armv9e etc.).
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   106
	 *                                  If set to <code>null</code>, match is made only based on component name.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   107
	 * @return component properties data for the component, or <code>null</code> if component was not found.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   108
	 * @throws CacheIndexNotReadyException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   109
	 * @throws IOException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   110
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   111
	public ComponentPropertiesData getComponentPropertyArrayForComponent(String cmpName, ITargetPlatform targetPlatformRestriction) throws CacheIndexNotReadyException, IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   112
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   113
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   114
	 * Gets the components that the given component directly depends upon.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   115
	 * Delegates call further to corresponding method in <code>ITargetCacher</code> interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   116
	 * @param componentName The name of the component.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   117
	 * @return The string array of component name that are directly depended upon.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   118
	 * @throws IOException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   119
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   120
	public List<UsedComponentData> getDirectlyDependentComponentsFor(String compToSearchFor) throws IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   121
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   122
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   123
	 * Gets the functions that are exported from the given library for the use
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   124
	 * of other components. Methods can be found from symbols table cache 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   125
	 * file in the ordinal order 1->N.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   126
	 * Delegates call further to corresponding method in <code>ITargetCacher</code> interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   127
	 * @param exportedCmpName Name of the component the functions are exported from.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   128
	 * @return String array of exported function info lines without any parsing.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   129
	 * @throws CacheIndexNotReadyException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   130
	 * @throws IOException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   131
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   132
	public Collection<ExportFunctionData> getExportedFunctionsForComponent(String componentNameWithExtension) throws CacheIndexNotReadyException, IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   133
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   134
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   135
	 * Gets the functions that are imported from imported component for the use
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   136
	 * of parent component.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   137
	 * Delegates call further to corresponding method in <code>ITargetCacher</code> interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   138
	 * @param parentCmpName Name of the parent component that imports the functions.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   139
	 * @param importedCmpName Name of the component that the functions are imported from.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   140
	 * @return String array of imported function info lines without any parsing.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   141
	 * @throws CacheIndexNotReadyException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   142
	 * @throws IOException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   143
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   144
	public Collection<ImportFunctionData> getParentImportedFunctionsForComponent(String parentCmpName, String importedCmpName) throws CacheIndexNotReadyException, IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   145
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   146
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   147
	 * Gets the string array of component properties for the components
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   148
	 * that are using the given component. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   149
	 * Delegates call further to corresponding method in <code>ITargetCacher</code> interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   150
	 * @param progressCallback Job progress callback interface.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   151
	 * @param resultComponentsArrayList Array list objects to return resulting components into. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   152
	 * @param componentName Name of the component to search using components for. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   153
	 * @param functionOrdinal Ordinal of the function to search using components for. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   154
	 *                        This parameter can be set to <code>null</code> if we are
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   155
	 *                        only interested in components that are using the given component.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   156
	 * @throws JobCancelledByUserException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   157
	 * @throws IOException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   158
	 * @throws CacheIndexNotReadyException 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   159
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   160
	public void getUsingComponents(IJobProgressStatus progressCallback, ArrayList<ComponentPropertiesData> resultComponentsArrayList, String componentName, String functionOrdinal) throws JobCancelledByUserException, IOException;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   161
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
   162
}