Community
Participate
Working Groups
Build ID: COSMOS-1.0.0-200804270312 Steps To Reproduce: 1.Install COSMOS Componets as per wiki http://wiki.eclipse.org/COSMOS_DEMO_i10#Installation 2.open <cosmos-demo>/bin/cosmos-client>cosmos-client.sh, register all DataManagers 3.Now try to deregister with invalid host or non-existing datamanager Result: - No error message, instead it displays successful message as ""DataManager deregistered" Also, if we try to deregister multiple times again and again on same datamanager, also shows same message as "DataManager deregistered" More information:
Also, de-registration doesn't work if we give IP address instead of hostname. It work's only with the hostname that appears in the result of "broker getDataManagers"
I would characterize the problem as a need to have a better return code and message. Possible return states are: 1. data manager is deregistered 2. the data manager requested to be deregistered was not registered at the broker 3. (unexpected) errors occurred while deregistering data manager For comment #1, the broker would not know the IP address of the data manager if it was registered with the host name.
Java design patterns don't normally employ return codes. Instead failure states are implemented as custom exceptions. For example... public void deRegisterManager(String aName) throws UnknownDataManagerException, DeRegistrationFailedException, UnknownIPAddressException; (In reply to comment #2) > I would characterize the problem as a need to have a better return code and > message. > Possible return states are: > 1. data manager is deregistered > 2. the data manager requested to be deregistered was not registered at the > broker > 3. (unexpected) errors occurred while deregistering data manager > For comment #1, the broker would not know the IP address of the data manager if > it was registered with the host name.
I was referring to content of the SOAP message returned by the broker. The client can throw exceptions when a fault is received.
The broker now returns a web-defined constant in the SOAP response to indicate the status of the registration or deregistration operation. The broker client APIs have changed to indicate the operation results and exceptions. /** * Register a group of services with the broker. * @param group * @return true if the group is registered, * false if a group with the same identity has already been registered. * @throws BrokerDatabaseException unexpected errors occurred */ public boolean registerGroup(Group group) throws BrokerException; /** * Deregister a service group at the broker. * @param hostname Hostname of the server that hosts the service group * @param groupName The name of the service group. * @return true if deregistration is successful, false if the group identified does not exist on the broker. * @throws BrokerDatabaseException unexpected error occurred */ public boolean deregisterGroup(String hostname, String groupName) throws BrokerException;
Hubert, From my below testing, I can see proper broker return codes in SOAP Response messages, however I don't see proper messages on COSMOS Command Line Client console. Don't we need fix to COSMOS Client to display appropriate message based on SOAP response ? Broker Registration: =================== 1) COSMOS> broker register ExampleMdr Registering ExampleMdr SOAP Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:registerGroupResponse xmlns:ns="http://www.eclipse.org/cosmos/broker">REGISTRATION_SUCCESSFUL</ns:registerGroupResponse></soapenv:Body></soapenv:Envelope> 2) COSMOS> broker register ExampleMdr Registering ExampleMdr SOAP Response: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:registerGroupResponse xmlns:ns="http://www.eclipse.org/cosmos/broker">REGISTRATION_DUPLICATED_SERVICE</ns:registerGroupResponse></soapenv:Body></soapenv:Envelope> Broker Deregistration: ===================== 1) COSMOS> broker deregister domsr01-xp ExampleMdr DataManager deregistered. SOAP Response: <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body><ns:deregisterGroupResponse xmlns:ns="http://www.eclipse.org/cosmos/broker">DEREGISTRATION_SUCCESSFUL</ns:deregisterGroupResponse> </soapenv:Body></soapenv:Envelope> 2) COSMOS> broker deregister domsr01-xp mymdr DataManager deregistered. COSMOS> SOAP Response: <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body><ns:deregisterGroupResponse xmlns:ns="http://www.eclipse.org/cosmos/broker">DEREGISTRATION_FAILED</ns:deregisterGroupResponse> </soapenv:Body></soapenv:Envelope>
Srinivas, Yes, the command line client need to change to display a message that reflect the status of the operation. I will open a bug for this problem. Thanks.
This is resolved and verified long back, Closing it as part of cleanup.