01: /*
02: * <copyright>
03: *
04: * Copyright 2002-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.pizza.plugin.util;
28:
29: import java.io.File;
30: import java.util.ArrayList;
31:
32: import org.cougaar.pizza.Constants;
33:
34: /**
35: * Simple extension of the main ServiceDiscovery PublishTaxonomy support class,
36: * to point to the tModelNames needed by the pizza application, and point to the
37: * pizza app Taxonomy files.
38: * Note that this class could be used by any simple SD application that needs only
39: * the Commercial Service Scheme, by simply using your own Constants.getDataPath().
40: */
41: public class PublishTaxonomy extends
42: org.cougaar.servicediscovery.util.yp.PublishTaxonomy {
43:
44: public void initialize() {
45: super .initialize();
46:
47: // Add taxonomies required for pizza application.
48: // Constants.UDDIConstants.COMMERCIAL_SERVICE_SCHEME lists all
49: // recognized roles.
50: // Constants.UDDIConstants.ORGANIZATION_TYPES lists the recognized
51: // organization types e.g. Military or Commercial (which we want).
52: ArrayList tModelNames = new ArrayList();
53: tModelNames
54: .add(Constants.UDDIConstants.COMMERCIAL_SERVICE_SCHEME);
55: tModelNames.add(Constants.UDDIConstants.ORGANIZATION_TYPES);
56:
57: setTModelNames(tModelNames);
58:
59: // Define file path for above taxonomy files - for pizza app, located in
60: // $CIP/pizza/data/taxonomies.
61: setBasePath(Constants.getDataPath() + File.separator
62: + "taxonomies" + File.separator);
63: }
64: }
|