01: /*
02: * Service Broker: The class responsible for supplying the service broker interface.
03: * Copyright (C) 2006-2007 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library 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 GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * ServiceBroker.java
20: */
21:
22: package com.rift.coad.daemon.servicebroker;
23:
24: import java.rmi.Remote;
25: import java.rmi.RemoteException;
26: import java.util.List;
27:
28: /**
29: * The purpose of this Daemon is to allow the registration of services within a
30: * database which allows the JNDI's for those services to be retrieved.
31: *
32: * @author Glynn Chaldecott
33: */
34: public interface ServiceBroker extends Remote {
35:
36: /**
37: * The jndi url for the service broker.
38: */
39: public final static String JNDI_URL = "ServiceBroker";
40:
41: /**
42: * This method is used to register a service and its JNDI on the database.
43: * It will also pass the service to it's parent.
44: *
45: * @param JNDI This is a String containing the JNDI of the service.
46: * @param services This is a List containing Strings by which the daemon is
47: * linked to the services it provides.
48: */
49: public void registerService(String JNDI, List services)
50: throws RemoteException, ServiceBrokerException;
51:
52: /**
53: * This method is used to retrieve the JNDI for a service by searching for
54: * the supplied Strings within the database.
55: *
56: * @param services This is a List containing Strings by which the service
57: * can be identified.
58: * @return Returns the necessary JNDI.
59: */
60: public String getServiceProvider(List services)
61: throws RemoteException, ServiceBrokerException;
62:
63: /**
64: * This method is used to retrieve multiple JNDI values from the database.
65: *
66: * @param services This is a List containing Strings by which the service
67: * can be identified.
68: * @return Returns a list of multiple JNDI's.
69: */
70: public List getServiceProviders(List services)
71: throws RemoteException, ServiceBrokerException;
72:
73: /**
74: * This method is used to remove a service from the database.
75: *
76: * @param JNDI This is a string containing the JNDI of the service you wish
77: * to remove.
78: * @param services This is a List of the services that are linked to that
79: * JNDI.
80: */
81: public void removeServiceProviders(String JNDI, List services)
82: throws RemoteException, ServiceBrokerException;
83:
84: }
|