package dalclient; import java.util.*; /** * Generic DAL client connection to a service or set of services. * At this point the protocol is stateless and a "connection" is nothing * more than a list of service URLs. Queries require a connection context * be established first. */ public class DALConnection { ArrayList services = new ArrayList(); /* Default is an empty service list. */ DALConnection() { // Nothing yet. } /* Create a new connection with one service. */ DALConnection(String service) { services.add(service); } /* Add a service to an existing connection. */ public void addService(String service) { services.add(service); } /* Get count of number of services. */ public int getServiceCount() { return (services.size()); } /* Get an individual service URL. */ public String getServiceURL(int i) { return ((String) services.get(i)); } /* Get a new query context for this connection. */ public DALQuery getDALQuery() { return (new DALQuery(this)); } }