Interface ContentDomainResolver


  • public interface ContentDomainResolver
    Contract of the Content Domain Resolver.
    • Method Detail

      • idToEntity

        Object idToEntity​(String id)
                   throws ContentDomainException
        Converts the given ID to an entity.

        In case the given ID is unknown null is returned. In case of any other inability to return an entity an IllegalStateException is thrown. Note that ContentDomain implementations might result in other unchecked exceptions.

        Parameters:
        id - Entity identifier. Its form is: domain_namespace-domain_id, e.g. pageversion-26424. Must not be null.
        Returns:
        The actual entity instance that is represented by the given ID, or null if no entity exists for the given ID.
        Throws:
        ContentDomainException - In case the given ID is illegal, no content domain can be found, or the ContentDomain specific resolver throws the same exception.
      • entityToId

        String entityToId​(Object entity)
                   throws ContentDomainException
        Converts the given entity to an ID.

        In case of any inability to return an ID an IllegalStateException is thrown. Note that ContentDomain implementations might result in other unchecked exceptions.

        Parameters:
        entity - Entity instance.
        Returns:
        Entity identifier.
        Throws:
        ContentDomainException - In case the given entity is not part of a ContentDomain, or the ContentDomain specific resolver throws the same exception.