org.globus.rendezvous.client
Class RendezvousHelper

java.lang.Object
  extended byorg.globus.rendezvous.client.RendezvousHelper

public class RendezvousHelper
extends Object

Helper class to invoke operations on RendezvousPortType in a potentially secure manner.


Field Summary
private static org.globus.util.I18n i18n
           
private static org.apache.commons.logging.Log logger
           
static int NO_DESIRED_RANK
           
private  ClientSecurityStrategy security
           
 
Constructor Summary
RendezvousHelper()
           
RendezvousHelper(ClientSecurityStrategy security)
           
 
Method Summary
static byte[] extractHeader(byte[] data, int beginIndex)
          Extract byte array representing the binary array which is the value of the RegistrantData RP.
 byte[] getRegistrantData(EndpointReferenceType rendezvousEndpoint)
          will be null/empty if rdv not complete/done
 boolean isRendezvousDone(EndpointReferenceType rendezvousEndpoint)
          Pull status from the Rendezvous service/resource.
private static byte[] makeHeader(int count)
           
static byte[] prependHeader(byte[] data, int count)
          Prepend a Rendezvous binary data encoding header to a byte array.
static int readCount(byte[] bytes)
           
 int registerWithRendezvous(EndpointReferenceType rendezvousEndpoint, byte[] data)
          Register application binary data with a rendezvous without specifying any desired rank.
 int registerWithRendezvous(EndpointReferenceType rendezvousEndpoint, byte[] data, int desiredRank)
           
 void subscribeForCompletionNotifications(EndpointReferenceType rendezvousEndpoint, NotifyCallback notificationCallback)
          Susbcribe for notifications on completion of rendezvous.
 void subscribeForNotifications(EndpointReferenceType rendezvousEndpoint, NotifyCallback notificationCallback, QName topicQName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_DESIRED_RANK

public static final int NO_DESIRED_RANK
See Also:
Constant Field Values

security

private ClientSecurityStrategy security

logger

private static final org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n
Constructor Detail

RendezvousHelper

public RendezvousHelper()

RendezvousHelper

public RendezvousHelper(ClientSecurityStrategy security)
Method Detail

makeHeader

private static byte[] makeHeader(int count)

prependHeader

public static byte[] prependHeader(byte[] data,
                                   int count)
Prepend a Rendezvous binary data encoding header to a byte array. The header is an encoding of a count and is separated from the rest of the data by a 'space' ASCII character (byte 32).

This is used by:

Parameters:
data - byte[] the data to prepend a header to
count - int the positive number to encode as the header
Returns:
byte[]

extractHeader

public static byte[] extractHeader(byte[] data,
                                   int beginIndex)
Extract byte array representing the binary array which is the value of the RegistrantData RP. The byte array is an encoding of the number of registrants. The header is terminated by a 'space' ASCII character (byte 32) which is not included in the result of this function.

Parameters:
data - byte[] the data which contains the header to extract
beginIndex - int the index at which the header starts in the input array
Returns:
byte[]

readCount

public static int readCount(byte[] bytes)

isRendezvousDone

public boolean isRendezvousDone(EndpointReferenceType rendezvousEndpoint)
                         throws Exception
Pull status from the Rendezvous service/resource.

Parameters:
rendezvousEndpoint - EndpointReferenceType endpoint to query
Returns:
boolean
Throws:
Exception

getRegistrantData

public byte[] getRegistrantData(EndpointReferenceType rendezvousEndpoint)
                         throws Exception
will be null/empty if rdv not complete/done

Throws:
Exception

subscribeForCompletionNotifications

public void subscribeForCompletionNotifications(EndpointReferenceType rendezvousEndpoint,
                                                NotifyCallback notificationCallback)
                                         throws Exception
Susbcribe for notifications on completion of rendezvous. It is possible to use CompletionNotifyCallbackImpl in order to easily implement the notification callback to pass to this method.

Parameters:
rendezvousEndpoint - EndpointReferenceType
notificationCallback - NotifyCallback
Throws:
Exception

subscribeForNotifications

public void subscribeForNotifications(EndpointReferenceType rendezvousEndpoint,
                                      NotifyCallback notificationCallback,
                                      QName topicQName)
                               throws Exception
Throws:
Exception

registerWithRendezvous

public int registerWithRendezvous(EndpointReferenceType rendezvousEndpoint,
                                  byte[] data)
                           throws Exception
Register application binary data with a rendezvous without specifying any desired rank.

Parameters:
rendezvousEndpoint - EndpointReferenceType the endpoint to register with
data - byte[] the input binary data to register
Returns:
int the rank, positive.
Throws:
Exception

registerWithRendezvous

public int registerWithRendezvous(EndpointReferenceType rendezvousEndpoint,
                                  byte[] data,
                                  int desiredRank)
                           throws Exception
Parameters:
rendezvousEndpoint - EndpointReferenceType the endpoint to register with
data - byte[] the input binary data to register
desiredRank - int Can be NO_DESIRED_RANK to indicate no desired rank
Returns:
int the rank. Is >= 0 if the registration succeeded, -1 otherwise.
Throws:
Exception