Exemplo n.º 1
0
 private void storeVersion(Element root) {
   // add version at front
   root.addContent(
       0,
       new Element("jmriversion")
           .addContent(new Element("major").addContent("" + jmri.Version.major))
           .addContent(new Element("minor").addContent("" + jmri.Version.minor))
           .addContent(new Element("test").addContent("" + jmri.Version.test))
           .addContent(new Element("modifier").addContent(jmri.Version.getModifier())));
 }
Exemplo n.º 2
0
 /**
  * Create a ZeroConfService. The property <i>version</i> is added or replaced with the current
  * JMRI version as its value. The property <i>jmri</i> is added or replaced with the JMRI
  * major.minor.test version string as its value.
  *
  * <p>If a service with the same key as the new service is already published, the original service
  * is returned unmodified.
  *
  * @param type The service protocol
  * @param name The name of the JMRI server listed on client devices
  * @param port The port the service runs over
  * @param weight Default value is 0
  * @param priority Default value is 0
  * @param properties Additional information to be listed in service advertisement
  * @return An unpublished ZeroConfService
  */
 public static ZeroConfService create(
     String type,
     String name,
     int port,
     int weight,
     int priority,
     HashMap<String, String> properties) {
   ZeroConfService s;
   if (ZeroConfService.services().containsKey(ZeroConfService.key(type, name))) {
     s = ZeroConfService.services().get(ZeroConfService.key(type, name));
     log.debug("Using existing ZeroConfService {}", s.key());
   } else {
     properties.put("version", jmri.Version.name());
     // use the major.minor.test version string for jmri since we have potentially
     // tight space constraints in terms of the number of bytes that properties
     // can use, and there are some unconstrained properties that we would like to use.
     properties.put("jmri", jmri.Version.getCanonicalVersion());
     properties.put("node", NodeIdentity.identity());
     s = new ZeroConfService(ServiceInfo.create(type, name, port, weight, priority, properties));
     log.debug("Creating new ZeroConfService {} with properties {}", s.key(), properties);
   }
   return s;
 }
Exemplo n.º 3
0
 protected String line1() {
   return Bundle.getMessage("DefaultVersionCredit", jmri.Version.name());
 }
Exemplo n.º 4
0
 protected String line1() {
   return MessageFormat.format(
       Bundle.getMessage("JmriDemoVersionCredit"), new Object[] {jmri.Version.name()});
 }