public interface IPlatform
Say you need to perform an action for a given channel from tenant. Here is how you access the tenant settings:
IPlatform platform = PlatformProvider.getPlatform();
IPunchPlatformProperties properties = platform.getPlatformProperties();
ITenant tenant = platform.getTenant("myTenant");
IChannel channel = tenant.getChannel("myChannel");
Refer to the PlatformProvider
class for accessing your platform.
Every time you access a platform resource, it is read and fetched from your file system or (most likely) from zookeeper. The whole idea is to let you design short administration tasks that start, fetch the configuration, do what they need then exit. This has immense benefits : admninistrative actions are straightforward to code : no caching, no daemons, no cleanup, full protected from a per tenant synchronized access.
Second new tenants and channels will appear dynamically.
Modifier and Type | Method and Description |
---|---|
ISettingsMap |
getConfigurationTree() |
String |
getId() |
IPunchPlatformProperties |
getPlatformProperties() |
ITenant |
getTenant(String tenantName) |
List<ITenant> |
getTenants() |
IPunchPlatformProperties getPlatformProperties()
ITenant getTenant(String tenantName)
tenantName
- the tenant nameISettingsMap getConfigurationTree()
ISettingsMap
. Note that this relies on a lazy
loading strategy. Only files you actually access later on will be fetched.String getId()
Copyright © 2014–2023. All rights reserved.