Download Diffusion 5.1 User Guide - Documentation
Transcript
// Create metadata for the topic
final MContent metadata = defineMetadata();
// Get a topic builder
final RecordTopicDetails.Builder builder =
tc.newDetailsBuilder(RecordTopicDetails.Builder.class);
// Create the topic with metadata
tc.addTopic(
TOPIC_NAME,
builder.metadata(metadata).build(),
new TopicControl.AddCallback.Default() {
@Override
public void onTopicAdded(String topic) {
theTopic = topic;
}
});
}
/**
* A simple example of creating content metadata with two
records.
*
* @return content metadata
*/
public MContent defineMetadata() {
return factory.content(
"Content",
createNameAndAddressRecord(),
createMultipleRateCurrencyRecord("Exchange Rates",
5));
}
/**
* Creates a simple name and address record with fixed
name single
* multiplicity fields.
*
* @return record definition.
*/
public MRecord createNameAndAddressRecord() {
return factory.record(
"NameAndAddress",
factory.string("FirstName"),
factory.string("Surname"),
factory.string("HouseNumber"),
factory.string("Street"),
factory.string("Town"),
factory.string("State"),
factory.string("PostCode"));
}
/**
* This creates a record with two fields, a string called
"Currency" and a
* decimal string called "Rate" with a default value of
1.00 which repeats a
* specified number of times.
*
* @param name the record name
* @param occurs the number of occurrences of the "Rate"
field
* @return the metadata record
Diffusion | 252
Related documents
Diffusion 5.5 User Guide - Documentation
User Guide - Documentation
Netgear 782S Quick Start Guide
Netgear 782S Quick Start Guide
DNP 3.0 LAN/WAN Master (OPC) User`s Manual
HornetQ User Guide - for use with JBoss Enterprise
EDAS® CE - Intelligent Instrumentation
Sirius User Guide.book
NISAT database public user manual
FUF: the Universal Unifier User Manual Version 5.2
GemFire Enterprise Monitor User`s Manual
Supply and Delivery of RS and GIS Laboratory Setup
Stemming Selector 4 User Guide