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