/** * This method is required by the Management framework to write the mappings to the persistent form. The actual assignment is done * in the VDBMetaDataClassInstancefactory * @param policies */ public void setDataPolicies(List<DataPolicy> policies){ this.dataPolicies.clear(); for (DataPolicy policy:policies) { this.dataPolicies.put(policy.getName(), (DataPolicyMetadata)policy); } }
/** * This method is required by the Management framework to write the mappings to the persistent form. The actual assignment is done * in the VDBMetaDataClassInstancefactory * @param policies */ public void setDataPolicies(List<DataPolicy> policies){ this.dataPolicies.clear(); for (DataPolicy policy:policies) { this.dataPolicies.put(policy.getName(), (DataPolicyMetadata)policy); } }
public HashMap<String, DataPolicy> getAllowedDataPolicies() { if (this.policies == null) { this.policies = new HashMap<String, DataPolicy>(); Set<String> userRoles = getUserRoles(); // get data roles from the VDB VDBMetaData vdb = getVDB(); TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class); Collection<? extends DataPolicy> allPolicies = null; if (metadata == null) { allPolicies = vdb.getDataPolicies(); } else { allPolicies = metadata.getPolicies().values(); } for (DataPolicy policy : allPolicies) { if (matchesPrincipal(userRoles, policy)) { this.policies.put(policy.getName(), policy); } } } return this.policies; }
public HashMap<String, DataPolicy> getAllowedDataPolicies() { if (this.policies == null) { this.policies = new HashMap<String, DataPolicy>(); Set<String> userRoles = getUserRoles(); // get data roles from the VDB VDBMetaData vdb = getVDB(); TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class); Collection<? extends DataPolicy> allPolicies = null; if (metadata == null) { allPolicies = vdb.getDataPolicies(); } else { allPolicies = metadata.getPolicies().values(); } for (DataPolicy policy : allPolicies) { if (matchesPrincipal(userRoles, policy)) { this.policies.put(policy.getName(), policy); } } } return this.policies; }
public HashMap<String, DataPolicy> getAllowedDataPolicies() { if (this.policies == null) { this.policies = new HashMap<String, DataPolicy>(); Set<String> userRoles = getUserRoles(); // get data roles from the VDB VDBMetaData vdb = getVDB(); TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class); Collection<? extends DataPolicy> allPolicies = null; if (metadata == null) { allPolicies = vdb.getDataPolicies(); } else { allPolicies = metadata.getPolicies().values(); } for (DataPolicy policy : allPolicies) { if (matchesPrincipal(userRoles, policy)) { this.policies.put(policy.getName(), policy); } } } return this.policies; }
private void writeDataPolicy(XMLStreamWriter writer, DataPolicy dp) throws XMLStreamException { writer.writeStartElement(Element.DATA_ROLE.getLocalName()); writeAttribute(writer, Element.NAME.getLocalName(), dp.getName()); writeAttribute(writer, Element.DATA_ROLE_ANY_ATHENTICATED_ATTR.getLocalName(), String.valueOf(dp.isAnyAuthenticated())); writeAttribute(writer, Element.DATA_ROLE_GRANT_ALL_ATTR.getLocalName(), String.valueOf(dp.isGrantAll()));
private void writeDataPolicy(XMLStreamWriter writer, DataPolicy dp) throws XMLStreamException { writer.writeStartElement(Element.DATA_ROLE.getLocalName()); writeAttribute(writer, Element.NAME.getLocalName(), dp.getName()); writeAttribute(writer, Element.DATA_ROLE_ANY_ATHENTICATED_ATTR.getLocalName(), String.valueOf(dp.isAnyAuthenticated())); writeAttribute(writer, Element.DATA_ROLE_GRANT_ALL_ATTR.getLocalName(), String.valueOf(dp.isGrantAll()));