|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.yam.depend.Dependencies
public class Dependencies
Dependencies keeps track of the link and inclusion dependencies between YamFiles and other Files.
Constructor Summary | |
---|---|
Dependencies()
|
Method Summary | |
---|---|
static void |
clear()
Clear out the current Dependencies. |
Set<String> |
created(File createdFile)
A non-YamFile File has been "created" as far as the wiki is concerned if it has been uploaded. |
Set<String> |
created(YamFile createdYam)
Given a created YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created YamFile. |
Set<String> |
deleted(File deletedFile)
Given a deleted File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted File. |
Set<String> |
deleted(YamFile deletedYam)
Given a deleted YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted YamFile. |
boolean |
equals(Object obj)
Are two Dependencies equal? |
static boolean |
exists(String wikiID)
Do we have the Dependencies for a wiki, either loaded or serialized? |
static Dependencies |
get(Long wikiID)
Get Dependencies from a Long id. |
static Dependencies |
get(String wikiID)
Get the Dependencies instance for a wiki area. |
int |
hashCode()
Returns the hash code value for this Dependencies. |
String |
includedByAsString()
Create a String representation of the "includedBy" relationships in this Dependencies. |
String |
includesAsString()
Create a String representation of the "includes" relationships in this Dependencies. |
boolean |
isEmpty()
Does this Dependencies contain any information about links or includes? |
String |
linkedByAsString()
Create a String representation of the "linkedBy" relationships in this Dependencies. |
String |
linksToAsString()
Create a String representation of the "linksTo" relationships in this Dependencies. |
Set<String> |
modified(YamFile modifiedYam)
Given a modified YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the modified YamFile. |
static void |
remove(String wikiID)
Remove the Dependencies for a wiki area. |
Set<String> |
renamed(File oldFile,
File newFile)
Given the old name and new name of a renamed File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed File. |
Set<String> |
renamed(YamFile oldYam,
YamFile newYam)
Given the old name and new name of a renamed YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed YamFile. |
static void |
serialize()
Serialize all Dependencies for every wiki to the serialization directory |
static void |
serialize(String wikiID)
Serialize the Dependencies for a wiki to the serialization directory |
static void |
setSerializationDirectory(File directory)
Set the directory to which Dependencies are serialized. |
static void |
setSerializationFilePrefix(String prefix)
Set the prefix for serialized dependency file names. |
static void |
setSerializationFileSuffix(String suffix)
Set the suffix for serialized dependency file names. |
String |
toSortedString()
Sorted string representation |
String |
toString()
String representation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Dependencies()
Method Detail |
---|
public static void clear()
public static void setSerializationDirectory(File directory)
directory
- The directory to which Dependencies are serializedpublic static void setSerializationFilePrefix(String prefix)
prefix
- The prefix for serialized dependency files. The dependency
file name is made up of this prefix, the wiki ID, and the configured
suffix.public static void setSerializationFileSuffix(String suffix)
suffix
- The suffix for serialized dependency files. The dependency
file name is made up of the configured prefix, the wiki ID, and this
suffix.public static Dependencies get(String wikiID) throws gate.persist.PersistenceException
wikiID
- The identifier for the wiki area
gate.persist.PersistenceException
- If a Dependencies
serialization file cannot be deserializedpublic static Dependencies get(Long wikiID) throws gate.persist.PersistenceException
gate.persist.PersistenceException
public static boolean exists(String wikiID)
wikiID
- The ID of the wiki to be checked for Dependencies
public static void remove(String wikiID) throws gate.persist.PersistenceException
wikiID
- The id of the wiki area for which Dependecies will be
removed.
gate.persist.PersistenceException
- If a serialized Dependencies could not be
deleted.public static void serialize() throws gate.persist.PersistenceException
gate.persist.PersistenceException
- when serialization gives a filesystem error.public static void serialize(String wikiID) throws gate.persist.PersistenceException
wikiID
- The ID of the wiki for which the Dependencies will be
serialized
gate.persist.PersistenceException
- when serialization gives a filesystem errorpublic boolean isEmpty()
public boolean equals(Object obj)
equals
in class Object
obj
- the Object against which we test equality
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String toSortedString()
public Set<String> modified(YamFile modifiedYam)
Given a modified YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the modified YamFile. If the modified YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the modification.
This method is synchronised internally.
Note that there is no equivalent modified(File) method for modifying a File that is not a YamFile, as they cannot be modified via the wiki
modifiedYam
- The YamFile that has been modified
public Set<String> created(File createdFile)
A non-YamFile File has been "created" as far as the wiki is concerned if it has been uploaded.
Given a created File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created File. If the created File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
This method is synchronised internally.
createdFile
- The File that has been created
public Set<String> created(YamFile createdYam)
Given a created YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created YamFile. If the created YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the creation.
This method is synchronised internally.
createdYam
- The YamFile that has been created
public Set<String> deleted(File deletedFile)
Given a deleted File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted File. If the deleted File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
This method is synchronised internally.
deletedFile
- The File that has been deleted
public Set<String> deleted(YamFile deletedYam)
Given a deleted YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted YamFile. If the deleted YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the deletion.
This method is synchronised internally.
deletedYam
- The YamFile that has been deleted
public Set<String> renamed(File oldFile, File newFile)
Given the old name and new name of a renamed File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed File. If the old or new File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for the File, to take into account the renaming.
This method is synchronised internally.
oldFile
- The File that has been renamednewFile
- The new File
public Set<String> renamed(YamFile oldYam, YamFile newYam)
Given the old name and new name of a renamed YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed YamFile. If the old or new YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the renaming.
This method is synchronised internally.
oldYam
- The YamFile that has been renamednewYam
- The new YamFile
public String linksToAsString()
public String includesAsString()
public String linkedByAsString()
public String includedByAsString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |