View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/ebxml/RegistryServiceImpl.java,v 1.11 2003/07/18 14:46:50 farrukh_najmi Exp $ 3 * 4 * 5 */ 6 7 package com.sun.xml.registry.ebxml; 8 9 import javax.xml.registry.*; 10 import java.util.*; 11 import javax.xml.registry.infomodel.*; 12 13 /*** 14 * Class Declaration for Class1 15 * 16 */ 17 public class RegistryServiceImpl implements RegistryService { 18 private ConnectionImpl connection = null; 19 private BusinessQueryManagerImpl bqm = null; 20 private DeclarativeQueryManagerImpl dqm = null; 21 private BusinessLifeCycleManagerImpl lcm = null; 22 private SoapMessenger soapMessenger; 23 private ObjectCache objectCache = null; 24 25 RegistryServiceImpl(ConnectionImpl connection) { 26 this.connection = connection; 27 28 objectCache = new ObjectCache(this); 29 } 30 31 /*** 32 * Returns the CapabilityProfile for the JAXR provider 33 * 34 * <p><DL><DT><B>Capability Level: 0 </B></DL> 35 * 36 * @associates <{CapabilityProfile}> 37 * @see <{LifeCycleManager}> 38 */ 39 public CapabilityProfile getCapabilityProfile() throws JAXRException{ 40 CapabilityProfile profile = new CapabilityProfileImpl(); 41 return profile; 42 } 43 44 public ConnectionImpl getConnection() { 45 return connection; 46 } 47 48 private BusinessLifeCycleManagerImpl getBusinessLifeCycleManagerImpl() 49 throws JAXRException { 50 if (lcm == null) { 51 lcm = new BusinessLifeCycleManagerImpl(this); 52 } 53 return lcm; 54 } 55 56 /*** 57 * Returns the BusinessLifeCycleManager interface implemented by the 58 * JAXR provider 59 * 60 * <p><DL><DT><B>Capability Level: 0 </B></DL> 61 * 62 * @associates <{BusinessLifeCycleManager}> 63 * @see <{LifeCycleManager}> 64 */ 65 public BusinessLifeCycleManager getBusinessLifeCycleManager() 66 throws JAXRException { 67 return getBusinessLifeCycleManagerImpl(); 68 } 69 70 /*** 71 * Returns the basic LifeCycleManager interface implemented by the JAXR 72 * provider 73 * 74 * <p><DL><DT><B>Capability Level: 0 </B></DL> 75 * 76 * @associates <{LifeCycleManager}> 77 */ 78 public LifeCycleManager getLifeCycleManager() throws JAXRException { 79 // This method will be removed from JAXR API 80 return getBusinessLifeCycleManager(); 81 } 82 83 /*** 84 * Returns the BusinessQueryManager interface implemented by the JAXR 85 * provider 86 * 87 * <p><DL><DT><B>Capability Level: 0 </B></DL> 88 * 89 * @associates <{BusinessQueryManager}> 90 * @directed 91 */ 92 public BusinessQueryManager getBusinessQueryManager() throws JAXRException { 93 if (bqm == null) { 94 bqm = new BusinessQueryManagerImpl( 95 this, getBusinessLifeCycleManagerImpl()); 96 } 97 return bqm; 98 } 99 100 /*** 101 * Returns the DeclarativeQueryManager interface implemented by the 102 * JAXR provider Registries should throws 103 * UnsupportedCapabilityException if they do not implement this 104 * optional feature. 105 * 106 * <p><DL><DT><B>Capability Level: 0 (optional) </B></DL> 107 * 108 * @associates <{DeclarativeQueryManager}> 109 * @directed 110 */ 111 public DeclarativeQueryManager getDeclarativeQueryManager() 112 throws JAXRException, UnsupportedCapabilityException { 113 if (dqm == null) { 114 dqm = new DeclarativeQueryManagerImpl( 115 this, getBusinessLifeCycleManagerImpl()); 116 } 117 return dqm; 118 } 119 120 /*** 121 * Returns the BulkResponse associated with specified requestId. Once 122 * a client retrieves a BulkResponse for a particular requestId any 123 * subsequent calls to retrieve the Bulkresponse for the same requestId 124 * should result in an InvalidRequestException. Throws an 125 * InavlidRequestException if no responses exist for specified 126 * requestId. 127 * 128 * <p><DL><DT><B>Capability Level: 0 </B></DL> 129 * 130 */ 131 public BulkResponse getBulkResponse(String requestId) 132 throws InvalidRequestException, JAXRException { 133 // Async feature not supported yet. 134 throw new javax.xml.registry.InvalidRequestException("Unknown requestId '" + requestId + "'."); 135 } 136 137 /*** 138 * Get the default user-defined postal scheme for codifying the 139 * attributes of PostalAddress 140 * 141 * <p><DL><DT><B>Capability Level: 0 </B></DL> 142 * 143 */ 144 public ClassificationScheme getDefaultPostalScheme() throws JAXRException { 145 // Write your code here 146 return null; 147 } 148 149 /*** 150 * This method takes a String that is an XML request in a registry 151 * specific format. It sends the request to the registry and returns a 152 * String that is the registry specific XML response. 153 * 154 * <p><DL><DT><B>Capability Level: 0 </B></DL> 155 * 156 * @return String that is the XML response in a registry specific manner. 157 */ 158 public String makeRegistrySpecificRequest(String request) 159 throws JAXRException { 160 // Write your code here 161 return null; 162 } 163 164 /*** 165 * Implementation private interface 166 */ 167 public SoapMessenger getSoapMessenger() throws JAXRException { 168 if (soapMessenger == null) { 169 soapMessenger = new SoapMessenger( 170 this, connection.getQueryManagerURL(), 171 getBusinessLifeCycleManagerImpl()); 172 // soapMessenger.setCredentials(); 173 } 174 return soapMessenger; 175 } 176 177 public ObjectCache getObjectCache() { 178 return objectCache; 179 } 180 181 public String mapJAXRNameToEbXMLName(String className) { 182 String newName = null; 183 if (className.equalsIgnoreCase("Concept")) { 184 newName = "ClassificationNode"; 185 } 186 else { 187 newName = className; 188 } 189 190 return newName; 191 } 192 193 public String mapEbXMLNameToJAXRName(String ebXMLName) { 194 String newName = null; 195 if (ebXMLName.equalsIgnoreCase("ClassificationNode")) { 196 newName = "Concept"; 197 } 198 else { 199 newName = ebXMLName; 200 } 201 202 return newName; 203 } 204 205 }

This page was automatically generated by Maven