Update of /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6858/components/cddlm/client/org/cddlm/client/console Modified Files: ApplicationStatus.java ConsoleOperation.java Listen.java ShowServerStatus.java Undeploy.java Log Message: New service API. Yes, renaming XML bits breaks everything. tests are failing with configuration issues... Index: ApplicationStatus.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console/ApplicationStatus.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ApplicationStatus.java 17 Sep 2004 16:30:51 -0000 1.2 --- ApplicationStatus.java 14 Oct 2004 17:01:11 -0000 1.3 *************** *** 23,29 **** import org.cddlm.client.common.ServerBinding; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; import org.smartfrog.services.cddlm.generated.api.types.UnboundedXMLOtherNamespace; - import org.smartfrog.services.cddlm.generated.api.types.CallbackInformationType; - import org.smartfrog.services.cddlm.generated.api.types.CallbackAddressType; import java.io.PrintWriter; --- 23,29 ---- import org.cddlm.client.common.ServerBinding; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; + import org.smartfrog.services.cddlm.generated.api.types.NotificationAddressType; + import org.smartfrog.services.cddlm.generated.api.types.NotificationInformationType; import org.smartfrog.services.cddlm.generated.api.types.UnboundedXMLOtherNamespace; import java.io.PrintWriter; *************** *** 53,66 **** out.println("status: " + status.getState()); out.println("info: " + status.getStateInfo()); ! CallbackInformationType callbackInfo = status.getCallback(); ! if(callbackInfo!=null) { ! out.println( "callback: "+callbackInfo.getType()); ! CallbackAddressType address = callbackInfo.getAddress(); ! if ( address != null ) { ! if ( address.getUri() != null ) { out.println("url: " + address.getUri()); } } ! out.println( "identifier:"+callbackInfo.getIdentifier()); } UnboundedXMLOtherNamespace extendedState = status.getExtendedState(); --- 53,66 ---- out.println("status: " + status.getState()); out.println("info: " + status.getStateInfo()); ! NotificationInformationType notificationInfo = status.getNotification(); ! if (notificationInfo != null) { ! out.println("callback: " + notificationInfo.getType()); ! NotificationAddressType address = notificationInfo.getAddress(); ! if (address != null) { ! if (address.getUri() != null) { out.println("url: " + address.getUri()); } } ! out.println("identifier:" + notificationInfo.getIdentifier()); } UnboundedXMLOtherNamespace extendedState = status.getExtendedState(); Index: ConsoleOperation.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console/ConsoleOperation.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ConsoleOperation.java 29 Sep 2004 16:49:13 -0000 1.22 --- ConsoleOperation.java 14 Oct 2004 17:01:11 -0000 1.23 *************** *** 21,29 **** import nu.xom.ParsingException; import org.apache.axis.message.MessageElement; import org.apache.axis.message.Text; import org.apache.axis.types.NCName; import org.apache.axis.types.URI; - import org.apache.axis.AxisFault; import org.cddlm.client.common.Constants; import org.cddlm.client.common.ServerBinding; --- 21,29 ---- import nu.xom.ParsingException; + import org.apache.axis.AxisFault; import org.apache.axis.message.MessageElement; import org.apache.axis.message.Text; import org.apache.axis.types.NCName; import org.apache.axis.types.URI; import org.cddlm.client.common.Constants; import org.cddlm.client.common.ServerBinding; *************** *** 37,46 **** import org.smartfrog.services.cddlm.generated.api.types.ApplicationReferenceListType; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; - import org.smartfrog.services.cddlm.generated.api.types.CallbackAddressType; - import org.smartfrog.services.cddlm.generated.api.types.CallbackEnum; - import org.smartfrog.services.cddlm.generated.api.types.CallbackInformationType; import org.smartfrog.services.cddlm.generated.api.types.DeploymentDescriptorType; import org.smartfrog.services.cddlm.generated.api.types.EmptyElementType; import org.smartfrog.services.cddlm.generated.api.types.JsdlType; import org.smartfrog.services.cddlm.generated.api.types.OptionMapType; import org.smartfrog.services.cddlm.generated.api.types.OptionType; --- 37,46 ---- import org.smartfrog.services.cddlm.generated.api.types.ApplicationReferenceListType; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; import org.smartfrog.services.cddlm.generated.api.types.DeploymentDescriptorType; import org.smartfrog.services.cddlm.generated.api.types.EmptyElementType; import org.smartfrog.services.cddlm.generated.api.types.JsdlType; + import org.smartfrog.services.cddlm.generated.api.types.NotificationAddressType; + import org.smartfrog.services.cddlm.generated.api.types.NotificationEnum; + import org.smartfrog.services.cddlm.generated.api.types.NotificationInformationType; import org.smartfrog.services.cddlm.generated.api.types.OptionMapType; import org.smartfrog.services.cddlm.generated.api.types.OptionType; *************** *** 48,59 **** import org.smartfrog.services.cddlm.generated.api.types.StaticServerStatusType; import org.smartfrog.services.cddlm.generated.api.types._applicationStatusRequest; ! import org.smartfrog.services.cddlm.generated.api.types._deployRequest; ! import org.smartfrog.services.cddlm.generated.api.types._deployResponse; import org.smartfrog.services.cddlm.generated.api.types._deploymentDescriptorType_body; import org.smartfrog.services.cddlm.generated.api.types._languageListType_language; import org.smartfrog.services.cddlm.generated.api.types._lookupApplicationRequest; import org.smartfrog.services.cddlm.generated.api.types._serverStatusRequest; ! import org.smartfrog.services.cddlm.generated.api.types._setCallbackRequest; ! import org.smartfrog.services.cddlm.generated.api.types._undeployRequest; import org.w3c.dom.DOMImplementation; import org.xml.sax.SAXException; --- 48,59 ---- import org.smartfrog.services.cddlm.generated.api.types.StaticServerStatusType; import org.smartfrog.services.cddlm.generated.api.types._applicationStatusRequest; ! import org.smartfrog.services.cddlm.generated.api.types._createRequest; ! import org.smartfrog.services.cddlm.generated.api.types._createResponse; import org.smartfrog.services.cddlm.generated.api.types._deploymentDescriptorType_body; import org.smartfrog.services.cddlm.generated.api.types._languageListType_language; import org.smartfrog.services.cddlm.generated.api.types._lookupApplicationRequest; import org.smartfrog.services.cddlm.generated.api.types._serverStatusRequest; ! import org.smartfrog.services.cddlm.generated.api.types._setNotificationRequest; ! import org.smartfrog.services.cddlm.generated.api.types._terminateRequest; import org.w3c.dom.DOMImplementation; import org.xml.sax.SAXException; *************** *** 244,248 **** DeploymentDescriptorType descriptor, Options options, ! CallbackInformationType callbackInfo) throws RemoteException { JsdlType jsdl = new JsdlType(); --- 244,248 ---- DeploymentDescriptorType descriptor, Options options, ! NotificationInformationType callbackInfo) throws RemoteException { JsdlType jsdl = new JsdlType(); *************** *** 258,266 **** map = options.toOptionMap(); } ! _deployRequest request = new _deployRequest(jsdl, descriptor, callbackInfo, map); ! _deployResponse response = getStub().deploy(request); return response.getApplicationReference(); --- 258,266 ---- map = options.toOptionMap(); } ! _createRequest request = new _createRequest(jsdl, descriptor, callbackInfo, map); ! _createResponse response = getStub().create(request); return response.getApplicationReference(); *************** *** 315,319 **** MessageElement any[] = new MessageElement[1]; any[0] = element; ! DeploymentDescriptorType descriptor = createDescriptorWithXML(any,language, version); return descriptor; } --- 315,321 ---- MessageElement any[] = new MessageElement[1]; any[0] = element; ! DeploymentDescriptorType descriptor = createDescriptorWithXML(any, ! language, ! version); return descriptor; } *************** *** 341,346 **** /** ! * jump through hoops to turn a Xom document into a descriptor ! * Caller is left to set the language and version attributes * @param xom * @return --- 343,349 ---- /** ! * jump through hoops to turn a Xom document into a descriptor Caller is ! * left to set the language and version attributes ! * * @param xom * @return *************** *** 352,356 **** DOMImplementation impl = XomAxisHelper.loadDomImplementation(); MessageElement messageElement = XomAxisHelper.convert(xom, impl); ! return createDescriptorWithXML(messageElement,null,null); } --- 355,359 ---- DOMImplementation impl = XomAxisHelper.loadDomImplementation(); MessageElement messageElement = XomAxisHelper.convert(xom, impl); ! return createDescriptorWithXML(messageElement, null, null); } *************** *** 501,508 **** * @throws RemoteException */ ! public boolean undeploy(URI application, String reason) throws RemoteException { ! _undeployRequest undeploy = new _undeployRequest(application, reason); ! return getStub().undeploy(undeploy); } --- 504,512 ---- * @throws RemoteException */ ! public boolean terminate(URI application, String reason) throws RemoteException { ! _terminateRequest undeploy = new _terminateRequest(application, ! reason); ! return getStub().terminate(undeploy); } *************** *** 514,520 **** * @throws RemoteException */ ! public boolean setCallback(_setCallbackRequest request) throws RemoteException { ! return getStub().setCallback(request); } --- 518,524 ---- * @throws RemoteException */ ! public boolean setNotification(_setNotificationRequest request) throws RemoteException { ! return getStub().setNotification(request); } *************** *** 527,535 **** * @return */ ! public boolean setCddlmCallback(URI application, String url, String identifier) throws RemoteException { ! CallbackInformationType callbackInfo = new CallbackInformationType(); ! callbackInfo.setType(CallbackEnum.fromString( DeployApiConstants.CALLBACK_CDDLM_PROTOTYPE)); callbackInfo.setIdentifier(identifier); --- 531,539 ---- * @return */ ! public boolean setCddlmNotification(URI application, String url, String identifier) throws RemoteException { ! NotificationInformationType callbackInfo = new NotificationInformationType(); ! callbackInfo.setType(NotificationEnum.fromString( DeployApiConstants.CALLBACK_CDDLM_PROTOTYPE)); callbackInfo.setIdentifier(identifier); *************** *** 538,545 **** replyAddress = URIHelper.toAxisUri(url); } ! callbackInfo.setAddress(new CallbackAddressType(replyAddress, null)); ! _setCallbackRequest request = new _setCallbackRequest(application, callbackInfo); ! return setCallback(request); } --- 542,551 ---- replyAddress = URIHelper.toAxisUri(url); } ! callbackInfo.setAddress( ! new NotificationAddressType(replyAddress, null)); ! _setNotificationRequest request = new _setNotificationRequest( ! application, callbackInfo); ! return setNotification(request); } *************** *** 552,561 **** public boolean setUnsubscribeCallback(URI application) throws RemoteException { ! _setCallbackRequest request = new _setCallbackRequest(application, null); try { ! return setCallback(request); } catch (AxisFault e) { ! if(DeployApiConstants.FAULT_NO_SUCH_APPLICATION.equals(e.getFaultCode())) { //do nothing, as this is a common event return false; --- 558,569 ---- public boolean setUnsubscribeCallback(URI application) throws RemoteException { ! _setNotificationRequest request = new _setNotificationRequest( ! application, null); try { ! return setNotification(request); } catch (AxisFault e) { ! if (DeployApiConstants.FAULT_NO_SUCH_APPLICATION.equals( ! e.getFaultCode())) { //do nothing, as this is a common event return false; Index: Undeploy.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console/Undeploy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Undeploy.java 15 Sep 2004 12:59:12 -0000 1.3 --- Undeploy.java 14 Oct 2004 17:01:11 -0000 1.4 *************** *** 60,64 **** */ public void execute() throws RemoteException { ! undeploy(uri, reason); } --- 60,64 ---- */ public void execute() throws RemoteException { ! terminate(uri, reason); } Index: ShowServerStatus.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console/ShowServerStatus.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ShowServerStatus.java 29 Sep 2004 16:49:13 -0000 1.8 --- ShowServerStatus.java 14 Oct 2004 17:01:11 -0000 1.9 *************** *** 56,60 **** out.println("UTC offset " + serverInfo.getTimezoneUTCOffset()); out.println("Build " + serverInfo.getBuild()); ! String callbacks[] = statInfo.getCallbacks().getItem(); out.println("Callbacks: " + callbacks.length + " :-"); for (int i = 0; i < callbacks.length; i++) { --- 56,60 ---- out.println("UTC offset " + serverInfo.getTimezoneUTCOffset()); out.println("Build " + serverInfo.getBuild()); ! String callbacks[] = statInfo.getNotifications().getItem(); out.println("Callbacks: " + callbacks.length + " :-"); for (int i = 0; i < callbacks.length; i++) { Index: Listen.java =================================================================== RCS file: /cvsroot/smartfrog/core/components/cddlm/client/org/cddlm/client/console/Listen.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Listen.java 17 Sep 2004 16:30:52 -0000 1.3 --- Listen.java 14 Oct 2004 17:01:11 -0000 1.4 *************** *** 26,32 **** import org.cddlm.client.callbacks.CallbackServer; import org.cddlm.client.common.ServerBinding; ! import org.smartfrog.services.cddlm.generated.api.callbacks.DeploymentCallbackEndpoint; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; ! import org.smartfrog.services.cddlm.generated.api.types._lifecycleEventCallbackRequest; import java.io.IOException; --- 26,32 ---- import org.cddlm.client.callbacks.CallbackServer; import org.cddlm.client.common.ServerBinding; ! import org.smartfrog.services.cddlm.generated.api.callbacks.DeploymentNotificationEndpoint; import org.smartfrog.services.cddlm.generated.api.types.ApplicationStatusType; ! import org.smartfrog.services.cddlm.generated.api.types._lifecycleEventRequest; import java.io.IOException; *************** *** 40,50 **** */ public class Listen extends ConsoleOperation ! implements DeploymentCallbackEndpoint { ! _lifecycleEventCallbackRequest lastMessage; int messageCount = 0; ! int timeout = 5*60; public Listen(ServerBinding binding, PrintWriter out, String[] args) { --- 40,50 ---- */ public class Listen extends ConsoleOperation ! implements DeploymentNotificationEndpoint { ! _lifecycleEventRequest lastMessage; int messageCount = 0; ! int timeout = 5 * 60; public Listen(ServerBinding binding, PrintWriter out, String[] args) { *************** *** 75,79 **** } ! public _lifecycleEventCallbackRequest getLastMessage() { return lastMessage; } --- 75,79 ---- } ! public _lifecycleEventRequest getLastMessage() { return lastMessage; } *************** *** 100,104 **** //send a set callback message String url = server.getCallbackURL(); ! setCddlmCallback(getUri(), url, identifier); aboutToWait(); --- 100,104 ---- //send a set callback message String url = server.getCallbackURL(); ! setCddlmNotification(getUri(), url, identifier); aboutToWait(); *************** *** 115,119 **** //shutdown code server.stop(); ! if ( identifier != null ) { CallbackServer.removeMapping(identifier); } --- 115,119 ---- //shutdown code server.stop(); ! if (identifier != null) { CallbackServer.removeMapping(identifier); } *************** *** 130,134 **** */ ! protected void aboutToWait() throws IOException { } --- 130,134 ---- */ ! protected void aboutToWait() throws IOException { } *************** *** 141,148 **** * @throws RemoteException */ ! public synchronized boolean callback(_lifecycleEventCallbackRequest callback) throws RemoteException { messageCount++; lastMessage = callback; ! processCallback(callback); this.notifyAll(); return true; --- 141,149 ---- * @throws RemoteException */ ! public synchronized boolean notification(_lifecycleEventRequest callback) ! throws RemoteException { messageCount++; lastMessage = callback; ! processNotification(callback); this.notifyAll(); return true; *************** *** 154,160 **** * @param callback */ ! protected void processCallback(_lifecycleEventCallbackRequest callback) { BigInteger timestamp = callback.getTimestamp(); ! if ( timestamp != null ) { long utc = timestamp.longValue(); Date date = new Date(utc * 1000); --- 155,161 ---- * @param callback */ ! protected void processNotification(_lifecycleEventRequest callback) { BigInteger timestamp = callback.getTimestamp(); ! if (timestamp != null) { long utc = timestamp.longValue(); Date date = new Date(utc * 1000); *************** *** 169,179 **** status.getState().toString() : "(null)")); ! if ( status != null ) { ! if ( status.getStateInfo() != null ) { out.println("info :" + status.getStateInfo()); } ! if ( status.getExtendedState() != null ) { MessageElement[] any = status.getExtendedState().get_any(); ! for ( int i = 0; i < any.length; i++ ) { out.println(any[i].toString()); } --- 170,180 ---- status.getState().toString() : "(null)")); ! if (status != null) { ! if (status.getStateInfo() != null) { out.println("info :" + status.getStateInfo()); } ! if (status.getExtendedState() != null) { MessageElement[] any = status.getExtendedState().get_any(); ! for (int i = 0; i < any.length; i++) { out.println(any[i].toString()); } *************** *** 194,198 **** public synchronized boolean blockForMessages(long timeout) throws InterruptedException { ! if ( messageCount <= 0 ) { wait(timeout); } --- 195,199 ---- public synchronized boolean blockForMessages(long timeout) throws InterruptedException { ! if (messageCount <= 0) { wait(timeout); } |