public Stream createStream(String name, Map<String, String> properties) {
		Assert.hasText(name, "Stream name is required");
		Assert.notNull(properties, "Stream properties are required");

		String definition = properties.get("definition");
		Assert.hasText(definition, "Stream properties requires a 'definition' property");

		Deque<ModuleDescriptor> descriptors = new LinkedList<ModuleDescriptor>();
		for (ModuleDescriptor request : parser.parse(name, definition, ParsingContext.stream)) {
			descriptors.addFirst(request);
		}

		return new Stream.Builder()
				.setName(name)
				.setDeploymentProperties(DeploymentPropertiesFormat.parseDeploymentProperties(properties.get("deploymentProperties")))
				.setModuleDescriptors(descriptors).build();
	}
Create a new instance of {@link Stream} for the given name and
properties. The properties should at minimum contain the following
entries:
<table>
  <tr>
    <th>definition</th>
    <td>DSL definition for stream</td>
  </tr>
  <tr>
    <th>deploymentProperties</th>
    <td>Deployment properties for stream</td>
  </tr>
</table>

@param name        stream name
@param properties  properties for stream
@return new {@code Stream} domain model instance
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/StreamFactory.java