source: ndgCommon/trunk/ndg/common/src/clients/xmldb/interfacexmldbatomclient.py @ 5008

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ndgCommon/trunk/ndg/common/src/clients/xmldb/interfacexmldbatomclient.py@5008
Revision 5008, 3.6 KB checked in by cbyrom, 11 years ago (diff)

Remove unused imports from interfaces.

Line 
1'''
2 Interface for clients to implement for providing functionality to support Atom
3 document usage
4 
5 @author: C Byrom - Tessella, Feb 09
6'''
7from ndg.common.src.clients.interfacesearchclient import InterfaceSearchClient
8
9class InterfaceXMLDBAtomClient(InterfaceSearchClient):
10       
11    # location of the base moles atom schema in the XML DB
12    # - this should be defined if schema compliance needs to be checked
13    atomSchema = None
14
15    def checkAtomSchemaCompliance(self, atomPath, atom = None, isDebug = False):
16        '''
17        Validate the specified atom in the XML DB with the atom schemas contained in
18        this DB
19        @param atomPath: path to the atom in the XML DB
20        @keyword atom: if set to an atom, this will be created temporarily in the
21        XML DB - since it may not already exist there.  Once validation is completed, the
22        file will be removed from the DB.
23        @keyword isDebug: if True, return full error details, otherwise only return
24        a summary
25        @raise SystemError: if errors encountered whilst running the schema validation
26        @return array: containing any errors found - NB, if an empty array is returned,
27        this indicates successful validation
28        '''
29        raise NotImplementedError("This is an interface class and this method has not " + \
30                                  "been implemented yet")
31
32
33
34    def getAtomPublicationState(self, atomID, providerID):
35        '''
36        Retrieve the publication state of the specified atom - by
37        checking the collection it is in
38        @param atom: atom id to look up
39        @param providerID: provider ID for the atom data
40        @return: AtomState for the atom.  NB, if the ID is not found, assume
41        we're dealing with a new atom and set the state as the working state
42        '''
43        raise NotImplementedError("This is an interface class and this method has not " + \
44                                  "been implemented yet")
45
46
47    def changeAtomPublicationState(self, atom, newState):
48        '''
49        Adjust the publication state of an atom in the XML DB
50        @param atom: the Atom data model of the atom whose publication state
51        needs to change
52        @param newState: an AtomState object representing the new publication
53        state of the atom
54        @return atom: atom data model with updated state
55        '''
56        raise NotImplementedError("This is an interface class and this method has not " + \
57                                  "been implemented yet")
58
59           
60    def createAtom(self, atom, replaceAtom = True, runAsynch = True):
61        '''
62        Create an atom in the XML DB - using the atom contents to work out
63        the location + data set ID
64        @param atom: atom object to create in the DB
65        @keyword replaceAtom: if False and the atom is already available in the
66        XML DB, a DuplicateError will be raised, otherwise the atom is replaced
67        @param runAsynch: if True, if a backup of an existing file, do this
68        asynchronously in a separate thread
69        '''
70        raise NotImplementedError("This is an interface class and this method has not " + \
71                                  "been implemented yet")
72
73
74    def deleteAtom(self, atom):
75        '''
76        Delete the given atom from the XML DB - using the atom
77        details to work out the required path to delete
78        @param atom: an Atom instance to delete
79        @return True if atom deleted successfully, false otherwise
80        '''
81        raise NotImplementedError("This is an interface class and this method has not " + \
82                                  "been implemented yet")
Note: See TracBrowser for help on using the repository browser.