Package lumis.portal.serviceinstance
Class ServiceInstanceDaoJdbc
- java.lang.Object
-
- lumis.portal.serviceinstance.ServiceInstanceDaoJdbc
-
- All Implemented Interfaces:
IServiceInstanceDao
- Direct Known Subclasses:
ServiceInstanceDaoHib
public class ServiceInstanceDaoJdbc extends java.lang.Object implements IServiceInstanceDao
Service instance DAO implementation for JDBC.- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description ServiceInstanceDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Add the service's instance.void
addServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig, ITransaction transaction)
Add the given service instance dependency to the persistence.void
delete(java.lang.String serviceInstanceId, ITransaction transaction)
Delete the service's instance.void
deleteCustomProperties(java.lang.String serviceInstanceId, ITransaction daoTransaction)
Delete all service instance´s custom properties.void
deleteCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, ITransaction daoTransaction)
Delete a service instance´s custom property.ServiceInstanceConfig
get(java.lang.String serviceInstanceId, ITransaction transaction)
Get the service's instance.ServiceInstanceConfig
getByRestShortName(java.lang.String restShortName, ITransaction transaction)
Get the service's instance by rest short name, only for valid service instance.java.util.List<IChannelChild>
getChannelsChildren(java.lang.String parentChannelIds, boolean hideItems, java.lang.String serviceId, IResource resource, java.util.Locale locale, ITransaction transaction)
java.util.List<IChannelChild>
getChildrenData(java.lang.String channelId, int hidePages, java.lang.String serviceId, IResource resource, java.util.Locale locale, ITransaction transaction)
java.util.HashMap<java.lang.String,java.lang.String>
getCustomProperties(java.lang.String serviceInstanceId, ITransaction daoTransaction)
Get all service instance's custom properties.java.lang.String
getCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, ITransaction daoTransaction)
Get service instance´s custom property.java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getDependenciesOfDependentServiceInstances(java.lang.String serviceInstanceId, ITransaction transaction)
Returns a map with all the dependencies of a given service instance (grouped by the dependency type).java.util.Collection<java.lang.String>
getDependencyIdsByServiceInstanceId(java.lang.String serviceInstanceId, ITransaction transaction)
Get the ids of all the service instances that the given service instance depends onjava.util.Collection<java.lang.String>
getIdsByChannelIdAndServiceId(java.lang.String channelId, java.lang.String serviceId, ITransaction transaction)
Get a list of ids in a given channel and of a given service.java.util.Collection<java.lang.String>
getIdsByServiceInstanceAndDependencyType(java.lang.String serviceInstanceId, java.lang.String dependencyType, ITransaction transaction)
Get the ids of the service instances that the given service instance depends on by the given dependency type.java.util.Collection<java.lang.String>
getIdsOfDependentServiceInstances(java.lang.String serviceInstanceId, ITransaction transaction)
Get the ids of all service instances that depends on the given service instance.ServiceInstanceDependencyConfig
getServiceInstanceDependency(java.lang.String dependencyId, ITransaction transaction)
Get aServiceInstanceDependencyConfig
by the dependencyId.java.util.Collection<java.lang.String>
getServiceInstancesIdsByAutoAdminPageId(java.lang.String pageId, ITransaction transaction)
Returns a collection of serviceInstanceIds that contain the pageid as its auto administration page.void
removeServiceInstanceDependencies(java.lang.String dependentServiceInstanceId, java.lang.String dependencyType, ITransaction transaction)
Remove the service instance dependencies that matches the dependent service instance id and dependency type given.void
setCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, java.lang.String value, ITransaction daoTransaction)
Set service instance´s custom property.void
update(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Update the service's instance.
-
-
-
Method Detail
-
get
public ServiceInstanceConfig get(java.lang.String serviceInstanceId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get the service's instance.- Specified by:
get
in interfaceIServiceInstanceDao
- Returns:
- Throws:
DaoException
PortalException
-
getByRestShortName
public ServiceInstanceConfig getByRestShortName(java.lang.String restShortName, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get the service's instance by rest short name, only for valid service instance.- Specified by:
getByRestShortName
in interfaceIServiceInstanceDao
- Parameters:
restShortName
- rest short name of the service instance.transaction
- transaction used to perform the query.- Returns:
- the serviceInstanceConfig that represents the service instance.
- Throws:
DaoException
- if any database error occurs during the process.PortalException
- if any other error occurs during the process.
-
add
public void add(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Add the service's instance.- Specified by:
add
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
update
public void update(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Update the service's instance.- Specified by:
update
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
delete
public void delete(java.lang.String serviceInstanceId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Delete the service's instance.- Specified by:
delete
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
getIdsByChannelIdAndServiceId
public java.util.Collection<java.lang.String> getIdsByChannelIdAndServiceId(java.lang.String channelId, java.lang.String serviceId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get a list of ids in a given channel and of a given service. The channel or the service may be ommitted. In this case only the other condition will select the returned ids.- Specified by:
getIdsByChannelIdAndServiceId
in interfaceIServiceInstanceDao
- Returns:
- Throws:
DaoException
PortalException
-
getCustomProperty
public java.lang.String getCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, ITransaction daoTransaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get service instance´s custom property.- Specified by:
getCustomProperty
in interfaceIServiceInstanceDao
- Returns:
- Throws:
DaoException
PortalException
-
getCustomProperties
public java.util.HashMap<java.lang.String,java.lang.String> getCustomProperties(java.lang.String serviceInstanceId, ITransaction daoTransaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get all service instance's custom properties.- Specified by:
getCustomProperties
in interfaceIServiceInstanceDao
- Returns:
- Throws:
DaoException
PortalException
-
setCustomProperty
public void setCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, java.lang.String value, ITransaction daoTransaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Set service instance´s custom property.- Specified by:
setCustomProperty
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
deleteCustomProperties
public void deleteCustomProperties(java.lang.String serviceInstanceId, ITransaction daoTransaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Delete all service instance´s custom properties.- Specified by:
deleteCustomProperties
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
deleteCustomProperty
public void deleteCustomProperty(java.lang.String serviceInstanceId, java.lang.String name, ITransaction daoTransaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Delete a service instance´s custom property.- Specified by:
deleteCustomProperty
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
getIdsOfDependentServiceInstances
public java.util.Collection<java.lang.String> getIdsOfDependentServiceInstances(java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceDao
Get the ids of all service instances that depends on the given service instance.- Specified by:
getIdsOfDependentServiceInstances
in interfaceIServiceInstanceDao
- Parameters:
serviceInstanceId
- the service instance the returned service instances depend on.transaction
- the transaction for persistence access.- Returns:
- the dependent service instances.
- Throws:
PortalException
-
getDependenciesOfDependentServiceInstances
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getDependenciesOfDependentServiceInstances(java.lang.String serviceInstanceId, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceDao
Returns a map with all the dependencies of a given service instance (grouped by the dependency type).- Specified by:
getDependenciesOfDependentServiceInstances
in interfaceIServiceInstanceDao
- Parameters:
serviceInstanceId
- the dependent service instance id.transaction
- the transaction.- Returns:
- a map with all the dependencies of a given service instance (grouped by the dependency type).
- Throws:
PortalException
-
getIdsByServiceInstanceAndDependencyType
public java.util.Collection<java.lang.String> getIdsByServiceInstanceAndDependencyType(java.lang.String serviceInstanceId, java.lang.String dependencyType, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get the ids of the service instances that the given service instance depends on by the given dependency type.- Specified by:
getIdsByServiceInstanceAndDependencyType
in interfaceIServiceInstanceDao
- Parameters:
serviceInstanceId
- the id of the service instance that depends on the returned service instances.dependencyType
- the type of dependency.transaction
- the transaction for persistence access.- Returns:
- the ids of the service instances that the given service instance depends on by the given dependency type.
- Throws:
ManagerException
PortalException
DaoException
-
addServiceInstanceDependency
public void addServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceDao
Add the given service instance dependency to the persistence.- Specified by:
addServiceInstanceDependency
in interfaceIServiceInstanceDao
- Parameters:
serviceInstanceDependencyConfig
- the information about the dependency to be added.transaction
- the transaction for persistence access.- Throws:
PortalException
-
removeServiceInstanceDependencies
public void removeServiceInstanceDependencies(java.lang.String dependentServiceInstanceId, java.lang.String dependencyType, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceDao
Remove the service instance dependencies that matches the dependent service instance id and dependency type given.- Specified by:
removeServiceInstanceDependencies
in interfaceIServiceInstanceDao
- Throws:
PortalException
-
getChannelsChildren
public java.util.List<IChannelChild> getChannelsChildren(java.lang.String parentChannelIds, boolean hideItems, java.lang.String serviceId, IResource resource, java.util.Locale locale, ITransaction transaction) throws PortalException
- Specified by:
getChannelsChildren
in interfaceIServiceInstanceDao
- Throws:
PortalException
-
getChildrenData
public java.util.List<IChannelChild> getChildrenData(java.lang.String channelId, int hidePages, java.lang.String serviceId, IResource resource, java.util.Locale locale, ITransaction transaction) throws DaoException, PortalException
- Specified by:
getChildrenData
in interfaceIServiceInstanceDao
- Throws:
DaoException
PortalException
-
getDependencyIdsByServiceInstanceId
public java.util.Collection<java.lang.String> getDependencyIdsByServiceInstanceId(java.lang.String serviceInstanceId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get the ids of all the service instances that the given service instance depends on- Specified by:
getDependencyIdsByServiceInstanceId
in interfaceIServiceInstanceDao
- Returns:
- the ids of the service instances that the given service instance depends on.
- Throws:
DaoException
PortalException
-
getServiceInstanceDependency
public ServiceInstanceDependencyConfig getServiceInstanceDependency(java.lang.String dependencyId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IServiceInstanceDao
Get aServiceInstanceDependencyConfig
by the dependencyId.- Specified by:
getServiceInstanceDependency
in interfaceIServiceInstanceDao
- Returns:
- The ServiceInstanceDependencyConfig
- Throws:
DaoException
PortalException
-
getServiceInstancesIdsByAutoAdminPageId
public java.util.Collection<java.lang.String> getServiceInstancesIdsByAutoAdminPageId(java.lang.String pageId, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInstanceDao
Returns a collection of serviceInstanceIds that contain the pageid as its auto administration page.- Specified by:
getServiceInstancesIdsByAutoAdminPageId
in interfaceIServiceInstanceDao
- Parameters:
pageId
- to list the service instance ids by.transaction
- the transaction in which the operation should happen- Returns:
- collection of serviceInstanceIds that contain the pageid as its auto administration page.
- Throws:
PortalException
-
-