|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ispheres.server.core.Collection
public class Collection
A Collection is an iSphere representation of a group of objects which are similar. That is to say objects in a collection are of the same type and are typically about the same subject domain.
| Constructor Summary | |
|---|---|
Collection(java.io.File collectionPath,
java.io.File collectionConfig,
int collectionId,
MetadataObject iSphereMetadata)
Creates an empty collection. |
|
| Method Summary | |
|---|---|
int |
add(MetadataObject localMetadata,
DigitalObject digitalObject)
create a new record from the MetadataObject and the ISphereObject and add it to the collection. |
void |
consistancyCheck(LogFile logfile)
Check if the Collection passes the consistancy check. |
MetadataObject |
getCollectionMetadata()
Returns the metadata which describes this collection. |
Schema |
getLocalSchema()
This function returns the local schema of the collection. |
MetadataObject |
getMetadata(int sri,
boolean universalSchema)
Fetches a metadata object from the collection - the returned metadata object is in the local schema. |
DigitalObject |
getObject(int sri)
Fetches a digital object from the collection.. |
java.lang.Class |
getObjectType()
Returns the type of ISphere object held in this collection. |
int |
getResultCount(java.lang.String searchTerm)
Returns the amount of results that will be returned when calling search with the specified searchterm. |
DigitalObject |
getTransformedObject(int sri,
TransformInterface[] transforms)
Retrieves a transformed version of the object at the specified simple repository index. |
void |
remove(int sri)
Remove an element from the srm, it removes the metadata object, the digital object. |
MetadataObject[] |
search(java.lang.String searchTerm,
int start,
int max,
boolean universalSchema)
Searches the local repository for objects that match the specified metadata. |
void |
setMetadata(int sri,
MetadataObject m)
Update an already existing record with new metadata. |
void |
setObject(int sri,
DigitalObject o)
Update an existing record with a new object. |
void |
tearDown()
Shutdown the SimpleRepositoryModel. |
void |
writeConfiguration(org.w3c.dom.Element root)
Writes out the configuration of the collection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Collection(java.io.File collectionPath,
java.io.File collectionConfig,
int collectionId,
MetadataObject iSphereMetadata)
throws java.io.IOException
collectionPath - The path at which the collection is located.collectionConfig - The configuration filename that is used to
configure the collection.collectionId - The unique identifier of the collection within
the iSphere.iSphereMetadata - The metadata that is associated with the iSphere
that contains the collection.
java.io.IOException - Thrown when the configuration file could not be read.| Method Detail |
|---|
public final int add(MetadataObject localMetadata,
DigitalObject digitalObject)
throws ISphereException,
FatalException
localMetadata - The metadata of the digital object being added to
the collection. The metadata should be in the local schema.digitalObject - The digital object being inserted into the local
repository.
ISphereException - if the record is not added.
FatalException - if orphaned data is left in the connector.
public final void consistancyCheck(LogFile logfile)
throws java.io.IOException
logfile - the LogFile to write to.
java.io.IOException - if could not write to the LogFile.public final MetadataObject getCollectionMetadata()
public final Schema getLocalSchema()
public final MetadataObject getMetadata(int sri,
boolean universalSchema)
throws ISphereException
sri - The simple repository index of the object you wish to fetch.universalSchema - If true this function will return the metadata in
the universal schema, otherwise the local schema
will be used.
ISphereException - When unable to read from the local repository.
public final DigitalObject getObject(int sri)
throws ISphereException
sri - The simple repository index of the object you wish to fetch.
ISphereException - When unable to read from the local repository.public final java.lang.Class getObjectType()
public final void remove(int sri)
throws ISphereException,
FatalException
sri - The index of the record that is to be removed from the simple
repository model
ISphereException - if the item is not removed
FatalException - if orphaned data is left in the connector
public final int getResultCount(java.lang.String searchTerm)
throws ISphereException
searchTerm - A String specifying what to search for.
ISphereException - Thrown when the result count cannot be retrieved
public final MetadataObject[] search(java.lang.String searchTerm,
int start,
int max,
boolean universalSchema)
throws ISphereException
searchTerm - A term to search for.start - The starting index in the results to start returning
MetadataObjects from.max - The maximum number of results to return.universalSchema - If true return the results in the universal
schema, otherwise return them in the local.
ISphereException - Thrown when the local repository could not be
searched.
public final void setMetadata(int sri,
MetadataObject m)
throws ISphereException
sri - The index of the record whose metadata we wish to change.m - The metadata to replace the old metadata with.
ISphereException - If unable to write to the local repository.
public final void setObject(int sri,
DigitalObject o)
throws ISphereException
sri - The index of the record whose object we wish to change.o - The new object to replace the old object with.
ISphereException - if unable to write to the local repository.
public final DigitalObject getTransformedObject(int sri,
TransformInterface[] transforms)
throws ISphereException,
TransformException
sri - An int specifying the simple repository index of the record to
perform the transformation on.transforms - An array of TransformInterfaces that holds the
information for each of the transformations to perform.
ISphereException - Thrown when the object could not be retrieved
from the local repository, or when the transformation could not be a.
TransformException - Thrown when the transformations as defined by
the transforms parameter cannot be performed.
public final void writeConfiguration(org.w3c.dom.Element root)
throws ISphereException
root - The root collections element to which this collections
location should be added.
ISphereException - Thrown when the configurationpublic final void tearDown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||