@Transactional(readOnly = false)
private List<AbstractFacet> extractFacets(ApiData apiData, int objectTypes,
UpdateInfo updateInfo) throws Exception {
List<AbstractFacet> newFacets = new ArrayList<AbstractFacet>();
AbstractFacetExtractor facetExtractor = apiData.updateInfo.apiKey
.getConnector().extractor(objectTypes, beanFactory);
if (facetExtractor==null)
return newFacets;
List<ObjectType> connectorTypes = ObjectType.getObjectTypes(
apiData.updateInfo.apiKey.getConnector(), objectTypes);
if (connectorTypes != null) {
for (ObjectType objectType : connectorTypes) {
List<AbstractFacet> facets = facetExtractor.extractFacets(updateInfo,
apiData, objectType);
for (AbstractFacet facet : facets) {
AbstractFacet newFacet = persistFacet(facet);
if (newFacet!=null)
newFacets.add(newFacet);
}
}
} else {
List<AbstractFacet> facets = facetExtractor.extractFacets(updateInfo, apiData,
null);
for (AbstractFacet facet : facets) {
AbstractFacet newFacet = persistFacet(facet);
if (newFacet!=null)
newFacets.add(newFacet);