}
}
private DeploymentComponent createNewDeploymentComponent(Component component,
List<String> remoteEnabledComponentTypes) {
DeploymentComponent deploymentComponent = new DeploymentComponent(component);
// make sure type is permissible in destination and remote add is supported
if (Utils.isEmpty(remoteEnabledComponentTypes)
|| !remoteEnabledComponentTypes.contains(component.getComponentType())) {
deploymentComponent.setDestinationSummary(DeploymentSummary.NOT_PERMISSIBLE);
deploymentComponent.setDeploy(false);
if (logger.isDebugEnabled()) {
logger.debug("Created deployment component for " + component.getFullDisplayName()
+ ": type not permissible");
}
} else if (component.getFileResource() == null || !component.getFileResource().exists()) {
deploymentComponent.setDestinationSummary(DeploymentSummary.RESOURCE_NOT_FOUND);
deploymentComponent.setDeploy(false);
if (logger.isDebugEnabled()) {
logger.debug("Created deployment component for " + component.getFullDisplayName()
+ ": resource not found");
}
} else if (component.isRemoteAdd()) {
deploymentComponent.setDestinationSummary(DeploymentSummary.NEW);
if (logger.isDebugEnabled()) {
logger.debug("Created deployment component for " + component.getFullDisplayName() + ": new supported");
}
} else if (CustomObjectNameResolver.getCheckerForStandardObject().check(component.getName(), component.getComponentType())) {
deploymentComponent.setDestinationSummary(DeploymentSummary.UPDATED);
if (logger.isDebugEnabled()) {
logger.debug("Created deployment component for " + component.getFullDisplayName() + ": updated");
}
} else {
deploymentComponent.setDestinationSummary(DeploymentSummary.NEW_NOT_SUPPORTED);
deploymentComponent.setDeploy(false);
if (logger.isDebugEnabled()) {
logger.debug("Created deployment component for " + component.getFullDisplayName()
+ ": new not supported");
}
}