public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getFullName(metadataID); }
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getFullName(metadataID); }
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getFullName(metadataID); }
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { if(metadataID instanceof TempMetadataID) { return ((TempMetadataID)metadataID).getID(); } return this.actualMetadata.getFullName(metadataID); }
static SourceCapabilities getCapabilities(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, TeiidComponentException { // Find capabilities String modelName = metadata.getFullName(modelID); return capFinder.findCapabilities(modelName); }
static SourceCapabilities getCapabilities(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, TeiidComponentException { // Find capabilities String modelName = metadata.getFullName(modelID); return capFinder.findCapabilities(modelName); }
static SourceCapabilities getCapabilities(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, TeiidComponentException { // Find capabilities String modelName = metadata.getFullName(modelID); return capFinder.findCapabilities(modelName); }
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { if(metadataID instanceof TempMetadataID) { return ((TempMetadataID)metadataID).getID(); } return this.actualMetadata.getFullName(metadataID); }
public String getFullName(Object metadataID) throws TeiidComponentException, QueryMetadataException { if(metadataID instanceof TempMetadataID) { return ((TempMetadataID)metadataID).getID(); } return this.actualMetadata.getFullName(metadataID); }
static List<ElementSymbol> getElementsUnderNode(Object mid, Collection<ElementSymbol> validElements, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> elements = new ArrayList<ElementSymbol>(); String nodeName = metadata.getFullName(mid); for (ElementSymbol validElement : validElements) { String qualifiedName = validElement.getName(); if (StringUtil.startsWithIgnoreCase(qualifiedName, nodeName) && (qualifiedName.length() == nodeName.length() || qualifiedName.charAt(nodeName.length()) == '.')) { elements.add(validElement); } } return elements; }
public static boolean applyRowSecurity(QueryMetadataInterface metadata, final GroupSymbol group, CommandContext cc) throws QueryMetadataException, TeiidComponentException { Map<String, DataPolicy> policies = cc.getAllowedDataPolicies(); if (policies == null || policies.isEmpty()) { return false; } String fullName = metadata.getFullName(group.getMetadataID()); for (Map.Entry<String, DataPolicy> entry : policies.entrySet()) { DataPolicyMetadata dpm = (DataPolicyMetadata)entry.getValue(); if (dpm.hasRowSecurity(fullName)) { return true; } } return false; }
public static boolean applyRowSecurity(QueryMetadataInterface metadata, final GroupSymbol group, CommandContext cc) throws QueryMetadataException, TeiidComponentException { Map<String, DataPolicy> policies = cc.getAllowedDataPolicies(); if (policies == null || policies.isEmpty()) { return false; } String fullName = metadata.getFullName(group.getMetadataID()); for (Map.Entry<String, DataPolicy> entry : policies.entrySet()) { DataPolicyMetadata dpm = (DataPolicyMetadata)entry.getValue(); if (dpm.hasRowSecurity(fullName)) { return true; } } return false; }
public static boolean applyRowSecurity(QueryMetadataInterface metadata, final GroupSymbol group, CommandContext cc) throws QueryMetadataException, TeiidComponentException { Map<String, DataPolicy> policies = cc.getAllowedDataPolicies(); if (policies == null || policies.isEmpty()) { return false; } String fullName = metadata.getFullName(group.getMetadataID()); for (Map.Entry<String, DataPolicy> entry : policies.entrySet()) { DataPolicyMetadata dpm = (DataPolicyMetadata)entry.getValue(); if (dpm.hasRowSecurity(fullName)) { return true; } } return false; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
public static Collection<ElementSymbol> collectTempElements(GroupSymbol group, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException { ArrayList<ElementSymbol> validElements = new ArrayList<ElementSymbol>(); // Create GroupSymbol for temp groups and add to groups Collection<?> tempGroups = metadata.getXMLTempGroups(group.getMetadataID()); for (Object tempGroupID : tempGroups) { String name = metadata.getFullName(tempGroupID); GroupSymbol tempGroup = new GroupSymbol(name); tempGroup.setMetadataID(tempGroupID); validElements.addAll(ResolverUtil.resolveElementsInGroup(tempGroup, metadata)); } return validElements; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
public static boolean isNoCacheGroup(QueryMetadataInterface metadata, Object metadataID, Option option) throws QueryMetadataException, TeiidComponentException { if(option == null || !option.isNoCache()){ return false; } if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){ //only OPTION NOCACHE, no group specified return true; } String fullName = metadata.getFullName(metadataID); for (String groupName : option.getNoCacheGroups()) { if(groupName.equalsIgnoreCase(fullName)){ return true; } } return false; }
public static List<? extends Expression> maskColumns(List<ElementSymbol> cols, final GroupSymbol group, QueryMetadataInterface metadata, CommandContext cc) throws QueryMetadataException, TeiidComponentException, TeiidProcessingException { Map<String, DataPolicy> policies = cc.getAllowedDataPolicies(); if (policies == null || policies.isEmpty()) { return cols; } ArrayList<Expression> result = new ArrayList<Expression>(cols.size()); ExpressionMappingVisitor emv = new RowBasedSecurityHelper.RecontextVisitor(group); GroupSymbol gs = group; if (gs.getDefinition() != null) { gs = new GroupSymbol(metadata.getFullName(group.getMetadataID())); gs.setMetadataID(group.getMetadataID()); } for (int i = 0; i < cols.size(); i++) { result.add(maskColumn(cols.get(i), gs, metadata, emv, policies, cc)); } return result; }
private void helpCheckElements(LanguageObject langObj, String[] elementNames, String[] elementIDs) { List<ElementSymbol> elements = new ArrayList<ElementSymbol>(); ElementCollectorVisitor.getElements(langObj, elements); assertEquals("Wrong number of elements: ", elementNames.length, elements.size()); //$NON-NLS-1$ for(int i=0; i<elements.size(); i++) { ElementSymbol symbol = elements.get(i); assertEquals("Element name does not match: ", elementNames[i].toUpperCase(), symbol.getName().toUpperCase()); //$NON-NLS-1$ Object elementID = symbol.getMetadataID(); try { String name = metadata.getFullName(elementID); assertNotNull("ElementSymbol " + symbol + " was not resolved and has no metadataID", elementID); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("ElementID name does not match: ", elementIDs[i].toUpperCase(), name.toUpperCase()); //$NON-NLS-1$ } catch (TeiidComponentException e) { throw new RuntimeException(e); } } }
private ElementSymbol resolveElementSymbol(String elementName, MappingSourceNode sourceNode) { try { QueryMetadataInterface metadata = this.planEnv.getGlobalMetadata(); ElementSymbol symbol = sourceNode.getMappedSymbol(new ElementSymbol(elementName)); Object elementID = metadata.getElementID(symbol.getName()); symbol.setMetadataID(elementID); Object groupID = metadata.getGroupIDForElementID(elementID); String groupName = metadata.getFullName(groupID); GroupSymbol groupSymbol = new GroupSymbol(groupName); groupSymbol.setMetadataID(groupID); symbol.setGroupSymbol(groupSymbol); symbol.setType(DataTypeManager.getDataTypeClass(metadata.getElementRuntimeTypeName(symbol.getMetadataID()))); return symbol; } catch (QueryMetadataException e) { throw new TeiidRuntimeException(e); } catch (TeiidComponentException e) { throw new TeiidRuntimeException(e); } }