Interface ProjectStorage
public interface ProjectStorage
FIRSTspirit
Project management.- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefault packages that can be added whilecreatinga new project. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateProject(@NotNull Project project) Activates a deactivated project.checkProject(@NotNull Project project) Checks if a project needs to be migrated to current server version.@NotNull ProjectcreateProject(@NotNull String name, @Nullable String description) Create a new Project.@NotNull ProjectcreateProject(@NotNull String name, @Nullable String description, @NotNull Set<ProjectStorage.DefaultPackage> packages) Create a new Project with optional default packages.voiddeactivateProject(@NotNull Project project) Deactivates a project.voiddeleteExportFile(@NotNull ExportFile exportFile) Delete export file on server.@NotNull InputStreamdownloadExportFile(@NotNull ExportFile exportFile) Download an export file.getFontUsages(String name) Returns a list ofprojectsusing the font specified by the given name.getInstalledExportFiles(long projectId) Get filename list of installed exports and backups.intReturns maximum number of allowed projects (possible license restriction).@Nullable ProjectgetProject(long id) Returns the project by id, regardless whether it's active or not.@Nullable ProjectgetProject(String name) Returns the project by name, regardless whether it's active or not.@Nullable ProjectInfogetProjectInfo(@NotNull ExportFile exportFile) Parse info out of ExportFile contents@NotNull Project[]Returns all (active and inactive) projects.@NotNull Project[]getProjects(boolean active) Returns either all active or inactive projects.@NotNull List<Properties> getUnmappedLayers(long projectId, @NotNull String snapshotFileName, @NotNull List<ExportFile> backups) Get unmapped layer information for installing backup files.@NotNull List<ExportFile> List incremental, differential and snapshot backup files.@NotNull List<ExportFile> List all export files on server.voidrebuildReferences(@NotNull Project project) Deprecated.voidrebuildSearchIndex(@NotNull Project project) Since FirstSpirit v5 this starts the project schedule entry with the name "Rebuild search index".voidrebuildSearchIndex(@NotNull IDProvider element) Refreshes the search index for the givenelement.voidResets the cache of the project listvoidremoveProject(@NotNull Project project) Removes a project from server.voidremoveProject(@NotNull Project project, boolean cleanDB) Removes a project from server and deletes the connected database too if cleanDB is set to truestartDifferentialBackup(@NotNull BackupParameters backupParameters) Start differential project repository backup export.startExport(@NotNull ExportParameters exportParameters) Start project export.startImport(@NotNull ImportParameters importParameters) Start project import.startIncrementalBackup(@NotNull BackupParameters backupParameters) Start incremental project repository backup export.startPartialInstall(long projectId, @Nullable Map<String, String> layerMappings, @NotNull List<ExportFile> backups) Install incremental or differential backup file into a existing project.startProjectRevert(long projectId, @NotNull String snapshotFileName) Revert a project to a state after a snapshot has been installed.startSnapshotExport(@NotNull BackupParameters backupParameters) Start project snapshot export.voidupdateVersionInfo(@NotNull Project project) Updates the project information to match the current server version.uploadExportFile(String fileName, @NotNull InputStream fileData) Upload single export file or last part of files to server.voiduploadExportFilePart(String name, @NotNull InputStream fileData) Upload a part of a splitted export file.
-
Method Details
-
createProject
@NotNull @NotNull Project createProject(@NotNull @NotNull String name, @Nullable @Nullable String description) Create a new Project.- Parameters:
name- the name of the projectdescription- the unique description of the project- Returns:
- the newly created project
- Throws:
SecurityException- if the user isn't theserver admin- Since:
- 4.0
-
createProject
@NotNull @NotNull Project createProject(@NotNull @NotNull String name, @Nullable @Nullable String description, @NotNull @NotNull Set<ProjectStorage.DefaultPackage> packages) Create a new Project with optional default packages.- Parameters:
name- the name of the projectdescription- the unique description of the project, may benullpackages- thepackagesto install after the project has been created. May be empty but notnull.- Returns:
- the newly created project
- Throws:
SecurityException- if the user isn't theserver admin- Since:
- 5.2.260601
-
getProject
Returns the project by name, regardless whether it's active or not.- Parameters:
name- project name.- Returns:
- project or
nullif it doesn't exist. - Since:
- 4.0
-
getProject
Returns the project by id, regardless whether it's active or not.- Parameters:
id- project id.- Returns:
- project or
nullif it doesn't exist. - Since:
- 4.0
-
getProjects
Returns all (active and inactive) projects.- Returns:
- active and inactive projects
- Since:
- 4.0
-
getProjects
Returns either all active or inactive projects.- Parameters:
active-truefor active,falsefor inactive projects.- Returns:
- either active or inactive projects.
- Since:
- 4.0
-
removeProject
Removes a project from server.- Parameters:
project- the project to remove- Throws:
SecurityException- if the user isn't theserver admin- Since:
- 4.0
-
removeProject
Removes a project from server and deletes the connected database too if cleanDB is set to true- Parameters:
project- the project to removecleanDB- also clean the database and delete all connected tables- Throws:
SecurityException- if the user isn't theserver admin- Since:
- 5.2.210903
-
getMaxProjects
int getMaxProjects()Returns maximum number of allowed projects (possible license restriction).- Returns:
- maximum number of allowed projects.
- Since:
- 4.0
-
checkProject
Checks if a project needs to be migrated to current server version.- Since:
- 4.0
-
activateProject
Activates a deactivated project.- Parameters:
project- to activate.- Throws:
AccessRuntimeException- if the project couldn't be activated, e.g. in case of missing project directorySecurityException- if the user isn't theserver admin- Since:
- 4.0
-
deactivateProject
Deactivates a project. Project needs to belocked. CallingLockable.save()isn't necessary.- Parameters:
project- to deactivate.- Throws:
SecurityException- if the user isn't theserver admin- Since:
- 4.0
-
updateVersionInfo
Updates the project information to match the current server version.- Parameters:
project- the project to update.- Since:
- 4.0
-
rebuildReferences
Deprecated.since 5.2.301, useProjectReferencesAgent.rebuildReferences().Starts reference rebuilding for the givenprojectwith it'slatest revision.- Parameters:
project- which references should be rebuilded.- Since:
- 4.0
-
rebuildSearchIndex
Since FirstSpirit v5 this starts the project schedule entry with the name "Rebuild search index".- Since:
- 4.0
-
rebuildSearchIndex
Refreshes the search index for the givenelement. Supports all FirstSpirit element types, particularlyMediaandDatasetobjects.- Since:
- 5.0.313
-
refreshProjects
void refreshProjects()Resets the cache of the project list- Since:
- 4.0
- See Also:
-
uploadExportFilePart
Upload a part of a splitted export file. If the file exists, data is appended. UsedeleteExportFile(ExportFile)to delete export files on server.- Throws:
IOException- Since:
- 4.0
-
uploadExportFile
ExportFile uploadExportFile(String fileName, @NotNull @NotNull InputStream fileData) throws IOException Upload single export file or last part of files to server. If the file exists, data is appended. UsedeleteExportFile(ExportFile)to delete export files on server.- Parameters:
fileName- the file name of the uploaded file (e.g. export.tar.gz)- Throws:
IOException- Since:
- 4.0
-
listExportFiles
List all export files on server.- Throws:
IOException- Since:
- 4.0
-
deleteExportFile
Delete export file on server.- Throws:
FileNotFoundException- Since:
- 4.0
-
getProjectInfo
@Nullable @Nullable ProjectInfo getProjectInfo(@NotNull @NotNull ExportFile exportFile) throws IOException Parse info out of ExportFile contents- Parameters:
exportFile-- Throws:
IOException- Since:
- 4.0
-
startImport
ServerActionHandle<ImportProgress,Boolean> startImport(@NotNull @NotNull ImportParameters importParameters) throws IOException Start project import.- Parameters:
importParameters- The import parameters- Returns:
- importId handle
- Throws:
SecurityException- if the user isn't theserver adminIOException- Since:
- 4.0
-
downloadExportFile
@NotNull @NotNull InputStream downloadExportFile(@NotNull @NotNull ExportFile exportFile) throws IOException Download an export file.- Throws:
IOException- Since:
- 4.0
-
startExport
ServerActionHandle<ExportProgress,Boolean> startExport(@NotNull @NotNull ExportParameters exportParameters) throws IOException Start project export.- Parameters:
exportParameters- The export parameters- Returns:
- exportId handle
- Throws:
SecurityException- if the user isn't aproject adminof the projectIOException- Since:
- 4.0
-
getFontUsages
Returns a list ofprojectsusing the font specified by the given name.- Since:
- 4.2.34
- See Also:
-
startSnapshotExport
ServerActionHandle<ExportProgress,Boolean> startSnapshotExport(@NotNull @NotNull BackupParameters backupParameters) Start project snapshot export.- Returns:
- exportId handle
- Throws:
SecurityException- if the user isn't aproject adminof the project- Since:
- 4.1.25
-
listBackupFiles
List incremental, differential and snapshot backup files.- Throws:
IOException- Since:
- 4.1.16
-
startIncrementalBackup
ServerActionHandle<ExportProgress,Boolean> startIncrementalBackup(@NotNull @NotNull BackupParameters backupParameters) throws IllegalStateException Start incremental project repository backup export. All changed data since last snapshot export or incremental backup will be exported. If no snapshot export or incremental backup exists in this project, a IllegalStateException will be thrown.- Throws:
IllegalStateException- Thrown if no snapshot or incremental backup tag was found in this project.SecurityException- if the user isn't aproject adminof the project- Since:
- 4.1.25
-
startDifferentialBackup
ServerActionHandle<ExportProgress,Boolean> startDifferentialBackup(@NotNull @NotNull BackupParameters backupParameters) throws IllegalStateException Start differential project repository backup export. All changed data since last snapshot export will be exported. If no snapshot export exists in this project, a IllegalStateException will be thrown.- Throws:
IllegalStateException- Thrown if no snapshot tag was found in this project.SecurityException- if the user isn't aproject adminof the project- Since:
- 4.1.25
-
startPartialInstall
ServerActionHandle<ImportProgress,Boolean> startPartialInstall(long projectId, @Nullable @Nullable Map<String, String> layerMappings, @NotNull @NotNull List<ExportFile> backups) throws IOExceptionInstall incremental or differential backup file into a existing project.- Parameters:
backups- The backup files to install- Throws:
IOException- Since:
- 4.1.20
-
startProjectRevert
ServerActionHandle<ImportProgress,Boolean> startProjectRevert(long projectId, @NotNull @NotNull String snapshotFileName) throws IOException Revert a project to a state after a snapshot has been installed. Project will be deactivated during revert process. All newer files will be deleted, no backup is made!- Parameters:
snapshotFileName- The snapshot file name to revert the project to- Throws:
SecurityException- if the user isn't aproject adminof the projectIOException- Since:
- 4.2.3
-
getUnmappedLayers
@NotNull @NotNull List<Properties> getUnmappedLayers(long projectId, @NotNull @NotNull String snapshotFileName, @NotNull @NotNull List<ExportFile> backups) throws IOException Get unmapped layer information for installing backup files.- Parameters:
projectId- The project idsnapshotFileName- The snapshot the backups are based onbackups- The backup files to install- Throws:
IOException- Since:
- 4.2.450
-
getInstalledExportFiles
Get filename list of installed exports and backups.- Parameters:
projectId- The project id- Throws:
IOException- Since:
- 4.2.5
-
ProjectReferencesAgent.rebuildReferences().