ResourceResolver agentResourceResolver = null;
try {
agentResourceResolver = getAgentResourceResolver();
ReplicationPackage replicationPackage = replicationPackageExporter.getPackage(agentResourceResolver, queueItem.getId());
if (replicationPackage != null) {
replicationPackage.getInfo().fillInfo(queueItem.getPackageInfo());
replicationPackageImporter.importPackage(agentResourceResolver, replicationPackage);
Dictionary<Object, Object> properties = new Properties();
properties.put("replication.package.paths", replicationPackage.getPaths());
properties.put("replication.agent.name", name);
replicationEventFactory.generateEvent(ReplicationEventType.PACKAGE_REPLICATED, properties);
replicationPackage.delete();
success = true;
} else {
log.warn("replication package with id {} does not exist", queueItem.getId());
}