Project

General

Profile

« Previous | Next » 

Revision 8829

convert v2 SM to v1 SM for the v1 service call response

View differences:

src/edu/ucsb/nceas/metacat/dataone/v1/MNodeService.java
315 315
	public SystemMetadata getSystemMetadata(Identifier pid)
316 316
			throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure,
317 317
			NotFound {
318
		return impl.getSystemMetadata(null, pid);
318
		
319
		return this.getSystemMetadata(null, pid);
320
		
319 321
	}
320 322

  
321 323
	@Override
......
323 325
	public SystemMetadata getSystemMetadata(Session session, Identifier pid)
324 326
			throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure,
325 327
			NotFound {
326
		return impl.getSystemMetadata(session, pid);
328
		org.dataone.service.types.v2.SystemMetadata sysMeta = impl.getSystemMetadata(session, pid);
329
		SystemMetadata retSysMeta = null;
330
		try {
331
			retSysMeta = TypeMarshaller.convertTypeFromType(sysMeta, SystemMetadata.class);
332
		} catch (Exception e) {
333
			// report as service failure
334
			ServiceFailure sf = new ServiceFailure("4801", e.getMessage());
335
			sf.initCause(e);
336
			throw sf;
337
		}
338
		return retSysMeta;
327 339
	}
328 340

  
329 341
	@Override

Also available in: Unified diff