Class PackagePersistence
- java.lang.Object
-
- org.nuxeo.connect.update.standalone.PackagePersistence
-
public class PackagePersistence extends Object
The filenxserver/data/packages/.packages
stores the state of all local features.Each local package have a corresponding directory in
nxserver/data/features/store
which is named:<package_uid>
("id-version")- Author:
- Bogdan Stefanescu
-
-
Constructor Summary
Constructors Constructor Description PackagePersistence(org.nuxeo.connect.update.PackageUpdateService pus)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.nuxeo.connect.update.LocalPackage
addPackage(File file)
protected org.nuxeo.connect.update.LocalPackage
addPackageFromDir(File file)
Add unzipped packaged to local cache.org.nuxeo.connect.update.LocalPackage
getActivePackage(String name)
Get the local package having the given name and which is in either one of the following states:PackageState.INSTALLING
PackageState.INSTALLED
PackageState.STARTED
String
getActivePackageId(String name)
FileTime
getInstallDate(String id)
org.nuxeo.connect.update.LocalPackage
getPackage(String id)
List<org.nuxeo.connect.update.LocalPackage>
getPackages()
File
getRoot()
org.nuxeo.connect.update.PackageState
getState(String packageId)
Map<String,org.nuxeo.connect.update.PackageState>
getStates()
File
getStore()
protected Map<String,org.nuxeo.connect.update.PackageState>
loadStates()
protected File
newTempDir(String id)
void
removePackage(String id)
void
reset()
void
updateState(String id, int state)
Deprecated.Since 5.7.void
updateState(String id, org.nuxeo.connect.update.PackageState state)
protected void
writeStates()
-
-
-
Constructor Detail
-
PackagePersistence
public PackagePersistence(org.nuxeo.connect.update.PackageUpdateService pus) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getRoot
public File getRoot()
-
getStore
public File getStore()
- Since:
- 7.1
-
loadStates
protected Map<String,org.nuxeo.connect.update.PackageState> loadStates() throws IOException
- Throws:
IOException
-
writeStates
protected void writeStates() throws IOException
- Throws:
IOException
-
getPackage
public org.nuxeo.connect.update.LocalPackage getPackage(String id) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
addPackage
public org.nuxeo.connect.update.LocalPackage addPackage(File file) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
addPackageFromDir
protected org.nuxeo.connect.update.LocalPackage addPackageFromDir(File file) throws org.nuxeo.connect.update.PackageException
Add unzipped packaged to local cache. It replaces SNAPSHOT packages if not installed- Throws:
org.nuxeo.connect.update.AlreadyExistsPackageException
- If not replacing a SNAPSHOT or if the existing package is installedorg.nuxeo.connect.update.PackageException
-
getState
public org.nuxeo.connect.update.PackageState getState(String packageId)
-
getActivePackage
public org.nuxeo.connect.update.LocalPackage getActivePackage(String name) throws org.nuxeo.connect.update.PackageException
Get the local package having the given name and which is in either one of the following states:PackageState.INSTALLING
PackageState.INSTALLED
PackageState.STARTED
- Throws:
org.nuxeo.connect.update.PackageException
-
getActivePackageId
public String getActivePackageId(String name) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
getPackages
public List<org.nuxeo.connect.update.LocalPackage> getPackages() throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
removePackage
public void removePackage(String id) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
updateState
@Deprecated public void updateState(String id, int state) throws org.nuxeo.connect.update.PackageException
Deprecated.Since 5.7. UseupdateState(String, PackageState)
instead.- Throws:
org.nuxeo.connect.update.PackageException
-
updateState
public void updateState(String id, org.nuxeo.connect.update.PackageState state) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
- Since:
- 5.7
-
reset
public void reset() throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
-