|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.upgrade.Upgrader
public class Upgrader
Field Summary | |
---|---|
static boolean |
debug
|
Constructor Summary | |
---|---|
Upgrader(java.lang.String server,
java.io.File config,
java.io.File props,
Serializer serializer)
Constructor |
Method Summary | |
---|---|
protected void |
backupStores(java.io.File storedir,
java.io.FilenameFilter filter)
backup the stores under the given store directory. |
protected void |
checkDir(java.io.File dir)
|
protected void |
cleanStores(java.io.File storedir,
java.io.FilenameFilter filter)
clean the stores under the given store directory. |
protected boolean |
createSubDirs(java.io.File storedir)
Create the subdirectories under /stores. |
protected java.io.File |
getNewStore(java.io.File storedir,
java.io.File oldstore)
Get the new store location. |
static Attribute |
getOldAttribute(Attribute attr)
Get the old attribute relative to the given new kind of attribute. |
static int |
lookupAttribute(java.lang.String name,
Attribute[] attributes)
Get the index of the given attribute in the given attribute array |
static void |
readIndex(java.io.DataInputStream in)
|
static Resource[] |
readRepository(java.io.File rep)
Read the resource from a repository. |
static Resource |
readResource(java.io.DataInputStream in)
load a resoure from the given DataInputStream. |
static void |
unpickleProlog(java.io.DataInputStream in)
|
void |
updateEntriesIndex(java.io.File storedir)
update the index file (in stores) |
protected void |
updateProperties(int version)
Update the properties to add the serializer class in it. |
void |
upgrade(int version)
The big stuff, upgrade the configuration in XML Upgrade the resource stores Upgrade the indexers (if any) Upgrade the realms (if any) Upgrade the properties files |
protected void |
upgradeDB(java.io.File storedir,
java.io.FilenameFilter filter)
Upgrade the stores (.db) under the given store directory. |
protected void |
upgradeStores(java.io.File storedir,
java.io.FilenameFilter filter)
Upgrade the stores (st-xxx) under the given store directory. |
static void |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean debug
Constructor Detail |
---|
public Upgrader(java.lang.String server, java.io.File config, java.io.File props, Serializer serializer)
server
- the server nameconfig
- the server config directoryprops
- the server properties fileserializer
- the XML SerializerMethod Detail |
---|
public static void usage()
public static int lookupAttribute(java.lang.String name, Attribute[] attributes)
name,
- the attribute name.attributes,
- the atribute array.
public static Attribute getOldAttribute(Attribute attr) throws UpgradeException
attr
- the new attribute
UpgradeException
public static void unpickleProlog(java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
public static void readIndex(java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
public static Resource readResource(java.io.DataInputStream in) throws java.io.IOException, UpgradeException
in
- the DataInputStream
java.io.IOException
UpgradeException
public static Resource[] readRepository(java.io.File rep) throws java.io.FileNotFoundException, java.io.IOException, UpgradeException
rep
- the repository (a File)
java.io.FileNotFoundException
java.io.IOException
UpgradeException
public void updateEntriesIndex(java.io.File storedir) throws java.io.IOException, UpgradeException
java.io.IOException
- if an IO error occurs
UpgradeException
protected boolean createSubDirs(java.io.File storedir)
protected java.io.File getNewStore(java.io.File storedir, java.io.File oldstore)
oldstore
- the Old store.
protected void upgradeStores(java.io.File storedir, java.io.FilenameFilter filter) throws UpgradeException
storedir
- the store directoryfilter
- the filter to use to list the stores
UpgradeException
protected void upgradeDB(java.io.File storedir, java.io.FilenameFilter filter)
storedir
- the store directoryfilter
- the filter to use to list the storesprotected void backupStores(java.io.File storedir, java.io.FilenameFilter filter) throws java.io.IOException
storedir
- the store directoryfilter
- the filter to use to list the stores
java.io.IOException
protected void cleanStores(java.io.File storedir, java.io.FilenameFilter filter) throws java.io.IOException
storedir
- the store directoryfilter
- the filter to use to list the stores
java.io.IOException
protected void updateProperties(int version)
protected void checkDir(java.io.File dir) throws UpgradeException
UpgradeException
public void upgrade(int version) throws java.io.IOException, UpgradeException
java.io.IOException
- if an IO error occurs
UpgradeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |