Interface IContentService
- All Superinterfaces:
IComponent
,IInitializable
,IView
,Serializable
IContentService - Interface for content services. Defines functions to
operate with content files
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
'webmethods.service.content.reset' System property that controls if content services configuration should be reset from storageConfig.xml config file.static final String
Service view property: identifies if content service in online at that time.static final String
Service view property: identifies if content service is default service.static final String
Service view property: root folder for content service.static final String
Identifies content service configuration XML root property - where content service root folder value is storedFields inherited from interface com.webmethods.portal.service.view.IView
PROP_DESCRIPTION, PROP_NAME, PROP_TYPE, PROP_URI
-
Method Summary
Modifier and TypeMethodDescriptionacquireURI
(IURI uri) Acquires the normal content uri implementation for the specified string uri.acquireURI
(String uri) Acquires a uri implementation for the specified string uri.bind
(IURI name, IContentStore content) Binds content store to a Uri.bindAsync
(IURI name, IContentStore content, IContentEventListener eventListener) Binds content to a name asynchronously.Clones this serviceCopies contents from uri to uri.Creates empty content store object for this servicevoid
createRoot
(IURI name) Pre-creates root folder specified by name.boolean
Destroy content in repository.void
destroyRoot
(IURI name) Destroys root folder for specified uri.boolean
enableNotification
(int listenerToken, boolean enable) Enable/disable events notification for registered listenergenerateContentURI
(String key1, String key2) Creates a content URI based off the key which should be the thing nameReturns content nameboolean
Checks if content server availablelistContents
(IURI root) Enumerates all content URI under specified root URIEnumerates all roots URIs under specified root URILooks upIContentStore
by its uriLooks up for content by both name and mime type Use this function when several mime types were bound to the the URIint
registerEventListener
(Object eventListener) Registers event listener object to be notified for Content server operationsvoid
unregisterEventListener
(Object eventListener) Unregisters event listener object to be notified for Content server operationsvoid
updateConfiguration
(IThingID serviceID, Element configElem) Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.service.view.IView
getProperties, getProperty, getPropertyNames, getURI
-
Field Details
-
PROP_DEFAULT
Service view property: identifies if content service is default service. SeeIContentMechanics.getServices(com.webmethods.portal.service.view.IPagingCookie)
- See Also:
-
PROP_AVAILABLE
Service view property: identifies if content service in online at that time. SeeIContentMechanics.getServices(com.webmethods.portal.service.view.IPagingCookie)
- See Also:
-
PROP_ROOT
Service view property: root folder for content service. SeeIContentMechanics.getServices(com.webmethods.portal.service.view.IPagingCookie)
- See Also:
-
CONTENT_SERVICE_RESET_FLAG
'webmethods.service.content.reset' System property that controls if content services configuration should be reset from storageConfig.xml config file. Possible values are 'true' and 'false'- See Also:
-
PROPERTIES_ROOT_NAME
Identifies content service configuration XML root property - where content service root folder value is stored- See Also:
-
-
Method Details
-
createContent
Creates empty content store object for this service- Returns:
- instance of
IContentStore
- Throws:
MetaException
-
bind
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.extcontent
- 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 usingPortalSystem.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.extcontent
- object representing content to be boundeventListener
- 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 usingPortalSystem.lookup(com.webmethods.portal.system.IURI)
method - Throws:
MetaException
-
lookup
Looks upIContentStore
by its uri- Parameters:
name
- unique URI for content- Returns:
- contentstore for specified URI, or null of content is not found
- Throws:
MetaException
-
lookup
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 contentmime
- 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
Copies contents from uri to uri. Optionally may copy only specified mime types passed in mimeTypes- Parameters:
from
- source urito
- target urimimeTypes
- list of mime types to copy. This parameter may be null, in this case all mime types are copied.- Throws:
MetaException
-
createRoot
Pre-creates root folder specified by name. Doesn't bind anything- Parameters:
name
- folder uri to create- Throws:
MetaException
-
destroy
Destroy content in repository.- Parameters:
name
- unique URI for content- Returns:
- true if content was sucessfully deleted
- Throws:
MetaException
-
destroyRoot
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
Creates a content URI based off the key which should be the thing name- Parameters:
key1
- name of thingkey2
- DB ID of thing- Returns:
- content URI for the key
- Throws:
MetaException
-
listRoots
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
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
Registers event listener object to be notified for Content server operations- Returns:
- unique token for registered listener
- Throws:
MetaException
-
unregisterEventListener
Unregisters event listener object to be notified for Content server operations- Parameters:
eventListener
- instance of event listener for asynchronous bind operation- Throws:
MetaException
-
enableNotification
Enable/disable events notification for registered listener- Parameters:
listenerToken
- unique listener token returned by RegisterEventListenerenable
- flag to enable/disable notification for this listener- Returns:
- previous state
- Throws:
MetaException
-
cloneService
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
Acquires a uri implementation for the specified string uri.- Parameters:
uri
-- Returns:
-
acquireURI
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
- Throws:
MetaException
-