net.datacrow.core.services
Class OnlineServices

java.lang.Object
  extended by net.datacrow.core.services.OnlineServices

public class OnlineServices
extends java.lang.Object

The online services class holds all online service for a specific module. This class is populated by the module class. A specialized class loader is capable of detecting custom made server classes. Based on this information this class gets populated.

Author:
Robert Jan van der Waals
See Also:
DcModule.getOnlineServices(), ServiceClassLoader

Constructor Summary
OnlineServices(int module)
          Create an instance for the specified module.
 
Method Summary
 void addServer(IServer server)
          Add a server
 Region getDefaultRegion()
          Retrieves the previously used region.
 SearchMode getDefaultSearchMode()
          Retrieves the previously used search mode.
 IServer getDefaultServer()
          Retrieves the previously used server.
 SearchMode getMode(DcObject dco)
          Retrieves the selected search mode used when the information of the supplied item was retrieved.
 int getModule()
          The module to which the services belong
 java.lang.String getQuery(DcObject dco)
          Retrieves the query used for updating or retrieving the item.
 Region getRegion(DcObject dco)
          Retrieves the region from which the information of the supplied item was retrieved.
 IServer getServer(DcObject dco)
          Retrieves the service from which the information of the supplied item was retrieved.
 IServer getServer(java.lang.String name)
          Retrieves the server with the given name.
 java.util.Collection<IServer> getServers()
          Retrieves all registered servers.
 OnlineSearchForm getUI(DcObject dco, ItemForm itemForm, boolean advanced)
          Returns an instance of the online search form.
 DcObject query(DcObject dco)
          Retrieves an item (a new instance!)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnlineServices

public OnlineServices(int module)
Create an instance for the specified module.

Parameters:
module -
Method Detail

getServers

public java.util.Collection<IServer> getServers()
Retrieves all registered servers.


addServer

public void addServer(IServer server)
Add a server

Parameters:
server -

getModule

public int getModule()
The module to which the services belong


getServer

public IServer getServer(DcObject dco)
Retrieves the service from which the information of the supplied item was retrieved.

Parameters:
dco -
Returns:
The service used to update the item or null
See Also:
DcObject._SYS_SERVICE, DcObject._SYS_SERVICEURL

getRegion

public Region getRegion(DcObject dco)
Retrieves the region from which the information of the supplied item was retrieved.

Parameters:
dco -
Returns:
The region used to update the item or null
See Also:
DcObject._SYS_SERVICE, DcObject._SYS_SERVICEURL

getMode

public SearchMode getMode(DcObject dco)
Retrieves the selected search mode used when the information of the supplied item was retrieved.

Parameters:
dco -
Returns:
The search mode or null
See Also:
SearchMode

getQuery

public java.lang.String getQuery(DcObject dco)
Retrieves the query used for updating or retrieving the item.

Parameters:
dco -
Returns:
See Also:
DcObject._SYS_SERVICE, DcObject._SYS_SERVICEURL

getDefaultRegion

public Region getDefaultRegion()
Retrieves the previously used region.

See Also:
Region

getDefaultServer

public IServer getDefaultServer()
Retrieves the previously used server.

See Also:
IServer

getDefaultSearchMode

public SearchMode getDefaultSearchMode()
Retrieves the previously used search mode.

See Also:
SearchMode

getServer

public IServer getServer(java.lang.String name)
Retrieves the server with the given name.

Returns:
The server for the given name or null if not found.
See Also:
IServer

query

public DcObject query(DcObject dco)
               throws java.lang.Exception
Retrieves an item (a new instance!) based on the service information of the supplied item.

Parameters:
dco - The item on which the search is based.
Returns:
The retrieved item (a new instance) or null if no information could be found.
Throws:
java.lang.Exception

getUI

public OnlineSearchForm getUI(DcObject dco,
                              ItemForm itemForm,
                              boolean advanced)
Returns an instance of the online search form. For specific implementations this method can be overridden to return a specific implementation of the OnlineSearchForm class.

Parameters:
dco - The item to be updated or null when searching for new items only.
itemForm - The item form from which the search is started or null
advanced - Indicates if the advanced options should be shown.
See Also:
OnlineSearchForm