]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedRequest.java
990d2ae45b60db179abbe89ce6990cede5b6f926
[gpl/argeo-slc.git] / runtime / org.argeo.slc.detached / src / main / java / org / argeo / slc / detached / DetachedRequest.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.detached;
18
19 import java.util.Properties;
20
21 /** A request sent to the detached server. */
22 public class DetachedRequest implements DetachedCommunication {
23 static final long serialVersionUID = 1l;
24
25 private String uuid;
26 private Properties properties = new Properties();
27 private String ref;
28 private String path = "";
29
30 private Object cachedObject = null;
31
32 public DetachedRequest() {
33
34 }
35
36 public DetachedRequest(String uuid) {
37 this.uuid = uuid;
38 }
39
40 /** The properties configuring this request. */
41 public Properties getProperties() {
42 return properties;
43 }
44
45 public void setProperties(Properties inputParameters) {
46 this.properties = inputParameters;
47 }
48
49 /**
50 * A reference to the underlying implementation which will process the
51 * request.
52 */
53 public String getRef() {
54 return ref;
55 }
56
57 public void setRef(String stepRef) {
58 this.ref = stepRef;
59 }
60
61 /** A path identifying the request within its source context. */
62 public String getPath() {
63 return path;
64 }
65
66 public void setPath(String path) {
67 this.path = path;
68 }
69
70 /** The unique identifier of this request. */
71 public String getUuid() {
72 return uuid;
73 }
74
75 public void setUuid(String uuid) {
76 this.uuid = uuid;
77 }
78
79 public String toString() {
80 StringBuffer buf = new StringBuffer("detached request for ref ");
81 buf.append(ref);
82 buf.append(" #").append(uuid);
83 buf.append(" cachedObject=").append((cachedObject != null));
84 buf.append(" path=").append(path);
85 buf.append(" properties=").append(properties);
86 return buf.toString();
87 }
88
89 /**
90 * Optimization. Allows the driver to eagerly cache the object in the
91 * request, in order to relieve the detached server of the task to look for
92 * it. No implementation should rely on this to be set.
93 */
94 public Object getCachedObject() {
95 return cachedObject;
96 }
97
98 public void setCachedObject(Object cachedObject) {
99 this.cachedObject = cachedObject;
100 }
101
102 }