Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167535 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/messages.properties (-1 / +2 lines)
Lines 13-19 Link Here
13
# NLS_MESSAGEFORMAT_VAR
13
# NLS_MESSAGEFORMAT_VAR
14
# NLS_ENCODING=UTF-8
14
# NLS_ENCODING=UTF-8
15
15
16
MuseRuntime.CANT_CONN.ERROR.=IWAT0758E Cannot connect to WSDM resource
16
MuseRuntime.CANT_CONN.ERROR.=IWAT0758E Cannot connect to WSDM resource because resource does not support Metadata Exchange. Please see stack trace for exception thrown by resource.
17
MuseRuntime.BAD_WSDL.ERROR.=IWAT0882E Cannot connect to WSDM resource because resource returned empty or bad WSDL during Metadata Exchange.
17
MuseRuntime.CANT_CREATE_DISP_NAME.ERROR.=IWAT0759E Cannot create display name
18
MuseRuntime.CANT_CREATE_DISP_NAME.ERROR.=IWAT0759E Cannot create display name
18
MuseRuntime.CANT_INVOKE.ERROR.=IWAT0760E Cannot invoke WSDM operation
19
MuseRuntime.CANT_INVOKE.ERROR.=IWAT0760E Cannot invoke WSDM operation
19
ServiceGroupHelper.NOT_SG_RESOURCE.INFO.=IWAT0761I This resource is not a service group
20
ServiceGroupHelper.NOT_SG_RESOURCE.INFO.=IWAT0761I This resource is not a service group
(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java (-9 / +21 lines)
Lines 48-64 Link Here
48
 	}
48
 	}
49
	
49
	
50
	public boolean connect(String epr) throws Exception {
50
	public boolean connect(String epr) throws Exception {
51
		boolean emptyWSDL = false;
51
		try{
52
		try{
52
			Document doc = XmlUtils.createDocument(epr);
53
			Document doc = XmlUtils.createDocument(epr);
53
			Element eprEl = XmlUtils.getFirstElement(doc);
54
			Element eprEl = XmlUtils.getFirstElement(doc);
54
			_epr = new EndpointReference(eprEl);
55
			_epr = new EndpointReference(eprEl);
55
			_resource = new WsResourceClient(_epr);
56
			_resource = new WsResourceClient(_epr);
56
			
57
			
57
			// try to get the resource properties document to check the connection
58
			// 167535: all WS-resource may not have resource property documents so we cannot
58
			_resource.getResourcePropertyDocument();
59
			// rely on getResourcePropertyDocument as a ping mechanism
60
			// _resource.getResourcePropertyDocument();
61
			// however MAX is guaranteed to work only with resources that support MEX
62
			// hence we will try to get the WSDL using MEX and use that as the ping
63
			MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination());
64
			//mdxClient.setTrace(true);
65
			Element wsdl = mdxClient.getWSDL();
66
			if(wsdl==null){
67
				emptyWSDL=true;
68
				throw new Exception();
69
			}
70
			
59
			//_resource.setTrace(true);
71
			//_resource.setTrace(true);
60
		}catch(Throwable t){
72
		}catch(Throwable t){
61
			MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
73
			if(emptyWSDL){
74
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.BAD_WSDL.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
75
			}else{
76
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
77
			}
62
			return false;
78
			return false;
63
		}
79
		}
64
		return true;
80
		return true;
Lines 157-166 Link Here
157
		if(_resource==null) return null;
173
		if(_resource==null) return null;
158
		// providesCapability works only for WSDM resources, but this has to be a wsdm resource to 
174
		// providesCapability works only for WSDM resources, but this has to be a wsdm resource to 
159
		// have relationships (MUWS Part 2)
175
		// have relationships (MUWS Part 2)
160
		if(!CommonUtils.providesCapability(_resource, MuwsConstants.RELATIONSHIP_RESOURCE_URI)){
176
		/* if(!CommonUtils.providesCapability(_resource, MuwsConstants.RELATIONSHIP_RESOURCE_URI)){
161
			System.out.println("This is not a relationships resource"); //$NON-NLS-1$
177
			System.out.println("This is not a relationships resource"); //$NON-NLS-1$
162
			//throw new Exception("Not a relationship resource");
178
			//throw new Exception("Not a relationship resource");
163
		}
179
		}*/
164
		return _rHelper.getRelationships(_resource);
180
		return _rHelper.getRelationships(_resource);
165
	}
181
	}
166
	
182
	
Lines 168-177 Link Here
168
		if(_resource==null) return null;
184
		if(_resource==null) return null;
169
		
185
		
170
		Element[] els = _resource.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME);
186
		Element[] els = _resource.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME);
171
		if( els == null || els.length <= 0 ){
172
			System.out.println("No topics defined");
173
		}
174
175
		return _tHelper.getTopics(_resource);
187
		return _tHelper.getTopics(_resource);
176
	}
188
	}
177
}
189
}

Return to bug 167535