public class PackagePersistence extends Object
nxserver/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")
Modifier and Type | Field and Description |
---|---|
protected Random |
random |
protected File |
root |
protected Map<String,org.nuxeo.connect.update.PackageState> |
states |
protected File |
store |
protected File |
temp |
Constructor and Description |
---|
PackagePersistence(org.nuxeo.connect.update.PackageUpdateService pus) |
Modifier and Type | Method and 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. Use
updateState(String, PackageState) instead. |
void |
updateState(String id,
org.nuxeo.connect.update.PackageState state) |
protected void |
writeStates() |
public PackagePersistence(org.nuxeo.connect.update.PackageUpdateService pus) throws IOException
IOException
protected Map<String,org.nuxeo.connect.update.PackageState> loadStates() throws IOException
IOException
protected void writeStates() throws IOException
IOException
public org.nuxeo.connect.update.LocalPackage getPackage(String id) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public org.nuxeo.connect.update.LocalPackage addPackage(File file) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected org.nuxeo.connect.update.LocalPackage addPackageFromDir(File file) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.AlreadyExistsPackageException
- If not replacing a SNAPSHOT or if the existing package is installedpublic org.nuxeo.connect.update.LocalPackage getActivePackage(String name) throws org.nuxeo.connect.update.PackageException
PackageState.INSTALLING
PackageState.INSTALLED
PackageState.STARTED
name
- org.nuxeo.connect.update.PackageException
public String getActivePackageId(String name) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public List<org.nuxeo.connect.update.LocalPackage> getPackages() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void removePackage(String id) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
@Deprecated public void updateState(String id, int state) throws org.nuxeo.connect.update.PackageException
updateState(String, PackageState)
instead.org.nuxeo.connect.update.PackageException
public void updateState(String id, org.nuxeo.connect.update.PackageState state) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void reset() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected File newTempDir(String id)
public FileTime getInstallDate(String id)
Copyright © 2016 Nuxeo SA. All rights reserved.