Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Stardust/Knowledge Base/Java API/Queries/Partitions"
< Stardust | Knowledge Base | Java API
m (Stardust/Knowledge Base/Java API/Queries/Listing Partitions moved to Stardust/Knowledge Base/Java API/Queries/Partitions: will contain all queries related to partitions) |
(→Listing the Partitions in a multi-partition Audit Trail) |
||
Line 3: | Line 3: | ||
A partition is a logical separation in the audit trail database used to support multi-tenancy. In this context the term does not refer to a database partition. | A partition is a logical separation in the audit trail database used to support multi-tenancy. In this context the term does not refer to a database partition. | ||
− | + | <br> This example uses undocumented API (ForkingServiceFactory and IJobManager) to get a list of the partitions in an audit trail. | |
<source lang="java"> | <source lang="java"> |
Revision as of 03:22, 7 June 2013
Listing the Partitions in a multi-partition Audit Trail
A partition is a logical separation in the audit trail database used to support multi-tenancy. In this context the term does not refer to a database partition.
This example uses undocumented API (ForkingServiceFactory and IJobManager) to get a list of the partitions in an audit trail.
public List<String> listPartitions() { ForkingServiceFactory factory = (ForkingServiceFactory) Parameters.instance().get( EngineProperties.FORKING_SERVICE_HOME); IJobManager jobManager = factory.getJobManager(); if (null!= jobManager) { final List<String> result = newArrayList(); jobManager.performSynchronousJob(new Procedure<Void>() { @Override protected void invoke() { for (Iterator<IAuditTrailPartition> i = AuditTrailPartitionBean.findAll(); i.hasNext(); ) { IAuditTrailPartition partition = i.next(); result.add(partition.getId()); } Collections.sort(result); } }); return result; } else { trace.warn("Not able to list partitions, the component is not fully configured."); return emptyList(); } }