Package lumis.portal.service
Interface IService
-
- All Known Subinterfaces:
IDouiService
- All Known Implementing Classes:
ActivityStreamService
,AnalyticsService
,AutoAdministrationService
,BlogService
,ChatRoomService
,ColService
,CommentItService
,CommentService
,CommunityService
,ContentService
,DouiService
,ForumService
,GenericService
,HtmlContentService
,HtmlService
,LikeItService
,MicroblogService
,NavigationService
,PagePersonalizationService
,PortletService
,ProducerService
,RssService
,SimpleContentService
,SocialNetworkIntegrationService
,TagManagerService
,TagService
,WikiService
,WSRPConsumerService
@StableMinor(version="14.2", sinceVersion="4.0") public interface IService
Defines methods all portal services must implement.- Since:
- 4.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
- See Also:
GenericService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
autoAddDependencies(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction)
Adds service specific dependencies.default boolean
checkFileAccess(FileConfig file)
Returns whether the current user has access to the given file.void
deserializeContent(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext)
Deserializes service instance Content.Element
getDefaultServiceInstanceMenu(ServiceInstanceConfig serviceInstance)
Returns the default service instance menu definition to use for a service instance.void
instanceAdded(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction)
Called by the service container to indicate that a service instance has been added.void
instanceDeleted(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction)
Called by the service container to indicate that a service instance is about to be deleted.void
instanceDeserialized(SessionConfig sessionConfig, String serviceInstanceId, DeserializationConfig deserializationConfig, Node accessControlListNode, ITransaction transaction)
Called after an service instance is deserialized.void
instanceDeserialized(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext)
Called after an service instance is deserialized.void
instanceLoaded(ServiceInstanceConfig config)
Deprecated.Since 11.2.0 because this method was never called and may be removed in the future.default void
instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, ChannelConfig oldChannel, ChannelConfig newChannel, ITransaction transaction)
Called to indicate the given service instance was moved from a channel to the other channel.void
instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, IPortalBaseFolder oldWebRootFolder, IPortalBaseFolder newWebRootFolder, ITransaction transaction)
Called to indicate the given service instance has been moved from aweb root base folder
to another one.void
instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, IWebsite oldWebsite, IWebsite newWebsite, ITransaction transaction)
Called to indicate the given service instance has been moved from awebsite
to another one.void
instanceSerialized(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction)
Called after the serialization of a service instance.void
instanceSerialized(ServiceInstanceSerializationContext serviceInstanceSerializationContext)
Called after the serialization of a service instance.void
instanceUnloaded(ServiceInstanceConfig config)
Deprecated.Since 11.2.0 because this method was never called and may be removed in the future.void
load(ServiceConfig config)
Called by the service container to indicate to a service that the service is being activated.void
postRegister(SessionConfig sessionConfig, ServiceConfig serviceConfig, ITransaction transaction)
Called by the service manager after a service definition is registered.void
postUnregister(SessionConfig sessionConfig, ITransaction transaction)
Called by the service manager after a service has been unregistered.void
preRegister(SessionConfig sessionConfig, Node serviceXmlNode, ITransaction transaction)
Called by the service manager when a service definition is about to be registered.void
preUnregister(SessionConfig sessionConfig, ITransaction transaction)
Called by the service manager when a service is about to be unregistered.void
unload(ServiceConfig config)
Called by the service container to indicate to a service that the it is being de-activated.
-
-
-
Method Detail
-
preRegister
void preRegister(SessionConfig sessionConfig, Node serviceXmlNode, ITransaction transaction) throws PortalException
Called by the service manager when a service definition is about to be registered. This method allows the Service implementation to set its default values into the service definition xml.- Parameters:
sessionConfig
- TODOserviceXmlNode
-transaction
- TODO- Throws:
PortalException
-
postRegister
void postRegister(SessionConfig sessionConfig, ServiceConfig serviceConfig, ITransaction transaction) throws PortalException
Called by the service manager after a service definition is registered. This method allows the Service implementation to perform any custom registration that the service may require.- Parameters:
serviceXmlNode
-- Throws:
PortalException
-
preUnregister
void preUnregister(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Called by the service manager when a service is about to be unregistered.- Parameters:
sessionConfig
- the user session information.transaction
- transaction for persistence access.- Throws:
PortalException
-
postUnregister
void postUnregister(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Called by the service manager after a service has been unregistered.- Parameters:
sessionConfig
- the user session information.transaction
- transaction for persistence access.- Throws:
PortalException
-
load
void load(ServiceConfig config) throws ServiceException, PortalException
Called by the service container to indicate to a service that the service is being activated.The service container calls the
init
method exactly once after instantiating the service. Theinit
method must complete successfully before any interfaces are created.The service container cannot place the service into service if the
init
method- Throws a
ServiceException
- Does not return within a time period defined by the service container.
- Parameters:
config
- aServiceConfig
object containing the service's configuration and initialization parameters- Throws:
ServiceException
- if an exception has occurred that interferes with the service interface's normal operation.PortalException
- Throws a
-
unload
void unload(ServiceConfig config) throws ServiceException, PortalException
Called by the service container to indicate to a service that the it is being de-activated.Before the service container calls the destroy method, it should allow any threads that are currently processing requests within the service object to complete execution. To avoid waiting forever, the service container can optionally wait for a predefined time before destroying the service object.
This method enables the service to do the following:
- clean up any resources that it holds (for example, memory, file handles, threads)
- make sure that any persistent state is synchronized with the service current state in memory.
- Parameters:
config
- aServiceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceLoaded
@Deprecated void instanceLoaded(ServiceInstanceConfig config) throws ServiceException, PortalException
Deprecated.Since 11.2.0 because this method was never called and may be removed in the future.Called by the service container to indicate that a service instance has been loaded- Parameters:
config
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceUnloaded
@Deprecated void instanceUnloaded(ServiceInstanceConfig config) throws ServiceException, PortalException
Deprecated.Since 11.2.0 because this method was never called and may be removed in the future.Called by the service container to indicate that a service instance is about to be unloaded- Parameters:
config
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceAdded
void instanceAdded(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction) throws ServiceException, PortalException
Called by the service container to indicate that a service instance has been added. Dependencies between services must never be created inside this method. Dependencies must be created in theautoAddDependencies(lumis.portal.authentication.SessionConfig, lumis.portal.serviceinstance.ServiceInstanceConfig, lumis.util.ITransaction)
method.- Parameters:
config
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceDeleted
void instanceDeleted(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction) throws ServiceException, PortalException
Called by the service container to indicate that a service instance is about to be deleted.- Parameters:
config
- aServiceInstanceConfig
object containing the service's configuration- Throws:
ServiceException
PortalException
-
instanceMoved
void instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, IWebsite oldWebsite, IWebsite newWebsite, ITransaction transaction) throws ServiceException, PortalException
Called to indicate the given service instance has been moved from awebsite
to another one. The websites are, necessarily, different and they may benull
, but not both.- Parameters:
sessionConfig
- the user's session.serviceInstance
- the service instance.oldWebsite
- the old website.newWebsite
- the new website.transaction
- the transaction.- Throws:
ServiceException
PortalException
- Since:
- 6.2.0
-
instanceMoved
void instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, IPortalBaseFolder oldWebRootFolder, IPortalBaseFolder newWebRootFolder, ITransaction transaction) throws ServiceException, PortalException
Called to indicate the given service instance has been moved from aweb root base folder
to another one. Both folders are necessarily notnull
.- Parameters:
sessionConfig
- the user's session.serviceInstance
- the service instance.oldWebRootFolder
- the old web root folder.newWebRootFolder
- the new web root folder.transaction
- the transaction.- Throws:
ServiceException
PortalException
- Since:
- 6.2.0
-
instanceMoved
default void instanceMoved(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstance, ChannelConfig oldChannel, ChannelConfig newChannel, ITransaction transaction) throws ServiceException, PortalException
Called to indicate the given service instance was moved from a channel to the other channel.- Parameters:
sessionConfig
- the user's sessionserviceInstance
- the service instanceoldChannel
- the old channelnewChannel
- the new channeltransaction
-- Throws:
ServiceException
PortalException
- Since:
- 12.4.0
-
autoAddDependencies
void autoAddDependencies(SessionConfig sessionConfig, ServiceInstanceConfig config, ITransaction transaction) throws ServiceException, PortalException
Adds service specific dependencies. This is usually called when an instance of the service is created.- Parameters:
sessionConfig
-config
-transaction
-- Throws:
ServiceException
PortalException
- Since:
- 4.0.3
-
instanceSerialized
void instanceSerialized(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws PortalException
Called after the serialization of a service instance. The service may add custom information on the output stream, and they will be available during#aclDeserialized
.- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance id.outputStream
- the serialization outputStream.transaction
- the transaction for persistence access.- Throws:
PortalException
- Since:
- 4.0.6
- See Also:
instanceDeserialized(SessionConfig, String, DeserializationConfig, Node, ITransaction)
-
instanceDeserialized
void instanceDeserialized(SessionConfig sessionConfig, String serviceInstanceId, DeserializationConfig deserializationConfig, Node accessControlListNode, ITransaction transaction) throws PortalException
Called after an service instance is deserialized.- Parameters:
sessionConfig
- user session information.serviceInstanceId
- the service instance id.deserializationConfig
- the deserialization configuration.accessControlListNode
- the deserialized acl node.transaction
- the transaction for persistence access.- Throws:
PortalException
- Since:
- 4.0.6
- See Also:
instanceSerialized(SessionConfig, String, OutputStream, ITransaction)
-
instanceSerialized
void instanceSerialized(ServiceInstanceSerializationContext serviceInstanceSerializationContext) throws PortalException
Called after the serialization of a service instance. The service may serialize additional structure or data- Parameters:
sessionConfig
-serviceInstanceSerializationContext
-transaction
-- Throws:
PortalException
-
instanceDeserialized
void instanceDeserialized(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext) throws PortalException
Called after an service instance is deserialized.- Parameters:
sessionConfig
-serviceInstanceDeserializationContext
-transaction
-- Throws:
PortalException
-
deserializeContent
void deserializeContent(ServiceInstanceDeserializationContext serviceInstanceDeserializationContext) throws PortalException
Deserializes service instance Content.- Parameters:
sessionConfig
-serviceInstanceDeserializationContext
-transaction
-- Throws:
PortalException
-
getDefaultServiceInstanceMenu
Element getDefaultServiceInstanceMenu(ServiceInstanceConfig serviceInstance) throws PortalException
Returns the default service instance menu definition to use for a service instance.This default is used if this service does not have a explicit menu definition in its
servicedefinition.xml
.- Parameters:
serviceInstance
- the service instance.- Returns:
- the menu definition.
- Throws:
PortalException
- if the menu could not be generated.- Since:
- 8.2.0
-
checkFileAccess
default boolean checkFileAccess(FileConfig file) throws PortalException
Returns whether the current user has access to the given file.- Parameters:
file
- the file.- Throws:
PortalException
- Since:
- 10.1.0
-
-