Commit b60b48e1 authored by rwm's avatar rwm

Authenticator and timestamps for query request

parent f401805c
Pipeline #1550 skipped
......@@ -69,6 +69,7 @@ Query exchange
<!-- may also automatically reject requests:
reject all because of vacation,
reject specific recurring query -->
<reject-reason>La la la</reject-reason>
<comment></comment>
<last-execution>
<completed>XXXtimestamp</completed>
......
package org.aktin.dwh;
import java.security.Principal;
public interface Authenticator {
/**
* Determine whether the given user and password combination is granted
* the given role.
* @param user user name
* @param password password
* @param role role
* @return true if all criteria are matched, false otherwise
*/
boolean verifyUserRole(String user, char[] password, String role);
/**
* Determine whether a given user and password combination
* has admin privileges.
Principal authenticate(String user, char[] password);
boolean isUserInRole(Principal user, String role);
/** Determine whether a given user has admin privileges.
*
* @param user user name
* @param password password
* @return true if the user is admin and the password is correct
* @param user user
* @return true if the user has administrative rights
*/
boolean verifyAdmin(String user, char[] password);
boolean isUserAdmin(Principal user);
}
......@@ -34,10 +34,19 @@ public class QueryRequest {
/**
* Time stamp when the request was published at the query broker.
*/
@XmlElement(required=true)
Instant published;
/**
* Time stamp for the earliest execution / when the request is open.
* If unspecified, the query can be executed at any time (usually
* before the deadline)
*/
@XmlElement(required=false)
Instant scheduled;
/**
* Due date until which the query results have to be submitted.
*/
@XmlElement(required=true)
Instant deadline;
/**
* Date when the request was closed by the query broker. While
......
......@@ -35,11 +35,29 @@ public interface Preference<T> {
* @param user user name
* @param value value
*/
public void setValue(String user, T value);
public void setValue(T value, String user);
/**
* Set the value by the system user
* @param value value
*/
public void setValue(T value);
/**
* Set the value to the given string representation. The value
* is changed by the system user.
* @param value string representing the value
* @throws IllegalArgumentException if the string conversion fails
*/
public void setValueString(String value) throws IllegalArgumentException;
/**
* Set the value to the given string representation. The specified
* user name is used to perform the change.
*
* @param value string value
* @param user user name
* @throws IllegalArgumentException if string conversion fails
*/
public void setValueString(String value, String user) throws IllegalArgumentException;
}
......@@ -3,7 +3,8 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xml="http://www.w3.org/XML/1998/namespace">
<id>123</id>
<published>2016-04-28T00:00:00Z</published>
<published>2016-04-28T00:00:00Z</published>
<scheduled>2016-04-28T00:00:00Z</scheduled>
<deadline>2016-04-30T00:00:00Z</deadline>
<xi:include href="query.xml"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment