edu.indiana.dde.mylead.common
Class MyLeadReplica

java.lang.Object
  extended by edu.indiana.dde.mylead.common.MyLeadReplica

public class MyLeadReplica
extends java.lang.Object

This class is used for both adding and updating replica metadata. The wrap parameters method only wraps those parameters that are not empty (blank for strings, zero for type and port). In case the user wants to clear a value, the class has boolean flags that can set which will include the blank value. The nickname is the unique name, so it cannot be cleared.


Constructor Summary
MyLeadReplica()
          Default constructor for a new replica item.
 
Method Summary
 void clearAll(boolean clearFlag)
          Used to set all of the clear flags to true or false as a batch regardless of their prior setting.
 void clearLastUpdate(boolean clearFlag)
           
 void clearLocation(boolean clearFlag)
           
 void clearPort(boolean clearFlag)
           
 void clearServerUrl(boolean clearFlag)
           
 void clearServiceUrl(boolean clearFlag)
           
 void clearType(boolean clearFlag)
           
 java.lang.String getGlobalId()
          Returns a String with the global ID that was previously set using the setGlobalId method.
 java.util.Date getLastUpdate()
          Returns a Date with the date and time that the replica was last updated as previously set using the setLastUpdate method.
 java.lang.String getLocation()
          Returns a String with the replica location that was previously set using the setLocation method.
 java.lang.String getNickname()
          Returns a String with the nickname that was previously set using the setNickname method.
 int getPort()
          Returns an integer with the access port number that was previously set using the setPort method.
 java.lang.String getServerUrl()
          Returns a String with the server URL that was previously set using the setServerUrl method.
 java.lang.String getServiceUrl()
          Returns a String with the service URL that was previously set using the setServiceUrl method.
 int getType()
          Returns an integer with the type that was previously set using the setType method.
 void setGlobalId(java.lang.String myGlobalId)
          Used to set the global ID for the replica.
 void setLastUpdate(java.util.Date myUpdate, java.lang.String description)
          Used to identify the date and time when the replica was last updated.
 void setLocation(java.lang.String locationStr)
          Used to set the location in the replica definition.
 void setNickname(java.lang.String nameStr)
          Used to set the replica's nickname which should be a unique name for the replica in the myLEAD catalog.
 void setPort(int myPort)
          This method is called to identify the access port for this replica.
 void setServerUrl(java.lang.String urlStr)
          Used to set the server URL for this replica definition.
 void setServiceUrl(java.lang.String urlStr)
          Used to set the String with the replica's service URL.
 void setType(int myType)
          Used to set the type for the replica.
 java.lang.String wrapParameters()
          wrapParameters Wraps up the parameters in an XML fragment for use in an OGSA-DAI perform document used by the myLEAD client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadReplica

public MyLeadReplica()
Default constructor for a new replica item. All of the variables in the class are set to blank if a String or zero if an integer. The properties should be initialized with the set methods before this instance is used to add a replica definitioion to myLEAD.

Method Detail

setNickname

public void setNickname(java.lang.String nameStr)
Used to set the replica's nickname which should be a unique name for the replica in the myLEAD catalog.

Parameters:
nameStr - String with the unique nickname for the replica.

getNickname

public java.lang.String getNickname()
Returns a String with the nickname that was previously set using the setNickname method. If the nickname was not previously set, then an empty string will be returned.

Returns:
String with the nickname that was set for this replica definition.

setServiceUrl

public void setServiceUrl(java.lang.String urlStr)
Used to set the String with the replica's service URL. This method should not be called with a blank string to clear the current setting. to clear the current setting, the clearServiceUrl method should be used.

Parameters:
urlStr - String with the service URL for this replica definition.

getServiceUrl

public java.lang.String getServiceUrl()
Returns a String with the service URL that was previously set using the setServiceUrl method. If the URL was not previously set, then an empty string will be returned.

Returns:
String with the service URL that was set for this replica definition.

setServerUrl

public void setServerUrl(java.lang.String urlStr)
Used to set the server URL for this replica definition. This method should not be called with a blank string to clear the current setting. to clear the current setting, the clearServerUrl method should be used.

Parameters:
urlStr - String with the server URL for this replica definition.

getServerUrl

public java.lang.String getServerUrl()
Returns a String with the server URL that was previously set using the setServerUrl method. If the URL was not previously set, then an empty string will be returned.

Returns:
String with the server URL that was set for this replica definition.

setLocation

public void setLocation(java.lang.String locationStr)
Used to set the location in the replica definition. This method should not be called with a blank string to clear the current setting. To clear the current setting, the clearLocation method should be used.

Parameters:
locationStr - String with the location of the replica.

getLocation

public java.lang.String getLocation()
Returns a String with the replica location that was previously set using the setLocation method. If the location was not previously set, then an empty string will be returned.

Returns:
String with the location that was set for this replica definition.

setType

public void setType(int myType)
Used to set the type for the replica. Currently the only setting is for whether the replica is the master copy or not:
0 = not master
1 = master
This method should not be called with a zero parameter to clear the current setting. To clear the current setting, the clearType method should be used.

Parameters:
myType - integer with the type setting - 1 = master copy, 0 = not master.

getType

public int getType()
Returns an integer with the type that was previously set using the setType method. If the type was not previously set, then the default value of zero indicating not the master copy will be returned.

Returns:
integer with the type that was set for this replica definition.

setPort

public void setPort(int myPort)
This method is called to identify the access port for this replica. This method should not be called with a zero parameter to clear the current setting. To clear the current setting, the clearPort method should be used.

Parameters:
myPort - integer with the port setting.

getPort

public int getPort()
Returns an integer with the access port number that was previously set using the setPort method. If the port was not previously set, then the default value of zero will be returned.

Returns:
integer with the port that was set for this replica definition.

setGlobalId

public void setGlobalId(java.lang.String myGlobalId)
Used to set the global ID for the replica. Each replica must have a global ID that is unique, so there is no clear method for the global ID.

Parameters:
myGlobalId - String with the global ID for this replica.

getGlobalId

public java.lang.String getGlobalId()
Returns a String with the global ID that was previously set using the setGlobalId method. If the ID was not previously set, then an empty string will be returned.

Returns:
String with the global ID that was set for this replica definition.

setLastUpdate

public void setLastUpdate(java.util.Date myUpdate,
                          java.lang.String description)
Used to identify the date and time when the replica was last updated. In addition to a Date parameter, a description parameter is also required, but a blank String can be passed for the decription parameter.

Parameters:
myUpdate - Date containing the date and time when the replica was last updated.
description - String with the description of the update done. This should not exceed 255 characters.

getLastUpdate

public java.util.Date getLastUpdate()
Returns a Date with the date and time that the replica was last updated as previously set using the setLastUpdate method. If the date not previously set then the default value of null is returned.

Returns:
Date with the date and time that the replica defined was last updated.

clearServiceUrl

public void clearServiceUrl(boolean clearFlag)

clearServerUrl

public void clearServerUrl(boolean clearFlag)

clearLocation

public void clearLocation(boolean clearFlag)

clearType

public void clearType(boolean clearFlag)

clearPort

public void clearPort(boolean clearFlag)

clearLastUpdate

public void clearLastUpdate(boolean clearFlag)

clearAll

public void clearAll(boolean clearFlag)
Used to set all of the clear flags to true or false as a batch regardless of their prior setting. There are no clear flags for the replica nickname or global ID.

Parameters:
clearFlag - boolean to indicate whether all of the clear flags should be set to true or false.

wrapParameters

public java.lang.String wrapParameters()
wrapParameters Wraps up the parameters in an XML fragment for use in an OGSA-DAI perform document used by the myLEAD client. For each field, the user can elect to clear the field. For an update, this will clear any existing value. Otherwise, the field is only included if it has a value.

Returns:
String The XML fragment with the replica parameters.