m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/querysigner
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/querysigner')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryData.java7
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryUtils.java11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryData.java b/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryData.java
index 87b965c..a9e039e 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryData.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryData.java
@@ -19,6 +19,13 @@ public class QueryData implements Serializable {
this.installed = true;
}
+ public QueryData(String code, byte[] signature, long timestamp, boolean installed) {
+ this.code = code;
+ this.signature = signature;
+ this.timestamp = timestamp;
+ this.installed = installed;
+ }
+
public String getCode() {
return code;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryUtils.java b/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryUtils.java
index 6ec62f4..c46e32d 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryUtils.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QueryUtils.java
@@ -1,5 +1,7 @@
package pl.edu.mimuw.cloudatlas.querysigner;
+import pl.edu.mimuw.cloudatlas.model.ValueQuery;
+
import java.rmi.RemoteException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -13,4 +15,13 @@ public class QueryUtils {
throw new RemoteException("Invalid query identifier");
}
}
+
+ public static QueryData constructQueryData(ValueQuery valueQuery) {
+ return new QueryData(
+ valueQuery.getCode(),
+ valueQuery.getSignature(),
+ valueQuery.getTimestamp(),
+ valueQuery.isInstalled()
+ );
+ }
}