Interface Subscription
@NonExtendable
public interface Subscription
This interface provides methods to handle the subscription to a corporate-content
package.- Since:
- 3.1.158
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteDefines the mode automatic.static final byteDefines the mode manual.static final byteDefines the release mode automatic.static final byteDefines the release mode workflow.static final byteStrategy for update conflicts (the local copy and the original have been modified): .static final byteStrategy for update conflicts (the local copy and the original have been modified): An error is reported and the update / import process is cancelled.static final byteStrategy for update conflicts (the local copy and the original have been modified): Override local changes. -
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()Deletes this subscription.voidexcludeNode(IDProvider storeElement) Excludes the given storeelement from the list of nodes which will be imported from the package.byteThe conflict mode defines a strategy to handle conflicts which occurs during the import of this subscription.
A conflict occurs, when the local copy and the source of a subscribed element both have been changed since the last update of the subscription.@NotNull IdTranslatorProvides a translator between element IDs from the publisher project to thesubscriber project.Returns a read-only list ofStoreElement's which are excluded from the list of startnodes in the belongingPackageof this subscription.@Nullable CalendarReturns the date of the last import.@Nullable PackageImportLogfileReturns the import log file of the last import of this subscription ornullif no import log file exists.Returns the package this subscription is belonging tointGets the version number of the last imported package version or-1if nothing has been imported yetGets the publish group of this subscription.byteGets the release mode of this subscription.
RELEASE_MODE_AUTO(default) : all nodes which were updated or created during the import of this subscription will be released automatically.
RELEASE_MODE_WORKFLOW: after the import of this subscription the defined release workflow (setWorkflow(byte, Workflow)) will be started.@Nullable ProjectReturns the subscriberProjectof this subscription.
The update of this subscription will be imported into the subscriber project.@NotNull IdTranslatorProvides a translator between template IDs from the publisher project to thesubscriber project.byteGets the update mode of this subscription.
If the update mode isMODE_AUTOMATIC(default) the import of this subscription will start automatically as soon as a new version of the belongingPackageis available.
InMODE_MANUALmode the import has to be started manually.getWorkflow(byte type) Gets the workflow defined for the given event type.getWorkflowName(byte type) Gets the name of the workflow which is mapped to the given event type.booleanReturnstrueif an error occurred during the import of the lastPackageVersionvoidincludeNode(IDProvider storeElement) Includes the given storeelement to the list of nodes which will be imported from the package.booleanisActive()Returnstrueif this subscription is active,falseotherwise
If the subscription is inactive the update will not be processed.booleanbooleanReturnstrueif thePackagesubscribed by thisSubscriptionhas 'no' newerPackageVersionas the last importedPackageVersionin the subscriber-project of thisSubscriptionvoidExecutes the import of this subscription.
The lastPackageVersionexisting in the underlyingPackagewill be imported.voidrefresh()Refreshes this subscription with the subcription object from the server.
Call to rollback changesvoidsave()Call to this method makes all changes to this subscription persistent on the server.voidsetActive(boolean activate) Activates / Deactivates this subscription.voidsetChangeable(boolean changeable) Sets the changeable flag for this subscription.voidsetConflictMode(byte conflictMode) Sets the conflict mode for this subscription.voidsetPublishGroup(PublishGroup value) Sets the given publish group for this subscriptionvoidsetReleaseMode(byte releaseMode) Sets the release mode for this subscription.voidsetUpdateMode(byte updateMode) Sets the update mode for this subscription.voidsetWorkflow(byte type, Workflow workflow) Sets the given workflow for the given event type.
-
Field Details
-
MODE_AUTOMATIC
static final byte MODE_AUTOMATICDefines the mode automatic.- Since:
- 3.1.158
- See Also:
-
MODE_MANUAL
static final byte MODE_MANUALDefines the mode manual.- Since:
- 3.1.158
- See Also:
-
RELEASE_MODE_AUTO
static final byte RELEASE_MODE_AUTODefines the release mode automatic.- Since:
- 3.1.158
- See Also:
-
RELEASE_MODE_WORKFLOW
static final byte RELEASE_MODE_WORKFLOWDefines the release mode workflow.- Since:
- 3.1.158
- See Also:
-
STRATEGY_OVERRIDE
static final byte STRATEGY_OVERRIDEStrategy for update conflicts (the local copy and the original have been modified): Override local changes.- Since:
- 3.1.158
- See Also:
-
STRATEGY_ERROR
static final byte STRATEGY_ERRORStrategy for update conflicts (the local copy and the original have been modified): An error is reported and the update / import process is cancelled.- Since:
- 3.1.158
- See Also:
-
STRATEGY_COPY
static final byte STRATEGY_COPYStrategy for update conflicts (the local copy and the original have been modified): .- Since:
- 3.1.158
- See Also:
-
-
Method Details
-
getPublishGroup
PublishGroup getPublishGroup()Gets the publish group of this subscription.During the update the latest
PackageVersionexisting in the subscribedPackage, which is published for the returned publish group, is imported.- Returns:
- PublishGroup the publish group of this subscription
- Since:
- 3.1.158
-
setPublishGroup
Sets the given publish group for this subscription- Parameters:
value-- Since:
- 3.1.158
-
getPackage
Package getPackage()Returns the package this subscription is belonging to- Returns:
- Package the package of this subscription
- Since:
- 3.1.158
-
getSubscriber
Returns the subscriberProjectof this subscription.
The update of this subscription will be imported into the subscriber project.- Returns:
- Project the subscriber project of this subscription
- Since:
- 3.1.158
-
getLastImport
Returns the date of the last import.- Returns:
- the date of the last import or
nullif nothing has been imported yet - Since:
- 3.1.158
-
getLastImportLogfile
Returns the import log file of the last import of this subscription ornullif no import log file exists.- Since:
- 4.2.34
-
getPackageVersion
int getPackageVersion()Gets the version number of the last imported package version or-1if nothing has been imported yet- Returns:
- the version of the last imported package version
- Since:
- 3.1.158
- See Also:
-
isUptoDate
boolean isUptoDate()Returnstrueif thePackagesubscribed by thisSubscriptionhas 'no' newerPackageVersionas the last importedPackageVersionin the subscriber-project of thisSubscription- Returns:
- boolean
trueif uptoDate,falseotherwise - Since:
- 3.1.158
-
hasImportErrors
boolean hasImportErrors()Returnstrueif an error occurred during the import of the lastPackageVersion- Returns:
- boolean
trueif an error occurred,falseotherwise - Since:
- 3.1.158
-
isActive
boolean isActive()Returnstrueif this subscription is active,falseotherwise
If the subscription is inactive the update will not be processed.- Returns:
trueif this subscription is activefalseotherwise- Since:
- 3.1.158
-
setActive
void setActive(boolean activate) Activates / Deactivates this subscription.- Parameters:
activate-trueto activate,falseto deactivate the subscription- Since:
- 3.1.158
-
isChangeable
boolean isChangeable()The changeable flag indicates if the nodes containing in thePackagewhich is subscribed by this subscription, are changeable (true) in the subscriberProjector not (false).- Returns:
trueimported nodes are changeable,false- read-only- Since:
- 3.1.158
-
setChangeable
void setChangeable(boolean changeable) Sets the changeable flag for this subscription.- Parameters:
changeable-- Since:
- 3.1.158
- See Also:
-
excludeNode
Excludes the given storeelement from the list of nodes which will be imported from the package. The given element must be from themaster projectand NOT from thesubscriber.- Parameters:
storeElement- the element from master project respectively the element from the package- Since:
- 3.1.158
-
includeNode
Includes the given storeelement to the list of nodes which will be imported from the package. The given element must be from themaster projectand NOT from thesubscriber.- Parameters:
storeElement- the element from master project respectively the element from the package- Since:
- 3.1.158
-
getExclusionNodeList
Collection<IDProvider> getExclusionNodeList()Returns a read-only list ofStoreElement's which are excluded from the list of startnodes in the belongingPackageof this subscription.- Returns:
- a read-only List of
StoreElement's - Since:
- 3.1.158
-
getUpdateMode
byte getUpdateMode()Gets the update mode of this subscription.
If the update mode isMODE_AUTOMATIC(default) the import of this subscription will start automatically as soon as a new version of the belongingPackageis available.
InMODE_MANUALmode the import has to be started manually.- Returns:
MODE_AUTOMATICorMODE_MANUAL- Since:
- 3.1.158
-
setUpdateMode
void setUpdateMode(byte updateMode) Sets the update mode for this subscription.- Parameters:
updateMode-MODE_AUTOMATICorMODE_MANUAL- Since:
- 3.1.158
- See Also:
-
getReleaseMode
byte getReleaseMode()Gets the release mode of this subscription.
RELEASE_MODE_AUTO(default) : all nodes which were updated or created during the import of this subscription will be released automatically.
RELEASE_MODE_WORKFLOW: after the import of this subscription the defined release workflow (setWorkflow(byte, Workflow)) will be started.- Returns:
RELEASE_MODE_AUTO(default) orRELEASE_MODE_WORKFLOW- Since:
- 3.1.158
-
setReleaseMode
void setReleaseMode(byte releaseMode) Sets the release mode for this subscription.- Parameters:
releaseMode-RELEASE_MODE_AUTO(default) orRELEASE_MODE_WORKFLOW- Since:
- 3.1.158
- See Also:
-
getConflictMode
byte getConflictMode()The conflict mode defines a strategy to handle conflicts which occurs during the import of this subscription.
A conflict occurs, when the local copy and the source of a subscribed element both have been changed since the last update of the subscription.- Returns:
STRATEGY_OVERRIDE(default),STRATEGY_ERROR, orSTRATEGY_COPY- Since:
- 3.1.158
-
setConflictMode
void setConflictMode(byte conflictMode) Sets the conflict mode for this subscription.- Parameters:
conflictMode-STRATEGY_OVERRIDE,STRATEGY_ERROR, orSTRATEGY_COPY- Since:
- 3.1.158
- See Also:
-
getWorkflow
Gets the workflow defined for the given event type. The mapping event -> workflow is by default inherited from the subsribedPackage. This mapping could be overridden by usingsetWorkflow(byte, Workflow)- Parameters:
type-Package.WF_OK,Package.WF_ERROR,Package.WF_CONFLICT,Package.WF_RELEASE,Package.WF_ACTUALIZE- Returns:
- workflow the workflow which is mapped to the given type
- Since:
- 3.1.158
-
getWorkflowName
Gets the name of the workflow which is mapped to the given event type.- Parameters:
type-Package.WF_OK,Package.WF_ERROR,Package.WF_CONFLICT,Package.WF_RELEASE,Package.WF_ACTUALIZE- Returns:
nullif no workflow is defined for this type, else the node id of the workflow node- Since:
- 3.1.158
-
setWorkflow
Sets the given workflow for the given event type.- Parameters:
type-Package.WF_OK,Package.WF_ERROR,Package.WF_CONFLICT,Package.WF_RELEASE,Package.WF_ACTUALIZEworkflow-- Since:
- 3.1.158
-
pullImport
void pullImport()Executes the import of this subscription.
The lastPackageVersionexisting in the underlyingPackagewill be imported.- Throws:
de.espirit.firstspirit.access.packagepool.NoPackageVersionExistingException- if noPackageVersionexisting in belonging thePackagewhich is released for the underlyingPublishGroup- Since:
- 3.1.158
- See Also:
-
save
void save()Call to this method makes all changes to this subscription persistent on the server.- Since:
- 3.1.158
-
delete
boolean delete()Deletes this subscription.- Returns:
trueif this subscription was successfully deleted,falseotherwise- Since:
- 3.1.158
-
refresh
void refresh()Refreshes this subscription with the subcription object from the server.
Call to rollback changes- Since:
- 3.1.158
-
getElementIdTranslator
Provides a translator between element IDs from the publisher project to thesubscriber project. Reuse the provided IdTranslator for multiple id translation calls.- Returns:
- The element ID translator.
- Since:
- 5.1.504, 5.2.103
-
getTemplateIdTranslator
Provides a translator between template IDs from the publisher project to thesubscriber project. Reuse the provided IdTranslator for multiple id translation calls.- Returns:
- The template ID translator.
- Since:
- 5.1.504, 5.2.103
-