getCtx() {
- return Collections.unmodifiableMap(ctxData);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParser.java
deleted file mode 100644
index 162ee624a..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParser.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Objects;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
-import javax.xml.stream.util.EventReaderDelegate;
-import javax.xml.transform.stax.StAXSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
-
-import at.gv.egovernment.moa.id.process.model.EndEvent;
-import at.gv.egovernment.moa.id.process.model.ProcessDefinition;
-import at.gv.egovernment.moa.id.process.model.ProcessNode;
-import at.gv.egovernment.moa.id.process.model.StartEvent;
-import at.gv.egovernment.moa.id.process.model.TaskInfo;
-import at.gv.egovernment.moa.id.process.model.Transition;
-
-/**
- * Parses an XML representation of a process definition as defined by the respective XML schema.
- * transitionElements = new ArrayList<>();
- final List startEvents = new ArrayList<>();
-
- reader = new EventReaderDelegate(reader) {
-
- @Override
- public XMLEvent nextEvent() throws XMLStreamException {
- XMLEvent event = super.nextEvent();
-
- switch (event.getEventType()) {
- case XMLStreamConstants.START_ELEMENT:
- StartElement element = event.asStartElement();
- QName qname = element.getName();
-
- if (NS.equals(qname.getNamespaceURI())) {
- log.trace("Found process description element '{}'.", qname.getLocalPart());
- Attribute id = element.getAttributeByName(new QName("id"));
-
- switch (qname.getLocalPart()) {
- case "ProcessDefinition":
- if (id != null) {
- pd.setId(id.getValue());
- }
- break;
- case "StartEvent":
- StartEvent startEvent = new StartEvent();
- if (id != null) {
- startEvent.setId(id.getValue());
- }
- startEvents.add(startEvent);
- break;
- case "EndEvent":
- EndEvent endEvent = new EndEvent();
- if (id != null) {
- endEvent.setId(id.getValue());
- pd.getEndEvents().put(id.getValue(), endEvent);
- }
- break;
- case "Transition":
- transitionElements.add(element);
- break;
- case "Task":
- TaskInfo taskInfo = new TaskInfo();
- if (id != null) {
- taskInfo.setId(id.getValue());
- pd.getTaskInfos().put(id.getValue(), taskInfo);
- }
- Attribute async = element.getAttributeByName(new QName("async"));
- if (async != null) {
- taskInfo.setAsync(Boolean.valueOf(async.getValue()));
- }
- Attribute implementingClass = element.getAttributeByName(new QName("class"));
- if (implementingClass != null) {
- taskInfo.setTaskImplementingClass(implementingClass.getValue());
- }
- break;
- }
-
- }
-
- break;
- }
-
- return event;
- }
-
- };
-
- // validator is not thread-safe
- Validator validator = LazyProcessDefinitionSchemaHolder.PD_SCHEMA_INSTANCE.newValidator();
- validator.validate(new StAXSource(reader));
- log.trace("Process definition successfully schema validated.");
-
- // perform some basic checks
- log.trace("Building model and performing some plausibility checks.");
- if (startEvents.size() != 1) {
- throw new ProcessDefinitionParserException("A ProcessDefinition must contain exactly one single StartEvent.");
- }
- pd.setStartEvent(startEvents.get(0));
-
- // link transitions
- Iterator transitions = transitionElements.iterator();
- while (transitions.hasNext()) {
- StartElement element = transitions.next();
- Transition transition = new Transition();
- Attribute id = element.getAttributeByName(new QName("id"));
- if (id != null) {
- transition.setId(id.getValue());
- }
- Attribute conditionExpression = element.getAttributeByName(new QName("conditionExpression"));
- if (conditionExpression != null) {
- transition.setConditionExpression(conditionExpression.getValue());
- }
- Attribute from = element.getAttributeByName(new QName("from"));
- if (from != null) {
- ProcessNode fromNode = pd.getProcessNode(from.getValue());
- if (fromNode == null) {
- throw new ProcessDefinitionParserException("Transition's 'from'-attribute refers to a non-existing event or task '" + from.getValue() + '.');
- }
- if (fromNode instanceof EndEvent) {
- throw new ProcessDefinitionParserException("Transition cannot start from end event.");
- }
- transition.setFrom(fromNode);
- fromNode.getOutgoingTransitions().add(transition);
- }
- Attribute to = element.getAttributeByName(new QName("to"));
- if (to != null) {
- ProcessNode toNode = pd.getProcessNode(to.getValue());
- if (toNode == null) {
- throw new ProcessDefinitionParserException("Transition's 'to'-attribute refers to a non-existing event or task '" + to.getValue() + '.');
- }
- transition.setTo(toNode);
- toNode.getIncomingTransitions().add(transition);
- }
- if (transition.getConditionExpression() == null && Objects.equals(transition.getFrom(), transition.getTo())) {
- throw new ProcessDefinitionParserException("Transition's 'from' equals its 'to'. Since no 'conditionExpression' has been set this will cause a loop.");
- }
- }
- log.debug("Process definition '{}' successfully parsed.", pd.getId());
- return pd;
-
- } catch (ProcessDefinitionParserException e) {
- throw e;
- } catch (XMLStreamException|IOException e) {
- throw new ProcessDefinitionParserException("Unable to read process definition from inputstream.", e);
- } catch (SAXException e) {
- throw new ProcessDefinitionParserException("Schema validation of process description failed.", e);
- } catch (Exception e) {
- throw new ProcessDefinitionParserException("Internal error creating process definition from inputstream.", e);
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (XMLStreamException e) {
- // error freeing resources
- }
- }
- }
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParserException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParserException.java
deleted file mode 100644
index 0c214750d..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessDefinitionParserException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-/**
- * Exception thrown in case of error parsing a process definition.
- *
- * @author tknall
- *
- */
-public class ProcessDefinitionParserException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates a new parser exception providing a {@code message} describing the reason and the {@code cause}.
- *
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- public ProcessDefinitionParserException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Creates a new parser exception providing a {@code message} describing the reason.
- *
- * @param message
- * The message.
- */
- public ProcessDefinitionParserException(String message) {
- super(message);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java
deleted file mode 100644
index 44f622fa0..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-
-import java.io.InputStream;
-
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-import at.gv.egovernment.moa.id.process.model.ProcessDefinition;
-
-/**
- * Process engine providing means for starting and resuming processes.
- *
- * @author tknall
- */
-public interface ProcessEngine {
-
- /**
- * Registers a new process definition. Note that existing definitions with the same identifier will be replaced.
- *
- * @param processDefinition
- * The process definition to be registered.
- */
- void registerProcessDefinition(ProcessDefinition processDefinition);
-
- /**
- * Registers a new process definition given as {@link InputStream}. Note that existing definitions with the same identifier will be replaced.
- *
- * @param processDefinitionInputStream The input stream to the definition to be registered.
- * @throws ProcessDefinitionParserException Thrown in case of an error parsing the process definition.
- * @return The process definition's identifier.
- */
- String registerProcessDefinition(InputStream processDefinitionInputStream) throws ProcessDefinitionParserException;
-
- /**
- * Creates a process instance according to the referenced process definition, persists it into the database and returns it identifier.
- *
- * Note that the method returns the identifier of a process instance which will be needed in order to start a process or to continue
- * process execution after asynchronous task execution (refer to {@link #start(String)} and
- * {@link #signal(String)} for further information).
- *
- * @param processDefinitionId
- * The identifier of the respective process definition.
- * @param executionContext The execution context (may be {@code null}).
- * @return The id of the newly created process instance (never {@code null}).
- * @throws ProcessExecutionException
- * Thrown in case of error, e.g. when a {@code processDefinitionId} is referenced that does not exist.
- */
- String createProcessInstance(String processDefinitionId, ExecutionContext executionContext) throws ProcessExecutionException;
-
- /**
- * Creates a process instance according to the referenced process definition, persists it into the database and returns it identifier.
- *
- * Note that the method returns the identifier of a process instance which will be needed in order to start a process or to continue
- * process execution after asynchronous task execution (refer to {@link #start(String)} and
- * {@link #signal(String)} for further information).
- *
- * @param processDefinitionId
- * The identifier of the respective process definition.
- * @return The id of the newly created process instance (never {@code null}).
- * @throws ProcessExecutionException
- * Thrown in case of error, e.g. when a {@code processDefinitionId} is referenced that does not exist.
- */
- String createProcessInstance(String processDefinitionId) throws ProcessExecutionException;
-
-
- /**
- * Delete a process instance
- *
- * @param processInstanceId
- * The identifier of the respective process.
- * @throws ProcessExecutionException
- * Thrown in case of error, e.g. when a {@code processInstanceId} is referenced that does not exist.
- */
- void deleteProcessInstance(String processInstanceId) throws ProcessExecutionException;
-
- /**
- * Returns the process instance with a given {@code processInstanceId}.
- *
- * @param processInstanceId
- * The process instance id.
- * @return The process instance (never {@code null}).
- * @throws IllegalArgumentException
- * In case the process instance does not/no longer exist.
- * @throws RuntimeException
- * In case the process instance could not be retrieved from persistence.
- */
- ProcessInstance getProcessInstance(String processInstanceId);
-
- /**
- * Starts the process using the given {@code pendingReq}.
- *
- * @param pendingReq
- * The protocol request for which a process should be started.
- * @throws ProcessExecutionException
- * Thrown in case of error.
- */
- void start(IRequest pendingReq) throws ProcessExecutionException;
-
-
- /**
- * Resumes process execution after an asynchronous task has been executed.
- *
- * @param pendingReq
- * The process instance id.
- * @throws ProcessExecutionException
- * Thrown in case of error.
- */
- void signal(IRequest pendingReq) throws ProcessExecutionException;
-
-}
\ No newline at end of file
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngineImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngineImpl.java
deleted file mode 100644
index 76e6605c1..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngineImpl.java
+++ /dev/null
@@ -1,420 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-
-import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluationContext;
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluator;
-import at.gv.egovernment.moa.id.process.api.Task;
-import at.gv.egovernment.moa.id.process.dao.ProcessInstanceStore;
-import at.gv.egovernment.moa.id.process.dao.ProcessInstanceStoreDAO;
-import at.gv.egovernment.moa.id.process.model.EndEvent;
-import at.gv.egovernment.moa.id.process.model.ProcessDefinition;
-import at.gv.egovernment.moa.id.process.model.ProcessNode;
-import at.gv.egovernment.moa.id.process.model.StartEvent;
-import at.gv.egovernment.moa.id.process.model.TaskInfo;
-import at.gv.egovernment.moa.id.process.model.Transition;
-import at.gv.egovernment.moa.util.MiscUtil;
-
-/**
- * Process engine implementation allowing starting and continuing processes as well as providing means for cleanup actions.
- */
-public class ProcessEngineImpl implements ProcessEngine {
-
- private Logger log = LoggerFactory.getLogger(getClass());
-
- @Autowired ProcessInstanceStoreDAO piStoreDao;
- @Autowired ApplicationContext context;
-
- private ProcessDefinitionParser pdp = new ProcessDefinitionParser();
-
- private Map processDefinitions = new ConcurrentHashMap();
-
- private final static String MDC_CTX_PI_NAME = "processInstanceId";
- private final static String MDC_CTX_TASK_NAME = "taskId";
-
- private ExpressionEvaluator transitionConditionExpressionEvaluator;
-
- @Override
- public void registerProcessDefinition(ProcessDefinition processDefinition) {
- log.info("Registering process definition '{}'.", processDefinition.getId());
- processDefinitions.put(processDefinition.getId(), processDefinition);
- }
-
- @Override
- public String registerProcessDefinition(InputStream processDefinitionInputStream) throws ProcessDefinitionParserException{
- ProcessDefinition pd = pdp.parse(processDefinitionInputStream);
- registerProcessDefinition(pd);
- return pd.getId();
- }
-
- /**
- * Sets the process definitions.
- *
- * @param processDefinitions
- * The process definitions.
- * @throws IllegalArgumentException
- * In case the process definitions contain definitions with the same identifier.
- */
- public void setProcessDefinitions(Iterable processDefinitions) {
- this.processDefinitions.clear();
- for (ProcessDefinition pd : processDefinitions) {
- if (this.processDefinitions.containsKey(pd.getId())) {
- throw new IllegalArgumentException("Duplicate process definition identifier '" + pd.getId() + "'.");
- }
- registerProcessDefinition(pd);
- }
- }
-
- /**
- * Sets an expression evaluator that should be used to process transition condition expressions.
- * @param transitionConditionExpressionEvaluator The expression evaluator.
- */
- public void setTransitionConditionExpressionEvaluator(
- ExpressionEvaluator transitionConditionExpressionEvaluator) {
- this.transitionConditionExpressionEvaluator = transitionConditionExpressionEvaluator;
- }
-
-
- @Override
- public String createProcessInstance(String processDefinitionId, ExecutionContext executionContext) throws ProcessExecutionException {
- // look for respective process definition
- ProcessDefinition pd = processDefinitions.get(processDefinitionId);
- if (pd == null) {
- throw new ProcessExecutionException("Unable to find process definition for process '" + processDefinitionId + "'.");
- }
- // create and keep process instance
- ProcessInstance pi = new ProcessInstance(pd, executionContext);
- log.info("Creating process instance from process definition '{}': {}", processDefinitionId, pi.getId());
-
- try {
- saveOrUpdateProcessInstance(pi);
- } catch (MOADatabaseException e) {
- throw new ProcessExecutionException("Unable to persist process instance.", e);
- }
-
- return pi.getId();
- }
-
- @Override
- public String createProcessInstance(String processDefinitionId) throws ProcessExecutionException {
- return createProcessInstance(processDefinitionId, null);
- }
-
- @Override
- public void start(IRequest pendingReq) throws ProcessExecutionException {
- try {
- if (MiscUtil.isEmpty(pendingReq.getProcessInstanceId())) {
- log.error("Pending-request with id:" + pendingReq.getRequestID()
- + " includes NO 'ProcessInstanceId'");
- throw new ProcessExecutionException("Pending-request with id:" + pendingReq.getRequestID()
- + " includes NO 'ProcessInstanceId'");
- }
-
- ProcessInstance pi = loadProcessInstance(pendingReq.getProcessInstanceId());
-
- if (pi == null ) {
- throw new ProcessExecutionException("Process instance '" + pendingReq.getProcessInstanceId() + "' does not exist.");
-
- }
-
- MDC.put(MDC_CTX_PI_NAME, pi.getId());
-
- if (!ProcessInstanceState.NOT_STARTED.equals(pi.getState())) {
- throw new ProcessExecutionException("Process instance '" + pi.getId() + "' has already been started (current state is " + pi.getState() + ").");
- }
- log.info("Starting process instance '{}'.", pi.getId());
- // execute process
- pi.setState(ProcessInstanceState.STARTED);
- execute(pi, pendingReq);
-
- //store ProcessInstance if it is not already ended
- if (!ProcessInstanceState.ENDED.equals(pi.getState()))
- saveOrUpdateProcessInstance(pi);
-
- } catch (MOADatabaseException e) {
- throw new ProcessExecutionException("Unable to load/save process instance.", e);
-
- } finally {
- MDC.remove(MDC_CTX_PI_NAME);
- }
- }
-
- @Override
- public void signal(IRequest pendingReq) throws ProcessExecutionException {
-
- try {
- if (MiscUtil.isEmpty(pendingReq.getProcessInstanceId())) {
- log.error("Pending-request with id:" + pendingReq.getRequestID()
- + " includes NO 'ProcessInstanceId'");
- throw new ProcessExecutionException("Pending-request with id:" + pendingReq.getRequestID()
- + " includes NO 'ProcessInstanceId'");
- }
-
- ProcessInstance pi = loadProcessInstance(pendingReq.getProcessInstanceId());
-
- if (pi == null ) {
- throw new ProcessExecutionException("Process instance '" + pendingReq.getProcessInstanceId() + "' does not exist.");
-
- }
-
- MDC.put(MDC_CTX_PI_NAME, pi.getId());
-
- if (!ProcessInstanceState.SUSPENDED.equals(pi.getState())) {
- throw new ProcessExecutionException("Process instance '" + pi.getId() + "' has not been suspended (current state is " + pi.getState() + ").");
- }
-
- log.info("Waking up process instance '{}'.", pi.getId());
- pi.setState(ProcessInstanceState.STARTED);
-
- //put pending-request ID on execution-context because it could be changed
- pi.getExecutionContext().put(MOAIDAuthConstants.PARAM_TARGET_PENDINGREQUESTID, pendingReq.getRequestID());
-
- execute(pi, pendingReq);
-
- //store ProcessInstance if it is not already ended
- if (!ProcessInstanceState.ENDED.equals(pi.getState()))
- saveOrUpdateProcessInstance(pi);
-
- } catch (MOADatabaseException e) {
- throw new ProcessExecutionException("Unable to load/save process instance.", e);
-
- } finally {
- MDC.remove(MDC_CTX_PI_NAME);
- }
- }
-
-
- /**
- * Instantiates a task implementation given by a {@link TaskInfo}.
- * @param ti The task info.
- * @return A Task implementation or {@code null} if the task info does not reference any task implementing classes.
- * @throws ProcessExecutionException Thrown in case of error (when the referenced class does not implement {@link Task} for instance).
- */
- private Task createTaskInstance(TaskInfo ti) throws ProcessExecutionException {
- String clazz = StringUtils.trimToNull(ti.getTaskImplementingClass());
- Task task = null;
-
- if (clazz != null) {
- log.debug("Instantiating task implementing class '{}'.", clazz);
- Object instanceClass = null;
- try {
- instanceClass = context.getBean(clazz);
-
- } catch (Exception e) {
- throw new ProcessExecutionException("Unable to get class '" + clazz + "' associated with task '" + ti.getId() + "' .", e);
-
- }
- if (instanceClass == null || !(instanceClass instanceof Task)) {
- throw new ProcessExecutionException("Class '" + clazz + "' associated with task '" + ti.getId() + "' is not assignable to " + Task.class.getName() + ".");
-
- }
- try {
- task = (Task) instanceClass;
-
- } catch (Exception e) {
- throw new ProcessExecutionException("Unable to instantiate class '" + clazz + "' associated with task '" + ti.getId() + "' .", e);
- }
- }
-
- return task;
- }
-
- /**
- * Starts/executes a given process instance.
- * @param pi The process instance.
- * @param pendingReq
- * @throws ProcessExecutionException Thrown in case of error.
- */
- private void execute(final ProcessInstance pi, IRequest pendingReq) throws ProcessExecutionException {
- if (ProcessInstanceState.ENDED.equals(pi.getState())) {
- throw new ProcessExecutionException("Process for instance '" + pi.getId() + "' has already been ended.");
- }
- ProcessDefinition pd = pi.getProcessDefinition();
- ProcessNode processNode = pd.getProcessNode(pi.getNextId());
- log.debug("Processing node '{}'.", processNode.getId());
-
- // distinguish process node types StartEvent, TaskInfo and EndEvent
-
- if (processNode instanceof TaskInfo) {
- // TaskInfo types need to be executed
- TaskInfo ti = (TaskInfo) processNode;
- MDC.put(MDC_CTX_TASK_NAME, ti.getId());
- try {
- log.info("Processing task '{}'.", ti.getId());
- Task task = createTaskInstance(ti);
- if (task != null) {
- try {
- log.info("Executing task implementation for task '{}'.", ti.getId());
- log.debug("Execution context before task execution: {}", pi.getExecutionContext().keySet());
- pendingReq = task.execute(pendingReq, pi.getExecutionContext());
- log.info("Returned from execution of task '{}'.", ti.getId());
- log.debug("Execution context after task execution: {}", pi.getExecutionContext().keySet());
- } catch (Throwable t) {
- throw new ProcessExecutionException("Error executing task '" + ti.getId() + "'.", t);
- }
- } else {
- log.debug("No task implementing class set.");
- }
- } finally {
- MDC.remove(MDC_CTX_TASK_NAME);
- }
-
- } else if (processNode instanceof EndEvent) {
- log.info("Finishing process instance '{}'.", pi.getId());
-
- try {
- piStoreDao.remove(pi.getId());
-
- } catch (MOADatabaseException e) {
- throw new ProcessExecutionException("Unable to remove process instance.", e);
-
- }
- pi.setState(ProcessInstanceState.ENDED);
- log.debug("Final process context: {}", pi.getExecutionContext().keySet());
- return;
- }
-
- final ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContextImpl(pi);
-
- // traverse pointer
- Transition t = CollectionUtils.find(processNode.getOutgoingTransitions(), new Predicate() {
- @Override
- public boolean evaluate(Transition transition) {
- if (transitionConditionExpressionEvaluator != null && transition.getConditionExpression() != null) {
- log.trace("Evaluating transition expression '{}'.", transition.getConditionExpression());
- return transitionConditionExpressionEvaluator.evaluate(expressionContext, transition.getConditionExpression());
- }
- return true;
- }
- });
- if (t == null) {
- throw new ProcessExecutionException("No valid transition starting from process node '" + processNode.getId()+ "'.");
- }
- log.trace("Found suitable transition: {}", t);
- // update pointer
- log.trace("Shifting process token from '{}' to '{}'.", pi.getNextId(), t.getTo().getId());
- pi.setNextId(t.getTo().getId());
-
- // inspect current task
- if (t.getTo() instanceof TaskInfo && (((TaskInfo) t.getTo()).isAsync())) {
- // immediately return in case of asynchonous task
- log.info("Suspending process instance '{}' for asynchronous task '{}'.", pi.getId(), t.getTo().getId());
- pi.setState(ProcessInstanceState.SUSPENDED);
- return;
- }
-
- // continue execution in case of StartEvent or Task
- if (processNode instanceof StartEvent || processNode instanceof TaskInfo) {
- execute(pi, pendingReq);
- }
- }
-
- @Override
- public ProcessInstance getProcessInstance(String processInstanceId) {
-
- ProcessInstance processInstance;
- try {
- processInstance = loadProcessInstance(processInstanceId);
-
- } catch (MOADatabaseException e) {
- throw new RuntimeException("The process instance '" + processInstanceId + "' could not be retrieved.", e);
- }
-
- if (processInstance == null) {
- throw new IllegalArgumentException("The process instance '" + processInstanceId + "' does not/no longer exist.");
- }
-
- return processInstance;
- }
-
- /**
- * Persists a {@link ProcessInstance} to the database.
- * @param processInstance The object to persist.
- * @throws MOADatabaseException Thrown if an error occurs while accessing the database.
- */
- private void saveOrUpdateProcessInstance(ProcessInstance processInstance) throws MOADatabaseException {
- ProcessInstanceStore store = new ProcessInstanceStore();
-
- ExecutionContext ctx = processInstance.getExecutionContext();
-
- Map ctxData = new HashMap();
- for (String key : ctx.keySet()) {
- ctxData.put(key, ctx.get(key));
- }
- store.setExecutionContextData(ctxData);
-
- store.setNextTaskId(processInstance.getNextId());
- store.setProcessDefinitionId(processInstance.getProcessDefinition().getId());
-
- store.setProcessInstanceId(processInstance.getId());
- store.setProcessState(processInstance.getState());
-
- piStoreDao.saveOrUpdate(store);
- }
-
- /**
- * Load a {@link ProcessInstance} with a certain id from the database.
- * @param processInstanceId The process instance id
- * @return The process instance corresponding to the id or {@code null} if no such object is found.
- * @throws MOADatabaseException Thrown if an error occurs while accessing the database.
- */
- private ProcessInstance loadProcessInstance(String processInstanceId) throws MOADatabaseException {
-
- ProcessInstanceStore piStore = piStoreDao.load(processInstanceId);
-
- if (piStore == null) {
- return null;
- }
-
- ExecutionContext executionContext = new ExecutionContextImpl(piStore.getProcessInstanceId());
-
- Map executionContextData = piStore.getExecutionContextData();
- for (String key : executionContextData.keySet()) {
- executionContext.put(key, executionContextData.get(key));
- }
-
- ProcessInstance pi = new ProcessInstance(processDefinitions.get(piStore.getProcessDefinitionId()), executionContext);
- pi.setNextId(piStore.getNextTaskId());
- pi.setState(piStore.getProcessState());
-
- return pi;
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.process.ProcessEngine#deleteProcessInstance(java.lang.String)
- */
- @Override
- public void deleteProcessInstance(String processInstanceId) throws ProcessExecutionException {
- if (MiscUtil.isEmpty(processInstanceId)) {
- throw new ProcessExecutionException("Unable to remove process instance: ProcessInstanceId is empty");
-
- }
-
- try {
- piStoreDao.remove(processInstanceId);
-
- } catch (MOADatabaseException e) {
- throw new ProcessExecutionException("Unable to remove process instance.", e);
-
- }
-
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessExecutionException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessExecutionException.java
deleted file mode 100644
index 821bbe6dc..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessExecutionException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-/**
- * Indicates a problem when executing a process.
- *
- * @author tknall
- *
- */
-public class ProcessExecutionException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates a new process execution exception providing a {@code message} describing the reason and the respective
- * {@code cause}.
- *
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- public ProcessExecutionException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Creates a new process execution exception providing a {@code message} describing the reason.
- *
- * @param message
- * The message.
- */
- public ProcessExecutionException(String message) {
- super(message);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstance.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstance.java
deleted file mode 100644
index a6cf3b57f..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstance.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.commons.lang3.time.DurationFormatUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-import at.gv.egovernment.moa.id.process.model.ProcessDefinition;
-import at.gv.egovernment.moa.id.process.support.SecureRandomHolder;
-
-/**
- * Represents a process being executed. The process instance provides information about the process and its state.
- *
- * @author tknall
- *
- */
-public class ProcessInstance implements Serializable {
-
- private static final long serialVersionUID = 1L;
- private static final int RND_ID_LENGTH = 22;
-
- private ProcessDefinition processDefinition;
- private String nextId;
- private Date lru;
- private ExecutionContext executionContext;
- private ProcessInstanceState state = ProcessInstanceState.NOT_STARTED;
-
- private Logger log = LoggerFactory.getLogger(getClass());
-
- /**
- * Creates a new process instance, based on a given process definition and a
- * given execution context. If the given execution context is {@code null} a new execution context will be created.
- * The process instance id of the execution context will be newly generated if it is {@code null} in the execution context.
- *
- * @param processDefinition
- * The process definition.
- * @param executionContext
- * The execution context (may be {@code null}). If {@code null} a new execution context will be created internally.
- */
- ProcessInstance(ProcessDefinition processDefinition, ExecutionContext executionContext) {
- this.processDefinition = processDefinition;
- nextId = processDefinition.getStartEvent().getId();
- if (executionContext == null) {
- executionContext = new ExecutionContextImpl();
- }
- if (executionContext.getProcessInstanceId() == null) {
- String pdIdLocalPart = RandomStringUtils.random(RND_ID_LENGTH, 0, 0, true, true, null,
- SecureRandomHolder.getInstance());
- executionContext.setProcessInstanceId(this.processDefinition.getId() + "-" + pdIdLocalPart);
- } else {
- log.debug("Using process instance id from execution context.");
- }
- log.debug("Creating process instance with id '{}'.", executionContext.getProcessInstanceId());
- this.executionContext = executionContext;
- touch();
- }
-
- /**
- * Returns the underlying process definition.
- *
- * @return The underlying process definition.
- */
- ProcessDefinition getProcessDefinition() {
- touch();
- return processDefinition;
- }
-
- /**
- * Returns the id of the process node to be executed next.
- *
- * @return The process node pointer indicating the process node to be executed next.
- */
- public String getNextId() {
- touch();
- return nextId;
- }
-
- /**
- * Sets the internal pointer to the process node to be executed next.
- *
- * @param nextId
- * The process node id to be executed next.
- */
- void setNextId(String nextId) {
- touch();
- this.nextId = nextId;
- }
-
- /**
- * Returns the current state of the process instance.
- *
- * @return The current state.
- */
- public ProcessInstanceState getState() {
- touch();
- return state;
- }
-
- /**
- * Sets the current state of the process instance.
- *
- * @param state
- * The current state.
- */
- void setState(ProcessInstanceState state) {
- touch();
- this.state = state;
- }
-
- public String getId() {
- touch();
- return executionContext.getProcessInstanceId();
- }
-
- /**
- * Updates the last recently used date of the process instance.
- */
- private void touch() {
- lru = new Date();
- }
-
- /**
- * Returns the date the process instance has been accessed last.
- *
- * @return The last recently used date.
- */
- Date getLru() {
- return lru;
- }
-
- /**
- * Returns the associated execution context.
- * @return The execution context (never {@code null}).
- */
- public ExecutionContext getExecutionContext() {
- touch();
- return executionContext;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("ProcessInstance [");
- builder.append("id=").append(executionContext.getProcessInstanceId());
- builder.append(", idle since=").append(
- DurationFormatUtils.formatDurationWords(new Date().getTime() - this.lru.getTime(), true, true));
- if (processDefinition != null) {
- builder.append(", processDefinition.id=");
- builder.append(processDefinition.getId());
- }
- if (nextId != null) {
- builder.append(", nextId=");
- builder.append(nextId);
- }
- builder.append(", executionContext=").append(executionContext);
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstanceState.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstanceState.java
deleted file mode 100644
index 2765283a0..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessInstanceState.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package at.gv.egovernment.moa.id.process;
-
-/**
- * Represents a certain process instance state.
- * @author tknall
- *
- */
-public enum ProcessInstanceState {
-
- /**
- * Indicates that the process with this process instance has not yet been started.
- */
- NOT_STARTED,
-
- /**
- * Indicates that the process is currently running.
- */
- STARTED,
-
- /**
- * Indicates that the process has been suspended until being waken up by someonce calling {@code signal}.
- */
- SUSPENDED,
-
- /**
- * Indicates that the process has been completed.
- */
- ENDED
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExecutionContext.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExecutionContext.java
deleted file mode 100644
index 4a9dfc336..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExecutionContext.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package at.gv.egovernment.moa.id.process.api;
-
-import java.io.Serializable;
-import java.util.Set;
-
-/**
- * Encapsulates data needed for or provided by task execution.
- *
- * @author tknall
- *
- */
-public interface ExecutionContext extends Serializable {
-
- /**
- * Returns the identifier of underlying process instance.
- *
- * @return The identifier of the process instance.
- */
- String getProcessInstanceId();
-
- /**
- * Sets the identifier of underlying process instance.
- *
- * @param processInstanceId
- * The identifier of the process instance.
- */
- void setProcessInstanceId(String processInstanceId);
-
- /**
- * Stores a serializable object using {@code key}.
- *
- * @param key
- * The key under that the {@code object} should be stored.
- * @param object The object to be stored.
- */
- void put(String key, Serializable object);
-
- /**
- * Returns an serializable object stored within this process context using {@code key}.
- *
- * @param key
- * The key that has been used to store the serializable object (may be {@code null}).
- * @return The object or {@code null} in case the key does not relate to a stored object or the stored object itself
- * was {@code null}.
- */
- Serializable get(String key);
-
- /**
- * Removes the object stored using {@code key}.
- * @param key
- * The key that has been used to store the serializable object (may be {@code null}).
- * @return The object that has been removed or {@code null} there was no object stored using {@code key}.
- */
- Serializable remove(String key);
-
- /**
- * Returns an unmodifiable set containing the stored keys.
- *
- * @return The keyset (never {@code null}).
- */
- Set keySet();
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluationContext.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluationContext.java
deleted file mode 100644
index 94854dcad..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluationContext.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package at.gv.egovernment.moa.id.process.api;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import at.gv.egovernment.moa.id.process.model.Transition;
-
-/**
- * Context used for evaluation of condition expressions set for {@linkplain Transition Transitions}.
- *
- * @author tknall
- *
- */
-public interface ExpressionEvaluationContext extends Serializable {
-
- /**
- * Returns the context data map used for expression evaluation.
- *
- * @return An unmodifiable map (never {@code null}).
- */
- Map getCtx();
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluator.java
deleted file mode 100644
index fe0743201..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/ExpressionEvaluator.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package at.gv.egovernment.moa.id.process.api;
-
-/**
- * Evaluates a given {@code expression} returning a boolean value.
- *
- * @author tknall
- */
-public interface ExpressionEvaluator {
-
- /**
- * Evaluates a given {@code expression} returning a boolean value.
- *
- * @param expressionContext
- * The context which can be used for evaluation of the expression.
- * @param expression
- * The expression resulting in a boolean (must not be {@code null}).
- * @return A boolean value.
- * @throws IllegalArgumentException
- * In case of an invalid {@code expression}.
- * @throws NullPointerException
- * In case of a {@code null} expression.
- */
- boolean evaluate(ExpressionEvaluationContext expressionContext, String expression);
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/Task.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/Task.java
deleted file mode 100644
index cff85ad60..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/api/Task.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package at.gv.egovernment.moa.id.process.api;
-
-import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-
-
-/**
- * Represents a single task to be performed upon process execution.
- *
- * @author tknall
- *
- */
-public interface Task {
-
- /**
- * Executes this task.
- * @param pendingReq
- * Provides the current processed protocol request
- * @param executionContext
- * Provides execution related information.
- * @return The pending-request object, because Process-management works recursive
- * @throws Exception An exception upon task execution.
- */
- IRequest execute(IRequest pendingReq, ExecutionContext executionContext) throws TaskExecutionException;
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
deleted file mode 100644
index 3620f2950..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStore.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package at.gv.egovernment.moa.id.process.dao;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.Table;
-
-import org.hibernate.internal.util.SerializationHelper;
-
-import at.gv.egovernment.moa.id.process.ProcessInstanceState;
-
-@Entity
-@Table(name = "processinstance")
-public class ProcessInstanceStore implements Serializable{
-
- private static final long serialVersionUID = -6147519767313903808L;
-
- /**
- * A process instance identifier qualifies as natural primary key by satisfying these requirements
- * ("unique, constant, required"):
- *
- * - unique value
- * - never changes (immutable)
- * - never {@code null}
- *
- */
- @Id
- private String processInstanceId;
-
- @Column(name = "processDefinitionId", nullable = false)
- private String processDefinitionId;
-
- @Column(name = "nextTaskId", nullable = false)
- private String nextTaskId;
-
- @Column(name = "processState", nullable = false)
- @Enumerated(value = EnumType.STRING)
- private ProcessInstanceState processState;
-
- @Column(name = "executionContextData", nullable = false)
- @Lob
- private byte[] executionContextData;
-
- public String getProcessInstanceId() {
- return processInstanceId;
- }
-
- public String getProcessDefinitionId() {
- return processDefinitionId;
- }
-
- public String getNextTaskId() {
- return nextTaskId;
- }
-
- public ProcessInstanceState getProcessState() {
- return processState;
- }
-
- @SuppressWarnings("unchecked")
- public Map getExecutionContextData() {
- return (Map) SerializationHelper.deserialize(executionContextData);
- }
-
- public void setProcessInstanceId(String processInstanceId) {
- this.processInstanceId = processInstanceId;
- }
-
- public void setProcessDefinitionId(String processDefinitionId) {
- this.processDefinitionId = processDefinitionId;
- }
-
- public void setNextTaskId(String nextTaskId) {
- this.nextTaskId = nextTaskId;
- }
-
- public void setProcessState(ProcessInstanceState processState) {
- this.processState = processState;
- }
-
- public void setExecutionContextData(Map executionContextData) {
- this.executionContextData = SerializationHelper.serialize((Serializable) executionContextData);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java
deleted file mode 100644
index 57ce70c08..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package at.gv.egovernment.moa.id.process.dao;
-
-import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
-import at.gv.egovernment.moa.id.process.ProcessInstance;
-
-public interface ProcessInstanceStoreDAO {
-
- /**
- * Stores a {@link ProcessInstance} defined by {@code pIStore} in the
- * database.
- *
- * @param pIStore
- * the {@link ProcessInstanceStore} to persist.
- * @throws MOADatabaseException
- * is thrown if a problem occurs while accessing the database.
- */
- void saveOrUpdate(ProcessInstanceStore pIStore) throws MOADatabaseException;
-
- /**
- * Returns a {@link ProcessInstanceStore}, defined by
- * {@code processInstanceID} from the database, or {@code null} if the
- * object could not be found.
- *
- * @param processInstanceId
- * the id of the {@code ProcessInstanceStore} to retrieve.
- * @return a ProcessInstanceStore, or {@code null}.
- * @throws MOADatabaseException
- * is thrown if a problem occurs while accessing the database.
- */
- ProcessInstanceStore load(String processInstanceId) throws MOADatabaseException;
-
- /**
- * Deletes the {@link ProcessInstance} corresponding with the
- * {@code processInstanceId}.
- *
- * @param processInstanceId
- * the id of the {@code ProcessInstance} to be deleted.
- * @throws MOADatabaseException
- * is thrown if a problem occurs while accessing the database.
- */
- void remove(String processInstanceId) throws MOADatabaseException;
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java
deleted file mode 100644
index 428931b5e..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAOImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package at.gv.egovernment.moa.id.process.dao;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
-import at.gv.egovernment.moa.id.storage.ITransactionStorage;
-
-/**
- * Database backed implementation of the {@link ProcessInstanceStoreDAO}
- * interface.
- */
-@Service("ProcessInstanceStoreage")
-public class ProcessInstanceStoreDAOImpl implements ProcessInstanceStoreDAO {
-
- private Logger log = LoggerFactory.getLogger(getClass());
-
- @Autowired ITransactionStorage transactionStorage;
-
- @Override
- public void saveOrUpdate(ProcessInstanceStore pIStore) throws MOADatabaseException {
- try {
- transactionStorage.put(pIStore.getProcessInstanceId(), pIStore, -1);
-
-// MOASessionDBUtils.saveOrUpdate(pIStore);
- log.debug("Store process instance with='{}' in the database.", pIStore.getProcessInstanceId());
- } catch (MOADatabaseException e) {
- log.warn("ProcessInstanceStore could not be persisted to the database.");
- throw e;
- }
- }
-
- @Override
- public ProcessInstanceStore load(String processInstanceId) throws MOADatabaseException {
-
- log.debug("Retrieve the ProcessInstanceStore for id='{}' from the database.", processInstanceId);
-
-
-// Session session = MOASessionDBUtils.getCurrentSession();
-//
- ProcessInstanceStore result = null;
-// Transaction tx = null;
-// synchronized (session) {
- try {
-
- result = transactionStorage.get(processInstanceId, ProcessInstanceStore.class);
-
-// tx = session.beginTransaction();
-// // select all where processInstanceId equals processInstanceId
-// Criteria criteria = session.createCriteria(ProcessInstanceStore.class);
-// criteria.add(Restrictions.eq("processInstanceId", processInstanceId));
-// result = (ProcessInstanceStore) criteria.uniqueResult();
-// tx.commit();
-//
- } catch (Exception e) {
- log.error("There are multiple persisted processes with the same process instance id '{}'",
- processInstanceId);
-// if (tx != null) {
-// tx.rollback();
-// }
- throw e;
- } finally {
- //MOASessionDBUtils.closeSession();
- }
-// }
- if (result != null) {
- log.debug("Found process instance store for instance '{}'.", processInstanceId);
- } else {
- log.debug("Unable to find process instance store for instance '{}'.", processInstanceId);
- }
- return result;
- }
-
- @Override
- public void remove(String processInstanceId) throws MOADatabaseException {
-
- log.debug("Delete the ProcessInstanceStore for id='{}' from the database.", processInstanceId);
- //ProcessInstanceStore toBeDeleted = load(processInstanceId);
-
- if (transactionStorage.containsKey(processInstanceId)) {
- transactionStorage.remove(processInstanceId);
-// if (!MOASessionDBUtils.delete(toBeDeleted)) {
-// log.warn("Could not delete the ProcessInstanceStore with process instance id '{}'", processInstanceId);
-// throw new MOADatabaseException("Could not delete the ProcessInstanceStore with process instance id '"
-// + processInstanceId + "'.");
-// }
- } else
- log.trace("ProcessInstanceStore for id='{}' was not found and could therefore not be deleted.", processInstanceId);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/EndEvent.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/EndEvent.java
deleted file mode 100644
index 49fb082ea..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/EndEvent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.io.Serializable;
-
-import org.apache.commons.collections4.CollectionUtils;
-
-/**
- * Represents an end event. Process execution terminates when an end event is reached.
- *
- * @author tknall
- */
-public class EndEvent extends ProcessNode implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("EndEvent [");
- if (getId() != null) {
- builder.append("id=");
- builder.append(getId());
- }
- if (CollectionUtils.isNotEmpty(getIncomingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("incomingTransitions=");
- builder.append(getIncomingTransitions());
- }
- if (CollectionUtils.isNotEmpty(getOutgoingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("outgoingTransitions=");
- builder.append(getOutgoingTransitions());
- }
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessDefinition.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessDefinition.java
deleted file mode 100644
index 518409ecf..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessDefinition.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Objects;
-
-import at.gv.egovernment.moa.id.process.ProcessDefinitionParser;
-
-/**
- * Represents a single process definition containing
- *
- * - a {@link StartEvent},
- * - one or more {@linkplain TaskInfo Tasks},
- * - one or more {@linkplain EndEvent EndEvents} and
- * - some {@linkplain Transition Transitions} linking StartEvents, Tasks and EndEvents.
- *
- *
- * @author tknall
- *
- */
-public class ProcessDefinition {
-
- private String id;
- private StartEvent startEvent;
- private Map taskInfos = new LinkedHashMap<>();
- private Map endEvents = new LinkedHashMap<>();
-
- /**
- * Returns the unique identifier of the process definition.
- *
- * @return The unique identifier (never {@code null} if process definition comes from
- * {@link ProcessDefinitionParser}).
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the unique identifier of the process definition.
- *
- * @param id
- * The unique identifier.
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Returns the start event of the process definition.
- *
- * @return The start event (never {@code null} if process definition comes from {@link ProcessDefinitionParser}).
- */
- public StartEvent getStartEvent() {
- return startEvent;
- }
-
- /**
- * Sets the start event of the process definition.
- *
- * @param startEvent
- * The start event.
- */
- public void setStartEvent(StartEvent startEvent) {
- this.startEvent = startEvent;
- }
-
- /**
- * Returns a map containing the tasks of the process definition.
- *
- * @return The tasks (map is never {@code null} if process definition comes from {@link ProcessDefinitionParser}).
- */
- public Map getTaskInfos() {
- return taskInfos;
- }
-
- /**
- * Sets the map containing the tasks.
- *
- * @param taskInfos
- * The map containing the tasks.
- */
- public void setTaskInfos(Map taskInfos) {
- this.taskInfos = taskInfos;
- }
-
- /**
- * Returns a map containing the end events of the process description.
- *
- * @return The map containing the end events (map is never {@code null} if process definition comes from
- * {@link ProcessDefinitionParser}).
- */
- public Map getEndEvents() {
- return endEvents;
- }
-
- /**
- * Sets a map containing the end events of the process description.
- *
- * @param endEvents
- * The map containing the end events.
- */
- public void setEndEvents(Map endEvents) {
- this.endEvents = endEvents;
- }
-
- /**
- * Returns the process node associated with the given {@code id}.
- *
- * @param id
- * The identifier of the process node.
- * @return The process node (may be {code null} when no process node with the given {@code id} exists).
- */
- public ProcessNode getProcessNode(String id) {
- Objects.requireNonNull(id, "Identifier must not be null.");
- if (startEvent != null && id.equals(startEvent.getId())) {
- return startEvent;
- }
- TaskInfo task = taskInfos.get(id);
- if (task != null) {
- return task;
- }
- return endEvents.get(id);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- if (id != null) {
- builder.append("id=");
- builder.append(id);
- }
- if (startEvent != null) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("startEvent=");
- builder.append(startEvent);
- }
- if (taskInfos != null && !taskInfos.isEmpty()) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("tasksInfos=");
- builder.append(taskInfos.values());
- }
- if (endEvents != null && !endEvents.isEmpty()) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("endEvents=");
- builder.append(endEvents.values());
- }
- builder.insert(0, "ProcessDefinition [");
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessNode.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessNode.java
deleted file mode 100644
index 42f2e3cc2..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/ProcessNode.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import at.gv.egovernment.moa.id.process.ProcessDefinitionParser;
-
-/**
- * Represents a {@link StartEvent}, an {@link EndEvent} or a {@linkplain TaskInfo Task}.
- * @author tknall
- *
- */
-public abstract class ProcessNode {
-
- private String id;
- private List outgoingTransitions = new ArrayList<>();
- private List incomingTransitions = new ArrayList<>();
-
- /**
- * Returns the unique identifier of the process node.
- *
- * @return The unique identifier (never {@code null} if process node comes from a process definition from
- * {@link ProcessDefinitionParser}).
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the unique identifier of the process node.
- * @param id The unique identifier.
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Returns a list of transitions pointing from this process node to another one.
- * @return A list of transitions (never {@code null} if process node comes from a process definition from {@link ProcessDefinitionParser}).
- */
- public List getOutgoingTransitions() {
- return outgoingTransitions;
- }
-
- /**
- * Sets the list of transitions pointing from this process node to another one.
- * @param outgoingTransitions The list of transitions originating from this process node.
- */
- public void setOutgoingTransitions(List outgoingTransitions) {
- this.outgoingTransitions = outgoingTransitions;
- }
-
- /**
- * Returns a list of transitions pointing from another process node to this one.
- * @return A list of transitions (never {@code null} if process node comes from a process definition from {@link ProcessDefinitionParser}).
- */
- public List getIncomingTransitions() {
- return incomingTransitions;
- }
-
- /**
- * Sets the list of transitions pointing from another process node to this one.
- * @param incomingTransitions A list of transitions pointing to this process node.
- */
- public void setIncomingTransitions(List incomingTransitions) {
- this.incomingTransitions = incomingTransitions;
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/StartEvent.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/StartEvent.java
deleted file mode 100644
index 60175e09c..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/StartEvent.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.io.Serializable;
-
-import org.apache.commons.collections4.CollectionUtils;
-
-/**
- * Represents a start event. Each process description contains a single start event. Process execution starts with a
- * start event.
- *
- * @author tknall
- *
- */
-public class StartEvent extends ProcessNode implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("StartEvent [");
- if (getId() != null) {
- builder.append("id=");
- builder.append(getId());
- }
- if (CollectionUtils.isNotEmpty(getIncomingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("incomingTransitions=");
- builder.append(getIncomingTransitions());
- }
- if (CollectionUtils.isNotEmpty(getOutgoingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("outgoingTransitions=");
-
- builder.append(getOutgoingTransitions());
- }
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/TaskInfo.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/TaskInfo.java
deleted file mode 100644
index 78a9d6a0a..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/TaskInfo.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.io.Serializable;
-
-import org.apache.commons.collections4.CollectionUtils;
-
-import at.gv.egovernment.moa.id.process.api.Task;
-
-/**
- * Represents information about a single task to be performed upon process execution.
- * @author tknall
- *
- */
-public class TaskInfo extends ProcessNode implements Serializable {
-
- private static final long serialVersionUID = 1L;
- private static final boolean DEFAULT_ASYNC = false;
-
- private String taskImplementingClass;
- private boolean async = DEFAULT_ASYNC;
-
- /**
- * Determines if the task is marked asynchronous ({@code true}) or synchronous ({@code false}).
- * @return A flag indicating if the task should be executed asynchronously or synchronously. (Default: {@code false})
- */
- public boolean isAsync() {
- return async;
- }
-
- /**
- * Marks a task to executed asynchronously ({@code true}) or synchronously ({@code false}).
- * @param async The flag.
- */
- public void setAsync(boolean async) {
- this.async = async;
- }
-
- /**
- * Returns the class that implements the actual task (must implement {@link Task}).
- * @return The task implementing class.
- */
- public String getTaskImplementingClass() {
- return taskImplementingClass;
- }
-
- /**
- * Sets the class that implements the actual task (must implement {@link Task}).
- * @param taskImplementingClass The task implementing class.
- */
- public void setTaskImplementingClass(String taskImplementingClass) {
- this.taskImplementingClass = taskImplementingClass;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- if (getId() != null) {
- builder.append("id=");
- builder.append(getId());
- }
- if (async != DEFAULT_ASYNC) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("async=");
- builder.append(async);
- }
- if (taskImplementingClass != null) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("taskImplementingClass=");
- builder.append(taskImplementingClass);
- }
- if (CollectionUtils.isNotEmpty(getIncomingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("incomingTransitions=");
- builder.append(getIncomingTransitions());
- }
- if (CollectionUtils.isNotEmpty(getOutgoingTransitions())) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("outgoingTransitions=");
- builder.append(getOutgoingTransitions());
- }
- builder.insert(0, "TaskInfo [");
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/Transition.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/Transition.java
deleted file mode 100644
index bc3005534..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/model/Transition.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package at.gv.egovernment.moa.id.process.model;
-
-import java.io.Serializable;
-
-import at.gv.egovernment.moa.id.process.ProcessDefinitionParser;
-
-/**
- * Represents a single transition from a {@link StartEvent} or {@linkplain TaskInfo Task} to another
- * {@linkplain TaskInfo Task} or {@link EndEvent}.
- *
- * @author tknall
- *
- */
-public class Transition implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String id;
- private String conditionExpression;
- private ProcessNode from;
- private ProcessNode to;
-
- /**
- * Returns the process node (effectively a {@link StartEvent} or {@linkplain TaskInfo Task}) the transition is
- * pointing from.
- *
- * @return The transition's source process node (never {@code null} if transition comes from a process definition
- * from {@link ProcessDefinitionParser}).
- */
- public ProcessNode getFrom() {
- return from;
- }
-
- /**
- * Sets the process node the transition is pointing from.
- *
- * @param from
- * The transition's source process node.
- */
- public void setFrom(ProcessNode from) {
- this.from = from;
- }
-
- /**
- * Returns the process node (effectively a {@linkplain TaskInfo Task} or {@link EndEvent}) the transition is
- * pointing to.
- *
- * @return The transition's destination process node (never {@code null} if transition comes from a process
- * definition from {@link ProcessDefinitionParser}).
- */
- public ProcessNode getTo() {
- return to;
- }
-
- /**
- * Sets the process node the transition is pointing to.
- *
- * @param to
- * The transition's destination process node.
- */
- public void setTo(ProcessNode to) {
- this.to = to;
- }
-
- /**
- * Returns the unique identifier of the transition.
- *
- * @return The unique identifier (may be {@code null}).
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the unique identifier of the transition.
- *
- * @param id
- * The unique identifier.
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Returns the condition expression for this transition.
- *
- * @return The condition expression (may be {@code null}).
- */
- public String getConditionExpression() {
- return conditionExpression;
- }
-
- /**
- * Sets the condition expression for this transition.
- *
- * @param conditionExpression
- * The condition expression.
- */
- public void setConditionExpression(String conditionExpression) {
- this.conditionExpression = conditionExpression;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- if (id != null) {
- builder.append("id=");
- builder.append(id);
- }
- if (from != null) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("from.id=");
- builder.append(from.getId());
- }
- if (to != null) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("to.id=");
- builder.append(to.getId());
- }
- if (conditionExpression != null) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append("conditionExpression=");
- builder.append(conditionExpression);
- }
- builder.insert(0, "Transition [");
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/spring/SpringExpressionEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/spring/SpringExpressionEvaluator.java
deleted file mode 100644
index 5b30c7172..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/spring/SpringExpressionEvaluator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package at.gv.egovernment.moa.id.process.spring;
-
-import java.util.Objects;
-
-import javax.annotation.PostConstruct;
-
-import org.apache.commons.lang3.BooleanUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.expression.BeanFactoryResolver;
-import org.springframework.expression.Expression;
-import org.springframework.expression.ExpressionParser;
-import org.springframework.expression.spel.standard.SpelExpressionParser;
-import org.springframework.expression.spel.support.StandardEvaluationContext;
-
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluationContext;
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluator;
-import at.gv.egovernment.moa.id.process.model.Transition;
-
-/**
- * Expression evaluator for processing {@link Transition} conditions allowing to reference Spring beans from the
- * application context.
- *
- * @author tknall
- *
- */
-public class SpringExpressionEvaluator implements ExpressionEvaluator {
-
- private Logger log = LoggerFactory.getLogger(getClass());
- private ExpressionParser parser = new SpelExpressionParser();
- private StandardEvaluationContext evaluationContext = new StandardEvaluationContext();
-
- @Autowired(required = false)
- private ApplicationContext ctx;
-
- @PostConstruct
- private void init() {
- if (ctx != null) {
- evaluationContext.setBeanResolver(new BeanFactoryResolver(ctx));
- }
- }
-
- @Override
- public boolean evaluate(ExpressionEvaluationContext expressionContext, String expression) {
- Objects.requireNonNull(expression, "Expression must not be null.");
- log.trace("Evaluating '{}'.", expression);
-
- Expression expr = parser.parseExpression(expression);
- Boolean result = expr.getValue(evaluationContext, expressionContext, Boolean.class);
- if (result == null) {
- log.warn("Evaluation of '{}' results in null-value.", expression);
- } else {
- log.debug("Expression '{}' -> {}", expression, result);
- }
-
- return BooleanUtils.isTrue(result);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/AbstractAuthSourceServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/AbstractAuthSourceServlet.java
deleted file mode 100644
index 738b58834..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/AbstractAuthSourceServlet.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package at.gv.egovernment.moa.id.process.springweb;
-
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
-
-import at.gv.egovernment.moa.id.process.ProcessEngine;
-import at.gv.egovernment.moa.id.process.ProcessInstance;
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-
-/**
- * Abstract HttpServlet that provides means for retrieving the process engine (Spring Web required) as well as
- * retrieving the underlying process instance and execution context evaluating a certain request parameter.
- *
- * @author tknall
- *
- */
-public abstract class AbstractAuthSourceServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- private ProcessEngine processEngine;
-
- /**
- * Returns the name of the request parameter representing the respective instance id.
- * Default is {@code processInstanceId}.
- * @return The request parameter name.
- */
- public String getProcessInstanceIdParameterName() {
- return "processInstanceId";
- }
-
- /**
- * Returns the underlying process engine instance.
- *
- * @return The process engine (never {@code null}).
- * @throws NoSuchBeanDefinitionException
- * if no {@link ProcessEngine} bean was found.
- * @throws NoUniqueBeanDefinitionException
- * if more than one {@link ProcessEngine} bean was found.
- * @throws BeansException
- * if a problem getting the {@link ProcessEngine} bean occurred.
- * @throws IllegalStateException
- * if the Spring WebApplicationContext was not found, which means that the servlet is used outside a
- * Spring web environment.
- */
- public synchronized ProcessEngine getProcessEngine() {
- if (processEngine == null) {
- WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
- if (ctx == null) {
- throw new IllegalStateException(
- "Unable to find Spring WebApplicationContext. Servlet needs to be executed within a Spring web environment.");
- }
- processEngine = ctx.getBean(ProcessEngine.class);
- }
- return processEngine;
- }
-
- /**
- * Retrieves the process instance referenced by the request parameter {@link #getProcessInstanceIdParameterName()}.
- *
- * @param request
- * The HttpServletRequest.
- * @return The process instance (never {@code null}).
- * @throws NoSuchBeanDefinitionException
- * if no {@link ProcessEngine} bean was found.
- * @throws NoUniqueBeanDefinitionException
- * if more than one {@link ProcessEngine} bean was found.
- * @throws BeansException
- * if a problem getting the {@link ProcessEngine} bean occurred.
- * @throws IllegalStateException
- * if the Spring WebApplicationContext was not found, which means that the servlet is used outside a
- * Spring web environment.
- * @throws IllegalArgumentException
- * in case the process instance id referenced by the request parameter
- * {@link #getProcessInstanceIdParameterName()} does not exist.
- */
- public ProcessInstance getProcessInstance(HttpServletRequest request) {
- String processInstanceId = StringUtils.trimToNull(request.getParameter(getProcessInstanceIdParameterName()));
- if (processInstanceId == null) {
- throw new IllegalArgumentException("Missing request parameter '" + getProcessInstanceIdParameterName() + "'.");
- }
- return getProcessEngine().getProcessInstance(processInstanceId);
- }
-
- /**
- * Retrieves the execution context for the respective process instance referenced by the request parameter
- * {@link #getProcessInstanceIdParameterName()}.
- *
- * @param request
- * The HttpServletRequest.
- * @return The execution context (never {@code null}).
- * @throws NoSuchBeanDefinitionException
- * if no {@link ProcessEngine} bean was found.
- * @throws NoUniqueBeanDefinitionException
- * if more than one {@link ProcessEngine} bean was found.
- * @throws BeansException
- * if a problem getting the {@link ProcessEngine} bean occurred.
- * @throws IllegalStateException
- * if the Spring WebApplicationContext was not found, which means that the servlet is used outside a
- * Spring web environment.
- * @throws IllegalArgumentException
- * in case the process instance id referenced by the request parameter
- * {@link #getProcessInstanceIdParameterName()} does not exist.
- */
- public ExecutionContext getExecutionContext(HttpServletRequest request) {
- return getProcessInstance(request).getExecutionContext();
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/MoaIdTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/MoaIdTask.java
deleted file mode 100644
index dd0d87dd7..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/MoaIdTask.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package at.gv.egovernment.moa.id.process.springweb;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-import org.springframework.web.filter.RequestContextFilter;
-
-import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-import at.gv.egovernment.moa.id.process.api.Task;
-
-/**
- * Abstract task implementation providing {@link HttpServletRequest} and {@link HttpServletResponse}.
- *
- * Note that this abstract task requires the Spring (web) framework including a {@link RequestContextFilter} to be set
- * within {@code web.xml}.
- *
- *
- * ...
- * <filter>
- * <filter-name>requestContextFilter</filter-name>
- * <filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
- * </filter>
- * <filter-mapping>
- * <filter-name>requestContextFilter</filter-name>
- * <url-pattern>/*</url-pattern>
- * </filter-mapping>
- * ...
- *
- *
- * @author tknall
- * @author tlenz
- *
- */
-public abstract class MoaIdTask implements Task {
-
- /**
- * Executes the task providing the underlying {@link ExecutionContext} {@code executionContext} as well as the
- * respective {@link HttpServletRequest} and {@link HttpServletResponse}.
- *
- * @param executionContext
- * The execution context (never {@code null}).
- * @param request
- * The HttpServletRequest (never {@code null}).
- * @param response
- * The HttpServletResponse (never {@code null}).
- * @throws IllegalStateException
- * Thrown in case the task is nur being run within the required environment. Refer to javadoc for
- * further information.
- * @throws Exception
- * Thrown in case of error executing the task.
- */
- public abstract void execute(ExecutionContext executionContext, HttpServletRequest request,
- HttpServletResponse response) throws TaskExecutionException;
-
- /**
- * Executes the task providing the underlying {@link ExecutionContext} {@code executionContext}
- * and the {@link IRequest} {@code pendingReq }as well as the
- * respective {@link HttpServletRequest} and {@link HttpServletResponse}.
- *
- * This method sets the pending-request object of the task implementation and starts the
- * {@code execute} method of the task
- *
- * @param pendingReq The pending-request object (never {@code null}).
- * @param executionContext The execution context (never {@code null}).
- * @param request The HttpServletRequest (never {@code null}).
- * @param response The HttpServletResponse (never {@code null}).
- * @return The pending-request object, because Process-management works recursive
- *
- * @throws IllegalStateException
- * Thrown in case the task is being run within the required environment. Refer to javadoc for
- * further information.
- * @throws Exception
- * Thrown in case of error executing the task.
- */
- protected abstract IRequest internalExecute(IRequest pendingReq, ExecutionContext executionContext, HttpServletRequest request,
- HttpServletResponse response) throws TaskExecutionException;
-
- @Override
- public IRequest execute(IRequest pendingReq, ExecutionContext executionContext) throws TaskExecutionException {
- RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
- if (requestAttributes != null && requestAttributes instanceof ServletRequestAttributes) {
- HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
- HttpServletResponse response = ((ServletRequestAttributes) requestAttributes).getResponse();
- if (request == null || response == null) {
- throw new IllegalStateException(
- "Spring's RequestContextHolder did not provide HttpServletResponse. Did you forget to set the required org.springframework.web.filter.RequestContextFilter in your web.xml.");
- }
- return internalExecute(pendingReq, executionContext, request, response);
- } else {
- throw new IllegalStateException("Task needs to be executed within a Spring web environment.");
- }
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java
deleted file mode 100644
index af6822ba6..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package at.gv.egovernment.moa.id.process.springweb;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.BooleanUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.expression.BeanFactoryResolver;
-import org.springframework.expression.Expression;
-import at.gv.egovernment.moa.id.process.api.ExecutionContext;
-import org.springframework.expression.ExpressionParser;
-import org.springframework.expression.spel.standard.SpelExpressionParser;
-import org.springframework.expression.spel.support.StandardEvaluationContext;
-
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluationContext;
-import at.gv.egovernment.moa.id.process.api.ExpressionEvaluator;
-import at.gv.egovernment.moa.id.process.model.Transition;
-
-/**
- * Expression evaluator for processing {@link Transition} conditions allowing to
- *
- * - reference Spring beans from the application context using {@code @myBeanName...},
- * - {@link ExecutionContext} properties using {@code ctx['property']},
- * - Multi valued {@link HttpServletRequest} parameters using {@code requestParameters['foo']} (keep in mind that this
- * expression returns an array of String values) and
- * - Single valued {@link HttpServletRequest} parameters using {@code requestParameter['foo']}
- *
- *
- * @author tknall
- *
- */
-public class SpringWebExpressionEvaluator implements ExpressionEvaluator {
-
- private Logger log = LoggerFactory.getLogger(getClass());
- private ExpressionParser parser = new SpelExpressionParser();
- private StandardEvaluationContext evaluationContext = new StandardEvaluationContext();
-
- @Autowired(required = false)
- private ApplicationContext ctx;
-
- @Autowired(required = false)
- private HttpServletRequest request;
-
- @PostConstruct
- private void init() {
- if (ctx != null) {
- evaluationContext.setBeanResolver(new BeanFactoryResolver(ctx));
- }
- }
-
- /**
- * Evaluation context that provides access to {@link HttpServletRequest} parameters using
- * {@code requestParameter['foo']} for single value parameters or {@code requestParameters['foo']} for multi value
- * parameters. Basic calls to {@code ctx} will be delegated.
- *
- * @author tknall
- *
- */
- private class SpringWebExpressionEvaluationContext implements ExpressionEvaluationContext {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates a new expression evaluation context, providing access to HttpServletRequest parameter(s).
- *
- * @param delegate
- * The original {@link ExpressionEvaluationContext} to be delegated to for {@code ctx['foo']}
- * expressions.
- */
- public SpringWebExpressionEvaluationContext(ExpressionEvaluationContext delegate) {
- this.delegate = delegate;
- }
-
- private ExpressionEvaluationContext delegate;
-
- @Override
- public Map getCtx() {
- return delegate.getCtx();
- }
-
- @SuppressWarnings("unused")
- public Map getRequestParameter() {
- if (request != null) {
- Map singleValueMap = new HashMap();
- Iterator> it = request.getParameterMap().entrySet().iterator();
- while (it.hasNext()) {
- Entry entry = it.next();
- if (ArrayUtils.isNotEmpty(entry.getValue())) {
- singleValueMap.put(entry.getKey(), entry.getValue()[0]);
- }
- }
- return singleValueMap;
- } else {
- return Collections. emptyMap();
- }
- }
-
- @SuppressWarnings("unused")
- public Map getRequestParameters() {
- if (request != null) {
- return request.getParameterMap();
- } else {
- return Collections. emptyMap();
- }
- }
-
- }
-
- @Override
- public boolean evaluate(ExpressionEvaluationContext expressionContext, String expression) {
- Objects.requireNonNull(expression, "Expression must not be null.");
- log.trace("Evaluating '{}'.", expression);
-
- Expression expr = parser.parseExpression(expression);
- Boolean result = null;
- try {
- result = expr.getValue(evaluationContext, new SpringWebExpressionEvaluationContext(expressionContext),
- Boolean.class);
- if (result == null) {
- log.warn("Evaluation of '{}' results in null-value.", expression);
- } else {
- log.debug("Expression '{}' -> {}", expression, result);
- }
- } catch (Exception e) {
- log.warn("Expression '{}' could not be processed.", expression, e);
- }
-
- return BooleanUtils.isTrue(result);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/support/SecureRandomHolder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/support/SecureRandomHolder.java
deleted file mode 100644
index 72677739a..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/support/SecureRandomHolder.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package at.gv.egovernment.moa.id.process.support;
-
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-
-/**
- * Holder for a secure random instance following the initialization on demand holder design pattern. The secure random
- * instance is a singleton that is initialized on first usage.
- *
- * @author tknall
- *
- */
-public class SecureRandomHolder {
-
- private SecureRandomHolder() {
- }
-
- private static final SecureRandom SRND_INSTANCE;
- static {
- try {
- SRND_INSTANCE = SecureRandom.getInstance("SHA1PRNG");
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException("Unable to instantiate SHA1PRNG.", e);
- }
- }
-
- /**
- * Returns a secure random generator instance.
- * @return The secure random instance.
- */
- public static SecureRandom getInstance() {
- return SecureRandomHolder.SRND_INSTANCE;
- }
-
-}
\ No newline at end of file
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java
deleted file mode 100644
index 9b30368e3..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egovernment.moa.id.protocols;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-
-import at.gv.egovernment.moa.id.advancedlogging.MOAIDEventConstants;
-import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataBuilder;
-import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
-import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
-import at.gv.egovernment.moa.id.auth.servlet.AbstractController;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-import at.gv.egovernment.moa.id.commons.api.data.IAuthenticationSession;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.data.SLOInformationInterface;
-import at.gv.egovernment.moa.id.moduls.AuthenticationManager;
-import at.gv.egovernment.moa.id.moduls.IAction;
-import at.gv.egovernment.moa.id.moduls.IModulInfo;
-import at.gv.egovernment.moa.id.moduls.RequestImpl;
-import at.gv.egovernment.moa.id.moduls.SSOManager;
-import at.gv.egovernment.moa.id.storage.IAuthenticationSessionStoreage;
-import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.util.MiscUtil;
-
-/**
- * @author tlenz
- *
- */
-
-public abstract class AbstractAuthProtocolModulController extends AbstractController implements IModulInfo {
-
- public static final String FINALIZEPROTOCOL_ENDPOINT = "finalizeAuthProtocol";
-
- @Autowired protected ApplicationContext applicationContext;
- @Autowired private SSOManager ssomanager;
- @Autowired protected AuthenticationManager authmanager;
- @Autowired protected IAuthenticationSessionStoreage authenticatedSessionStorage;
- @Autowired private AuthenticationDataBuilder authDataBuilder;
-
- /**
- * Initialize an authentication process for this protocol request
- *
- * @param httpReq HttpServletRequest
- * @param httpResp HttpServletResponse
- * @param protocolRequest Authentication request which is actually in process
- * @throws IOException
- */
- protected void performAuthentication(HttpServletRequest req, HttpServletResponse resp,
- RequestImpl pendingReq) throws IOException {
- try {
- if (pendingReq.isNeedAuthentication()) {
- //request needs authentication --> start authentication process ...
-
- //load Parameters from OnlineApplicationConfiguration
- IOAAuthParameters oaParam = pendingReq.getOnlineApplicationConfiguration();
-
- if (oaParam == null) {
- throw new AuthenticationException("auth.00", new Object[] { pendingReq.getOAURL() });
- }
-
-
- AuthenticationSession ssoMoaSession = authmanager.doAuthentication(req, resp, pendingReq);
- if (ssoMoaSession != null) {
- //authenticated MOASession already exists --> protocol-specific postProcessing can start directly
- finalizeAuthenticationProcess(req, resp, pendingReq, ssoMoaSession);
-
- //transaction is finished, log transaction finished event
- revisionsLogger.logEvent(MOAIDEventConstants.TRANSACTION_DESTROYED, pendingReq.getUniqueTransactionIdentifier());
-
- }
-
- } else {
- executeProtocolSpecificAction(req, resp, pendingReq, null);
-
- }
-
- } catch (Exception e) {
- buildProtocolSpecificErrorResponse(e, req, resp, pendingReq);
-
- removeUserSession(pendingReq, req, resp);
-
- }
- }
-
-
- protected String createNewSSOSessionCookie(HttpServletRequest req, HttpServletResponse resp,
- IRequest pendingReq, IAuthenticationSession moaSession) {
- Logger.debug("Add SSO information to MOASession.");
-
- //Store SSO information into database
- String newSSOSessionId = ssomanager.createSSOSessionInformations(moaSession.getSessionID(),
- pendingReq.getOAURL());
-
- //set SSO cookie to response
- if (MiscUtil.isNotEmpty(newSSOSessionId)) {
- ssomanager.setSSOSessionID(req, resp, newSSOSessionId);
-
- } else {
- ssomanager.deleteSSOSessionID(req, resp);
-
- }
-
- return newSSOSessionId;
- }
-
- /**
- * Finalize the requested protocol operation
- *
- * @param httpReq HttpServletRequest
- * @param httpResp HttpServletResponse
- * @param protocolRequest Authentication request which is actually in process
- * @param moaSession MOASession object, which is used to generate the protocol specific authentication information
- * @throws Exception
- */
- protected void finalizeAuthenticationProcess(HttpServletRequest req, HttpServletResponse resp,
- IRequest pendingReq, IAuthenticationSession moaSession) throws Exception {
-
- String newSSOSessionId = null;
-
- //if Single Sign-On functionality is enabled for this request
- if (pendingReq.needSingleSignOnFunctionality()) {
- newSSOSessionId = createNewSSOSessionCookie(req, resp, pendingReq, moaSession);
-
- }
-
- //build authenticationdata from session information and OA configuration
- IAuthData authData = authDataBuilder.buildAuthenticationData(pendingReq, moaSession);
-
- //execute the protocol-specific action
- SLOInformationInterface sloInformation = executeProtocolSpecificAction(req, resp, pendingReq, authData);
-
- //check if SSO
- boolean isSSOCookieSetted = MiscUtil.isNotEmpty(newSSOSessionId);
-
- //Store OA specific SSO session information if an SSO cookie is set
- if (isSSOCookieSetted) {
- try {
- AuthenticationSession internalDBSSOSession = null;
-
- //create new SSO session, if actually no SSO session exists
- if (MiscUtil.isEmpty(pendingReq.getInternalSSOSessionIdentifier())) {
- internalDBSSOSession = authenticatedSessionStorage.createInternalSSOSession(pendingReq);
- authenticatedSessionStorage.addSSOInformation(internalDBSSOSession.getSessionID(),
- newSSOSessionId, sloInformation, pendingReq);
-
- //MOA SSO-session already exists only update is required
- } else if (MiscUtil.isNotEmpty(pendingReq.getInternalSSOSessionIdentifier()) &&
- moaSession instanceof AuthenticationSession) {
- authenticatedSessionStorage.addSSOInformation(moaSession.getSessionID(),
- newSSOSessionId, sloInformation, pendingReq);
-
- } else {
- Logger.fatal("MOA-Session data object has a suspect or unsupported type:" + moaSession.getClass().getName()
- + " pendingReq_internalSsoId:" + pendingReq.getInternalSSOSessionIdentifier());
- throw new AuthenticationException("1299", null);
-
- }
-
- } catch (AuthenticationException e) {
- Logger.warn("SSO Session information can not be stored -> SSO is not enabled!");
- authmanager.performOnlyIDPLogOut(req, resp, moaSession.getSessionID());
-
- }
-
- } else {
- //remove MOASession from database
- authmanager.performOnlyIDPLogOut(req, resp, moaSession.getSessionID());
-
- }
-
- //Advanced statistic logging
- statisticLogger.logSuccessOperation(pendingReq, authData, isSSOCookieSetted);
-
- }
-
- /**
- * Executes the requested protocol action
- *
- * @param httpReq HttpServletRequest
- * @param httpResp HttpServletResponse
- * @param protocolRequest Authentication request which is actually in process
- * @param authData Service-provider specific authentication data
- *
- * @return Return Single LogOut information or null if protocol supports no SSO
- *
- * @throws Exception
- */
- private SLOInformationInterface executeProtocolSpecificAction(HttpServletRequest httpReq, HttpServletResponse httpResp,
- IRequest pendingReq, IAuthData authData) throws Exception {
- try {
- // request needs no authentication --> start request processing
- Class> clazz = Class.forName(pendingReq.requestedAction());
- if (clazz == null ||
- !IAction.class.isAssignableFrom(clazz)) {
- Logger.fatal("Requested protocol-action processing Class is NULL or does not implement the IAction interface.");
- throw new Exception("Requested protocol-action processing Class is NULL or does not implement the IAction interface.");
-
- }
-
- IAction protocolAction = (IAction) applicationContext.getBean(clazz);
- return protocolAction.processRequest(pendingReq, httpReq, httpResp, authData);
-
- } catch (ClassNotFoundException e) {
- Logger.fatal("Requested Auth. protocol processing Class is NULL or does not implement the IAction interface.");
- throw new Exception("Requested Auth. protocol processing Class is NULL or does not implement the IAction interface.");
- }
-
- }
-
- protected void removeUserSession(IRequest pendingReq, HttpServletRequest req,
- HttpServletResponse resp) {
- authmanager.performOnlyIDPLogOut(req, resp, pendingReq.getInternalSSOSessionIdentifier());
-
- }
-
- protected void buildProtocolSpecificErrorResponse(Throwable throwable, HttpServletRequest req,
- HttpServletResponse resp, IRequest protocolRequest) throws IOException {
- try {
-
- Class> clazz = Class.forName(protocolRequest.requestedModule());
-
- if (clazz == null ||
- !IModulInfo.class.isAssignableFrom(clazz)) {
- Logger.fatal("Requested protocol module Class is NULL or does not implement the IModulInfo interface.");
- throw new Exception("Requested protocol module Class is NULL or does not implement the IModulInfo interface.");
-
- }
-
- IModulInfo handlingModule = (IModulInfo) applicationContext.getBean(clazz);
-
- if (handlingModule.generateErrorMessage(
- throwable, req, resp, protocolRequest)) {
-
- //log Error to technical log
- logExceptionToTechnicalLog(throwable);
-
- //log Error Message
- statisticLogger.logErrorOperation(throwable, protocolRequest);
-
- //write revision log entries
- revisionsLogger.logEvent(protocolRequest, MOAIDEventConstants.TRANSACTION_ERROR, protocolRequest.getUniqueTransactionIdentifier());
-
- return;
-
- } else {
- handleErrorNoRedirect(throwable, req, resp, true);
-
- }
-
- } catch (Throwable e) {
- handleErrorNoRedirect(throwable, req, resp, true);
-
- }
-
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.moduls.IModulInfo#getName()
- */
- @Override
- public abstract String getName();
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.moduls.IModulInfo#getPath()
- */
- @Override
- public abstract String getPath();
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.moduls.IModulInfo#generateErrorMessage(java.lang.Throwable, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.moduls.IRequest)
- */
- @Override
- public abstract boolean generateErrorMessage(Throwable e, HttpServletRequest request, HttpServletResponse response,
- IRequest protocolRequest) throws Throwable;
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.moduls.IModulInfo#validate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.moduls.IRequest)
- */
- @Override
- public abstract boolean validate(HttpServletRequest request, HttpServletResponse response, IRequest pending);
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/ProtocolFinalizationController.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/ProtocolFinalizationController.java
deleted file mode 100644
index 41a4c9835..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/ProtocolFinalizationController.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egovernment.moa.id.protocols;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import at.gv.egovernment.moa.id.advancedlogging.MOAIDEventConstants;
-import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
-import at.gv.egovernment.moa.id.commons.api.data.IAuthenticationSession;
-import at.gv.egovernment.moa.id.commons.api.exceptions.MOAIDException;
-import at.gv.egovernment.moa.id.data.ExceptionContainer;
-import at.gv.egovernment.moa.logging.Logger;
-
-/**
- * @author tlenz
- *
- */
-@Controller
-public class ProtocolFinalizationController extends AbstractAuthProtocolModulController {
-
- @RequestMapping(value = "/finalizeAuthProtocol", method = {RequestMethod.GET})
- public void finalizeAuthProtocol(HttpServletRequest req, HttpServletResponse resp) throws MOAIDException, IOException {
-
- //read pendingRequest from http request
- Object idObject = StringEscapeUtils.escapeHtml(req.getParameter(PARAM_TARGET_PENDINGREQUESTID));
- IRequest pendingReq = null;
- String pendingRequestID = null;
- if (idObject != null && (idObject instanceof String)) {
- pendingRequestID = (String) idObject;
- pendingReq = requestStorage.getPendingRequest(pendingRequestID);
-
- }
-
- //receive an authentication error
- String errorid = StringEscapeUtils.escapeHtml(req.getParameter(ERROR_CODE_PARAM));
- if (errorid != null) {
- try {
- //load stored exception from database
- ExceptionContainer container = transactionStorage.get(errorid, ExceptionContainer.class);
- if (container != null) {
- //remove exception if it was found
- transactionStorage.remove(errorid);
-
- Throwable throwable = container.getExceptionThrown();
-
- if (pendingReq != null) {
- //build protocol-specific error message if possible
- buildProtocolSpecificErrorResponse(throwable, req, resp, pendingReq);
-
- //remove active user-session
- removeUserSession(pendingReq, req, resp);
-
- return;
-
- } else {
- handleErrorNoRedirect(throwable, req, resp, true);
-
- }
- } else {
- handleErrorNoRedirect(new MOAIDException("auth.26", null), req, resp, false);
-
- }
-
- } catch (Throwable e) {
- Logger.error(e);
- handleErrorNoRedirect(e, req, resp, false);
-
- }
-
- // receive a pending request
- } else {
- if (pendingReq == null) {
- Logger.error("No PendingRequest with ID " + pendingRequestID + " found.!");
- handleErrorNoRedirect(new MOAIDException("auth.28", new Object[]{pendingRequestID}), req, resp, false);
- return;
-
- }
- try {
- Logger.debug("Finalize PendingRequest with ID " + pendingRequestID);
-
- //get MOA session data object from pending request
- IAuthenticationSession pendingMoaSession = pendingReq.getMOASession();
-
- //check if pending-request has 'abortedByUser' flag set
- if (pendingReq.isAbortedByUser()) {
- //send authentication aborted error to Service Provider
- buildProtocolSpecificErrorResponse(
- new AuthenticationException("auth.21", new Object[] {}),
- req, resp, pendingReq);
-
- //do not remove the full active SSO-Session
- // in case of only one Service-Provider authentication request is aborted
- if ( !(pendingMoaSession.isAuthenticated()
- && pendingReq.needSingleSignOnFunctionality()) ) {
- removeUserSession(pendingReq, req, resp);
-
- }
-
- //check if MOASession and pending-request are authenticated
- } else if (pendingMoaSession.isAuthenticated() && pendingReq.isAuthenticated()) {
- finalizeAuthenticationProcess(req, resp, pendingReq, pendingMoaSession);
-
- } else {
- //suspect state: pending-request is not aborted but also are not authenticated
- Logger.error("MOASession oder Pending-Request are not authenticated --> Abort authentication process!");
- handleErrorNoRedirect(new MOAIDException("auth.20", null), req, resp, true);
-
- }
-
- } catch (Exception e) {
- Logger.error("Finalize authentication protocol FAILED." , e);
- buildProtocolSpecificErrorResponse(e, req, resp, pendingReq);
-
- removeUserSession(pendingReq, req, resp);
-
- }
- }
-
- //remove pending-request
- if (pendingReq != null) {
- requestStorage.removePendingRequest(pendingReq.getRequestID());
- revisionsLogger.logEvent(MOAIDEventConstants.TRANSACTION_DESTROYED, pendingReq.getUniqueTransactionIdentifier());
-
- }
-
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.protocols.AbstractProtocolModulController#getName()
- */
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.protocols.AbstractProtocolModulController#getPath()
- */
- @Override
- public String getPath() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.protocols.AbstractProtocolModulController#generateErrorMessage(java.lang.Throwable, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.moduls.IRequest)
- */
- @Override
- public boolean generateErrorMessage(Throwable e, HttpServletRequest request, HttpServletResponse response,
- IRequest protocolRequest) throws Throwable {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see at.gv.egovernment.moa.id.protocols.AbstractProtocolModulController#validate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, at.gv.egovernment.moa.id.moduls.IRequest)
- */
- @Override
- public boolean validate(HttpServletRequest request, HttpServletResponse response, IRequest pending) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BPKAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BPKAttributeBuilder.java
index c13c5e288..9262e97c2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BPKAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BPKAttributeBuilder.java
@@ -22,10 +22,12 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.builder.attributes;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -36,8 +38,8 @@ public class BPKAttributeBuilder implements IPVPAttributeBuilder {
return BPK_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
String bpk = authData.getBPK();
String type = authData.getBPKType();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BirthdateAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BirthdateAttributeBuilder.java
deleted file mode 100644
index f1d88f877..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/BirthdateAttributeBuilder.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-
-public class BirthdateAttributeBuilder implements IPVPAttributeBuilder {
-
- public String getName() {
- return BIRTHDATE_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
-
- if (authData.getDateOfBirth() != null) {
- DateFormat pvpDateFormat = new SimpleDateFormat(BIRTHDATE_FORMAT_PATTERN);
- String dateString = pvpDateFormat.format(authData.getDateOfBirth());
-
- return g.buildStringAttribute(BIRTHDATE_FRIENDLY_NAME, BIRTHDATE_NAME, dateString);
-
- } else {
- //build empty attribute if no Birthday date is found (STORK2)
- return g.buildEmptyAttribute(BIRTHDATE_FRIENDLY_NAME, BIRTHDATE_NAME);
-
- }
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(BIRTHDATE_FRIENDLY_NAME, BIRTHDATE_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDAuthBlock.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDAuthBlock.java
index 6f7c0dc97..d3b2a5c38 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDAuthBlock.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDAuthBlock.java
@@ -26,10 +26,12 @@ import java.io.IOException;
import org.springframework.util.Base64Utils;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -39,8 +41,8 @@ public class EIDAuthBlock implements IPVPAttributeBuilder {
return EID_AUTH_BLOCK_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
try {
String authblock = authData.getAuthBlock();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCcsURL.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCcsURL.java
index 623acd18e..f87a9b673 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCcsURL.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCcsURL.java
@@ -22,11 +22,12 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.builder.attributes;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.util.MiscUtil;
public class EIDCcsURL implements IPVPAttributeBuilder {
@@ -35,8 +36,8 @@ public class EIDCcsURL implements IPVPAttributeBuilder {
return EID_CCS_URL_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
String bkuurl = authData.getBkuURL();
if (MiscUtil.isNotEmpty(bkuurl))
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCitizenQAALevelAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCitizenQAALevelAttributeBuilder.java
index b254bc305..715bc376e 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCitizenQAALevelAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDCitizenQAALevelAttributeBuilder.java
@@ -22,9 +22,13 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.builder.attributes;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
+
@Deprecated
public class EIDCitizenQAALevelAttributeBuilder implements IPVPAttributeBuilder {
@@ -33,12 +37,12 @@ public class EIDCitizenQAALevelAttributeBuilder implements IPVPAttributeBuilder
return EID_CITIZEN_QAA_LEVEL_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
String qaaLevel = null;
- if (authData.getQAALevel().startsWith(STORK_QAA_PREFIX))
- qaaLevel = authData.getQAALevel().substring(STORK_QAA_PREFIX.length());
+ if (authData.getQAALevel().startsWith(PVPConstants.STORK_QAA_PREFIX))
+ qaaLevel = authData.getQAALevel().substring(PVPConstants.STORK_QAA_PREFIX.length());
else
qaaLevel = authData.getQAALevel();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIdentityLinkBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIdentityLinkBuilder.java
deleted file mode 100644
index a01605986..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIdentityLinkBuilder.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import java.io.IOException;
-
-import org.springframework.util.Base64Utils;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
-import at.gv.egovernment.moa.logging.Logger;
-
-public class EIDIdentityLinkBuilder implements IPVPAttributeBuilder {
-
- public String getName() {
- return EID_IDENTITY_LINK_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
- try {
- String ilAssertion = null;
-
- if (authData.getIdentityLink() == null)
- throw new UnavailableAttributeException(EID_IDENTITY_LINK_NAME);
-
- ilAssertion = authData.getIdentityLink().getSerializedSamlAssertion();
-
- return g.buildStringAttribute(EID_IDENTITY_LINK_FRIENDLY_NAME,
- EID_IDENTITY_LINK_NAME, Base64Utils.encodeToString(ilAssertion.getBytes("UTF-8")));
-
- } catch (IOException e) {
- Logger.warn("IdentityLink serialization error.", e);
- return g.buildEmptyAttribute(EID_IDENTITY_LINK_FRIENDLY_NAME,
- EID_IDENTITY_LINK_NAME);
- }
-
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(EID_IDENTITY_LINK_FRIENDLY_NAME,
- EID_IDENTITY_LINK_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIssuingNationAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIssuingNationAttributeBuilder.java
deleted file mode 100644
index fc80ad7fe..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDIssuingNationAttributeBuilder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.util.MiscUtil;
-
-public class EIDIssuingNationAttributeBuilder implements IPVPAttributeBuilder {
-
- public String getName() {
- return EID_ISSUING_NATION_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
- String countryCode = authData.getCcc();
- if (MiscUtil.isNotEmpty(countryCode))
- return g.buildStringAttribute(EID_ISSUING_NATION_FRIENDLY_NAME,
- EID_ISSUING_NATION_NAME, countryCode);
-
- else
- return null;
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(EID_ISSUING_NATION_FRIENDLY_NAME,
- EID_ISSUING_NATION_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSTORKTOKEN.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSTORKTOKEN.java
index 71fc7966c..b38660a57 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSTORKTOKEN.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSTORKTOKEN.java
@@ -26,11 +26,13 @@ import java.io.IOException;
import org.springframework.util.Base64Utils;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSessionStorageConstants;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -41,8 +43,8 @@ public class EIDSTORKTOKEN implements IPVPAttributeBuilder {
return EID_STORK_TOKEN_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (!authData.isForeigner()) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSectorForIDAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSectorForIDAttributeBuilder.java
index c3300d60f..783e044f8 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSectorForIDAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSectorForIDAttributeBuilder.java
@@ -22,11 +22,12 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.builder.attributes;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.util.MiscUtil;
public class EIDSectorForIDAttributeBuilder implements IPVPAttributeBuilder {
@@ -35,8 +36,8 @@ public class EIDSectorForIDAttributeBuilder implements IPVPAttributeBuilder {
return EID_SECTOR_FOR_IDENTIFIER_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
String bpktype = authData.getBPKType();
if (MiscUtil.isEmpty(authData.getBPKType()))
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSignerCertificate.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSignerCertificate.java
index 4b4296536..2f18c78e2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSignerCertificate.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSignerCertificate.java
@@ -25,10 +25,12 @@ package at.gv.egovernment.moa.id.protocols.builder.attributes;
import org.springframework.util.Base64Utils;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.logging.Logger;
public class EIDSignerCertificate implements IPVPAttributeBuilder {
@@ -37,8 +39,8 @@ public class EIDSignerCertificate implements IPVPAttributeBuilder {
return EID_SIGNER_CERTIFICATE_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
try {
byte[] signerCertificate = authData.getSignerCertificate();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePIN.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePIN.java
deleted file mode 100644
index b4846db12..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePIN.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributePolicyException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
-import at.gv.egovernment.moa.util.MiscUtil;
-
-public class EIDSourcePIN implements IPVPAttributeBuilder {
-
- public String getName() {
- return EID_SOURCE_PIN_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
-
- if (authData.isBaseIDTransferRestrication())
- throw new AttributePolicyException(EID_SOURCE_PIN_NAME);
-
- else {
- if (MiscUtil.isEmpty(authData.getIdentificationValue()))
- throw new UnavailableAttributeException(EID_SOURCE_PIN_NAME);
-
- return g.buildStringAttribute(EID_SOURCE_PIN_FRIENDLY_NAME, EID_SOURCE_PIN_NAME, authData.getIdentificationValue());
- }
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(EID_SOURCE_PIN_FRIENDLY_NAME, EID_SOURCE_PIN_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePINType.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePINType.java
deleted file mode 100644
index ccaecb3b6..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDSourcePINType.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
-
-public class EIDSourcePINType implements IPVPAttributeBuilder {
-
- public String getName() {
- return EID_SOURCE_PIN_TYPE_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
-
- if (authData.isBaseIDTransferRestrication())
- throw new UnavailableAttributeException(EID_SOURCE_PIN_TYPE_NAME);
-
- else {
- return g.buildStringAttribute(EID_SOURCE_PIN_TYPE_FRIENDLY_NAME, EID_SOURCE_PIN_TYPE_NAME, authData.getIdentificationType());
- }
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(EID_SOURCE_PIN_TYPE_FRIENDLY_NAME, EID_SOURCE_PIN_TYPE_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDeIDASQAALevelAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDeIDASQAALevelAttributeBuilder.java
deleted file mode 100644
index ca3dfa765..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EIDeIDASQAALevelAttributeBuilder.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-
-public class EIDeIDASQAALevelAttributeBuilder implements IPVPAttributeBuilder {
-
- public String getName() {
- return EID_CITIZEN_EIDAS_QAA_LEVEL_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
-
- return g.buildStringAttribute(EID_CITIZEN_EIDAS_QAA_LEVEL_FRIENDLY_NAME,
- EID_CITIZEN_EIDAS_QAA_LEVEL_NAME, authData.getEIDASQAALevel());
- }
-
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(EID_CITIZEN_EIDAS_QAA_LEVEL_FRIENDLY_NAME,
- EID_CITIZEN_EIDAS_QAA_LEVEL_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
index 9dfbe00b2..e91bc90d6 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/EncryptedBPKAttributeBuilder.java
@@ -22,13 +22,12 @@
*******************************************************************************/
package at.gv.egovernment.moa.id.protocols.builder.attributes;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
-import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.util.Constants;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
public class EncryptedBPKAttributeBuilder implements IPVPAttributeBuilder {
@@ -36,8 +35,8 @@ public class EncryptedBPKAttributeBuilder implements IPVPAttributeBuilder {
return ENC_BPK_LIST_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (authData.getEncbPKList() != null &&
authData.getEncbPKList().size() > 0) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/GivenNameAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/GivenNameAttributeBuilder.java
deleted file mode 100644
index af87a319a..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/GivenNameAttributeBuilder.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-
-public class GivenNameAttributeBuilder implements IPVPAttributeBuilder {
-
- public String getName() {
- return GIVEN_NAME_NAME;
- }
-
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
- return g.buildStringAttribute(GIVEN_NAME_FRIENDLY_NAME, GIVEN_NAME_NAME, authData.getGivenName());
- }
-
- public ATT buildEmpty(IAttributeGenerator g) {
- return g.buildEmptyAttribute(GIVEN_NAME_FRIENDLY_NAME, GIVEN_NAME_NAME);
- }
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/HolderOfKey.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/HolderOfKey.java
index 1d3faff2d..e1e7440e6 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/HolderOfKey.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/HolderOfKey.java
@@ -24,11 +24,13 @@ package at.gv.egovernment.moa.id.protocols.builder.attributes;
import java.io.IOException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Base64Utils;
@@ -38,8 +40,8 @@ public class HolderOfKey implements IPVPAttributeBuilder {
return PVP_HOLDEROFKEY_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
try {
byte[] certEncoded = authData.getGenericData(
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeBuilder.java
deleted file mode 100644
index 5b44f02aa..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeBuilder.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-
-public interface IAttributeBuilder {
- public String getName();
-
- public ATT build(final IOAAuthParameters oaParam, final IAuthData authData,
- final IAttributeGenerator g) throws AttributeException;
-
- public ATT buildEmpty(final IAttributeGenerator g);
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeGenerator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeGenerator.java
deleted file mode 100644
index ecd67db64..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IAttributeGenerator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-public interface IAttributeGenerator {
- /**
- *
- * @param friendlyName FriendlyName
- * @param name Name
- * @param value value
- * @return
- */
- public abstract ATT buildStringAttribute(final String friendlyName, final String name, final String value);
-
- public abstract ATT buildIntegerAttribute(final String friendlyName, final String name, final int value);
-
- public abstract ATT buildLongAttribute(final String friendlyName, final String name, final long value);
-
- public abstract ATT buildEmptyAttribute(final String friendlyName, final String name);
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IPVPAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IPVPAttributeBuilder.java
deleted file mode 100644
index dbb799256..000000000
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/IPVPAttributeBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright 2014 Federal Chancellery Austria
- * MOA-ID has been developed in a cooperation between BRZ, the Federal
- * Chancellery Austria - ICT staff unit, and Graz University of Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- *******************************************************************************/
-package at.gv.egovernment.moa.id.protocols.builder.attributes;
-
-import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
-
-interface IPVPAttributeBuilder extends PVPConstants, IAttributeBuilder {
-
-}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateFullMandateAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateFullMandateAttributeBuilder.java
index ffb69c2dc..007f7403a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateFullMandateAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateFullMandateAttributeBuilder.java
@@ -28,9 +28,11 @@ import javax.xml.transform.TransformerException;
import org.springframework.util.Base64Utils;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.DOMUtils;
@@ -41,8 +43,8 @@ public class MandateFullMandateAttributeBuilder implements IPVPAttributeBuilder
return MANDATE_FULL_MANDATE_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (authData.isUseMandate()) {
//only provide full mandate if it is included.
//In case of federation only a short mandate could be include
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonFullNameAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonFullNameAttributeBuilder.java
index f85fd7cae..e41a5ccf1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonFullNameAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonFullNameAttributeBuilder.java
@@ -26,9 +26,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.CorporateBodyType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -40,8 +42,8 @@ public class MandateLegalPersonFullNameAttributeBuilder implements IPVPAttribute
return MANDATE_LEG_PER_FULL_NAME_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (authData.isUseMandate()) {
//get PVP attribute directly, if exists
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinAttributeBuilder.java
index 7e0815ab2..e20cf6684 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinAttributeBuilder.java
@@ -26,9 +26,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.CorporateBodyType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -40,8 +42,8 @@ public class MandateLegalPersonSourcePinAttributeBuilder implements IPVPAttribu
return MANDATE_LEG_PER_SOURCE_PIN_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if(authData.isUseMandate()) {
return g.buildStringAttribute(MANDATE_LEG_PER_SOURCE_PIN_FRIENDLY_NAME,
MANDATE_LEG_PER_SOURCE_PIN_NAME, getLegalPersonIdentifierFromMandate(authData));
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinTypeAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinTypeAttributeBuilder.java
index 8b22acc01..098ecf68f 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinTypeAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateLegalPersonSourcePinTypeAttributeBuilder.java
@@ -26,9 +26,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.CorporateBodyType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -40,8 +42,8 @@ public class MandateLegalPersonSourcePinTypeAttributeBuilder implements IPVPAttr
return MANDATE_LEG_PER_SOURCE_PIN_TYPE_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (authData.isUseMandate()) {
//get PVP attribute directly, if exists
String sourcePinType = authData.getGenericData(MANDATE_LEG_PER_SOURCE_PIN_TYPE_NAME, String.class);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java
index ad469921c..ebec019ae 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBPKAttributeBuilder.java
@@ -27,15 +27,18 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.IdentificationType;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
import at.gv.egovernment.moa.id.auth.exception.BuildException;
import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
-import at.gv.egovernment.moa.id.data.IAuthData;
import at.gv.egovernment.moa.id.data.Pair;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.UnavailableAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
@@ -47,10 +50,10 @@ public class MandateNaturalPersonBPKAttributeBuilder implements IPVPAttributeBui
return MANDATE_NAT_PER_BPK_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
- try {
- Pair calcResult = internalBPKGenerator(oaParam, authData);
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
+ try {
+ Pair calcResult = internalBPKGenerator((IOAAuthParameters)oaParam, authData);
if (calcResult != null) {
String bpk = calcResult.getFirst();
String type = calcResult.getSecond();
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBirthDateAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBirthDateAttributeBuilder.java
index ebba376f8..0b8263ffb 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBirthDateAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonBirthDateAttributeBuilder.java
@@ -31,10 +31,12 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.InvalidDateFormatAttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.InvalidDateFormatAttributeException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -46,8 +48,8 @@ public class MandateNaturalPersonBirthDateAttributeBuilder implements IPVPAttrib
return MANDATE_NAT_PER_BIRTHDATE_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
String attrValue = internalAttributGeneration(oaParam, authData);
if (attrValue != null)
@@ -62,7 +64,7 @@ public class MandateNaturalPersonBirthDateAttributeBuilder implements IPVPAttrib
}
- protected String internalAttributGeneration(IOAAuthParameters oaParam, IAuthData authData) throws InvalidDateFormatAttributeException, NoMandateDataAttributeException {
+ protected String internalAttributGeneration(ISPConfiguration oaParam, IAuthData authData) throws InvalidDateFormatAttributeException, NoMandateDataAttributeException {
if (authData.isUseMandate()) {
//get PVP attribute directly, if exists
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonFamilyNameAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonFamilyNameAttributeBuilder.java
index 07e5c9d09..38a520298 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonFamilyNameAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonFamilyNameAttributeBuilder.java
@@ -29,9 +29,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.PersonNameType.FamilyName;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -43,8 +45,8 @@ public class MandateNaturalPersonFamilyNameAttributeBuilder implements IPVPAttr
return MANDATE_NAT_PER_FAMILY_NAME_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if(authData.isUseMandate()) {
//get PVP attribute directly, if exists
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonGivenNameAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonGivenNameAttributeBuilder.java
index 51a3d2e74..be8e761e0 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonGivenNameAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonGivenNameAttributeBuilder.java
@@ -28,9 +28,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -42,8 +44,8 @@ public class MandateNaturalPersonGivenNameAttributeBuilder implements IPVPAttrib
return MANDATE_NAT_PER_GIVEN_NAME_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if (authData.isUseMandate()) {
//get PVP attribute directly, if exists
String givenName = authData.getGenericData(MANDATE_NAT_PER_GIVEN_NAME_NAME, String.class);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinAttributeBuilder.java
index 8be85415e..2890b72d9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinAttributeBuilder.java
@@ -27,10 +27,12 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.IdentificationType;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributePolicyException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
+import at.gv.egiz.eaaf.core.exceptions.AttributePolicyException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -41,8 +43,8 @@ public class MandateNaturalPersonSourcePinAttributeBuilder implements IPVPAttri
return MANDATE_NAT_PER_SOURCE_PIN_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator g) throws AttributeBuilderException {
if(authData.isUseMandate()) {
Element mandate = authData.getMandate();
if(mandate == null) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinTypeAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinTypeAttributeBuilder.java
index d89ae0225..6b3ed6768 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinTypeAttributeBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/builder/attributes/MandateNaturalPersonSourcePinTypeAttributeBuilder.java
@@ -27,9 +27,11 @@ import org.w3c.dom.Element;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.persondata._20020228_.IdentificationType;
import at.gv.e_government.reference.namespace.persondata._20020228_.PhysicalPersonType;
-import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.data.IAuthData;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException;
+import at.gv.egiz.eaaf.core.api.idp.IAttributeGenerator;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.idp.IPVPAttributeBuilder;
+import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration;
+import at.gv.egiz.eaaf.core.exceptions.AttributeBuilderException;
import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.NoMandateDataAttributeException;
import at.gv.egovernment.moa.id.util.MandateBuilder;
import at.gv.egovernment.moa.logging.Logger;
@@ -40,8 +42,8 @@ public class MandateNaturalPersonSourcePinTypeAttributeBuilder implements IPVPAt
return MANDATE_NAT_PER_SOURCE_PIN_TYPE_NAME;
}
- public ATT build(IOAAuthParameters oaParam, IAuthData authData,
- IAttributeGenerator g) throws AttributeException {
+ public ATT build(ISPConfiguration oaParam, IAuthData authData,
+ IAttributeGenerator