/** * Create element configuration for Hazelcast cache. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createHazelcastCacheElement() { ElementNode.Builder builder = new ElementNode.Builder( "Hazelcast Distributed Cache Provider", TenantDatastoreParser.Elements.HazelcastCache.getLocalName(), "folder-open-o", ElementRole.DataManagement_CacheProvider); builder.description( "Cache device management data using Hazelcast distributed maps. " + "This cache allows data to be shared between clustered SiteWhere instances. " + "This element has been deprecated since a Hazelcast cache is used by default."); builder.makeDeprecated(); return builder.build(); }
/** * Create element configuration for device model initializer. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createDefaultScheduleModelInitializerElement() { ElementNode.Builder builder = new ElementNode.Builder( "Default Schedule Model Initializer", TenantDatastoreParser.Elements.DefaultScheduleModelInitializer.getLocalName(), "flash", ElementRole.DataManagement_ScheduleModelInitializer); builder.description( "This component creates sample data when no existing schedule data " + "is detected in the datastore. It provides examples of both simple and cron-based " + "schedules that are commonly used. " + "<strong>Deprecated: Initialization is now done based on the tenant template.</strong>"); builder.makeDeprecated(); return builder.build(); }
/** * Create element configuration for device model initializer. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createDefaultAssetModelInitializerElement() { ElementNode.Builder builder = new ElementNode.Builder( "Default Asset Model Initializer", TenantDatastoreParser.Elements.DefaultAssetModelInitializer.getLocalName(), "flash", ElementRole.DataManagement_AssetModelInitializer); builder.description( "This component creates sample data when no existing asset data " + "is detected in the datastore. If using the <strong>device model initializer</strong> " + "this component should be used as well so that assets in the sample data can be resolved. " + "<strong>Deprecated: Initialization is now done based on the tenant template.</strong>"); builder.makeDeprecated(); return builder.build(); }
/** * Create element configuration for device model initializer. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createDefaultDeviceModelInitializerElement() { ElementNode.Builder builder = new ElementNode.Builder( "Default Device Model Initializer", TenantDatastoreParser.Elements.DefaultDeviceModelInitializer.getLocalName(), "flash", ElementRole.DataManagement_DeviceModelInitializer); builder.description( "This component creates sample data when no existing device data " + "is detected in the datastore. A site with device specifications, devices, " + "assignments, events and other example data is created on instance startup. " + "<strong>Deprecated: Initialization is now done based on the tenant template.</strong>"); builder.makeDeprecated(); return builder.build(); }
/** * Create element configuration for Groovy device model initializer. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createGroovyDeviceModelInitializerElement() { ElementNode.Builder builder = new ElementNode.Builder( "Groovy Device Model Initializer", TenantDatastoreParser.Elements.GroovyDeviceModelInitializer.getLocalName(), "cogs", ElementRole.DataManagement_DeviceModelInitializer); builder.description( "Generates sample data for the device model by delegating creation logic to a Groovy script. " + "<strong>Deprecated: Initialization is now done based on the tenant template.</strong>"); builder.attribute( (new AttributeNode.Builder("Script path", "scriptPath", AttributeType.String) .description("Script path relative to Groovy script root.") .makeRequired() .build())); builder.makeDeprecated(); return builder.build(); }
/** * Create element configuration for EHCache cache. * * @return */ @SuppressWarnings("deprecation") protected ElementNode createEHCacheElement() { ElementNode.Builder builder = new ElementNode.Builder( "EHCache Cache Provider", TenantDatastoreParser.Elements.EHCacheDeviceManagementCache.getLocalName(), "folder-open-o", ElementRole.DataManagement_CacheProvider); builder.description( "Cache device management data using EHCache. Note that this " + "cache is not intended for use on clustered installations. " + "This element has been deprecated in favor of using the Hazelcast cache."); builder.attributeGroup("max", "Max Entries in Cache"); builder.attributeGroup("ttl", "Cache Entry Time to Live"); builder.attribute( (new AttributeNode.Builder( "Site cache max entries", "siteCacheMaxEntries", AttributeType.Integer) .description("Maximum number entries in site cache.") .defaultValue("1000") .group("max") .build())); builder.attribute( (new AttributeNode.Builder( "Specification cache max entries", "deviceSpecificationCacheMaxEntries", AttributeType.Integer) .description("Maximum number entries in device specification cache.") .defaultValue("1000") .group("max") .build())); builder.attribute( (new AttributeNode.Builder( "Device cache max entries", "deviceCacheMaxEntries", AttributeType.Integer) .description("Maximum number entries in device cache.") .defaultValue("10000") .group("max") .build())); builder.attribute( (new AttributeNode.Builder( "Assignment cache max entries", "deviceAssignmentCacheMaxEntries", AttributeType.Integer) .description("Maximum number entries in device assignment cache.") .defaultValue("10000") .group("max") .build())); builder.attribute( (new AttributeNode.Builder("Site cache TTL seconds", "siteCacheTtl", AttributeType.Integer) .description("Maximum time to live (in seconds) for site cache.") .defaultValue("6000") .group("ttl") .build())); builder.attribute( (new AttributeNode.Builder( "Specification cache TTL seconds", "deviceSpecificationCacheTtl", AttributeType.Integer) .description("Maximum time to live (in seconds) for device specification cache.") .defaultValue("6000") .group("ttl") .build())); builder.attribute( (new AttributeNode.Builder( "Device cache TTL seconds", "deviceCacheTtl", AttributeType.Integer) .description("Maximum time to live (in seconds) for device cache.") .defaultValue("600") .group("ttl") .build())); builder.attribute( (new AttributeNode.Builder( "Assignment cache TTL seconds", "deviceAssignmentCacheTtl", AttributeType.Integer) .description("Maximum time to live (in seconds) for device assignment cache.") .defaultValue("600") .group("ttl") .build())); builder.makeDeprecated(); return builder.build(); }