[3235] | 1 | /*
|
---|
| 2 | * ModuleInterface.java
|
---|
| 3 | * Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org
|
---|
| 4 | *
|
---|
| 5 | * This program is free software; you can redistribute it and/or modify
|
---|
| 6 | * it under the terms of the GNU General Public License as published by
|
---|
| 7 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 8 | * (at your option) any later version.
|
---|
| 9 | *
|
---|
| 10 | * This program is distributed in the hope that it will be useful,
|
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 13 | * GNU General Public License for more details.
|
---|
| 14 | *
|
---|
| 15 | * You should have received a copy of the GNU General Public License
|
---|
| 16 | * along with this program; if not, write to the Free Software
|
---|
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 18 | */
|
---|
[3229] | 19 | package org.greenstone.gsdl3.core;
|
---|
| 20 |
|
---|
[16688] | 21 | import org.w3c.dom.Node;
|
---|
[3235] | 22 |
|
---|
[3229] | 23 | /**
|
---|
[3502] | 24 | * interface for all modules in greenstone.
|
---|
[3229] | 25 | *
|
---|
| 26 | * all components talk via a process method - in its simplest form,
|
---|
| 27 | * it takes a String of XML, and returns a String of XML
|
---|
| 28 | *
|
---|
[16688] | 29 | * the more efficient process method uses DOM Nodes instead
|
---|
[3502] | 30 | * of Strings - this avoids parsing the XML at each module
|
---|
[3235] | 31 | *
|
---|
[25727] | 32 | * @author Katherine Don
|
---|
[3235] | 33 | * @version $Revision: 25727 $
|
---|
[3229] | 34 | */
|
---|
| 35 | public interface ModuleInterface {
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | * Process an XML request - as a String
|
---|
| 39 | *
|
---|
| 40 | * @param xml_in the request to process
|
---|
| 41 | * @return the response - contains any error messages
|
---|
[3233] | 42 | * @see java.lang.String
|
---|
[3229] | 43 | */
|
---|
| 44 | abstract public String process(String xml_in);
|
---|
| 45 |
|
---|
| 46 | /**
|
---|
[16688] | 47 | * Process an XML request - as a DOM model Node
|
---|
[3229] | 48 | *
|
---|
[3502] | 49 | * @param xml_in the request to process
|
---|
[3229] | 50 | * @return the response - contains any error messages
|
---|
[16688] | 51 | * @see org.w3c.dom.Node
|
---|
[3229] | 52 | */
|
---|
[16688] | 53 | abstract public Node process(Node xml_in);
|
---|
[9874] | 54 |
|
---|
| 55 | /**
|
---|
| 56 | * Do any clean up necessary for deactivating the module, eg
|
---|
| 57 | * close any open file handles (gdbm in particular) or windows
|
---|
| 58 | * holds locks on them.
|
---|
| 59 | */
|
---|
| 60 | abstract public void cleanUp();
|
---|
[3229] | 61 | }
|
---|
| 62 |
|
---|