Package lumis.portal.serviceinterface
Class ServiceInterfaceManager
- java.lang.Object
-
- lumis.portal.serviceinterface.ServiceInterfaceManager
-
- All Implemented Interfaces:
IConfigKeyChecker
,IServiceInterfaceManager
,IServiceInterfaceManagerSPI
public class ServiceInterfaceManager extends Object implements IServiceInterfaceManagerSPI
Service interface manager implementation.- Since:
- 4.0.0
- Version:
- $Revision: 20184 $ $Date: 2017-05-24 13:42:40 -0300 (Wed, 24 May 2017) $
-
-
Field Summary
-
Fields inherited from interface lumis.portal.serviceinterface.IServiceInterfaceManager
INTERFACE_HOLDER_ID
-
-
Constructor Summary
Constructors Constructor Description ServiceInterfaceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOrUpdateStyle(SessionConfig sessionConfig, ServiceInterfaceStyleConfig serviceInterfaceStyleConfig, ITransaction transaction)
Add or update a Style.void
clearCache()
Clears the service interface caches.void
deleteStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, ITransaction transaction)
Delete a Style.void
deserializeStyle(SessionConfig sessionConfig, Node interfaceStyleNode, ITransaction transaction)
Deserializes a ServiceInterfaceStyleConfig contained in the interfaceStyleNode.Collection<String>
getIdsByServiceId(String serviceId, ITransaction transaction)
Get the service interface ids from a given service.ServiceInterfaceMenuGroupTypeConfig
getMenuGroupType(SessionConfig sessionConfig, String menuGroupTypeId, ITransaction transaction)
Get the menu group type.ServiceInterfaceMenuItemTypeConfig
getMenuItemType(SessionConfig sessionConfig, String menuItemTypeId, ITransaction transaction)
Get the menu item type.IServiceInterface
getServiceInterface(String serviceInterfaceId, ITransaction transaction)
Get the service interface.ServiceInterfaceConfig
getServiceInterfaceConfig(String serviceInterfaceId, ITransaction transaction)
Get the configuration of the service interface.protected ServiceInterfaceTypeConfig
getServiceInterfaceTypeConfig(String interfaceType, ITransaction transaction)
ServiceInterfaceStyleConfig
getStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, ITransaction transaction)
Get the style configuration os the service interface.ServiceInterfaceStyleConfig
getStyleByServiceInterfaceInstanceId(SessionConfig sessionConfig, String serviceInterfaceInstanceId, ITransaction transaction)
Get the Style given the ServiceInterfaceInstanceId.IConfigKeyChecker
getStyleConfigKeyChecker()
Collection<String>
getStyleIds(SessionConfig sessionConfig, String serviceInterfaceId, ITransaction transaction)
Get the Id of all styles associated with a service interface.Collection<String>
getStyleIdsByInterfaceInstance(SessionConfig sessionConfig, String interfaceInstanceId, ITransaction transaction, boolean onlyCustomStyles)
Get the Id of all styles available to an interface instance considering the isolation rules.boolean
keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
Checks if configId matches an already persisted objectvoid
register(SessionConfig sessionConfig, String serviceConfigPath, ITransaction transaction)
Register the service interface.void
registerMenuGroupTypes(SessionConfig sessionConfig, String groupTypesConfigPath, ITransaction transaction)
Register the menu group types.void
registerMenuItemTypes(SessionConfig sessionConfig, String itemTypesConfigPath, ITransaction transaction)
Register menu item type.void
registerServiceInterfaceTypes(SessionConfig sessionConfig, String serviceTypesConfigPath, ITransaction transaction)
Register the type of the service interface.void
serializeStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, OutputStream outputStream, ITransaction transaction)
Serializes a ServiceInterfaceStyleConfig to the specified outputStream.void
unregister(SessionConfig sessionConfig, ServiceInterfaceConfig serviceInterfaceConfig, ITransaction transaction)
Unregister the Service Interface.void
unregisterMenuGroupType(SessionConfig sessionConfig, String typeId, ITransaction transaction)
Unregisters a service menu group type.void
unregisterMenuItemType(SessionConfig sessionConfig, String typeId, ITransaction transaction)
Unregisters a service menu item type.void
unregisterServiceInterfaceType(String typeId, ITransaction transaction)
Unregister the type of service interface.
-
-
-
Method Detail
-
getServiceInterfaceConfig
public ServiceInterfaceConfig getServiceInterfaceConfig(String serviceInterfaceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the configuration of the service interface.- Specified by:
getServiceInterfaceConfig
in interfaceIServiceInterfaceManager
- Returns:
- a ServiceInterfaceConfig.
- Throws:
ManagerException
PortalException
-
getIdsByServiceId
public Collection<String> getIdsByServiceId(String serviceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the service interface ids from a given service.- Specified by:
getIdsByServiceId
in interfaceIServiceInterfaceManager
- Returns:
- a array of Strings.
- Throws:
ManagerException
PortalException
-
getServiceInterface
public IServiceInterface getServiceInterface(String serviceInterfaceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the service interface.- Specified by:
getServiceInterface
in interfaceIServiceInterfaceManager
- Returns:
- an IServiceInterface.
- Throws:
ManagerException
PortalException
-
register
public void register(SessionConfig sessionConfig, String serviceConfigPath, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Register the service interface.- Specified by:
register
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
registerServiceInterfaceTypes
public void registerServiceInterfaceTypes(SessionConfig sessionConfig, String serviceTypesConfigPath, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Register the type of the service interface.- Specified by:
registerServiceInterfaceTypes
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
getServiceInterfaceTypeConfig
protected ServiceInterfaceTypeConfig getServiceInterfaceTypeConfig(String interfaceType, ITransaction transaction) throws ManagerException, PortalException
- Throws:
ManagerException
PortalException
-
unregisterServiceInterfaceType
public void unregisterServiceInterfaceType(String typeId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Unregister the type of service interface.- Specified by:
unregisterServiceInterfaceType
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
getStyleByServiceInterfaceInstanceId
public ServiceInterfaceStyleConfig getStyleByServiceInterfaceInstanceId(SessionConfig sessionConfig, String serviceInterfaceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the Style given the ServiceInterfaceInstanceId.- Specified by:
getStyleByServiceInterfaceInstanceId
in interfaceIServiceInterfaceManager
- Returns:
- a ServiceInterfaceStyleConfig.
- Throws:
ManagerException
PortalException
-
getStyle
public ServiceInterfaceStyleConfig getStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the style configuration os the service interface.- Specified by:
getStyle
in interfaceIServiceInterfaceManager
- Returns:
- a ServiceInterfaceStyleConfig.
- Throws:
ManagerException
PortalException
-
deleteStyle
public void deleteStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Delete a Style.- Specified by:
deleteStyle
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
addOrUpdateStyle
public void addOrUpdateStyle(SessionConfig sessionConfig, ServiceInterfaceStyleConfig serviceInterfaceStyleConfig, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Add or update a Style. This method consider the rules of Style Isolation level.The rules considered are:
- The Isolation level of a style from definition service can not has it's level changed.
- A custom style can not refer to a XSL file used by another interface style.
- Specified by:
addOrUpdateStyle
in interfaceIServiceInterfaceManager
- Parameters:
sessionConfig
- the sessionConfig object that contains the informations about the user request.serviceInterfaceStyleConfig
- the style object to be persisted.transaction
- used to get informations from database.- Throws:
ManagerException
- if any error occurs during the process of communication with database.PortalException
- if any other error occurs during the process.
-
registerMenuItemTypes
public void registerMenuItemTypes(SessionConfig sessionConfig, String itemTypesConfigPath, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Register menu item type.- Specified by:
registerMenuItemTypes
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
registerMenuGroupTypes
public void registerMenuGroupTypes(SessionConfig sessionConfig, String groupTypesConfigPath, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Register the menu group types.- Specified by:
registerMenuGroupTypes
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
unregisterMenuItemType
public void unregisterMenuItemType(SessionConfig sessionConfig, String typeId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Unregisters a service menu item type.- Specified by:
unregisterMenuItemType
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
unregisterMenuGroupType
public void unregisterMenuGroupType(SessionConfig sessionConfig, String typeId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Unregisters a service menu group type.- Specified by:
unregisterMenuGroupType
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
getMenuGroupType
public ServiceInterfaceMenuGroupTypeConfig getMenuGroupType(SessionConfig sessionConfig, String menuGroupTypeId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the menu group type.- Specified by:
getMenuGroupType
in interfaceIServiceInterfaceManager
- Returns:
- a ServiceInterfaceMenuGroupTypeConfig.
- Throws:
ManagerException
PortalException
-
getMenuItemType
public ServiceInterfaceMenuItemTypeConfig getMenuItemType(SessionConfig sessionConfig, String menuItemTypeId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the menu item type.- Specified by:
getMenuItemType
in interfaceIServiceInterfaceManager
- Returns:
- a ServiceInterfaceMenuItemConfig.
- Throws:
ManagerException
PortalException
-
unregister
public void unregister(SessionConfig sessionConfig, ServiceInterfaceConfig serviceInterfaceConfig, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Unregister the Service Interface.- Specified by:
unregister
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
getStyleIds
public Collection<String> getStyleIds(SessionConfig sessionConfig, String serviceInterfaceId, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the Id of all styles associated with a service interface.- Specified by:
getStyleIds
in interfaceIServiceInterfaceManager
- Parameters:
sessionConfig
- the sessionConfig object that contains the informations about the user request.serviceInterfaceId
- Service Interface target.transaction
- used to get informations from database.- Returns:
- list of interface styles according with the isolation rules.
- Throws:
ManagerException
- if any error occurs during the process of communication with database.PortalException
- if any other error occurs during the process.
-
serializeStyle
public void serializeStyle(SessionConfig sessionConfig, String serviceInterfaceStyleId, String serviceInterfaceId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Serializes a ServiceInterfaceStyleConfig to the specified outputStream.- Specified by:
serializeStyle
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
deserializeStyle
public void deserializeStyle(SessionConfig sessionConfig, Node interfaceStyleNode, ITransaction transaction) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Deserializes a ServiceInterfaceStyleConfig contained in the interfaceStyleNode.- Specified by:
deserializeStyle
in interfaceIServiceInterfaceManager
- Throws:
ManagerException
PortalException
-
keyExists
public boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
Description copied from interface:IConfigKeyChecker
Checks if configId matches an already persisted object- Specified by:
keyExists
in interfaceIConfigKeyChecker
config
- Optional, allows a checker to read aditional fields to check composed keys- Returns:
- true if configId matches an already persisted object
-
getStyleConfigKeyChecker
public IConfigKeyChecker getStyleConfigKeyChecker()
- Specified by:
getStyleConfigKeyChecker
in interfaceIServiceInterfaceManager
-
getStyleIdsByInterfaceInstance
public Collection<String> getStyleIdsByInterfaceInstance(SessionConfig sessionConfig, String interfaceInstanceId, ITransaction transaction, boolean onlyCustomStyles) throws ManagerException, PortalException
Description copied from interface:IServiceInterfaceManager
Get the Id of all styles available to an interface instance considering the isolation rules.The isolation rules are:
- Interface Style with isolation level Isolated - Can be used only by one interface instance.
- Interface Style with isolation level:
Non-Isolated
- Can be used for any the interface instance. This level is the default for new styles. - Interface Style with isolation level:
Shared
- Can be used just by service instances indicated by the user during the add or update custom interface style process.
- Specified by:
getStyleIdsByInterfaceInstance
in interfaceIServiceInterfaceManager
- Parameters:
sessionConfig
- the sessionConfig object that contains the informations about the user request.interfaceInstanceId
- Interface instance target.transaction
- used to get informations from database.onlyCustomStyles
- determine if is to return only custom styles.- Returns:
- list of interface styles according with the isolation rules.
- Throws:
ManagerException
- if any error occurs during the process of communication with database.PortalException
- if any other error occurs during the process.
-
clearCache
public void clearCache()
Description copied from interface:IServiceInterfaceManagerSPI
Clears the service interface caches.- Specified by:
clearCache
in interfaceIServiceInterfaceManagerSPI
-
-