Package org.dlese.dpc.repository
Class SetInfo
java.lang.Object
org.dlese.dpc.repository.SetInfo
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
DcsSetInfo
Data structure used in the
RepositoryManager to hold information about a set of metadata files.
Note that as of jOAI v3.x (Feb 2006), this class is no longer used to define OAI sets but is now only used
to define the files that are configured in the RepositoryManager. OAI sets are now defined
separately.- Author:
- John Weatherley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplements Comparator to enable sorting by format.static classImplements Comparator to enable sorting by name.static classImplements Comparator to enable sorting by numDeleted.static classImplements Comparator to enable sorting by numFiles.static classImplements Comparator to enable sorting by numIndexed.static classImplements Comparator to enable sorting by numIndexingErrors.static classImplements Comparator to enable sorting by setSpec.static classImplements Comparator to enable sorting by status. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDirInfo(String format, String dir) Adds a feature to the DirInfo attribute of the SetInfo objectintCompares two SetInfos by the Set Name.booleancontainsDirectory(File directory) Determines whether a directory is configured in this SetInfo.booleancontainsDirInfo(DirInfo dirInfo) booleanChecks equality of two SetInfo objects.Gets the accession status of this Set.getAttribute(String key) Gets an attribute Object from this SetInfo.static ComparatorgetComparator(String type) Gets the comparator attribute of the SetInfo classGets the XML description.Gets the descriptionHtml attribute of the SetInfo objectGets the primary directory path configured for this set, or an empty String if none is configured.getDirInfo(int i) Gets the dirInfo attribute of the SetInfo objectGets the dirInfos attribute of the SetInfo objectGets the enabled status String [true | false].Gets the metadata format of the files in the primary directory configured for this set, or an empty String if none is configured.getId()Gets the record ID for this SetInfo.getName()Gets the name attribute of the SetInfo objectGets the name attribute of the SetInfo object, encoded for use in a URL.Gets the number of items deleted for this collection.intGets the number of items deleted for this collection.Gets the number of files for this collection.intGets the numFiles attribute of the SetInfo objectGets the number of items indexed for this collection.intGets the number of items indexed for this collection.Gets the number of indexing errors that were found for this collection.intGets the number of indexing errors that were found for this collection.Gets the setSpec attribute of the SetInfo objectGets the unique ID for this SetInfo.longGets the unique ID for this SetInfo.booleanGets the enabled status boolean [true | false].voidremoveDirInfo(int i) DESCRIPTIONvoidsetAccessionStatus(String val) Sets the accession status for this Set.voidsetAttribute(String key, Object attribute) Sets an attribute Object that will be available for access using the given key.voidsetDescription(String val) Sets the description, which must be in XML form.voidsetDirInfo(int i, String dir, String format) Sets the dirInfo attribute of the SetInfo objectvoidsetDirInfo(int i, DirInfo dirInfo) Sets the dirInfo attribute of the SetInfo objectvoidsetEnabled(String val) Sets the enabled status [true | false].voidSets the record ID for this SetInfo.voidSets the name attribute of the SetInfo objectvoidSets data in the SetInfo for display in the UI.voidsetSetSpec(String val) Sets the setSpec attribute of the SetInfo objecttoString()Provides a String representataion for this SetInfo.
-
Constructor Details
-
SetInfo
public SetInfo()Constructor for the SetInfo object -
SetInfo
public SetInfo(String name, String setSpec, String description, String enabled, String dir, String format, String id) Constructor for the SetInfo object- Parameters:
name- The human-readable name of the setsetSpec- The oai setSpec that will be used to reference this setdescription- A description for this set, in XML form.enabled- [true | false]dir- A directory where files for this set are locatedformat- The native metadata format for the files in the above directoryid- DESCRIPTION
-
-
Method Details
-
getName
Gets the name attribute of the SetInfo object- Returns:
- The name value
-
getId
Gets the record ID for this SetInfo.- Returns:
- The record ID.
-
setId
Sets the record ID for this SetInfo.- Parameters:
id- The record ID.
-
getUniqueID
Gets the unique ID for this SetInfo.- Returns:
- The unique ID.
-
getUniqueIDLong
public long getUniqueIDLong()Gets the unique ID for this SetInfo.- Returns:
- The unique ID.
-
getNameEncoded
Gets the name attribute of the SetInfo object, encoded for use in a URL.- Returns:
- The name encoded with URL encoing.
-
setName
Sets the name attribute of the SetInfo object- Parameters:
val- The new name value
-
getSetSpec
Gets the setSpec attribute of the SetInfo object- Returns:
- The setSpec value
-
setSetSpec
Sets the setSpec attribute of the SetInfo object- Parameters:
val- The new setSpec value
-
getDescription
Gets the XML description.- Returns:
- The description value
-
getFormat
Gets the metadata format of the files in the primary directory configured for this set, or an empty String if none is configured. The primary directory is the first one configured.- Returns:
- The metadta format of the files.
-
getDirectory
Gets the primary directory path configured for this set, or an empty String if none is configured. The primary directory is the first one configured.- Returns:
- The directory path.
-
getDescriptionHtml
Gets the descriptionHtml attribute of the SetInfo object- Returns:
- The descriptionHtml value
-
setDescription
Sets the description, which must be in XML form.- Parameters:
val- The new description value
-
getEnabled
Gets the enabled status String [true | false].- Returns:
- The enabled status.
-
isEnabled
public boolean isEnabled()Gets the enabled status boolean [true | false].- Returns:
- The enabled status.
-
setEnabled
Sets the enabled status [true | false].- Parameters:
val- The String 'true' or 'false'.
-
getDirInfos
Gets the dirInfos attribute of the SetInfo object- Returns:
- The dirInfos value
-
getDirInfo
Gets the dirInfo attribute of the SetInfo object- Parameters:
i- DESCRIPTION- Returns:
- The dirInfo value
-
setDirInfo
Sets the dirInfo attribute of the SetInfo object- Parameters:
i- The new dirInfo valuedirInfo- The new dirInfo value
-
setDirInfo
Sets the dirInfo attribute of the SetInfo object- Parameters:
i- The new dirInfo valuedir- The new dirInfo valueformat- The new dirInfo value
-
containsDirInfo
-
getNumFiles
Gets the number of files for this collection.- Returns:
- The numFiles value
-
getNumFilesInt
public int getNumFilesInt()Gets the numFiles attribute of the SetInfo object- Returns:
- The numFiles value
-
setSetInfoData
Sets data in the SetInfo for display in the UI. This includes things like the number of items indexed for this collection, the number if items that are discoverable for this collection, the number of files for this collection, and the number of index errors that were detected for this collection. Also the collection accession status.- Parameters:
rm- The RepositoryManager whoes index contains the collections configured by this SetSpec.
-
getAccessionStatus
Gets the accession status of this Set.- Returns:
- The accession status
-
setAccessionStatus
Sets the accession status for this Set.- Parameters:
val- The accession status.
-
getNumIndexed
Gets the number of items indexed for this collection.- Returns:
- The numIndexed value
-
getNumIndexedInt
public int getNumIndexedInt()Gets the number of items indexed for this collection.- Returns:
- The numIndexed value
-
getNumDeleted
Gets the number of items deleted for this collection.- Returns:
- The numDeleted value
-
getNumDeletedInt
public int getNumDeletedInt()Gets the number of items deleted for this collection.- Returns:
- The numDeleted value
-
getNumIndexingErrors
Gets the number of indexing errors that were found for this collection.- Returns:
- The numIndexingErrors value
-
getNumIndexingErrorsInt
public int getNumIndexingErrorsInt()Gets the number of indexing errors that were found for this collection.- Returns:
- The numIndexingErrors value
-
containsDirectory
Determines whether a directory is configured in this SetInfo.- Parameters:
directory- A file directory.- Returns:
- True if the directory is configured in this SetInfo.
-
removeDirInfo
public void removeDirInfo(int i) DESCRIPTION- Parameters:
i- DESCRIPTION
-
addDirInfo
Adds a feature to the DirInfo attribute of the SetInfo object- Parameters:
format- The feature to be added to the DirInfo attributedir- The feature to be added to the DirInfo attribute
-
setAttribute
Sets an attribute Object that will be available for access using the given key. The object MUST be serializable.- Parameters:
key- The key used to reference the attribute.attribute- Any Java Object that is Serializable.
-
getAttribute
Gets an attribute Object from this SetInfo.- Parameters:
key- The key used to reference the attribute.- Returns:
- The Java Object that was stored under the given key or null if none exists.
-
toString
Provides a String representataion for this SetInfo. This method may be used for debugging to see what is in the SetInfo. This method is also used it theequals(Object)method. -
equals
Checks equality of two SetInfo objects. -
compareTo
Compares two SetInfos by the Set Name. Collections.sort() or Arrays.sort() can thus be used to sort a list of SetInfos by Name.- Specified by:
compareToin interfaceComparable- Parameters:
o- The SetInfo to compare- Returns:
- Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- If the object passed in is not a SetInfo.
-
getComparator
Gets the comparator attribute of the SetInfo class- Parameters:
type- The comparator type, for example 'key'- Returns:
- The comparator value
-