Package lumis.portal.serviceinstance
Interface IServiceInstanceManager
-
- All Superinterfaces:
IConfigDeleter
,IConfigKeyChecker
- All Known Subinterfaces:
IServiceInstanceManagerSPI
- All Known Implementing Classes:
ServiceInstanceManager
@StableMinor(version="14.1", sinceVersion="4.0") public interface IServiceInstanceManager extends IConfigDeleter, IConfigKeyChecker
Manager Interface for Service Instance operations- Since:
- 4.0.0
- Version:
- $Revision: 24683 $ $Date: 2021-08-23 18:55:58 -0300 (Mon, 23 Aug 2021) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description String
add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction)
String
add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Add a service instance.void
addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction)
void
addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Add or Update a Service Instance, depending on its previous existence.void
clearServiceInstanceCache(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Remove the object cache entries for the specificed Service Instance also clearing it's ACL cache.void
delete(SessionConfig sessionConfig, String serviceInstanceId, boolean force, ITransaction transaction)
Delete a service instance.void
deleteCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Deletes all service instance´s custom propertiesvoid
deleteCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction)
Deletes a service instance custom propertyString
deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceNode, ITransaction transaction)
void
deserializeCustomProperties(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceCustomPropertiesNode, ITransaction transaction)
Deprecated.Since 6.2.0 this method is no longer used and may be removed in a future version.String
deserializeDependency(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceDependencyNode, ITransaction transaction)
Deserializes the given dependencyServiceInstanceConfig
findServiceInstanceThroughChannelTree(SessionConfig sessionConfig, String channelId, String serviceId, ITransaction transaction)
Searches for a service instanceServiceInstanceConfig
get(String serviceInstanceId, ITransaction transaction)
Get the configuration of the service instance.Map<String,String>
getCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Gets all the custom properties of a specified service instance.String
getCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction)
Returns the specified custom property.ServiceInstanceDependencyConfig
getDependency(String serviceInstanceDependencyId, ITransaction transaction)
Collection<String>
getDependencyIdsByServiceInstanceId(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Returns the service instance ids that the given service instance id depends onCollection<String>
getDependentServiceInstanceIds(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Collection<ServiceInstanceConfig>
getDependentServiceInstances(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Returns the service instances that are dependent on the specified service instance.Collection<String>
getIds(SessionConfig sessionConfig, ITransaction transaction)
Get the ids of all services instancesCollection<String>
getIdsByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
Get the ids of the services instances by passing the channel id.Collection<String>
getIdsByChannelTree(SessionConfig sessionConfig, String rootChannelId, ITransaction transaction)
Get the ids of the services instances of all the channel tree by passing the tree's root channel id.Collection<String>
getIdsByChannelTreeAndAreaTags(SessionConfig sessionConfig, String rootChannelId, Collection<String> areaTags, ITransaction transaction)
Returns the identifiers of services instances that belong to the channel tree inside the specified root channel, and contains any of the specified area tags.Collection<String>
getIdsByServiceId(SessionConfig sessionConfig, String serviceId, ITransaction transaction)
Get the ids of the services instances by passing the service id.ServiceInstanceConfig
getServiceInstanceByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction)
Get the service instance the given service instance depends on by the given dependency type.Collection<ServiceInstanceConfig>
getServiceInstancesByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction)
Returns the service instances the given service instance depends on by the given dependency type.void
serialize(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction)
void
serializeCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction)
Serializes the custom properties of a service instance into the specified outputstream.void
serializeDependencies(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction)
Serializes the dependencies of a service instancevoid
setCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, Map<String,String> propertiesTable, ITransaction transaction)
Receives a Map with one or more properties to be set for the given service instance.void
setCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, String value, ITransaction transaction)
Set a custom property for the given service instance.void
setServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig, ITransaction transaction)
Sets the given service instance dependency.void
update(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction)
Update a service instance.-
Methods inherited from interface lumis.portal.serialization.operation.IConfigDeleter
deleteConfig
-
Methods inherited from interface lumis.portal.serialization.operation.IConfigKeyChecker
keyExists
-
-
-
-
Method Detail
-
addOrUpdate
void addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ManagerException, PortalException
Add or Update a Service Instance, depending on its previous existence.- Parameters:
sessionConfig
-serviceInstanceConfig
-transaction
-- Throws:
ManagerException
PortalException
-
get
ServiceInstanceConfig get(String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Get the configuration of the service instance.- Parameters:
serviceInstanceId
-transaction
-- Returns:
- a ServiceInstanceConfig.
- Throws:
ManagerException
PortalException
-
findServiceInstanceThroughChannelTree
ServiceInstanceConfig findServiceInstanceThroughChannelTree(SessionConfig sessionConfig, String channelId, String serviceId, ITransaction transaction) throws PortalException
Searches for a service instance- Parameters:
sessionConfig
-channelId
-serviceId
-transaction
-- Returns:
- Throws:
PortalException
-
add
String add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ManagerException, PortalException
Add a service instance. The isInstantiable attribute of the associated serviceConfig is simply an informative attribute. This is used by the front end. However if one calls the ServiceManager.add method the isInstantiable attribute will be ignored.- Parameters:
sessionConfig
-serviceInstanceConfig
-transaction
-- Returns:
- a String.
- Throws:
ManagerException
PortalException
-
update
void update(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ManagerException, PortalException
Update a service instance.- Parameters:
sessionConfig
-serviceInstanceConfig
-transaction
-- Throws:
ManagerException
PortalException
-
delete
void delete(SessionConfig sessionConfig, String serviceInstanceId, boolean force, ITransaction transaction) throws ManagerException, PortalException
Delete a service instance.- Parameters:
sessionConfig
-serviceInstanceId
-force
- TODOtransaction
-- Throws:
ManagerException
PortalException
-
getIds
Collection<String> getIds(SessionConfig sessionConfig, ITransaction transaction) throws ManagerException, PortalException
Get the ids of all services instances- Parameters:
sessionConfig
-channelId
-transaction
-- Returns:
- a array of Strings.
- Throws:
ManagerException
PortalException
-
getIdsByChannelId
Collection<String> getIdsByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws ManagerException, PortalException
Get the ids of the services instances by passing the channel id.- Parameters:
sessionConfig
-channelId
-transaction
-- Returns:
- a array of Strings.
- Throws:
ManagerException
PortalException
-
getIdsByChannelTree
Collection<String> getIdsByChannelTree(SessionConfig sessionConfig, String rootChannelId, ITransaction transaction) throws ManagerException, PortalException
Get the ids of the services instances of all the channel tree by passing the tree's root channel id.- Parameters:
sessionConfig
-rootChannelId
-transaction
-- Returns:
- a array of Strings.
- Throws:
ManagerException
PortalException
-
getIdsByChannelTreeAndAreaTags
Collection<String> getIdsByChannelTreeAndAreaTags(SessionConfig sessionConfig, String rootChannelId, Collection<String> areaTags, ITransaction transaction) throws PortalException
Returns the identifiers of services instances that belong to the channel tree inside the specified root channel, and contains any of the specified area tags.- Parameters:
sessionConfig
- user session information.rootChannelId
- the channel that is root of the channel tree where the service instances are searched on.areaTags
- the service instance must have one of the specified area tags to be returned. If this argument isnull
, it is ignored and the service instances will not be filtered by area tags. If this argument is an empty collection, an empty collection will be returned.transaction
- the transaction for persistence access.- Returns:
- collection with identifiers of service instances found.
- Throws:
PortalException
-
getIdsByServiceId
Collection<String> getIdsByServiceId(SessionConfig sessionConfig, String serviceId, ITransaction transaction) throws ManagerException, PortalException
Get the ids of the services instances by passing the service id.- Parameters:
sessionConfig
-serviceId
-transaction
-- Returns:
- a array of Strings.
- Throws:
ManagerException
PortalException
-
setCustomProperty
void setCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, String value, ITransaction transaction) throws ManagerException, PortalException
Set a custom property for the given service instance. If the property has been previously set, this method replaces the previous value, else a new property is created for the service instance. If the property value is null or empty the property is removed.- Parameters:
sessionConfig
- the user session information.serviceInstanceId
- the id of the service instance.name
- the property name.value
- the property value.transaction
- the transaction for persistence access.- Throws:
ManagerException
PortalException
-
getCustomProperty
String getCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction) throws ManagerException, PortalException
Returns the specified custom property. If the property has not been set earlier, null is returned.- Parameters:
sessionConfig
-serviceInstanceId
-name
-transaction
-- Returns:
- a String.
- Throws:
ManagerException
PortalException
-
deleteCustomProperty
void deleteCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction) throws ManagerException, PortalException
Deletes a service instance custom property- Parameters:
sessionConfig
-serviceInstanceId
-name
-transaction
-- Throws:
ManagerException
PortalException
-
deleteCustomProperties
void deleteCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Deletes all service instance´s custom properties- Parameters:
sessionConfig
-serviceInstanceId
-transaction
-- Throws:
ManagerException
PortalException
-
serialize
void serialize(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
- Parameters:
sessionConfig
-serviceInstanceId
-outputStream
-transaction
-- Throws:
ManagerException
PortalException
-
deserialize
String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceNode, ITransaction transaction) throws ManagerException, PortalException
- Parameters:
sessionConfig
-deserializationConfig
-serviceInstanceNode
-transaction
-- Returns:
- Returns a String.
- Throws:
ManagerException
PortalException
-
getServiceInstanceByDependency
ServiceInstanceConfig getServiceInstanceByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction) throws ManagerException, PortalException
Get the service instance the given service instance depends on by the given dependency type.If the service instance depends on multiple service instances, any may be returned. Use
getServiceInstancesByDependency(SessionConfig, String, String, ITransaction)
to get all of them.- Parameters:
sessionConfig
- current session informationserviceInstanceId
- the id of the service instance that depends on the returned service instance.dependencyType
- the type of dependency.transaction
- the transaction for persistence access.- Returns:
- the service instance the given service instance depends on, or null if none was found.
- Throws:
PortalException
ManagerException
-
getServiceInstancesByDependency
Collection<ServiceInstanceConfig> getServiceInstancesByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction) throws PortalException
Returns the service instances the given service instance depends on by the given dependency type.- Parameters:
sessionConfig
- current session informationserviceInstanceId
- 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 service instances the given service instance depends on, or an empty collection if none was found.
- Throws:
PortalException
- if the service instances could not be obtained.- Since:
- 6.2.0
- See Also:
getServiceInstanceByDependency(SessionConfig, String, String, ITransaction)
-
setServiceInstanceDependency
void setServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig, ITransaction transaction) throws PortalException
Sets the given service instance dependency. Any existing dependency from the same service instance of the same type is removed.- Parameters:
serviceInstanceDependencyConfig
- the information about the dependency to be set.transaction
- the transaction for persistence access.- Throws:
PortalException
-
serializeDependencies
void serializeDependencies(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws PortalException
Serializes the dependencies of a service instance- Parameters:
sessionConfig
-serviceInstanceId
-outputStream
-transaction
-- Throws:
PortalException
-
getDependencyIdsByServiceInstanceId
Collection<String> getDependencyIdsByServiceInstanceId(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Returns the service instance ids that the given service instance id depends on- Parameters:
sessionConfig
-serviceInstanceId
-transaction
-- Returns:
- Throws:
ManagerException
PortalException
-
getDependentServiceInstances
Collection<ServiceInstanceConfig> getDependentServiceInstances(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
Returns the service instances that are dependent on the specified service instance.- Parameters:
sessionConfig
- the user session information.serviceInstanceId
- the id of the service instance the returned service instances depend on.transaction
- the transaction for persistence access.- Returns:
- a collection with the service instances found.
- Throws:
PortalException
-
deserializeDependency
String deserializeDependency(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceDependencyNode, ITransaction transaction) throws PortalException
Deserializes the given dependency- Parameters:
sessionConfig
-deserializationConfig
-serviceInstanceDependencyNode
-transaction
-- Returns:
- Throws:
PortalException
-
getCustomProperties
Map<String,String> getCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Gets all the custom properties of a specified service instance. The method will return a Hashmap containing all properties names and values of a service instance by it's serviceInstanceId.- Parameters:
sessionConfig
-serviceInstanceId
-transaction
-- Returns:
- Throws:
ManagerException
PortalException
- Since:
- 4.0.3
-
serializeCustomProperties
void serializeCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
Serializes the custom properties of a service instance into the specified outputstream.- Parameters:
sessionConfig
-serviceInstanceId
-outputStream
-transaction
-- Throws:
ManagerException
PortalException
- Since:
- 4.0.3
-
deserializeCustomProperties
@Deprecated void deserializeCustomProperties(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceCustomPropertiesNode, ITransaction transaction) throws ManagerException, PortalException
Deprecated.Since 6.2.0 this method is no longer used and may be removed in a future version.Deserialize custom properties from a XML node into a service instance. The properties name and values will be read from the serviceInstanceCustomPropertiesNode and will follow the constraints stored on the DeserializationConfig. The expected scheme of the serviceInstanceCustomPropertiesNode is the same used by the {@link serializeCustomProperties) method.- Parameters:
sessionConfig
-deserializationConfig
-serviceInstanceCustomPropertiesNode
-transaction
-- Throws:
ManagerException
PortalException
- Since:
- 4.0.3
-
clearServiceInstanceCache
void clearServiceInstanceCache(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
Remove the object cache entries for the specificed Service Instance also clearing it's ACL cache.- Parameters:
sessionConfig
-serviceInstanceId
-transaction
-- Throws:
ManagerException
PortalException
- Since:
- 4.0.4
-
getDependency
ServiceInstanceDependencyConfig getDependency(String serviceInstanceDependencyId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
getDependentServiceInstanceIds
Collection<String> getDependentServiceInstanceIds(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
setCustomProperties
void setCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, Map<String,String> propertiesTable, ITransaction transaction) throws ManagerException, PortalException
Receives a Map with one or more properties to be set for the given service instance. If the property has been previously set, this method replaces the previous value, else a new property is created for the interface instance. If the property value is null or empty the property is removed.- Parameters:
sessionConfig
- the user session information.serviceInstanceId
- the id of the service instance.propertiesTable
- the<key, value>
property map.transaction
- the transaction for persistence access.- Throws:
ManagerException
PortalException
- Since:
- 4.0.3
-
addOrUpdate
void addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction) throws ManagerException, PortalException
- Throws:
ManagerException
PortalException
-
add
String add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
-