com.j_spaces.core.client
Class SpaceURL

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by com.j_spaces.core.client.SpaceURL
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Map<Object,Object>

public class SpaceURL
extends Properties
implements Externalizable

SpaceFinder context.

 schema
 The schema property space defines schema name will be used and loaded while 
 creating the space and its container. 
 If the space/container already has configuration file then the requested schema 
 will not be applied and if that file exist, it will overwrite the default 
 configuration defined by the schema. 
 When using the create URL property with java:// protocol, the system will create 
 a container the space and will use the default space and container configuration 
 schema file (default-space-schema.xml and default-container-schema.xml).
 
 Example: when specifying schema=cache then cache-space-schema.xml will be
 used for the space configuration and cache-container-schema.xml 
 will be used for the container configuration.

 cluster_schema
 The cluster_schema property specifies the cluster schema XSL file name to be used
 to setup a cluster config on the fly in memory. 
 If the cluster_schema used - e.g. ?cluster_schema=sync_replicated GigaSpaces will
 use the sync_replicated-cluster-schema.xsl together with user's inputs such as 
 the # of members, # of backup members etc.

 total_members
 The total_members property in the space URL stands for the maximum total active 
 spaces within the cluster.
 This number is used to create the list of members participating in the cluster 
 on the fly based on the space name convention.
 The number of actual running space instances can vary dynamically between 1<=total_members. 
  
 Example: 
 gsInstance "/./mySpace?cluster_schema=partitioned&total_members=4&id=1"

 In case the total_members property is used in Partitioned topology. 
 In partitioned space each instance contains different segment of the total information. 
 With this topology data may be lost once the space is brought down or fails.
 To ensure the high availability of each partition a backup instance is set per partition. 

 Setting up a partitioned space with 2 primary partitions and one backup per primary 
 partition done using the following setup:
 
  Partition 1
  gsInstance "/./mySpace?cluster_schema=partitioned-sync2backup&total_members=2,1&id=1"
 
  Partition 2
  gsInstance "/./mySpace?cluster_schema=partitioned-sync2backup&total_members=2,1&id=2"

  Partition 1 backup
  gsInstance "/./mySpace?cluster_schema=partitioned-sync2backup&total_members=2,1&id=1&backup_id=1"

  Partition 2 backup
  gsInstance "/./mySpace?cluster_schema=partitioned-sync2backup&total_members=2,1&id=2&backup_id=1"

 total_members={number of primary instances, number of backup instances per primary} � 
 e.g., total_members=2,1, means that this cluster contains 2 partitions having one backup instance each.

 The format of the total_members={number of primary instances, number of backup instances per primary}. 
 The backup_id is used to define whether the instance is a backup instance or not. 
 If this attribute is not defined the instance will be considered as a primary instance. 
 
 The number of primary instances nor the number of backup instances per primary, should not be <= 0

 properties
 The properties property allow you to use a properties file to store the URL properties and space,
 container and cluster properties. You may also define system properties using this file. 
 The properties defined as part of the properties file override the schema space/container/cluster 
 values that are defined in the relevant schema file. 
 
 Example:
 gsInstance "/./mySpace?properties=myproperties"

 id
 The id attribute is used to distinguish between the different space members in the cluster. 
 The id can take any value>0. 
 The maximum value for the id property can be the total_memebrs value.

 Examples:
 gsInstance "/./space?schema=cache&cluster_schema=partitioned&total_members=2&id=1&groups=gigaspaces"
 gsInstance "/./space?schema=cache&cluster_schema=partitioned&total_members=2&id=1&groups=gigaspaces"
 
 backup_id
 The backup_id property used with the Partitioned space to form the partitioned 
 with backup topology. 
 The backup_id is used to define whether the instance is a backup instance or not. 
 If this attribute is not defined the instance will be considered as primary space instance. 
 
 Examples:
 gsInstance "/./space?schema=cache&cluster_schema=partitioned-sync2backup&total_members=2,1&id=1&groups=gigaspaces"
 gsInstance "/./space?schema=cache&cluster_schema=partitioned-sync2backup&total_members=2,1&id=2&groups=gigaspaces"
 gsInstance "/./space?schema=cache&cluster_schema=partitioned-sync2backup&total_members=2,1&id=1&backup_id=1&groups=gigaspaces"
 gsInstance "/./space?schema=cache&cluster_schema=partitioned-sync2backup&total_members=2,1&id=2&backup_id=1&groups=gigaspaces"
 
 useLocalCache
 Starts a local cache at the client application process. 
 The local cache will be used to speed up the read operation performance. 

 Example:
 IJSpace space = (IJSpace)SpaceFinder.find("jini://*/./mySpace?useLocalCache")
 

Since:
2.5
See Also:
SpaceFinder, Copyright: GigaSpaces Technologies, Serialized Form

Field Summary
static String ANY
          Represents * symbol.
static HashSet<String> AVAILABLE_PROTOCOLS
          Contains a set of actual space protocols.
static String CACHE_URL_PROP
          This system property can be used when space started using ServiceStarter.
static String CLUSTER_BACKUP_ID
          Used in case of Partitioned Cache (when adding backup to each partition) The backup_id is used to define whether the instance is a backup instance or not.
static String CLUSTER_GROUP
           jini:// multicast support.
static String CLUSTER_MEMBER_ID
          The id attribute is used to distinguish between cache instances in this cluster.
static String CLUSTER_NAME
           jini:// multicast support.
static String CLUSTER_SCHEMA
          The cluster schema XSL file name to be used to setup a cluster config on the fly in memory.
static String CLUSTER_TOTAL_MEMBERS
           The total_members attribute in the space url stands for the total number of space members within the space cluster.
static String CONTAINER
           Container key which holds the container name taken from the space url string
static String CREATE
           java:// protocol support.
static String CUSTOM_PROPERTIES_NAME
          If this key exists it holds a custom Properties object which was passed by the user or was loaded from the [prop-file-name].properties file, parsed and set into SpaceURL.
static String DEFAULT_SCHEMA_NAME
          Default schema name, will be used if schema is not defined.
static String DESTROY
           java:// protocol support.
static String EMBEDDED_SPACE_PROTOCOL
          java:// protocol.
static String FIFO_MODE
           if true FIFO mode enabled.
static String GROUPS
           jini:// multicast support.
static String HOST_NAME
           Host name
static String IGNORE_VALIDATION
          If ignore validation is passed, it means the space url not need to be valid.
static String JINI_PROTOCOL
          jini:// protocol.
static String LOCAL_CACHE_UPDATE_MODE
           DCache update modes: UPDATE_MODE_PULL = 1 UPDATE_MODE_PUSH = 2 Example: jini://localhost:10098/containerName/JavaSpaces?
static String LOCATORS
           jini:// unicast support.
static String MIRROR
           When setting this URL property it will allow the space to connect to the Mirror service to push its data and operations for asynchronous persistency.
static String NO_WRITE_LEASE
           If true � Lease object would not return from the write/writeMultiple operations.
static String PROPERTIES_FILE_NAME
          If properties file name is passed, it means loading the schema and then loading the requested [prop-file-name].properties file which contains the values to override the schema space/container/cluster configuration values that are defined in the schema files.
static String PROPERTIES_SPACE_URL_ARG
          When using properties, one can set the SpaceURL attributes which we break into properties with gs.space.url.arg.
static String PROPERTIES_SPACE_URL_ARGLINE
          When using properties, one can set the SpaceURL attributes line which we break into properties with gs.space.url.arg_line.
static String PROTOCOL_NAME
           Protocol name
static String RMI_PROTOCOL
          rmi:// protocol.
static String SCHEMA_NAME
           Using the schema flag, the requested space schema name will be loaded/parsed while creating an embedded space.
static String SECURITY_MANAGER
           if false SpaceFinder will not initialize java.rmi.RMISecurityManager().
static String SPACE
           Space name
static String STATE
           The state attribute is used to define specified space state.
static String TIMEOUT
           jini:// multicast support.
static int UPDATE_MODE_PULL
           In the UPDATE_MODE_PUSH policy, the cache will be updated with the updated value.
static int UPDATE_MODE_PUSH
           In the UPDATE_MODE_PUSH policy, the updated value is simply marked as invalidated.
static String USE_LOCAL_CACHE
           Initializes local cache.
static String VERSIONED
           if false Optimistic Locking is disabled.
static String VIEWS
           When setting this URL property a view will be created according to the query.
 
Constructor Summary
SpaceURL()
          constructor.
 
Method Summary
 Object clone()
          deep clones this SpaceURL instance - makes a distinct copy of each of the SpaceURL fields, and underlying tables.
static String concatAttrIfNotExist(String spaceURL, String attrName, String attrValue)
           Concatenates if not exist the specified attrName and attrValue to the end of the spaceURL.
 boolean equals(Object obj)
           
 String getClusterSchema()
          Gets the cluster schema name.
 String getContainerName()
          Get container name.
 Properties getCustomProperties()
          Returns custom properties
 String getHost()
          Gets URL host.
 String getMemberName()
           
 String getProperty(String key)
          Retrieves space URL property.
 String getProperty(String key, String defaultValue)
          Retrieves space URL property or default value.
 String getProtocol()
          Returns SpaceFinder protocol.
 String getSchema()
          Gets the space and container schema name.
 String getSpaceName()
          Gets Space name.
static HashSet<String> getSpaceUrlAttributes()
          Gets a list of all the available space url attributes keys.
 String getURL()
          Gets URL.
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 void setContainerName(String containerName)
          Sets container name in SpaceURL and in the ContainerName GenericEntry
 void setCustomProperties(Properties customProperties)
          Set custom properties
 void setElectionState(String electionState)
          Sets the active election state lookup attribute.
 void setPropertiesForSpaceProxy(IJSpace spaceProxy)
          Set SpaceURL properties for desired space proxy.
 void setPropertiesPrefix(String protocolName, String hostAndPort, String containerName, String spaceName)
          Sets the space url "left"/prefix part of the url.
 SpaceURL setProperty(String spaceURLKey, String spaceURLValue)
           
 void setSpaceName(String spaceName)
          Sets space name in SpaceURL and into the Name Entry which is later used in LookupFinder.
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.util.Properties
list, list, load, loadFromXML, propertyNames, save, store, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY

public static final String ANY
Represents * symbol.

See Also:
Constant Field Values

JINI_PROTOCOL

public static final String JINI_PROTOCOL
jini:// protocol.

See Also:
Constant Field Values

RMI_PROTOCOL

public static final String RMI_PROTOCOL
rmi:// protocol.

See Also:
Constant Field Values

EMBEDDED_SPACE_PROTOCOL

public static final String EMBEDDED_SPACE_PROTOCOL
java:// protocol.

See Also:
Constant Field Values

AVAILABLE_PROTOCOLS

public static final HashSet<String> AVAILABLE_PROTOCOLS
Contains a set of actual space protocols.


GROUPS

public static final String GROUPS
 jini:// multicast support.
 LookupService group to find Container or Space using multicast jini:// protocol.
 This attribute will be ignored in unicast protocol jini://lookuphost/containerName/JavaSpaces,
 
 Example:
 jini://*/containerName/?groups=fenix,pantera
 jini://*/containerName/spaceName?groups=grid
 Default: public
 

See Also:
Constant Field Values

LOCATORS

public static final String LOCATORS
 jini:// unicast support.
 The comma delimited Jini Locators list.
 This list will be used in the LookupLocators unicast registration for the container/space.
 When creating a space using SpaceFinder:
 SpaceFinder.find("/./Space?groups=g1,g2,g3&locators=h1:port,h2:port,h3:port). 
 The locators property value will override the  container schema value.
 When client discovers a space:
 The locators URL property should be used to perform unicast LUS discovery. 
 To enable both multicast and unicast discovery the following Space URL should be used.
 SpaceFinder.find("jini:////Space?groups=g1,g2,g3&locators=h1:port,h2:port,h3:port).
 

See Also:
Constant Field Values

CLUSTER_NAME

public static final String CLUSTER_NAME
 jini:// multicast support.
 LookupService attribute to find Space using multicast jini:// protocol in specified cluster.
 This attribute will be ignored in unicast protocol jini://lookuphost/containerName/JavaSpaces,
 
 Example:
 jini://*/containerName/JavaSpaces?clustername=myClusterTest
 
 Find JavaSpaces in myClusterTest, doesn't matter which container name.
 jini://*/*/JavaSpaces?clustername=myClusterTest
 
 Find any space in myClusterTest, doesn't matter which container name and space name.
 jini://*/*/*?clustername=myClusterTest
 
 Default: null
 

See Also:
Constant Field Values

CLUSTER_GROUP

public static final String CLUSTER_GROUP
 jini:// multicast support.
 Clustered group to find Container or Space using multicast jini:// protocol.
 This attribute will be ignored in unicast protocol jini://lookuphost/containerName/JavaSpaces,
 
 Example:
 jini://*/containerName/?clustergroup=fenix,pantera
 jini://*/containerName/JavaSpaces?clustergroup=test
 Default: null
 

See Also:
Constant Field Values

TIMEOUT

public static final String TIMEOUT
 jini:// multicast support.
 The maximum timeout in ms to find Container or Space using multicast jini:// protocol.
 This attribute will be ignored in unicast protocol jini://lookuphost/containerName/JavaSpaces,

 Example:
 jini://*/containerName/?timeout=5000
 jini://*/containerName/JavaSpaces?timeout=10000
 Default: 5000 ms
 

See Also:
Constant Field Values

FIFO_MODE

public static final String FIFO_MODE
 if true FIFO mode enabled.
 Example: jini://localhost:10098/containerName/JavaSpaces?fifo
 Default: false
 

See Also:
Constant Field Values

DESTROY

public static final String DESTROY
 java:// protocol support.
 if true the requested Space will be destroyed in container,
 otherwise will be thrown com.j_spaces.core.DestroyedFailedException
 if the space doesn't exist in container.
  
 Example: java://localhost:10098/containerName/JavaSpaces?destroy
 Default: false
 

See Also:
Constant Field Values

CREATE

public static final String CREATE
 java:// protocol support.
 if true a new Space will be created,
 if requested space already exists in container create operation will be ignored.
 Example: java://localhost:10098/containerName/JavaSpaces?create
 
 Note that when using the ?create option with java:// protocol, the system 
 will create a container, space and use the default space configuration schema file (default-schema.xml)
 same as using for example:
 Example: java://localhost:10098/containerName/JavaSpaces?create?schema=default
 
 if false no new space will be created. The system will return the 
 space proxy which has same container name. In this case we do NOT match on the SpaceURL objects
 equals.
 
 Default: false
 

See Also:
Constant Field Values

USE_LOCAL_CACHE

public static final String USE_LOCAL_CACHE
 Initializes local cache.
 Example: jini://localhost:10098/containerName/JavaSpaces?useLocalCache
 Default: not initialized 
 

See Also:
Constant Field Values

LOCAL_CACHE_UPDATE_MODE

public static final String LOCAL_CACHE_UPDATE_MODE
 DCache update modes:
 UPDATE_MODE_PULL = 1
 UPDATE_MODE_PUSH = 2
 
 Example: jini://localhost:10098/containerName/JavaSpaces?useLocalCache&updateMode=1

 Default: UPDATE_MODE_PULL.
 

See Also:
Constant Field Values

UPDATE_MODE_PULL

public static final int UPDATE_MODE_PULL
 In the UPDATE_MODE_PUSH policy,
 the cache will be updated with the updated value.
 

See Also:
DCacheSpaceImpl, Constant Field Values

UPDATE_MODE_PUSH

public static final int UPDATE_MODE_PUSH
 In the UPDATE_MODE_PUSH policy, the updated value is simply marked as invalidated.
 Any attempt to retrieve an object from the cache,
 will enforce a reload of the updated value from the master cache.
 

See Also:
DCacheSpaceImpl, Constant Field Values

VERSIONED

public static final String VERSIONED
 if false Optimistic Locking is disabled.
 Example: jini://localhost:10098/containerName/JavaSpaces?versioned
 Default: false 
 

See Also:
Constant Field Values

SECURITY_MANAGER

public static final String SECURITY_MANAGER
 if false SpaceFinder will not initialize java.rmi.RMISecurityManager().
 Example: jini://localhost:10098/containerName/JavaSpaces?securityManager
 Default: true
 

See Also:
Constant Field Values

NO_WRITE_LEASE

public static final String NO_WRITE_LEASE
 If true � Lease object would not return from the write/writeMultiple operations.
 Default: false
 

See Also:
Constant Field Values

MIRROR

public static final String MIRROR
 When setting this URL property it will allow the space to connect to the Mirror 
 service to push its data and operations for asynchronous persistency.
 Example: /./JavaSpace?cluster_schema=sync_replicated&mirror
 Default: no mirror connection
 

See Also:
Constant Field Values

VIEWS

public static final String VIEWS
 When setting this URL property a view will be created according to the query.
 The views value can include a list of queries separated by ";".
 Query structure: Class-Name:SQL-Where-clause 
 The SQL-Where-clause should keep the com.j_spaces.core.client.view.View rules.
 Notice: views are only supported in conjuction with useLocalCache.
 Example: /./JavaSpace?useLocalCache&views={MyEntry:fieldA=3;UserEntry:fieldB=3 AND fieldC=2}
 Default: no views
 

See Also:
View, Constant Field Values

SCHEMA_NAME

public static final String SCHEMA_NAME
 Using the schema flag, the requested space schema name will be loaded/parsed
 while creating an embedded space. If the space already has configuration file
 then the requested schema will not be applied and the that file exist, it will
 overwrite the default configuration defined by the schema.
 
 Note that when using the option ?create with java:// protocol, the system 
 will create a container, space and use the default space configuration schema file (default-schema.xml) 
 

See Also:
Constant Field Values

DEFAULT_SCHEMA_NAME

public static final String DEFAULT_SCHEMA_NAME
Default schema name, will be used if schema is not defined.

See Also:
SCHEMA_NAME, Constant Field Values

CLUSTER_SCHEMA

public static final String CLUSTER_SCHEMA
The cluster schema XSL file name to be used to setup a cluster config on the fly in memory. If the ?cluster_schema option is passed e.g. ?cluster_schema=sync_replication the system will use the sync_replication-cluster-schema.xsl together with a cluster Dom which will be built using user's inputs on regards # of members, # of backup members etc.

See Also:
Constant Field Values

CLUSTER_TOTAL_MEMBERS

public static final String CLUSTER_TOTAL_MEMBERS
 The total_members attribute in the space url stands for 
 the total number of space members within the space cluster. 
 The number is used to create the list of members participating in the cluster on the fly 
 based on the space name convention. 
 This pattern is used to avoid the need for creating a cluster topology file. 
 The number of actual running space instances can vary dynamically between 1<=total_members.
 
 Example:
 SpaceFinder.find(/./mySpace?cluster_schema=partitioned&total_members=4&id=1);
 
 In case it is used in Partitioned Space (when adding backup to each partition).
 In partitioned space each instance contains different segment of the total information. 
 That information may be lost once a space is brought down or fails. 
 To  ensure the high availability of each partition a backup instance is set per partition. 
 Setting up a partitioned space with backup instances will be done using the following command:
 For Member1:
 SpaceFinder.find(/./mySpace?cluster_schema=partitioned&total_members=4,2&id=1);
 For Member 1 backup 1: 
 SpaceFinder.find(/./mySpace?cluster_schema=partitioned&total_members=4,2&id=2&backup_id=1);
 For Member 2 backup 2: 
 SpaceFinder.find(/./mySpace?cluster_schema=partitioned&total_members=4,2&id=2&backup_id=2);
  
 The format of the 
 total_members={number of primary instances, number of backup instances per primary} 
 In this example the value is 4,2 which means that this cluster contains 
 up to 4 primary instances each containing 2 backup instances.
 The backup_id is used to define whether the instance is a backup instance or not. 
 If this attribute is not defined the instance will be considered a primary instance.
 The container name will be translated in this case to [space name]_container[id]_[backup_id]. 
 In this case it will be expanded to mySpace_container1_1
 

See Also:
Constant Field Values

CLUSTER_BACKUP_ID

public static final String CLUSTER_BACKUP_ID
Used in case of Partitioned Cache (when adding backup to each partition) The backup_id is used to define whether the instance is a backup instance or not. If this attribute is not defined the instance will be considered a primary space instance. The container name will be translated in this case to [space name]_container[id]_[backup_id]. In this case it will be expanded to mySpace_container1_1.

See Also:
Constant Field Values

CLUSTER_MEMBER_ID

public static final String CLUSTER_MEMBER_ID
The id attribute is used to distinguish between cache instances in this cluster.

See Also:
Constant Field Values

PROPERTIES_FILE_NAME

public static final String PROPERTIES_FILE_NAME
If properties file name is passed, it means loading the schema and then loading the requested [prop-file-name].properties file which contains the values to override the schema space/container/cluster configuration values that are defined in the schema files. Another benefit of using the ?properties option is when we want to load system properties while VM starts or set SpaceURL attributes. See /config/gs.properties file as a reference.

See Also:
Constant Field Values

CUSTOM_PROPERTIES_NAME

public static final String CUSTOM_PROPERTIES_NAME
If this key exists it holds a custom Properties object which was passed by the user or was loaded from the [prop-file-name].properties file, parsed and set into SpaceURL.

See Also:
Constant Field Values

CACHE_URL_PROP

public static final String CACHE_URL_PROP
This system property can be used when space started using ServiceStarter.

See Also:
Constant Field Values

PROPERTIES_SPACE_URL_ARG

public static final String PROPERTIES_SPACE_URL_ARG
When using properties, one can set the SpaceURL attributes which we break into properties with gs.space.url.arg. where attribute name = cluster_schema | schema | total_members etc. The space url args should be in a lower case.

See Also:
Constant Field Values

PROPERTIES_SPACE_URL_ARGLINE

public static final String PROPERTIES_SPACE_URL_ARGLINE
When using properties, one can set the SpaceURL attributes line which we break into properties with gs.space.url.arg_line. The value will be a lower cased url e.g. gs.space.url.arg_line=schema=persistent&id=2&total_members=3&cluster_schema=sync-replicated

See Also:
Constant Field Values

IGNORE_VALIDATION

public static final String IGNORE_VALIDATION
If ignore validation is passed, it means the space url not need to be valid. The class SpaceUrlValidation will ignore and wouldn't check the Url. The default is false : to check the url validation

See Also:
Constant Field Values

CONTAINER

public static final String CONTAINER
 Container key which holds the container name taken from the space url string  
 

See Also:
Constant Field Values

STATE

public static final String STATE
 The state attribute is used to define specified space state.
 Example: jini://*/*/*?clustername=cluster&clustergroup=group&state=started

See Also:
, Constant Field Values

SPACE

public static final String SPACE
 Space name 
 

See Also:
Constant Field Values

HOST_NAME

public static final String HOST_NAME
 Host name 
 

See Also:
Constant Field Values

PROTOCOL_NAME

public static final String PROTOCOL_NAME
 Protocol name 
 

See Also:
Constant Field Values
Constructor Detail

SpaceURL

public SpaceURL()
constructor.

Method Detail

getProtocol

public String getProtocol()
Returns SpaceFinder protocol.

Returns:
SpaceFinder protocol.

getMemberName

public String getMemberName()
Returns:
the member name - containerName:spaceName

getSpaceUrlAttributes

public static HashSet<String> getSpaceUrlAttributes()
Gets a list of all the available space url attributes keys.

Returns:
List of all the available space url attributes keys in lower case E.g. create, schema, cluster_schema. NoWriteLease, fifo etc.

getHost

public String getHost()
Gets URL host.

Returns:
URL host, or * if hostname is not defined

setPropertiesPrefix

public void setPropertiesPrefix(String protocolName,
                                String hostAndPort,
                                String containerName,
                                String spaceName)
Sets the space url "left"/prefix part of the url. In other words, it enables you to set all besides the url attributes, which are right side of the ? separator (is such exists). The method is used with an existing SpaceURL instance and with conjunction with the setProperty(String, String) method. Possible usage: If the spaceURL begins with jini://localhist/mySpace_container/mySpace?schema=cache&timeout=3000 and we want just to replace the properties prefix and keep the rest i.e. jini://*/*/*?schema=cache&timeout=3000 Then you need to call: spaceURL.setPropertiesPrefix(SpaceURL.JINI_PROTOCOL, SpaceURL.ANY, SpaceURL.ANY, SpaceURL.ANY);

Parameters:
protocolName - - if unknown protocol then will use Jini as a fallback
hostAndPort - - host:port, might be * if Jini://
containerName - - might be * if Jini://
spaceName - - might be * if Jini://

getContainerName

public String getContainerName()
Get container name.

Returns:
container name, or * if container name is not defined

setContainerName

public void setContainerName(String containerName)
Sets container name in SpaceURL and in the ContainerName GenericEntry

Parameters:
containerName -

setSpaceName

public void setSpaceName(String spaceName)
Sets space name in SpaceURL and into the Name Entry which is later used in LookupFinder.

Parameters:
spaceName -

setElectionState

public void setElectionState(String electionState)
Sets the active election state lookup attribute.

Parameters:
electionState - String representation of an election state.
See Also:
ElectionState

getSpaceName

public String getSpaceName()
Gets Space name.

Returns:
Space name

getURL

public String getURL()
Gets URL.

Returns:
entire SpaceFinder URL

getProperty

public String getProperty(String key)
Retrieves space URL property. Example: String groupName = spaceUrl.getProperty( SpaceURL.GROUPS );

Overrides:
getProperty in class Properties
Parameters:
key - SpaceURL constant property.
Returns:
space URL property

getProperty

public String getProperty(String key,
                          String defaultValue)
Retrieves space URL property or default value. Example: String groupName = spaceUrl.getProperty( SpaceURL.GROUPS );

Overrides:
getProperty in class Properties
Parameters:
key - SpaceURL constant property.
defaultValue - default value if key not found
Returns:
space URL property or default value

getClusterSchema

public String getClusterSchema()
Gets the cluster schema name.

Returns:
Cluster Schema name

getSchema

public String getSchema()
Gets the space and container schema name.

Returns:
Space and container schema name

setPropertiesForSpaceProxy

public void setPropertiesForSpaceProxy(IJSpace spaceProxy)
Set SpaceURL properties for desired space proxy.

Parameters:
spaceProxy - Space proxy.

concatAttrIfNotExist

public static String concatAttrIfNotExist(String spaceURL,
                                          String attrName,
                                          String attrValue)
 Concatenates if not exist the specified attrName and attrValue to the end of the spaceURL.
 For i.e: SpaceURL.concatAttrIfNotExist( "rmi://localhost/myCont/mySpace", timeout, 10000)
 The return value is: rmi://localhost/myCont/mySpace?timeout=10000 
 

Parameters:
spaceURL - The space URL.
attrName - The attribute name.
attrValue - The attribute value (can be null, in case no value is required).
Returns:
The new concatenated SpaceFinder URL.

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map<Object,Object>
Overrides:
equals in class Hashtable<Object,Object>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<Object,Object>
Overrides:
hashCode in class Hashtable<Object,Object>

getCustomProperties

public Properties getCustomProperties()
Returns custom properties

Returns:
custom properties

setCustomProperties

public void setCustomProperties(Properties customProperties)
Set custom properties

Parameters:
customProperties - customProperties

setProperty

public SpaceURL setProperty(String spaceURLKey,
                            String spaceURLValue)
Overrides:
setProperty in class Properties

toString

public String toString()
Overrides:
toString in class Hashtable<Object,Object>

clone

public Object clone()
deep clones this SpaceURL instance - makes a distinct copy of each of the SpaceURL fields, and underlying tables. Basically overrides Hashtable.clone() method, which creates only a shallow copy.

Overrides:
clone in class Hashtable<Object,Object>
Returns:
a distinct copy of this SpaceURL (including all object references).
See Also:
IOUtils.deepClone(Object)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException