org.oclc.da.gdfr.registryprototype.srw.test
Class StubCollectionsCollection

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.srw.test.StubCollectionsCollection
All Implemented Interfaces:
Collection

public class StubCollectionsCollection
extends java.lang.Object
implements Collection

Created on Oct 17, 2006

Author:
stanesca TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
StubCollectionsCollection()
           
 
Method Summary
 void add(CollectionItem item)
          Adds the given CollectionItem to the collection preconditions: 1) The user is recognized and is allowed to execute this feature 2) The identifier given to the record is valid and does not already exist.
 CollectionItem create()
          Creates a new instance of CollectionItem with a GUID associated with it preconditions: 1) The collection exists postconditions: 1) The GUID is in fact globally unique
 void delete(Ref ref)
          Deletes the record identified by the given ref preconditions 1) The record with the given Ref exists postconditions 1) The record is deleted from the collection
 CollectionItem read(Ref ref)
          Returns the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists.
 AdminData readAdmin(Ref ref)
          Returns the admin data of the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists.
 Content readContent(Ref ref)
          Returns the content data of the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists.
 Abstract[] search(Query query)
          Return a list (possibly empty if no matches) of abstracts of registry records, containing its known identifiers and some unique & relevant identifying attributes.
 void update(CollectionItem item)
          Updates the given CollectionItem in the Collection preconditions: 1) The user is recognized and is allowed to execute this feature 2) The identifier given to the record is valid and already exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubCollectionsCollection

public StubCollectionsCollection()
Method Detail

add

public void add(CollectionItem item)
         throws RegistryException
Description copied from interface: Collection
Adds the given CollectionItem to the collection preconditions: 1) The user is recognized and is allowed to execute this feature 2) The identifier given to the record is valid and does not already exist. 3) The record contains all the required data elements, in the proper format. postconditions: The CollectionItem is now part of the collection

Specified by:
add in interface Collection
Parameters:
item - CollectionItem to add
Throws:
RegistryException - if any erros occur.

create

public CollectionItem create()
                      throws RegistryException
Description copied from interface: Collection
Creates a new instance of CollectionItem with a GUID associated with it preconditions: 1) The collection exists postconditions: 1) The GUID is in fact globally unique

Specified by:
create in interface Collection
Returns:
The CollectionItem created
Throws:
RegistryException - if anything goes wrong

delete

public void delete(Ref ref)
            throws RegistryException
Description copied from interface: Collection
Deletes the record identified by the given ref preconditions 1) The record with the given Ref exists postconditions 1) The record is deleted from the collection

Specified by:
delete in interface Collection
Parameters:
ref - The Ref of the record to delete
Throws:
RegistryException - if anything goes wrong

read

public CollectionItem read(Ref ref)
                    throws RegistryException
Description copied from interface: Collection
Returns the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists. postconditions 1) true

Specified by:
read in interface Collection
Parameters:
ref - The Ref of the CollectionItem
Returns:
The CollectionItem identified by id, null if not found
Throws:
RegistryException - If anything goes wrong

readAdmin

public AdminData readAdmin(Ref ref)
                    throws RegistryException
Description copied from interface: Collection
Returns the admin data of the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists. postconditions 1) true

Specified by:
readAdmin in interface Collection
Parameters:
ref - The Ref of the CollectionItem
Returns:
The admin data of the CollectionItem identified by id, null if not found
Throws:
RegistryException - If anything goes wrong

readContent

public Content readContent(Ref ref)
                    throws RegistryException
Description copied from interface: Collection
Returns the content data of the CollectionItem identified by the given Ref preconditions 1) The record identified by the given identifier exists. postconditions 1) true

Specified by:
readContent in interface Collection
Parameters:
ref - The Ref of the CollectionItem
Returns:
The content data of the CollectionItem identified by id, null if not found
Throws:
RegistryException - If anything goes wrong

search

public Abstract[] search(Query query)
                  throws RegistryException
Description copied from interface: Collection
Return a list (possibly empty if no matches) of abstracts of registry records, containing its known identifiers and some unique & relevant identifying attributes. preconditions: 1) The query statement is valid. postconditions: 2) true

Specified by:
search in interface Collection
Parameters:
query - The query to search on
Returns:
An array of Abstracts representing the search results.
Throws:
RegistryException

update

public void update(CollectionItem item)
            throws RegistryException
Description copied from interface: Collection
Updates the given CollectionItem in the Collection preconditions: 1) The user is recognized and is allowed to execute this feature 2) The identifier given to the record is valid and already exists. 3) The record contains all the required data elements, in the proper format. postconditions: 1) Record is correctly updated in the Source Node repository. 2) Attributes are correctly indexed.

Specified by:
update in interface Collection
Parameters:
item - The new version of the CollectionItem
Throws:
RegistryException - if anything goes wrong


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.