Revision: 4482 http://unicore.svn.sourceforge.net/unicore/?rev=4482&view=rev Author: bdemuth Date: 2009-04-14 11:02:02 +0000 (Tue, 14 Apr 2009) Log Message: ----------- Modified Paths: -------------- eclipseclient/trunk/plugins/de.fzj.unicore.rcp.servicebrowser/src/main/java/de/fzj/unicore/rcp/servicebrowser/nodes/JobNode.java Modified: eclipseclient/trunk/plugins/de.fzj.unicore.rcp.servicebrowser/src/main/java/de/fzj/unicore/rcp/servicebrowser/nodes/JobNode.java =================================================================== --- eclipseclient/trunk/plugins/de.fzj.unicore.rcp.servicebrowser/src/main/java/de/fzj/unicore/rcp/servicebrowser/nodes/JobNode.java 2009-04-14 10:58:10 UTC (rev 4481) +++ eclipseclient/trunk/plugins/de.fzj.unicore.rcp.servicebrowser/src/main/java/de/fzj/unicore/rcp/servicebrowser/nodes/JobNode.java 2009-04-14 11:02:02 UTC (rev 4482) @@ -93,8 +93,8 @@ else return null; } - - + + public Calendar getNormalizedSubmissionTime() { return getNormalizedTime(getSubmissionTime()); } @@ -104,39 +104,41 @@ */ protected void retrieveChildren() throws Exception { List<Node> newChildren = new ArrayList<Node>(); - JobProperties jobProps = getJobProperties(); - Map<URI, Node> oldChildren = getChildrenMap(); + if(hasCachedResourceProperties()) + { + JobProperties jobProps = getJobProperties(); + Map<URI, Node> oldChildren = getChildrenMap(); - // add working directory - EndpointReferenceType epr = jobProps.getWorkingDirectoryReference(); + // add working directory + EndpointReferenceType epr = jobProps.getWorkingDirectoryReference(); - URI uri = new URI(epr.getAddress().getStringValue()); - if (!oldChildren.containsKey(uri)) { - Node wdso = NodeFactory.createNode(epr); - newChildren.add(wdso); - } else { - newChildren.add(oldChildren.get(uri)); - } - - // storage refs... - StorageReferenceType[] allEntries = jobProps.getStorageReferenceArray(); - for (StorageReferenceType s : allEntries) { - epr = AddressingUtil.newEPR(); - epr.addNewAddress().setStringValue( - s.getStorageEndpointReference().getAddress() - .getStringValue()); - AddressingUtil.addPortType(epr, StorageManagement.SMS_PORT); - uri = new URI(epr.getAddress().getStringValue()); + URI uri = new URI(epr.getAddress().getStringValue()); if (!oldChildren.containsKey(uri)) { - Node storage = NodeFactory.createNode(epr); - newChildren.add(storage); + Node wdso = NodeFactory.createNode(epr); + newChildren.add(wdso); } else { newChildren.add(oldChildren.get(uri)); } - } - updateChildren(newChildren); + // storage refs... + StorageReferenceType[] allEntries = jobProps.getStorageReferenceArray(); + for (StorageReferenceType s : allEntries) { + epr = AddressingUtil.newEPR(); + epr.addNewAddress().setStringValue( + s.getStorageEndpointReference().getAddress() + .getStringValue()); + AddressingUtil.addPortType(epr, StorageManagement.SMS_PORT); + uri = new URI(epr.getAddress().getStringValue()); + if (!oldChildren.containsKey(uri)) { + Node storage = NodeFactory.createNode(epr); + newChildren.add(storage); + } else { + newChildren.add(oldChildren.get(uri)); + } + } + updateChildren(newChildren); + } } @@ -162,10 +164,10 @@ String s = jobProps.getLog().replaceAll("\\\n", newLine); hm.put("Execution Log", s); - + BigInteger exitCode = getExitCode(); if(exitCode != null) hm.put("Exit code", exitCode.toString()); - + Float progress = getExecutionProgress(); if(progress != null && progress > 0) hm.put("Execution progress", progress.toString()); @@ -193,29 +195,29 @@ return (StatusType.Enum) o; else return null; } - + public void setJobStatus(StatusType.Enum status) { putData(PROPERTY_JOB_STATUS, status); } - + public BigInteger getExitCode() { Object o = getData().getProperty(PROPERTY_EXIT_CODE); if (o != null && o instanceof BigInteger) return (BigInteger) o; else return null; } - + public void setExitCode(BigInteger exitCode) { putData(PROPERTY_EXIT_CODE, exitCode); } - + public Float getExecutionProgress() { Object o = getData().getProperty(PROPERTY_EXECUTION_PROGRESS); if (o != null && o instanceof Float) return (Float) o; else return null; } - + public void setExecutionProgress(Float progress) { putData(PROPERTY_EXECUTION_PROGRESS, progress); } @@ -233,7 +235,7 @@ } catch (Exception e) { ServiceBrowserActivator.log(IStatus.WARNING,"Error while retrieving job status", e); } - + try { // store the submission time // do not use the xmlbeans Calendar instance! it cannot be deserialized by xstream. @@ -247,7 +249,7 @@ } return result; } - + public void startJob() { try { @@ -261,8 +263,8 @@ putData(PROPERTY_SUBMISSION_TIME, submissionTime); } - + protected JobProperties getJobProperties() { if(hasCachedResourceProperties()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |