Class CmsLoader

java.lang.Object
com.cloudforgeci.api.compute.CmsLoader

public final class CmsLoader extends Object
Auto-discovery utility for CmsSpec implementations using Java ServiceLoader.

This class discovers all CmsSpec implementations registered via META-INF/services/com.cloudforge.core.interfaces.ApplicationSpec and provides convenient access methods for deployment tools.

CMS platforms are discovered from:

  • Built-in CMS applications in cloudforge-api module
  • External plugins providing META-INF/services registration

Usage Example:

// Discover all CMS platforms
Map<String, CmsSpec> platforms = CmsLoader.discover();

// Get CMS by category
List<CmsSpec> ecommerceApps = CmsLoader.discoverByCategory("ecommerce");
List<CmsSpec> socialApps = CmsLoader.discoverByCategory("social");

// Find specific CMS
Optional<CmsSpec> wordpress = CmsLoader.findById("wordpress");

// Get all e-commerce platforms
List<CmsSpec> ecommerce = CmsLoader.discoverEcommerce();
Since:
3.1.0
See Also:
  • Method Details

    • discover

      public static Map<String,CmsSpec> discover()
      Discover all CmsSpec implementations via ServiceLoader.

      Returns a map of CMS ID to CmsSpec instance. The CMS ID is obtained from ApplicationSpec.applicationId().

      CmsSpec implementations are discovered from the ApplicationSpec ServiceLoader registration and filtered to include only those that implement CmsSpec.

      Returns:
      map of CMS ID to CmsSpec (never null, may be empty)
    • discoverAsList

      public static List<CmsSpec> discoverAsList()
      Discover all CmsSpec implementations as a list.

      CMS platforms are sorted alphabetically by application ID for consistent ordering.

      Returns:
      list of CmsSpec instances (never null, may be empty)
    • discoverByCategory

      public static List<CmsSpec> discoverByCategory(String category)
      Discover CmsSpec implementations filtered by CMS category.

      CMS categories include:

      • cms - Content management systems (WordPress, Joomla, Drupal)
      • ecommerce - E-commerce platforms (WooCommerce, Magento, PrestaShop)
      • social - Social networking (Dolphin/UNA, HumHub, Elgg)
      • forum - Forum software (phpBB, Discourse, Flarum)
      • wiki - Wiki platforms (MediaWiki, DokuWiki, BookStack)
      • lms - Learning management (Moodle, Canvas, Chamilo)
      Parameters:
      category - the CMS category to filter by
      Returns:
      list of CmsSpec instances in this category
    • discoverCms

      public static List<CmsSpec> discoverCms()
      Discover all content management systems (category: "cms").

      Includes: WordPress, Joomla, Drupal, TYPO3, Concrete5, etc.

      Returns:
      list of CMS platforms
    • discoverEcommerce

      public static List<CmsSpec> discoverEcommerce()
      Discover all e-commerce platforms (category: "ecommerce").

      Includes: WooCommerce, Magento, PrestaShop, OpenCart, Shopware, etc.

      Returns:
      list of e-commerce platforms
    • discoverSocial

      public static List<CmsSpec> discoverSocial()
      Discover all social networking platforms (category: "social").

      Includes: Dolphin/UNA, HumHub, Elgg, phpFox, etc.

      Returns:
      list of social networking platforms
    • discoverForums

      public static List<CmsSpec> discoverForums()
      Discover all forum platforms (category: "forum").

      Includes: phpBB, Discourse, Flarum, MyBB, XenForo, etc.

      Returns:
      list of forum platforms
    • discoverWikis

      public static List<CmsSpec> discoverWikis()
      Discover all wiki platforms (category: "wiki").

      Includes: MediaWiki, DokuWiki, BookStack, Wiki.js, etc.

      Returns:
      list of wiki platforms
    • discoverLms

      public static List<CmsSpec> discoverLms()
      Discover all learning management systems (category: "lms").

      Includes: Moodle, Canvas, Chamilo, ILIAS, etc.

      Returns:
      list of LMS platforms
    • discoverCategories

      public static List<String> discoverCategories()
      Discover all available CMS categories.

      Returns a sorted list of unique categories from all discovered platforms.

      Returns:
      sorted list of category names
    • findById

      public static Optional<CmsSpec> findById(String cmsId)
      Find a specific CmsSpec by CMS ID.
      Parameters:
      cmsId - the CMS identifier (e.g., "wordpress", "magento", "dolphin")
      Returns:
      Optional containing the CmsSpec if found
    • discoverGroupedByCategory

      public static Map<String, List<CmsSpec>> discoverGroupedByCategory()
      Get CMS platforms grouped by category.

      Returns a map where keys are category names and values are lists of CmsSpec instances in that category.

      Returns:
      map of category to list of CMS platforms
    • discoverOidcEnabled

      public static List<CmsSpec> discoverOidcEnabled()
      Discover CMS platforms that support OIDC integration.
      Returns:
      list of CmsSpec instances supporting OIDC
    • discoverS3MediaSupported

      public static List<CmsSpec> discoverS3MediaSupported()
      Discover CMS platforms that support S3 media storage.
      Returns:
      list of CmsSpec instances supporting S3 media
    • discoverObjectCacheSupported

      public static List<CmsSpec> discoverObjectCacheSupported()
      Discover CMS platforms that support object caching (Redis/Memcached).
      Returns:
      list of CmsSpec instances supporting object caching
    • discoverMultisiteSupported

      public static List<CmsSpec> discoverMultisiteSupported()
      Discover CMS platforms that support multi-site/multi-store.
      Returns:
      list of CmsSpec instances supporting multi-site
    • discoverByPhpVersion

      public static List<CmsSpec> discoverByPhpVersion(String phpVersion)
      Discover CMS platforms by PHP version requirement.
      Parameters:
      phpVersion - the PHP version to filter by (e.g., "8.2", "8.1")
      Returns:
      list of CmsSpec instances requiring this PHP version
    • discoverFargateSupported

      public static List<CmsSpec> discoverFargateSupported()
      Discover CMS platforms that support Fargate deployment.
      Returns:
      list of CmsSpec instances supporting Fargate
    • discoverEc2Supported

      public static List<CmsSpec> discoverEc2Supported()
      Discover CMS platforms that support EC2 deployment.
      Returns:
      list of CmsSpec instances supporting EC2
    • printCatalog

      public static String printCatalog()
      Print a formatted catalog of all discovered CMS platforms.

      Useful for debugging and displaying available platforms to users.

      Returns:
      formatted string containing CMS catalog