//----------------------------------------------------------------------
//This code is developed as part of the Java CoG Kit project
//The terms of the license can be found at http://www.cogkit.org/license
//This message may not be removed or altered.
//----------------------------------------------------------------------

/*
 * Created on Jul 21, 2005
 */
package org.globus.cog.abstraction.coaster.service.local;

import org.globus.cog.abstraction.coaster.service.Registering;
import org.globus.cog.karajan.workflow.service.ProtocolException;
import org.globus.cog.karajan.workflow.service.handlers.RequestHandler;

public class RegistrationHandler extends RequestHandler {
    public static final String NAME = "REGISTER";

    public void requestComplete() throws ProtocolException {
        String id = this.getInDataAsString(0);
        String url = this.getInDataAsString(1);
        Registering ls = (Registering) getChannel().getChannelContext()
                .getService();
        try {
            String rid = ls.registrationReceived(id, url, getChannel());
            this.sendReply(rid == null ? "OK" : rid);
        }
        catch (Exception e) {
            throw new ProtocolException(e);
        }
    }
}

@@ -413,16 +413,38 @@
 local;%0A%0A
+import java.net.URI;%0A%0A
 import o
@@ -564,16 +564,102 @@
 eption;%0A
+import org.globus.cog.karajan.workflow.service.channels.AbstractStreamKarajanChannel;%0A
 import o
@@ -1178,16 +1178,219 @@
 nel());%0A
+            if (getChannel() instanceof AbstractStreamKarajanChannel) %7B%0A            %09((AbstractStreamKarajanChannel) getChannel()).setContact(new URI(id + (rid == null ? %22%22 : %22-%22 + rid)));%0A            %7D%0A
         

set contacts on certain channels for nicer debug messages