10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7298SMark.J.Nelson@Sun.COM * Common Development and Distribution License (the "License"). 6*7298SMark.J.Nelson@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 220Sstevel@tonic-gate * Copyright (c) 1999 by Sun Microsystems, Inc. 230Sstevel@tonic-gate * All rights reserved. 240Sstevel@tonic-gate * 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate // TemplateRegistry.java: 280Sstevel@tonic-gate // Author: James Kempf 290Sstevel@tonic-gate // Created On: Fri Jul 4 11:38:39 1997 300Sstevel@tonic-gate // Last Modified By: James Kempf 310Sstevel@tonic-gate // Last Modified On: Mon Jun 1 13:41:07 1998 320Sstevel@tonic-gate // Update Count: 26 330Sstevel@tonic-gate // 340Sstevel@tonic-gate 350Sstevel@tonic-gate package com.sun.slp; 360Sstevel@tonic-gate 370Sstevel@tonic-gate import java.util.*; 380Sstevel@tonic-gate 390Sstevel@tonic-gate /** 400Sstevel@tonic-gate * Classes subclassing the <b>TemplateRegistry</b> class register and 410Sstevel@tonic-gate * unregister service templates, look up the template URL's based on the 420Sstevel@tonic-gate * service type name, and return attribute verifiers for verifying 430Sstevel@tonic-gate * template attributes. 440Sstevel@tonic-gate * 450Sstevel@tonic-gate * @author James Kempf 460Sstevel@tonic-gate * 470Sstevel@tonic-gate */ 480Sstevel@tonic-gate 490Sstevel@tonic-gate public abstract class TemplateRegistry extends Object { 500Sstevel@tonic-gate 510Sstevel@tonic-gate protected static TemplateRegistry templateRegistry = null; 520Sstevel@tonic-gate 530Sstevel@tonic-gate /** 540Sstevel@tonic-gate * The property accessor for the TemplateRegistry. 550Sstevel@tonic-gate * 560Sstevel@tonic-gate * @return The TemplateRegistry object. 570Sstevel@tonic-gate * @exception ServiceLocationException If the registry can't be created. 580Sstevel@tonic-gate */ 590Sstevel@tonic-gate getTemplateRegistry()600Sstevel@tonic-gate public static TemplateRegistry getTemplateRegistry() 610Sstevel@tonic-gate throws ServiceLocationException 620Sstevel@tonic-gate { 630Sstevel@tonic-gate 640Sstevel@tonic-gate if (templateRegistry == null) { 650Sstevel@tonic-gate templateRegistry = new SLPTemplateRegistry(); 660Sstevel@tonic-gate 670Sstevel@tonic-gate } 680Sstevel@tonic-gate 690Sstevel@tonic-gate return templateRegistry; 700Sstevel@tonic-gate } 710Sstevel@tonic-gate 720Sstevel@tonic-gate /** 730Sstevel@tonic-gate * Register the new service. 740Sstevel@tonic-gate * 750Sstevel@tonic-gate * @param <i>serviceType</i> Name of the service. 760Sstevel@tonic-gate * @param <i>documentURL</i> URL of the template document. 770Sstevel@tonic-gate * @param <i>languageLocale</i> Locale of the template langugae. 780Sstevel@tonic-gate * @param <i>version</i> Version number of template document. 790Sstevel@tonic-gate * @exception ServiceLocationException If the registration fails. 800Sstevel@tonic-gate * @exception IllegalArgumentException Thrown if any parameters are null. 810Sstevel@tonic-gate * 820Sstevel@tonic-gate */ 830Sstevel@tonic-gate 840Sstevel@tonic-gate abstract public void registerServiceTemplate(ServiceType serviceType, String documentURL, Locale languageLocale, String version)850Sstevel@tonic-gate registerServiceTemplate(ServiceType serviceType, 860Sstevel@tonic-gate String documentURL, 870Sstevel@tonic-gate Locale languageLocale, 880Sstevel@tonic-gate String version) 890Sstevel@tonic-gate throws ServiceLocationException; 900Sstevel@tonic-gate 910Sstevel@tonic-gate /** 920Sstevel@tonic-gate * Deregister the template for service type. 930Sstevel@tonic-gate * 940Sstevel@tonic-gate * @param <i>serviceType</i> Name of service. 950Sstevel@tonic-gate * @param <i>languageLocale</i> Language locale of template. 960Sstevel@tonic-gate * @param <i>version</i> Version of the template, null for latest. 970Sstevel@tonic-gate * @exception ServiceLocationException Thrown if the template 980Sstevel@tonic-gate * is not registered. 990Sstevel@tonic-gate * @exception IllegalArgumentException Thrown if the serviceType or 1000Sstevel@tonic-gate * languageLocale parameter is null. 1010Sstevel@tonic-gate * 1020Sstevel@tonic-gate */ 1030Sstevel@tonic-gate 1040Sstevel@tonic-gate abstract public void deregisterServiceTemplate(ServiceType serviceType, Locale languageLocale, String version)1050Sstevel@tonic-gate deregisterServiceTemplate(ServiceType serviceType, 1060Sstevel@tonic-gate Locale languageLocale, 1070Sstevel@tonic-gate String version) 1080Sstevel@tonic-gate throws ServiceLocationException; 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate /** 1110Sstevel@tonic-gate * Find the document URL for the service. 1120Sstevel@tonic-gate * 1130Sstevel@tonic-gate * @param <i>serviceType</i> Name of service. 1140Sstevel@tonic-gate * @param <i>languageLocale</i> Language locale of template. 1150Sstevel@tonic-gate * @param <i>version</i> Version of the template, null for latest. 1160Sstevel@tonic-gate * @return <b>String</b> for the service's template document. 1170Sstevel@tonic-gate * If the service doesn't exist, returns null. 1180Sstevel@tonic-gate * @exception ServiceLocationException If more than one template 1190Sstevel@tonic-gate * document URL is returned. 1200Sstevel@tonic-gate *</blockquote> 1210Sstevel@tonic-gate * @exception IllegalArgumentException Thrown if the service type or 1220Sstevel@tonic-gate * languageLocal parameter is null. 1230Sstevel@tonic-gate * 1240Sstevel@tonic-gate */ 1250Sstevel@tonic-gate 1260Sstevel@tonic-gate abstract public String findTemplateURL(ServiceType serviceType, Locale languageLocale, String version)1270Sstevel@tonic-gate findTemplateURL(ServiceType serviceType, 1280Sstevel@tonic-gate Locale languageLocale, 1290Sstevel@tonic-gate String version) 1300Sstevel@tonic-gate throws ServiceLocationException; 1310Sstevel@tonic-gate 1320Sstevel@tonic-gate /** 1330Sstevel@tonic-gate * Create an attribute verifier for the template document URL. 1340Sstevel@tonic-gate * 1350Sstevel@tonic-gate * @param <i>documentURL</i> A URL for the template document. 1360Sstevel@tonic-gate * @return An attribute verifier for the service 1370Sstevel@tonic-gate * @exception ServiceLocationException If a parse error occurs or 1380Sstevel@tonic-gate * if the document can't be found. 1390Sstevel@tonic-gate * @exception IllegalArgumentException Thrown if any parameters are null. 1400Sstevel@tonic-gate * 1410Sstevel@tonic-gate */ 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate abstract public attributeVerifier(String documentURL)1440Sstevel@tonic-gate ServiceLocationAttributeVerifier attributeVerifier(String documentURL) 1450Sstevel@tonic-gate throws ServiceLocationException; 1460Sstevel@tonic-gate } 147