org.globus.wsrf.impl.servicegroup.client
Class ServiceGroupRegistrationClient

java.lang.Object
  extended byorg.globus.wsrf.impl.servicegroup.client.ServiceGroupRegistrationClient

public class ServiceGroupRegistrationClient
extends Object

This class is a client library to manage registrations to WS-ServiceGroups. The term 'managed registration' is used to refer to a registration managed by this client.
Managed registrations come into existence in two ways:

The list of managed registrations may be specified through a combination of the above two methods.
Once a managed registration has been created in the client, the client will attempt to ensure that a corresponding ServiceGroupEntry always exists, as follows:
The client will create a ServiceGroupEntry in the appropriate WS-ServiceGroup. It will then periodically attempt WS-ResourceLifetime lifetime extension on the ServiceGroupEntry. If the client detects that the ServiceGroupEntry is no longer available, it will create a new one.
When operating inside a container, there is a distinguished instance of this client that is configured to register to the default MDS index service running in that container. This is intended to allow easy registration of interesting (from an MDS perspective) resources into MDS hierarchies.


Field Summary
 boolean isDebug
           
 boolean outputToConsole
           
static String TAG_NS
           
static String TAG_PARAMS
           
static String TAG_REG_EPR
           
static String TAG_SEC_DESC
           
static String TAG_SG_EPR
           
 
Constructor Summary
ServiceGroupRegistrationClient()
          Creates a new instance of ServiceGroupRegistrationClient
ServiceGroupRegistrationClient(org.globus.wsrf.client.BaseClient baseClient)
          Creates an instance of the client library backed by an instance of a BaseClient derived command line class, inheriting its command line parameters and redirecting output to the console accordingly.
 
Method Summary
 void finalize()
           
 void flushOutput()
          Flushes the current list of registered EPRs to a specified file.
 ServiceGroupRegistrationClientCallback getClientCallback()
          Gets the instance of the ServiceGroupRegistrationClientCallback that is to receive registration status messages.
static ServiceGroupRegistrationClient getContainerClient()
          This should only be called when running within a container
 EndpointReferenceType getDefaultServiceGroupEPR()
           
 org.globus.mds.servicegroup.client.EndpointReferenceTypeArray getEPRArray(String fileName)
           
static EndpointReferenceType getIndexEPR()
           
 String getOutputFilename()
          Gets the location of a output file where currently registered EPRs are written.
 EndpointReferenceType getRegistrantEPR()
           
 void processConfigFile(String fileName)
          Parses the config file for registration entries to process.
static org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters readParams(String filename)
          A helper method for reading a params block from a file.
static commonj.timers.Timer register(EndpointReferenceType epr, String regFile)
           
static commonj.timers.Timer register(org.globus.wsrf.ResourceContext ctx, EndpointReferenceType epr, String regFile)
           
 commonj.timers.Timer register(org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters params)
          Create new managed registration using the supplied registration parameters.
 commonj.timers.Timer register(org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters params, long delayMillis)
          Create new managed registration using the supplied registration parameters.
 void setClientCallback(ServiceGroupRegistrationClientCallback callback)
          Sets the instance of a ServiceGroupRegistrationClientCallback that is to receive registration status messages.
 void setDefaultEPR(EndpointReferenceType defaultEPR)
          Deprecated. use setDefaultServiceGroupEPR instead
 void setDefaultSecDescFile(String f)
          Sets the default security descriptor filename for registrations that have a null security descriptor filename.
 void setDefaultServiceGroupEPR(EndpointReferenceType epr)
          Sets the service group EPR for registrations that have a null servicegroup field.
 void setInitialDelay(int d)
           
 void setMultipleTerminationTime(org.globus.mds.servicegroup.client.EndpointReferenceTypeArray eprArray, Calendar newTermTime, int delay)
           
 void setOutputFilename(String outputFilename)
          Sets the location of a output file where currently registered EPRs are written.
 void setRegistrantEPR(EndpointReferenceType epr)
          Sets the default registrant EPR for registrations that have a null registrant field.
protected  void setSecurityProperties(Stub port)
           
protected  void setSecurityProperties(Stub port, String secDescFile)
           
 void terminate()
          Use caution when calling the terminate method, as this method will cause ALL registration timer events to be canceled.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isDebug

public boolean isDebug

outputToConsole

public boolean outputToConsole

TAG_SG_EPR

public static final String TAG_SG_EPR
See Also:
Constant Field Values

TAG_REG_EPR

public static final String TAG_REG_EPR
See Also:
Constant Field Values

TAG_SEC_DESC

public static final String TAG_SEC_DESC
See Also:
Constant Field Values

TAG_PARAMS

public static final String TAG_PARAMS
See Also:
Constant Field Values

TAG_NS

public static final String TAG_NS
See Also:
Constant Field Values
Constructor Detail

ServiceGroupRegistrationClient

public ServiceGroupRegistrationClient()
Creates a new instance of ServiceGroupRegistrationClient


ServiceGroupRegistrationClient

public ServiceGroupRegistrationClient(org.globus.wsrf.client.BaseClient baseClient)
Creates an instance of the client library backed by an instance of a BaseClient derived command line class, inheriting its command line parameters and redirecting output to the console accordingly.

Method Detail

setOutputFilename

public void setOutputFilename(String outputFilename)
Sets the location of a output file where currently registered EPRs are written.

Since:
GT4.1.0

getOutputFilename

public String getOutputFilename()
Gets the location of a output file where currently registered EPRs are written.

Since:
GT4.1.0

flushOutput

public void flushOutput()
Flushes the current list of registered EPRs to a specified file.

Since:
GT4.1.0

setClientCallback

public void setClientCallback(ServiceGroupRegistrationClientCallback callback)
Sets the instance of a ServiceGroupRegistrationClientCallback that is to receive registration status messages.

Since:
GT4.0.0

getClientCallback

public ServiceGroupRegistrationClientCallback getClientCallback()
Gets the instance of the ServiceGroupRegistrationClientCallback that is to receive registration status messages.

Since:
GT4.0.0

setDefaultEPR

public void setDefaultEPR(EndpointReferenceType defaultEPR)
Deprecated. use setDefaultServiceGroupEPR instead


setDefaultServiceGroupEPR

public void setDefaultServiceGroupEPR(EndpointReferenceType epr)
Sets the service group EPR for registrations that have a null servicegroup field.

Since:
GT3.9.4

getDefaultServiceGroupEPR

public EndpointReferenceType getDefaultServiceGroupEPR()
Since:
GT3.9.5

setRegistrantEPR

public void setRegistrantEPR(EndpointReferenceType epr)
Sets the default registrant EPR for registrations that have a null registrant field.

Since:
GT3.9.4

getRegistrantEPR

public EndpointReferenceType getRegistrantEPR()
Since:
GT3.9.5

setDefaultSecDescFile

public void setDefaultSecDescFile(String f)
Sets the default security descriptor filename for registrations that have a null security descriptor filename.

Since:
GT3.9.4

setInitialDelay

public void setInitialDelay(int d)

processConfigFile

public void processConfigFile(String fileName)
                       throws Exception
Parses the config file for registration entries to process. The config file entry format is a series of configuration elements:
TODO: Define this config file format completely in XSD rather than performing the deserialisation partly ourselves.
TODO: shorter name for ServiceGroupRegistrationParameters, eg registration

Parameters:
fileName - the name of the configuration file to process
Throws:
Exception - if there is an error during processing of the file

register

public commonj.timers.Timer register(org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters params,
                                     long delayMillis)
Create new managed registration using the supplied registration parameters.

Parameters:
params - registration parameters
delayMillis - the delay in milliseconds before executing the request.

register

public commonj.timers.Timer register(org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters params)
Create new managed registration using the supplied registration parameters. The registration will be made immediately (but asynchronously.

Parameters:
params - registration parameters

terminate

public void terminate()
Use caution when calling the terminate method, as this method will cause ALL registration timer events to be canceled. In particular, excercise caution when calling terminate on the ServiceGroupRegistrationClient instance returned from the static getContainerClient method.


finalize

public void finalize()

setSecurityProperties

protected void setSecurityProperties(Stub port,
                                     String secDescFile)

setSecurityProperties

protected void setSecurityProperties(Stub port)

getEPRArray

public org.globus.mds.servicegroup.client.EndpointReferenceTypeArray getEPRArray(String fileName)
                                                                          throws Exception
Throws:
Exception

setMultipleTerminationTime

public void setMultipleTerminationTime(org.globus.mds.servicegroup.client.EndpointReferenceTypeArray eprArray,
                                       Calendar newTermTime,
                                       int delay)

getContainerClient

public static ServiceGroupRegistrationClient getContainerClient()
This should only be called when running within a container


getIndexEPR

public static EndpointReferenceType getIndexEPR()
                                         throws MalformedURLException,
                                                IOException,
                                                URI.MalformedURIException
Throws:
MalformedURLException
IOException
URI.MalformedURIException

readParams

public static org.globus.mds.servicegroup.client.ServiceGroupRegistrationParameters readParams(String filename)
                                                                                        throws Exception
A helper method for reading a params block from a file. This is intended to be used to pull in a skeleton registration block by a service prior to populating any run-time defined fields.

Throws:
Exception
Since:
GT3.9.5

register

public static commonj.timers.Timer register(EndpointReferenceType epr,
                                            String regFile)
                                     throws Exception
Throws:
Exception

register

public static commonj.timers.Timer register(org.globus.wsrf.ResourceContext ctx,
                                            EndpointReferenceType epr,
                                            String regFile)
                                     throws Exception
Throws:
Exception


Copyright © 1999-2006 University of Chicago. All rights reserved.