Class Archive

java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.impex.Archive
All Implemented Interfaces:
Serializable

public class Archive extends com.logicaldoc.core.PersistentObject implements Serializable
This class represents archives.
Each archive contains one or more archived documents.
Mode:
  1. MODE_IMPORT: the archive for documents import
  2. MODE_EXPORT: the archive for documents export
Status:
  1. For Import Archive:
    1. READY_TO_IMPORT: the initial status, the archive is ready to be imported
    2. CLOSED: the import task is started, so the archive is read-only
    3. FINALIZED: the archive import task is completed
  2. For Export Archive:
    1. OPENED: the default status
    2. CLOSED: when the archive is ready to be build
    3. FINALIZED: the archive is completed
    4. READYTOSIGN: the 'store' archive is ready to be marked temporally
Type:
  1. TYPE_DEFAULT: the default status. It will be not signed temporally.
Since:
4.5
Author:
Matteo Caruso - LogicalDOC
See Also:
  • Field Details

    • STATUS_OPENED

      public static final int STATUS_OPENED
      Status of the export archive when it is open and you can put more files in it
      See Also:
    • STATUS_CLOSED

      public static final int STATUS_CLOSED
      Status of the export archive when it is closed and you cannot put more files in it
      See Also:
    • STATUS_FINALIZED

      public static final int STATUS_FINALIZED
      Status of the export archive has been completely built
      See Also:
    • STATUS_READYTOSIGN

      public static final int STATUS_READYTOSIGN
      Status of the export archive is ready to be signed
      See Also:
    • STATUS_READY_TO_IMPORT

      public static final int STATUS_READY_TO_IMPORT
      Status of the export archive when it is ready to be imported
      See Also:
    • STATUS_ERROR

      public static final int STATUS_ERROR
      The archive is set to error status if have occurred errors in the import/export operations.
      See Also:
    • TYPE_DEFAULT

      public static final int TYPE_DEFAULT
      The archive's default type
      See Also:
    • MODE_IMPORT

      public static final int MODE_IMPORT
      Mode to mark the archive as import
      See Also:
    • MODE_EXPORT

      public static final int MODE_EXPORT
      Mode to mark the archive as export
      See Also:
    • CUSTOMID_NOT_IMPORT

      public static final int CUSTOMID_NOT_IMPORT
      On existing CustomID skip
      See Also:
    • CUSTOMID_IMPORT_AND_NEW_RELEASE

      public static final int CUSTOMID_IMPORT_AND_NEW_RELEASE
      On existing CustomID import as new major version
      See Also:
    • CUSTOMID_IMPORT_AND_NEW_SUBVERSION

      public static final int CUSTOMID_IMPORT_AND_NEW_SUBVERSION
      On existing CustomID import as new minor version
      See Also:
    • CUSTOMID_IMPORT_AND_NEW_DOCUMENT

      public static final int CUSTOMID_IMPORT_AND_NEW_DOCUMENT
      On existing CustomID import as new document
      See Also:
  • Constructor Details

    • Archive

      public Archive()
  • Method Details

    • getName

      public String getName()
      The archive name. Also alternative identifier
      Returns:
      the name of the archive
    • setName

      public void setName(String name)
    • getDescription

      public String getDescription()
      The archive description
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
    • getStatus

      public int getStatus()
      The archive status
      Returns:
      the status
      See Also:
    • setStatus

      public void setStatus(int status)
    • getEntryIds

      public List<Long> getEntryIds()
    • getEntry

      public com.logicaldoc.core.document.Version getEntry(long versionId)
    • getEntries

      public Set<com.logicaldoc.core.document.Version> getEntries()
    • setEntries

      public void setEntries(Set<com.logicaldoc.core.document.Version> entries)
    • getSize

      public long getSize()
      Archive dimension in bytes, that is the sum of sizes of all document plus the size of all metadata files
      Returns:
      the total size of the archive expressed in bytes
    • setSize

      public void setSize(long size)
    • addEntry

      public boolean addEntry(com.logicaldoc.core.document.Version newVersion)
      Adds a new entry
      Parameters:
      newVersion - The version to be added
      Returns:
      true if the version was truly added
    • getType

      public int getType()
      The archive type
      Returns:
      the type
      See Also:
    • setType

      public void setType(int type)
    • getCreatorId

      public long getCreatorId()
      The archive creator id
      Returns:
      identifier of the creator user
    • setCreatorId

      public void setCreatorId(long creatorId)
    • getCreatorName

      public String getCreatorName()
      The archive creator name
      Returns:
      name of the creator user
    • setCreatorName

      public void setCreatorName(String creatorName)
    • getCloserId

      public Long getCloserId()
      The archive closer id
      Returns:
      identifier of the user that closed the archive
    • setCloserId

      public void setCloserId(Long closerId)
    • getCloserName

      public String getCloserName()
      The archive closer name
      Returns:
      name of the user that closed the archive
    • setCloserName

      public void setCloserName(String closerName)
    • getClosure

      public Date getClosure()
      The archive's closure date
      Returns:
      the closure date
    • setClosure

      public void setClosure(Date closure)
    • getMode

      public int getMode()
    • setMode

      public void setMode(int mode)
    • getImportTemplate

      public int getImportTemplate()
    • setImportTemplate

      public void setImportTemplate(int importTemplate)
    • getImportCustomId

      public int getImportCustomId()
    • setImportCustomId

      public void setImportCustomId(int importCustomId)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.logicaldoc.core.PersistentObject
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class com.logicaldoc.core.PersistentObject