1 16 package org.apache.juddi.function; 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 20 import org.apache.juddi.datatype.RegistryObject; 21 import org.apache.juddi.datatype.request.GetRegistryInfo; 22 import org.apache.juddi.datatype.response.RegistryInfo; 23 import org.apache.juddi.error.RegistryException; 24 import org.apache.juddi.registry.RegistryEngine; 25 import org.apache.juddi.util.Config; 26 import org.apache.juddi.util.Release; 27 28 31 public class GetRegisteryInfoFunction extends AbstractFunction 32 { 33 private static Log log = LogFactory.getLog(GetRegisteryInfoFunction.class); 35 36 39 public GetRegisteryInfoFunction(RegistryEngine registry) 40 { 41 super(registry); 42 } 43 44 47 public RegistryObject execute(RegistryObject regObject) 48 throws RegistryException 49 { 50 GetRegistryInfo request = (GetRegistryInfo)regObject; 51 String generic = request.getGeneric(); 52 53 try 54 { 55 58 RegistryInfo info = new RegistryInfo(); 59 info.setGeneric(generic); 60 info.setOperator(Config.getOperator()); 61 info.addProperty("operatorName",Config.getStringProperty("juddi.operatorName")); 62 info.addProperty("operatorEmailAddress",Config.getStringProperty("juddi.operatorEmailAddress")); 63 info.addProperty("registryVersion",Release.getRegistryVersion()); 64 info.addProperty("registryLastModified",Release.getLastModified()); 65 info.addProperty("uddiVersion",Release.getUDDIVersion()); 66 67 return info; 68 } 69 catch(Exception ex) 70 { 71 log.error(ex); 72 throw new RegistryException(ex); 73 } 74 } 75 76 77 78 79 80 81 82 public static void main(String [] args) 83 { 84 RegistryEngine reg = new RegistryEngine(); 86 reg.init(); 87 88 try 89 { 90 } 91 catch (Exception ex) 92 { 93 ex.printStackTrace(); 95 } 96 finally 97 { 98 reg.dispose(); 100 } 101 } 102 } | Popular Tags |