Interface IServiceInstanceManager

    • Method Detail

      • add

        java.lang.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
      • getIdsByChannelTree

        java.util.Collection<java.lang.String> getIdsByChannelTree​(SessionConfig sessionConfig,
                                                                   java.lang.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

        java.util.Collection<java.lang.String> getIdsByChannelTreeAndAreaTags​(SessionConfig sessionConfig,
                                                                              java.lang.String rootChannelId,
                                                                              java.util.Collection<java.lang.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 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.
        Returns:
        collection with identifiers of service instances found.
        Throws:
        PortalException
      • setCustomProperty

        void setCustomProperty​(SessionConfig sessionConfig,
                               java.lang.String serviceInstanceId,
                               java.lang.String name,
                               java.lang.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

        java.lang.String getCustomProperty​(SessionConfig sessionConfig,
                                           java.lang.String serviceInstanceId,
                                           java.lang.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
      • getServiceInstanceByDependency

        ServiceInstanceConfig getServiceInstanceByDependency​(SessionConfig sessionConfig,
                                                             java.lang.String serviceInstanceId,
                                                             java.lang.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 information
        serviceInstanceId - 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

        java.util.Collection<ServiceInstanceConfig> getServiceInstancesByDependency​(SessionConfig sessionConfig,
                                                                                    java.lang.String serviceInstanceId,
                                                                                    java.lang.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 information
        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 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,
                                   java.lang.String serviceInstanceId,
                                   java.io.OutputStream outputStream,
                                   ITransaction transaction)
                            throws PortalException
        Serializes the dependencies of a service instance
        Parameters:
        sessionConfig -
        serviceInstanceId -
        outputStream -
        transaction -
        Throws:
        PortalException
      • getDependencyIdsByServiceInstanceId

        java.util.Collection<java.lang.String> getDependencyIdsByServiceInstanceId​(SessionConfig sessionConfig,
                                                                                   java.lang.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

        java.util.Collection<ServiceInstanceConfig> getDependentServiceInstances​(SessionConfig sessionConfig,
                                                                                 java.lang.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

        java.lang.String deserializeDependency​(SessionConfig sessionConfig,
                                               DeserializationConfig deserializationConfig,
                                               org.w3c.dom.Node serviceInstanceDependencyNode,
                                               ITransaction transaction)
                                        throws PortalException
        Deserializes the given dependency
        Parameters:
        sessionConfig -
        deserializationConfig -
        serviceInstanceDependencyNode -
        transaction -
        Returns:
        Throws:
        PortalException
      • getCustomProperties

        java.util.Map<java.lang.String,​java.lang.String> getCustomProperties​(SessionConfig sessionConfig,
                                                                                   java.lang.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,
                                       java.lang.String serviceInstanceId,
                                       java.io.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,
                                         org.w3c.dom.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
      • setCustomProperties

        void setCustomProperties​(SessionConfig sessionConfig,
                                 java.lang.String serviceInstanceId,
                                 java.util.Map<java.lang.String,​java.lang.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