Interface IContentService

All Superinterfaces:
IComponent, IInitializable, IView, Serializable

public interface IContentService extends IComponent, IView
IContentService - Interface for content services. Defines functions to operate with content files
  • Field Details

  • Method Details

    • createContent

      IContentStore createContent() throws MetaException
      Creates empty content store object for this service
      Returns:
      instance of IContentStore
      Throws:
      MetaException
    • bind

      IContentURI bind(IURI name, IContentStore content) throws MetaException
      Binds content store to a Uri.
      Parameters:
      name - - unique URI for this content. This should be in a form of file path: /segment1/segment2/.../filename.ext
      content - object representing content to be bound
      Returns:
      a fully qualified Uri for the object to that contains identification of the service to be used. This Uri could be used to lookup IContentStore directly using PortalSystem.lookup(com.webmethods.portal.system.IURI) method
      Throws:
      MetaException
    • bindAsync

      IContentURI bindAsync(IURI name, IContentStore content, IContentEventListener eventListener) throws MetaException
      Binds content to a name asynchronously. Returns immediately.
      Parameters:
      name - - unique URI for this content. This should be in a form of file path: /segment1/segment2/.../filename.ext
      content - object representing content to be bound
      eventListener - registered object to be notified upon operation completion
      Returns:
      a fully qualified Uri for the object to that contains identification of the service to be used. This Uri could be used to lookup IContentStore directly using PortalSystem.lookup(com.webmethods.portal.system.IURI) method
      Throws:
      MetaException
    • lookup

      IContentStore lookup(IURI name) throws MetaException
      Looks up IContentStore by its uri
      Parameters:
      name - unique URI for content
      Returns:
      contentstore for specified URI, or null of content is not found
      Throws:
      MetaException
    • lookup

      IContentStore lookup(IURI name, String mime) throws MetaException
      Looks up for content by both name and mime type Use this function when several mime types were bound to the the URI
      Parameters:
      name - unique URI for content
      mime - mime type of content to lookup. This value will override any mime type specified directly in the content uri. This parameter may be null.
      Returns:
      contentstore for specified URI, or null of content is not found
      Throws:
      MetaException
    • copy

      IContentURI copy(IURI from, IURI to, String[] mimeTypes) throws MetaException
      Copies contents from uri to uri. Optionally may copy only specified mime types passed in mimeTypes
      Parameters:
      from - source uri
      to - target uri
      mimeTypes - list of mime types to copy. This parameter may be null, in this case all mime types are copied.
      Throws:
      MetaException
    • createRoot

      void createRoot(IURI name) throws MetaException
      Pre-creates root folder specified by name. Doesn't bind anything
      Parameters:
      name - folder uri to create
      Throws:
      MetaException
    • destroy

      boolean destroy(IURI name) throws MetaException
      Destroy content in repository.
      Parameters:
      name - unique URI for content
      Returns:
      true if content was sucessfully deleted
      Throws:
      MetaException
    • destroyRoot

      void destroyRoot(IURI name) throws MetaException
      Destroys root folder for specified uri. Effectively destroys all mime types as well stored under this uri
      Parameters:
      name - unique URI for content
      Throws:
      MetaException
    • generateContentURI

      IURI generateContentURI(String key1, String key2) throws MetaException
      Creates a content URI based off the key which should be the thing name
      Parameters:
      key1 - name of thing
      key2 - DB ID of thing
      Returns:
      content URI for the key
      Throws:
      MetaException
    • listRoots

      IContentURI[] listRoots(IURI root) throws MetaException
      Enumerates all roots URIs under specified root URI
      Parameters:
      root - URI for the root key. May be empty to enumerate roots under service root
      Returns:
      list of root URIs
      Throws:
      MetaException
    • listContents

      IContentURI[] listContents(IURI root) throws MetaException
      Enumerates all content URI under specified root URI
      Parameters:
      root - URI for the root key. May be empty to enumerate roots under service root
      Returns:
      list of content URIs
      Throws:
      MetaException
    • registerEventListener

      int registerEventListener(Object eventListener) throws MetaException
      Registers event listener object to be notified for Content server operations
      Returns:
      unique token for registered listener
      Throws:
      MetaException
    • unregisterEventListener

      void unregisterEventListener(Object eventListener) throws MetaException
      Unregisters event listener object to be notified for Content server operations
      Parameters:
      eventListener - instance of event listener for asynchronous bind operation
      Throws:
      MetaException
    • enableNotification

      boolean enableNotification(int listenerToken, boolean enable) throws MetaException
      Enable/disable events notification for registered listener
      Parameters:
      listenerToken - unique listener token returned by RegisterEventListener
      enable - flag to enable/disable notification for this listener
      Returns:
      previous state
      Throws:
      MetaException
    • cloneService

      IContentService cloneService() throws MetaException
      Clones this service
      Returns:
      cloned content service
      Throws:
      MetaException
    • isAvailable

      boolean isAvailable()
      Checks if content server available
      Returns:
      true if content service is online
    • getContentServiceName

      String getContentServiceName()
      Returns content name
      Returns:
      content service name
    • acquireURI

      IContentURI acquireURI(String uri)
      Acquires a uri implementation for the specified string uri.
      Parameters:
      uri -
      Returns:
    • acquireURI

      IContentURI acquireURI(IURI uri)
      Acquires the normal content uri implementation for the specified string uri.
      Parameters:
      uri - uri for content item
      Returns:
      valid IContentURI that reprensent original uri
    • updateConfiguration

      void updateConfiguration(IThingID serviceID, Element configElem) throws MetaException
      Throws:
      MetaException