com.ibm.commerce.context.content.resources

Interface ResourceManager

    • Method Detail

      • getMetaData

        ManagedResourceMetaData getMetaData()
        This method returns the metadata of the resource manager.
        Returns:
        The managed resource metadata.
      • setMetaData

        void setMetaData(ManagedResourceMetaData managedResourceMetaData)
        This method sets the metadata of the resource manager.
        Parameters:
        managedResourceMetaData - The managed resource metadata.
      • getResourceContainer

        ResourceContainer getResourceContainer()
        This method returns the resource container owning the resource manager.
        Returns:
        The resource container.
      • setResourceContainer

        void setResourceContainer(ResourceContainer resourceContainer)
        This method sets the resource container owning the resource manager.
        Parameters:
        resourceContainer - The resource container.
      • createManagedResource

        java.lang.Object createManagedResource(ActivityToken activityToken,
                                               java.lang.Object creationData)
                                        throws ResourceException
        This method creates a new instance of the resource. It uses the context information from the activity token to ensure the resource is created based on the current context values.
        Parameters:
        activityToken - The current activity.
        creationData - The data needed to create the object.
        Returns:
        The newly created resource.
        Throws:
        ResourceException - This is thrown when a problem occurs creating the resource.
      • updateManagedResource

        void updateManagedResource(ActivityToken activityToken,
                                   java.lang.Object resource)
                            throws ResourceException
        This method updates the current instance of the resource with the new current changes. These updates can be sensitive to the context information associated with the current activity.
        Parameters:
        activityToken - The current activity.
        resource - The resource to update.
        Throws:
        ResourceException - This is thrown when a problem occurs updating the resource.
      • deleteManagedResource

        void deleteManagedResource(ActivityToken activityToken,
                                   java.lang.Object resource)
                            throws ResourceException
        This method deletes the current instance of the resource with the new current changes. These updates can be sensitive to the context information associated with the current activity.
        Parameters:
        activityToken - The current activity.
        resource - The resource to delete.
        Throws:
        ResourceException - This is thrown when a problem occurs deleting the resource.
      • lockManagedResource

        void lockManagedResource(ActivityToken activityToken,
                                 ManagedResourceKey managedResourceKey)
                          throws ResourceException
        This method locks the specified business object based on the current activity information.
        Parameters:
        activityToken - The current activity.
        managedResourceKey - The business object to lock.
        Throws:
        ResourceException - This is thrown if the resource is already locked by another activity then the exception will be thrown.
      • unlockManagedResource

        void unlockManagedResource(ActivityToken activityToken,
                                   ManagedResourceKey managedResourceKey)
                            throws ResourceException
        This method unlocks the business object.
        Parameters:
        activityToken - The current activity
        managedResourceKey - The business object.
        Throws:
        ResourceException - This is thrown if the resource is already locked by another activity then the exception will be thrown.
      • relockManagedResource

        void relockManagedResource(ActivityToken activityToken,
                                   ManagedResourceKey managedResourceKey)
                            throws ResourceException
        This method updates the lock information for the specified business object.
        Parameters:
        activityToken - The current activity.
        managedResourceKey - The business object.
        Throws:
        ResourceException - This is thrown if the resource is already locked by another activity then the exception will be thrown.
      • isLocked

        boolean isLocked(ActivityToken activityToken,
                         ManagedResourceKey managedResourceKey)
                  throws ResourceException
        This method returns whether the specified business object is locked and cannot be modified by the current activity.
        Parameters:
        activityToken - The current activity.
        managedResourceKey - The business object.
        Returns:
        Whether the business object is locked.
        Throws:
        ResourceException - This is thrown if a problem occurs when determining if the managed resource is locked.
      • getLockData

        LockData getLockData(ManagedResourceKey managedResourceKey)
                      throws ResourceException
        This method returns the lock information for the specified business object. If the business object is not locked, then null will be returned.
        Parameters:
        managedResourceKey - The business object.
        Returns:
        The lock data for the business object.
        Throws:
        ResourceException - This is thrown if a problem occurs when retrieving the lock data.
      • isLocked

        boolean[] isLocked(ActivityToken activityToken,
                           ManagedResourceKey[] managedResourceKey)
                    throws ResourceException
        This method returns whether the specified business objects are locked and cannot be modified by the current activity.
        Parameters:
        activityToken - The current activity.
        managedResourceKey - The business objects to check.
        Returns:
        An array returning whether the corresponding business object index is locked or not.
        Throws:
        ResourceException - This is thrown if a problem occurs when determining if the managed resources are locked.
      • getLockData

        LockData[] getLockData(ManagedResourceKey[] managedResourceKey)
                        throws ResourceException
        This method returns the lock information for the specified business objects. If the business objects are not locked, then null will be returned.
        Parameters:
        managedResourceKey - The business objects.
        Returns:
        An array returning whether the corresponding business object locks information.
        Throws:
        ResourceException - This is thrown if a problem occurs when retrieving the lock data.
      • getManagedResourceKey

        ManagedResourceKey getManagedResourceKey(java.util.Map record)
                                          throws java.lang.Exception
        This method returns the managed resource key.
        Parameters:
        record - A map that represents the managed resource.
        Returns:
        Returns a managed resource key
        Throws:
        java.lang.Exception - This is thrown if a problem occurs when obtaining the managed resource key for the record.
      • getManagedResourceKey

        ManagedResourceKey getManagedResourceKey(java.lang.Object resource)
                                          throws java.lang.Exception
        This method returns the managed resource key.
        Parameters:
        resource - The resource to return the managed resource key of.
        Returns:
        Returns a managed resource key
        Throws:
        java.lang.Exception - This is thrown if a problem occurs when obtaining the managed resource key for the record.
      • commit

        void commit(ContentData contentData)
             throws ResourceException
        This method commits the changes in the workspace to the base edition.
        Parameters:
        contentData - The content data to commit.
        Throws:
        ResourceException - A problem performing the commit operation. Mostly this occurs when the commit causes data integrity problems.
      • rollback

        void rollback(ContentData contentData)
               throws ResourceException
        This method rolls back the workspace by undoing all changes.
        Parameters:
        contentData - The content data to commit.
        Throws:
        ResourceException - This is thrown if a problem occurs when performing the rollback.
      • synchronize

        void synchronize(ContentData contentData)
                  throws ResourceException
        This method synchronizes the specified workspace. The workspace may either need to be synchronized based on some changes caused by the base or by some operation performed workspace. This will be called when it is known that changes have been made which may have caused the workspace to be out of synchronization.
        Parameters:
        contentData - The content data to synchronize. This data will not include task and task group because the entire workspace needs to be synchronized.
        Throws:
        ResourceException - This is thrown if a problem occurs when performing the commit operation. Mostly this occurs when the commit causes data integrity problems.
      • postPublish

        java.lang.String postPublish(ContentData contentData)
                              throws ResourceException
        This method processes a post-publish event.
        Parameters:
        contentData - The content data.
        Returns:
        post-publish data to be propagated to production server.
        Throws:
        ResourceException - This is thrown if a problem occurs in the post-publish event processing.
      • getManagedResourceData

        java.util.List<LockData> getManagedResourceData(java.lang.String taskGroupId,
                                                        char filter)
                                                 throws ResourceException
        This method returns the list of all locks for objects of this resource manager associated to the provided workspace task group id.
        Parameters:
        taskGroupId - the task group identifier to retrieve the list of locks for.
        filter - the filter on data to retrieve.
        Returns:
        The list of lock data records for the business object.
        Throws:
        ResourceException - This is thrown if a problem occurs when retrieving the lock data.
      • getManagedResourceDataCount

        int getManagedResourceDataCount(java.lang.String taskGroupId)
                                 throws ResourceException
        This method returns the number of locked objects within the workspace.
        Parameters:
        taskGroupId - the task group identifier
        Returns:
        The count of locked objects for the business object in the task group.
        Throws:
        ResourceException - This is thrown if a problem occurs when retrieving the lock data.