]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java
ce08b8f38136d432617b8b7e8abcb2d145c82143
1 package org
.argeo
.slc
.jcr
.execution
;
4 import javax
.jcr
.RepositoryException
;
6 import org
.argeo
.jcr
.JcrUtils
;
7 import org
.argeo
.slc
.SlcException
;
8 import org
.argeo
.slc
.execution
.ExecutionProcess
;
9 import org
.argeo
.slc
.jcr
.SlcNames
;
11 /** Execution process implementation based on a JCR node. */
12 public class JcrExecutionProcess
implements ExecutionProcess
{
13 private final Node node
;
15 public JcrExecutionProcess(Node node
) {
19 public String
getUuid() {
21 return node
.getProperty(SlcNames
.SLC_UUID
).getString();
22 } catch (RepositoryException e
) {
23 throw new SlcException("Cannot get uuid for " + node
, e
);
27 public String
getStatus() {
29 return node
.getProperty(SlcNames
.SLC_STATUS
).getString();
30 } catch (RepositoryException e
) {
31 throw new SlcException("Cannot get uuid for " + node
, e
);
35 public void setStatus(String status
) {
37 node
.setProperty(SlcNames
.SLC_STATUS
, status
);
38 // last modified properties needs to be manually updated
39 // see https://issues.apache.org/jira/browse/JCR-2233
40 JcrUtils
.updateLastModified(node
);
41 node
.getSession().save();
42 } catch (RepositoryException e
) {
44 JcrUtils
.discardQuietly(node
.getSession());
45 } catch (RepositoryException e1
) {
48 throw new SlcException("Cannot get uuid for " + node
, e
);
52 public Node
getNode() {