/**
* "Getter" to get a string respresentation for a key for the sub-registry
- * in this format: class:protocol:port
+ * in this format: class:type:port
*
* @param $connectionInstance An instance of a ConnectionHelper class
* @return $key A string representation of the socket for the registry
*/
private function getSubRegistryKey (ConnectionHelper $connectionInstance) {
- // Get protocol and port number and add both together
- $key = sprintf("%s:%s:%s",
+ // Get connection type and port number and add both together
+ $key = sprintf('%s:%s:%s',
$connectionInstance->__toString(),
- $connectionInstance->getProtocolName(),
- $connectionInstance->getPort()
+ $connectionInstance->getConnectionType(),
+ $connectionInstance->getConnectionPort()
);
// Return resulting key
/**
* "Getter" to get a string respresentation of the protocol
*
- * @param $connectionInstance An instance of a ConnectionHelper class
- * @return $key A string representation of the protocol for the registry
+ * @param $connectionInstance An instance of a ConnectionHelper class
+ * @return $key A string representation of the protocol for the registry
*/
- private function getRegistryKeyFromProtocol (ConnectionHelper $connectionInstance) {
+ private function getRegistryKeyFromConnection (ConnectionHelper $connectionInstance) {
// Get the key
$key = $connectionInstance->getProtocolName();
* @param $connectionInstance An instance of a ConnectionHelper class
* @return $isRegistered Whether the protocol is registered
*/
- private function isProtocolRegistered (ConnectionHelper $connectionInstance) {
+ private function isConnectionRegistered (ConnectionHelper $connectionInstance) {
// Get the key
- $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+ $key = $this->getRegistryKeyFromConnection($connectionInstance);
// Determine it
$isRegistered = $this->instanceExists($key);
$isRegistered = FALSE;
// First, check for the instance, there can be only once
- if ($this->isProtocolRegistered($connectionInstance)) {
+ if ($this->isConnectionRegistered($connectionInstance)) {
// That one is found so "get" a registry key from it
- $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+ $key = $this->getRegistryKeyFromConnection($connectionInstance);
// Get the registry
$registryInstance = $this->getInstance($key);
} // END - if
// Does the instance exist?
- if (!$this->isProtocolRegistered($connectionInstance)) {
+ if (!$this->isConnectionRegistered($connectionInstance)) {
// No, not found so we create a sub registry (not needed to configure!)
$registryInstance = SubRegistry::createSubRegistry();
// Now we can create the sub-registry for this protocol
- $this->addInstance($this->getRegistryKeyFromProtocol($connectionInstance), $registryInstance);
+ $this->addInstance($this->getRegistryKeyFromConnection($connectionInstance), $registryInstance);
} else {
// Get the sub-registry back
- $registryInstance = $this->getInstance($this->getRegistryKeyFromProtocol($connectionInstance));
+ $registryInstance = $this->getInstance($this->getRegistryKeyFromConnection($connectionInstance));
}
// Get a key for sub-registries
} // END - if
// Now get the key from the protocol
- $key = $this->getRegistryKeyFromProtocol($connectionInstance);
+ $key = $this->getRegistryKeyFromConnection($connectionInstance);
// And get the registry
$registryInstance = $this->getInstance($key);