public class ServiceInstanceManager extends Object implements IServiceInstanceManagerSPI
Modifier and Type | Field and Description |
---|---|
static String |
DELETED_SERVICE_INSTANCES_TRANSACTION_ATTRIBUTE_NAME |
Constructor and Description |
---|
ServiceInstanceManager() |
Modifier and Type | Method and 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 |
clearAppropriateAutoAdministrationsPerPageIdCache(ServiceInstanceConfig serviceInstanceConfig,
ITransaction transaction)
Clears the entry in the cacheAutoAdministrationPageIds cache if the service config is an instance of a an auto-administration service.
|
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 |
clearServiceInstanceMemoryCache(String serviceInstanceId,
ITransaction transaction)
Clears the service instance information cached in this manager.
|
void |
delete(SessionConfig sessionConfig,
String serviceInstanceId,
boolean force,
ITransaction transaction)
Delete a service instance.
|
void |
deleteConfig(DeserializationContext deserializationContext,
String configId) |
void |
deleteCustomProperties(SessionConfig sessionConfig,
String serviceInstanceId,
ITransaction transaction)
Deletes all service instance´s custom properties
|
void |
deleteCustomProperty(SessionConfig sessionConfig,
String serviceInstanceId,
String name,
ITransaction transaction)
Deletes a service instance custom property
|
String |
deserialize(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node serviceInstanceNode,
ITransaction transaction) |
void |
deserializeCustomProperties(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node serviceInstanceCustomPropertiesNode,
ITransaction transaction)
Deprecated.
|
String |
deserializeDependency(SessionConfig sessionConfig,
DeserializationConfig deserializationConfig,
Node serviceInstanceDependencyNode,
ITransaction transaction)
Deserializes the given dependency
|
boolean |
existsRestShortName(String restShortName,
String serviceInstanceIdToIgnore,
ITransaction transaction)
Verify if a given name exists.
|
ServiceInstanceConfig |
findServiceInstanceThroughChannelTree(SessionConfig sessionConfig,
String channelId,
String serviceId,
ITransaction transaction)
Searches for a service instance
|
ServiceInstanceConfig |
get(String serviceInstanceId,
ITransaction transaction)
Get the configuration of the service instance.
|
ServiceInstanceConfig |
getByRestShortName(String restShortName,
ITransaction transaction)
Get the service's instance by rest short name.
|
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 on
|
Collection<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<FileTransformation> |
getFileTransformations(String serviceInstanceId)
Gets all fileTransformations using an serviceInstance´s id..
|
Collection<String> |
getIds(SessionConfig sessionConfig,
ITransaction transaction)
Get the ids of all services instances
|
Collection<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.
|
String |
getMenuXml(String serviceInstanceId)
Returns the configuration menu in XML for a service instance.
|
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.
|
Collection<String> |
getServiceInstancesIdsByAutoAdminPageId(String pageId,
ITransaction transaction)
Returns the service instance ids that use the indicated page id as the auto administration page.
|
boolean |
isGoogleAnalyticsEnabled(ServiceInstanceConfig serviceInstanceConfig)
Returns whether the Google Analytics is enable in the given service instance.
|
boolean |
isGoogleAnalyticsEnabled(String propertyBagId)
Returns whether the Google Analytics is enable in the given property bag.
|
Boolean |
isGoogleAnalyticsEnabledLocal(ServiceInstanceConfig serviceInstanceConfig)
Returns whether the Google Analytics is enable in the given service instance or
null if this property is inherited. |
Boolean |
isGoogleAnalyticsEnabledLocal(String propertyBagId)
Returns whether the Google Analytics is enable in the given property bag or
null if this property is inherited. |
boolean |
keyExists(SessionConfig sessionConfig,
Object configKey,
Object config,
ITransaction transaction)
Checks if configId matches an already persisted object
|
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 instance
|
void |
serializeFileTransformations(SessionConfig sessionConfig,
String serviceInstanceId,
OutputStream outputStream,
ITransaction transaction)
serialize a fileTransformation to be used in a new channel created from channel template.
|
void |
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 |
setGoogleAnalyticsEnable(Boolean enabled,
ServiceInstanceConfig serviceInstanceConfig)
Sets whether the Google Analytics is enable in the given service instance.
|
void |
setGoogleAnalyticsEnable(Boolean enabled,
String propertyBagId)
Sets whether the Google Analytics is enable in the given property bag.
|
void |
setServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig,
ITransaction transaction)
Sets the given service instance dependency.
|
void |
update(SessionConfig sessionConfig,
ServiceInstanceConfig serviceInstanceConfig,
ITransaction transaction)
Update a service instance.
|
void |
validateDuplicateInstanceInChannel(ServiceInstanceConfig serviceInstanceConfig,
ITransaction transaction)
Validates that there are no duplicates of a service instance in the same channel.
|
public static final String DELETED_SERVICE_INSTANCES_TRANSACTION_ATTRIBUTE_NAME
public void addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
addOrUpdate
in interface IServiceInstanceManager
ManagerException
PortalException
public ServiceInstanceConfig get(String serviceInstanceId, ITransaction transaction) throws PortalException
IServiceInstanceManager
get
in interface IServiceInstanceManager
ManagerException
PortalException
public boolean existsRestShortName(String restShortName, String serviceInstanceIdToIgnore, ITransaction transaction) throws PortalException
IServiceInstanceManagerSPI
existsRestShortName
in interface IServiceInstanceManagerSPI
restShortName
- rest short name of the service instance.serviceInstanceIdToIgnore
- service instance id that will
not include on the search.transaction
- transaction used to perform the query.PortalException
- if any other error occurs during the process.public ServiceInstanceConfig getByRestShortName(String restShortName, ITransaction transaction) throws PortalException
IServiceInstanceManagerSPI
getByRestShortName
in interface IServiceInstanceManagerSPI
restShortName
- rest short name of the service instance.transaction
- transaction used to perform the query.PortalException
- if any other error occurs during the process.public ServiceInstanceDependencyConfig getDependency(String serviceInstanceDependencyId, ITransaction transaction) throws PortalException
getDependency
in interface IServiceInstanceManager
PortalException
public ServiceInstanceConfig findServiceInstanceThroughChannelTree(SessionConfig sessionConfig, String channelId, String serviceId, ITransaction transaction) throws PortalException
IServiceInstanceManager
findServiceInstanceThroughChannelTree
in interface IServiceInstanceManager
PortalException
public String add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws PortalException
IServiceInstanceManager
add
in interface IServiceInstanceManager
ManagerException
PortalException
public void update(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws PortalException
IServiceInstanceManager
update
in interface IServiceInstanceManager
ManagerException
PortalException
public void validateDuplicateInstanceInChannel(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws ServiceInstanceDuplicatedInChannelException, PortalException
serviceInstanceConfig
- that should be verified if already exists in the target channel.transaction
- in which the method should be part of.ServiceInstanceDuplicatedInChannelException
- if the service has been duplicated in the current channel.PortalException
public final void clearAppropriateAutoAdministrationsPerPageIdCache(ServiceInstanceConfig serviceInstanceConfig, ITransaction transaction) throws PortalException
IServiceInstanceManagerSPI
clearAppropriateAutoAdministrationsPerPageIdCache
in interface IServiceInstanceManagerSPI
serviceInstanceConfig
- service instance to be evaluated.transaction
- under which the method should happen.PortalException
public void delete(SessionConfig sessionConfig, String serviceInstanceId, boolean force, ITransaction transaction) throws PortalException
IServiceInstanceManager
delete
in interface IServiceInstanceManager
force
- TODOManagerException
PortalException
public Collection<String> getIds(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
IServiceInstanceManager
getIds
in interface IServiceInstanceManager
ManagerException
PortalException
public Collection<String> getIdsByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction) throws PortalException
IServiceInstanceManager
getIdsByChannelId
in interface IServiceInstanceManager
ManagerException
PortalException
public Collection<String> getIdsByChannelTree(SessionConfig sessionConfig, String rootChannelId, ITransaction transaction) throws PortalException
IServiceInstanceManager
getIdsByChannelTree
in interface IServiceInstanceManager
ManagerException
PortalException
public Collection<String> getIdsByChannelTreeAndAreaTags(SessionConfig sessionConfig, String rootChannelId, Collection<String> areaTags, ITransaction transaction) throws PortalException
IServiceInstanceManager
getIdsByChannelTreeAndAreaTags
in interface IServiceInstanceManager
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 is
null
, 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.PortalException
public Collection<String> getIdsByServiceId(SessionConfig sessionConfig, String serviceId, ITransaction transaction) throws PortalException
IServiceInstanceManager
getIdsByServiceId
in interface IServiceInstanceManager
ManagerException
PortalException
public String getCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction) throws PortalException
IServiceInstanceManager
getCustomProperty
in interface IServiceInstanceManager
ManagerException
PortalException
public void setCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, String value, ITransaction transaction) throws PortalException
IServiceInstanceManager
setCustomProperty
in interface IServiceInstanceManager
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.ManagerException
PortalException
public void setCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, Map<String,String> propertiesTable, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
setCustomProperties
in interface IServiceInstanceManager
sessionConfig
- the user session information.serviceInstanceId
- the id of the service instance.propertiesTable
- the <key, value>
property map.transaction
- the transaction for persistence access.ManagerException
PortalException
#setCustomProperty(SessionConfig, String, String, String, ITransaction)}
public void deleteCustomProperty(SessionConfig sessionConfig, String serviceInstanceId, String name, ITransaction transaction) throws PortalException
IServiceInstanceManager
deleteCustomProperty
in interface IServiceInstanceManager
ManagerException
PortalException
public void deleteCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
IServiceInstanceManager
deleteCustomProperties
in interface IServiceInstanceManager
ManagerException
PortalException
public void serialize(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws PortalException
serialize
in interface IServiceInstanceManager
ManagerException
PortalException
public String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceNode, ITransaction transaction) throws PortalException
deserialize
in interface IServiceInstanceManager
ManagerException
PortalException
public ServiceInstanceConfig getServiceInstanceByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
If the service instance depends on multiple service instances, any may
be returned. Use IServiceInstanceManager.getServiceInstancesByDependency(SessionConfig, String, String, ITransaction)
to get all of them.
getServiceInstanceByDependency
in interface IServiceInstanceManager
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.PortalException
ManagerException
#getServiceInstancesByDependency(SessionConfig, String, String, ITransaction)}
public Collection<ServiceInstanceConfig> getServiceInstancesByDependency(SessionConfig sessionConfig, String serviceInstanceId, String dependencyType, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
getServiceInstancesByDependency
in interface IServiceInstanceManager
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.PortalException
- if the service instances could not be obtained.ManagerException
IServiceInstanceManager.getServiceInstanceByDependency(SessionConfig, String, String, ITransaction)
public void setServiceInstanceDependency(ServiceInstanceDependencyConfig serviceInstanceDependencyConfig, ITransaction transaction) throws PortalException
IServiceInstanceManager
setServiceInstanceDependency
in interface IServiceInstanceManager
serviceInstanceDependencyConfig
- the information about the dependency to be set.transaction
- the transaction for persistence access.PortalException
public void serializeDependencies(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws PortalException
IServiceInstanceManager
serializeDependencies
in interface IServiceInstanceManager
PortalException
public Collection<String> getDependencyIdsByServiceInstanceId(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
getDependencyIdsByServiceInstanceId
in interface IServiceInstanceManager
ManagerException
PortalException
public Collection<String> getDependentServiceInstanceIds(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
getDependentServiceInstanceIds
in interface IServiceInstanceManager
PortalException
public Collection<ServiceInstanceConfig> getDependentServiceInstances(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
IServiceInstanceManager
getDependentServiceInstances
in interface IServiceInstanceManager
sessionConfig
- the user session information.serviceInstanceId
- the id of the service instance the returned service instances depend on.transaction
- the transaction for persistence access.PortalException
public String deserializeDependency(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceDependencyNode, ITransaction transaction) throws PortalException
IServiceInstanceManager
deserializeDependency
in interface IServiceInstanceManager
PortalException
public Map<String,String> getCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
getCustomProperties
in interface IServiceInstanceManager
ManagerException
PortalException
public Collection<FileTransformation> getFileTransformations(String serviceInstanceId) throws PortalException
serviceInstanceId
- serviceInstance´s id.PortalException
- if an error occurs during the process.public void serializeCustomProperties(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
serializeCustomProperties
in interface IServiceInstanceManager
ManagerException
PortalException
@Deprecated public void deserializeCustomProperties(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node serviceInstanceCustomPropertiesNode, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
deserializeCustomProperties
in interface IServiceInstanceManager
ManagerException
PortalException
public void addOrUpdate(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction) throws ManagerException, PortalException
addOrUpdate
in interface IServiceInstanceManager
ManagerException
PortalException
public String add(SessionConfig sessionConfig, ServiceInstanceConfig serviceInstanceConfig, boolean fromDeserialization, ITransaction transaction) throws PortalException
add
in interface IServiceInstanceManager
PortalException
public void clearServiceInstanceCache(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManager
clearServiceInstanceCache
in interface IServiceInstanceManager
ManagerException
PortalException
public void clearServiceInstanceMemoryCache(String serviceInstanceId, ITransaction transaction) throws PortalException
ChannelManager
.serviceInstanceId
- the service instance identifier.transaction
- the transaction for persistence access.PortalException
public void deleteConfig(DeserializationContext deserializationContext, String configId) throws PortalException
deleteConfig
in interface IConfigDeleter
PortalException
public boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
IConfigKeyChecker
keyExists
in interface IConfigKeyChecker
config
- Optional, allows a checker to read aditional fields to check composed keyspublic void serializeFileTransformations(SessionConfig sessionConfig, String serviceInstanceId, OutputStream outputStream, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManagerSPI
serializeFileTransformations
in interface IServiceInstanceManagerSPI
sessionConfig
- user session information.serviceInstanceId
- new serviceInstance´s idoutputStream
- the outputstream to serialize the data to.transaction
- transaction used to perform the query.ManagerException
- if an error occurs during the processPortalException
- if an error occurs during the processpublic Collection<String> getServiceInstancesIdsByAutoAdminPageId(String pageId, ITransaction transaction) throws ManagerException, PortalException
IServiceInstanceManagerSPI
getServiceInstancesIdsByAutoAdminPageId
in interface IServiceInstanceManagerSPI
pageId
- to be looked forManagerException
PortalException
public String getMenuXml(String serviceInstanceId) throws PortalException
IServiceInstanceManagerSPI
getMenuXml
in interface IServiceInstanceManagerSPI
serviceInstanceId
- the service instance identifier.PortalException
- if the menu could not be generated.public Boolean isGoogleAnalyticsEnabledLocal(ServiceInstanceConfig serviceInstanceConfig) throws PortalException
IServiceInstanceManagerSPI
null
if this property is inherited.isGoogleAnalyticsEnabledLocal
in interface IServiceInstanceManagerSPI
serviceInstanceConfig
- the service instance the information will be read from.null
if this property is inherited.PortalException
public boolean isGoogleAnalyticsEnabled(ServiceInstanceConfig serviceInstanceConfig) throws PortalException
IServiceInstanceManagerSPI
isGoogleAnalyticsEnabled
in interface IServiceInstanceManagerSPI
serviceInstanceConfig
- the service instance the information will be read from.PortalException
public void setGoogleAnalyticsEnable(Boolean enabled, ServiceInstanceConfig serviceInstanceConfig) throws PortalException
IServiceInstanceManagerSPI
setGoogleAnalyticsEnable
in interface IServiceInstanceManagerSPI
enabled
- the value or null
to indicate the value should be inherited.serviceInstanceConfig
- the service instance the information will be set to.PortalException
public Boolean isGoogleAnalyticsEnabledLocal(String propertyBagId) throws PortalException
null
if this property is inherited.propertyBagId
- the identifier of the property bag the information will be read from.null
if this property is inherited.PortalException
public boolean isGoogleAnalyticsEnabled(String propertyBagId) throws PortalException
propertyBagId
- the identifier of the property bag the information will be read from.PortalException
public void setGoogleAnalyticsEnable(Boolean enabled, String propertyBagId) throws PortalException
enabled
- the value or null
to indicate the value should be inherited.propertyBagId
- the identifier of the property bag the information will be set to.PortalException
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.