use of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity in project camunda-bpm-platform by camunda.
the class DeployCmd method ensureResourcesWithIdsExist.
protected void ensureResourcesWithIdsExist(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual) {
Map<String, ResourceEntity> resources = new HashMap<String, ResourceEntity>();
for (ResourceEntity resource : actual) {
resources.put(resource.getId(), resource);
}
ensureResourcesWithKeysExist(deploymentId, expectedIds, resources, "id");
}
use of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentResourceForIdCmd method execute.
public InputStream execute(CommandContext commandContext) {
ensureNotNull("deploymentId", deploymentId);
ensureNotNull("resourceId", resourceId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDeployment(deploymentId);
}
ResourceEntity resource = commandContext.getResourceManager().findResourceByDeploymentIdAndResourceId(deploymentId, resourceId);
ensureNotNull("no resource found with id '" + resourceId + "' in deployment '" + deploymentId + "'", "resource", resource);
return new ByteArrayInputStream(resource.getBytes());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity in project camunda-bpm-platform by camunda.
the class GetDeploymentResourceCmd method execute.
public InputStream execute(CommandContext commandContext) {
ensureNotNull("deploymentId", deploymentId);
ensureNotNull("resourceName", resourceName);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadDeployment(deploymentId);
}
ResourceEntity resource = commandContext.getResourceManager().findResourceByDeploymentIdAndResourceName(deploymentId, resourceName);
ensureNotNull(DeploymentResourceNotFoundException.class, "no resource found with name '" + resourceName + "' in deployment '" + deploymentId + "'", "resource", resource);
return new ByteArrayInputStream(resource.getBytes());
}
use of org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity in project camunda-bpm-platform by camunda.
the class CacheDeployer method initDeployment.
protected void initDeployment(final DeploymentEntity deployment, String... resourceNames) {
deployment.clearResources();
for (String resourceName : resourceNames) {
if (resourceName != null) {
// with the given resource we prevent the deployment of querying
// the database which means using all resources that were utilized during the deployment
ResourceEntity resource = Context.getCommandContext().getResourceManager().findResourceByDeploymentIdAndResourceName(deployment.getId(), resourceName);
deployment.addResource(resource);
}
}
}
Aggregations