+ */
+@Path("strolch/inspector")
+public class Inspector {
+
+ private StrolchTransaction openTx(Certificate certificate, String realm) {
+ return RestfulStrolchComponent.getInstance().getContainer().getRealm(realm)
+ .openTx(certificate, Inspector.class);
+ }
+
+ /**
+ *
+ * Root path of the inspector
+ *
+ *
+ *
+ * Returns the root element, which is an overview of the configured realms
+ *
+ *
+ * @return the root element, which is an overview of the configured realms
+ *
+ * @see AgentOverview
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getAgent(@Context HttpServletRequest request) {
+ try {
+ ComponentContainer container = RestfulStrolchComponent.getInstance().getContainer();
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ Set realmNames = container.getRealmNames();
+ List realmOverviews = new ArrayList<>(realmNames.size());
+ for (String realmName : realmNames) {
+
+ try (StrolchTransaction tx = openTx(cert, realmName)) {
+ long size = 0;
+ size += tx.getResourceMap().querySize(tx);
+ size += tx.getOrderMap().querySize(tx);
+ RealmOverview realmOverview = new RealmOverview(realmName, size);
+ realmOverviews.add(realmOverview);
+ }
+ }
+
+ AgentOverview agentOverview = new AgentOverview(realmOverviews);
+ GenericEntity entity = new GenericEntity(agentOverview, AgentOverview.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ } catch (Exception e) {
+ //e.printStackTrace();
+ throw e;
+ }
+ }
+
+ /**
+ *
+ * Realm inspector
+ *
+ *
+ *
+ * Returns the overview of a specific relam
+ *
+ *
+ * @param realm
+ * the realm for which the overview is to be returned
+ *
+ * @return the overview of a specific relam
+ *
+ * @see RealmDetail
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}")
+ public Response getRealm(@PathParam("realm") String realm, @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ List elementMapOverviews = new ArrayList<>(2);
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+
+ ResourceMap resourceMap = tx.getResourceMap();
+ ElementMapsOverview resourceOverview = new ElementMapsOverview(ElementMapType.RESOURCE);
+ resourceOverview.setNrOfElements(resourceMap.querySize(tx));
+ resourceOverview.setTypes(resourceMap.getTypes(tx));
+ elementMapOverviews.add(resourceOverview);
+
+ OrderMap orderMap = tx.getOrderMap();
+ ElementMapsOverview orderOverview = new ElementMapsOverview(ElementMapType.ORDER);
+ orderOverview.setNrOfElements(orderMap.querySize(tx));
+ orderOverview.setTypes(orderMap.getTypes(tx));
+ elementMapOverviews.add(orderOverview);
+ }
+
+ RealmDetail modelOverview = new RealmDetail(elementMapOverviews);
+ GenericEntity entity = new GenericEntity(modelOverview, RealmDetail.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ /**
+ *
+ * Resource inspector
+ *
+ *
+ * Returns an overview of the {@link Resource Resources}. This is a list of all the types and the size each type has
+ *
+ *
+ * @param realm
+ * the realm for which the resource overview is to be returned
+ *
+ * @return an overview of the {@link Resource Resources}. This is a list of all the types and the size each type has
+ *
+ * @see ElementMapOverview
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/resource")
+ public Response getResourcesOverview(@PathParam("realm") String realm, @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ ElementMapOverview resourcesOverview;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ ResourceMap resourceMap = tx.getResourceMap();
+ List types = new ArrayList<>(resourceMap.getTypes(tx));
+ Collections.sort(types);
+ List typeOverviews = new ArrayList<>(types.size());
+ for (String type : types) {
+ long size = resourceMap.querySize(tx, type);
+ TypeOverview typeOverview = new TypeOverview(type, size);
+ typeOverviews.add(typeOverview);
+ }
+
+ resourcesOverview = new ElementMapOverview(ElementMapType.RESOURCE.getName(), typeOverviews);
+ }
+
+ GenericEntity entity = new GenericEntity(resourcesOverview,
+ ElementMapOverview.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ /**
+ *
+ * Order inspector
+ *
+ *
+ * Returns an overview of the {@link Order Orders}. This is a list of all the types and the size each type has
+ *
+ *
+ * @param realm
+ * the realm for which the order overview is to be returned
+ *
+ * @return an overview of the {@link Order Orders}. This is a list of all the types and the size each type has
+ *
+ * @see ElementMapOverview
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/order")
+ public Response getOrdersOverview(@PathParam("realm") String realm, @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ ElementMapOverview ordersOverview;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ OrderMap orderMap = tx.getOrderMap();
+ List types = new ArrayList<>(orderMap.getTypes(tx));
+ Collections.sort(types);
+ List typeOverviews = new ArrayList<>(types.size());
+ for (String type : types) {
+ long size = orderMap.querySize(tx, type);
+ TypeOverview typeOverview = new TypeOverview(type, size);
+ typeOverviews.add(typeOverview);
+ }
+
+ ordersOverview = new ElementMapOverview(ElementMapType.ORDER.getName(), typeOverviews);
+ }
+
+ GenericEntity entity = new GenericEntity(ordersOverview,
+ ElementMapOverview.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ // TODO for the get element type details, we should not simply query all objects, but rather find a solution to query only the id, name, type and date, state for the order
+
+ /**
+ *
+ * Resource type inspector
+ *
+ *
+ * Returns an overview of the {@link Resource Resources} with the given type. This is a list of overviews of the
+ * resources
+ *
+ *
+ * @param realm
+ * the realm for which the resource type overview is to be returned
+ * @param type
+ *
+ * @return an overview of the {@link Resource Resources} with the given type. This is a list of overviews of the
+ * resources
+ *
+ * @see TypeDetail
+ * @see StrolchElementOverview
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/resource/{type}")
+ public Response getResourceTypeDetails(@PathParam("realm") String realm, @PathParam("type") String type,
+ @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ TypeDetail typeDetail;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ List byType = tx.getResourceMap().getElementsBy(tx, type);
+ List elementOverviews = new ArrayList<>(byType.size());
+ for (Resource resource : byType) {
+ ResourceOverview resourceOverview = new ResourceOverview(resource);
+ elementOverviews.add(resourceOverview);
+ }
+ typeDetail = new TypeDetail(type, elementOverviews);
+ }
+
+ GenericEntity entity = new GenericEntity(typeDetail, TypeDetail.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ /**
+ *
+ * Order type inspector
+ *
+ *
+ * Returns an overview of the {@link Order Orders} with the given type. This is a list of overviews of the orders
+ *
+ *
+ * @param realm
+ * the realm for which the order type overview is to be returned
+ * @param type
+ *
+ * @return an overview of the {@link Order Orders} with the given type. This is a list of overviews of the orders
+ *
+ * @see TypeDetail
+ * @see StrolchElementOverview
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/order/{type}")
+ public Response getOrderTypeDetails(@PathParam("realm") String realm, @PathParam("type") String type,
+ @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ TypeDetail typeDetail;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ List byType = tx.getOrderMap().getElementsBy(tx, type);
+ List elementOverviews = new ArrayList<>(byType.size());
+ for (Order order : byType) {
+ OrderOverview orderOverview = new OrderOverview(order);
+ elementOverviews.add(orderOverview);
+ }
+ typeDetail = new TypeDetail(type, elementOverviews);
+ }
+
+ GenericEntity entity = new GenericEntity(typeDetail, TypeDetail.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ /**
+ *
+ * Resource inspector
+ *
+ *
+ *
+ * Returns the resource with the given id
+ *
+ *
+ * @param realm
+ * the realm for which the resource is to be returned
+ * @param type
+ * the type of the resource
+ * @param id
+ * the id of the resource
+ *
+ * @return the resource with the given id
+ *
+ * @see ResourceDetail
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/resource/{type}/{id}")
+ public Response getResource(@PathParam("realm") String realm, @PathParam("type") String type,
+ @PathParam("id") String id, @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ Resource resource;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ resource = tx.getResourceMap().getBy(tx, type, id);
+ }
+ if (resource == null) {
+ throw new StrolchException(MessageFormat.format("No Resource exists for {0}/{1}", type, id)); //$NON-NLS-1$
+ }
+
+ ResourceDetail resourceDetail = new ResourceDetail(resource);
+ GenericEntity entity = new GenericEntity(resourceDetail, ResourceDetail.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("{realm}/order/{type}/{id}")
+ public Response getOrder(@PathParam("realm") String realm, @PathParam("type") String type,
+ @PathParam("id") String id, @Context HttpServletRequest request) {
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+
+ Order order;
+ try (StrolchTransaction tx = openTx(cert, realm)) {
+ order = tx.getOrderMap().getBy(tx, type, id);
+ }
+ if (order == null) {
+ throw new StrolchException(MessageFormat.format("No Order exists for {0}/{1}", type, id)); //$NON-NLS-1$
+ }
+
+ OrderDetail orderDetail = new OrderDetail(order);
+ GenericEntity entity = new GenericEntity(orderDetail, OrderDetail.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/VersionQuery.java b/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/VersionQuery.java
new file mode 100644
index 000000000..4779be232
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/VersionQuery.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.endpoint;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.GenericEntity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import li.strolch.agent.api.ComponentContainer;
+import li.strolch.agent.api.VersionQueryResult;
+import li.strolch.rest.RestfulStrolchComponent;
+import li.strolch.rest.StrolchRestfulConstants;
+import ch.eitchnet.privilege.model.Certificate;
+
+/**
+ * @author Robert von Burg
+ */
+@Path("strolch/version")
+public class VersionQuery {
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getVersions(@Context HttpServletRequest request) {
+
+ ComponentContainer container = RestfulStrolchComponent.getInstance().getContainer();
+
+ Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
+ container.getPrivilegeHandler().isCertificateValid(cert);
+
+ VersionQueryResult versionQueryResult = container.getAgent().getVersion();
+ GenericEntity entity = new GenericEntity(versionQueryResult,
+ VersionQueryResult.class) {
+ //
+ };
+ return Response.ok().entity(entity).build();
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/filters/AccessControlResponseFilter.java b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AccessControlResponseFilter.java
new file mode 100644
index 000000000..3f3325668
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AccessControlResponseFilter.java
@@ -0,0 +1,70 @@
+package li.strolch.rest.filters;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+import javax.annotation.Priority;
+import javax.ws.rs.Priorities;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Provider
+@Priority(Priorities.HEADER_DECORATOR)
+public class AccessControlResponseFilter implements ContainerResponseFilter {
+
+ private static final String ACCESS_CONTROL_ALLOW_METHODS = "Access-Control-Allow-Methods"; //$NON-NLS-1$
+ private static final String ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; //$NON-NLS-1$
+ private static final String ACCESS_CONTROL_ALLOW_HEADERS = "Access-Control-Allow-Headers"; //$NON-NLS-1$
+ private static final String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; //$NON-NLS-1$
+
+ private static final Logger logger = LoggerFactory.getLogger(AccessControlResponseFilter.class);
+
+ private static boolean corsEnabled;
+ private static String origin;
+ private static boolean logged;
+
+ /**
+ * @param corsEnabled
+ * the corsEnabled to set
+ */
+ public static void setCorsEnabled(boolean corsEnabled) {
+ AccessControlResponseFilter.corsEnabled = corsEnabled;
+ }
+
+ /**
+ * @param origin
+ * the origin to set
+ */
+ public static void setOrigin(String origin) {
+ AccessControlResponseFilter.origin = origin;
+ }
+
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
+ throws IOException {
+
+ if (!corsEnabled)
+ return;
+
+ if (!logged) {
+ logged = true;
+ logger.info(MessageFormat.format("Enabling CORS for origin: {0}", origin)); //$NON-NLS-1$
+ }
+
+ MultivaluedMap headers = responseContext.getHeaders();
+
+ // allow for the configured origin
+ headers.add(ACCESS_CONTROL_ALLOW_ORIGIN, origin);
+
+ // and set the allowed HTTP headers and methods
+ headers.add(ACCESS_CONTROL_ALLOW_HEADERS, "Authorization, Origin, X-Requested-With, Content-Type"); //$NON-NLS-1$
+ headers.add(ACCESS_CONTROL_EXPOSE_HEADERS, "Location, Content-Disposition"); //$NON-NLS-1$
+ headers.add(ACCESS_CONTROL_ALLOW_METHODS, "POST, PUT, GET, DELETE, HEAD, OPTIONS"); //$NON-NLS-1$
+ }
+}
\ No newline at end of file
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationRequestFilter.java b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationRequestFilter.java
new file mode 100644
index 000000000..d20b09655
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationRequestFilter.java
@@ -0,0 +1,48 @@
+/**
+ *
+ */
+package li.strolch.rest.filters;
+
+import static li.strolch.rest.StrolchRestfulConstants.STROLCH_CERTIFICATE;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+import li.strolch.rest.RestfulStrolchComponent;
+import li.strolch.rest.StrolchSessionHandler;
+import ch.eitchnet.privilege.model.Certificate;
+
+/**
+ * @author Reto Breitenmoser
+ * @author Robert von Burg
+ */
+@Provider
+public class AuthenicationRequestFilter implements ContainerRequestFilter {
+
+ @Context
+ HttpServletRequest request;
+
+ @Override
+ public void filter(ContainerRequestContext requestContext) throws IOException {
+ String sessionId = requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);
+ if (sessionId != null) {
+ try {
+ String origin = this.request == null ? "test" : this.request.getRemoteAddr(); //$NON-NLS-1$
+ StrolchSessionHandler sessionHandler = RestfulStrolchComponent.getInstance().getComponent(
+ StrolchSessionHandler.class);
+ Certificate certificate = sessionHandler.validate(origin, sessionId);
+ requestContext.setProperty(STROLCH_CERTIFICATE, certificate);
+ } catch (Exception e) {
+ requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED)
+ .entity("User cannot access the resource.").build()); //$NON-NLS-1$
+ }
+ }
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationResponseFilter.java b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationResponseFilter.java
new file mode 100644
index 000000000..7aeecc1b9
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/filters/AuthenicationResponseFilter.java
@@ -0,0 +1,34 @@
+/**
+ *
+ */
+package li.strolch.rest.filters;
+
+import static li.strolch.rest.StrolchRestfulConstants.STROLCH_CERTIFICATE;
+
+import java.io.IOException;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.ext.Provider;
+
+import ch.eitchnet.privilege.model.Certificate;
+
+/**
+ * @author Reto Breitenmoser
+ * @author Robert von Burg
+ */
+@Provider
+public class AuthenicationResponseFilter implements ContainerResponseFilter {
+
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
+ throws IOException {
+
+ Certificate cert = (Certificate) requestContext.getProperty(STROLCH_CERTIFICATE);
+ if (cert != null) {
+ responseContext.getHeaders().add(HttpHeaders.AUTHORIZATION, cert.getAuthToken());
+ }
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/filters/CharsetResponseFilter.java b/li.strolch.rest/src/main/java/li/strolch/rest/filters/CharsetResponseFilter.java
new file mode 100644
index 000000000..f190319d2
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/filters/CharsetResponseFilter.java
@@ -0,0 +1,36 @@
+package li.strolch.rest.filters;
+
+import java.io.IOException;
+
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * The JSON generated is not in the same charset as the rest of the response, thus we override it to UTF-8 with this
+ * response filter
+ *
+ * @author Robert von Burg
+ */
+@Provider
+public class CharsetResponseFilter implements ContainerResponseFilter {
+
+ private static final String UTF_8 = "utf-8"; //$NON-NLS-1$
+
+ @Override
+ public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
+ throws IOException {
+
+ MediaType contentType = responseContext.getMediaType();
+ if (contentType != null) {
+ String charset = contentType.getParameters().get(MediaType.CHARSET_PARAMETER);
+ if (charset == null || !charset.equalsIgnoreCase(UTF_8)) {
+ contentType = contentType.withCharset(UTF_8);
+ responseContext.getHeaders().putSingle(HttpHeaders.CONTENT_TYPE, contentType.toString());
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/helper/RestfulHelper.java b/li.strolch.rest/src/main/java/li/strolch/rest/helper/RestfulHelper.java
new file mode 100644
index 000000000..bd0393b12
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/helper/RestfulHelper.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.helper;
+
+import java.util.Locale;
+
+import javax.ws.rs.core.HttpHeaders;
+
+import ch.eitchnet.utils.helper.StringHelper;
+
+/**
+ * @author Robert von Burg
+ */
+public class RestfulHelper {
+
+ public static Locale getLocale(HttpHeaders headers) {
+ Locale locale;
+ if (headers == null || StringHelper.isEmpty(headers.getHeaderString(HttpHeaders.ACCEPT_LANGUAGE)))
+ locale = Locale.getDefault();
+ else
+ locale = headers.getAcceptableLanguages().get(0);
+
+ return locale;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/AgentOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/AgentOverview.java
new file mode 100644
index 000000000..fe0506c71
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/AgentOverview.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Agent")
+public class AgentOverview {
+
+ @XmlElement(name = "realms")
+ private List realms;
+
+ public AgentOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ public AgentOverview(List realms) {
+ this.realms = realms;
+ }
+
+ /**
+ * @return the realms
+ */
+ public List getRealms() {
+ return this.realms;
+ }
+
+ /**
+ * @param realms
+ * the realms to set
+ */
+ public void setRealms(List realms) {
+ this.realms = realms;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.realms == null) ? 0 : this.realms.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ AgentOverview other = (AgentOverview) obj;
+ if (this.realms == null) {
+ if (other.realms != null)
+ return false;
+ } else if (!this.realms.equals(other.realms))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return MessageFormat.format("AgentOverview [realms={0}]", this.realms); //$NON-NLS-1$
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapOverview.java
new file mode 100644
index 000000000..9fb83e490
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapOverview.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "ElementMap")
+public class ElementMapOverview {
+
+ @XmlAttribute(name = "elementMapName")
+ private String elementMapName;
+ @XmlAttribute(name = "size")
+ private long size;
+ @XmlElement(name = "types", type = TypeOverview.class)
+ private List typeOverviews;
+
+ public ElementMapOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param elementMapName
+ * @param typeOverviews
+ */
+ public ElementMapOverview(String elementMapName, List typeOverviews) {
+ this.elementMapName = elementMapName;
+ this.typeOverviews = typeOverviews;
+ this.size = this.typeOverviews.size();
+ }
+
+ /**
+ * @return the elementMapName
+ */
+ public String getElementMapName() {
+ return this.elementMapName;
+ }
+
+ /**
+ * @param elementMapName
+ * the elementMapName to set
+ */
+ public void setElementMapName(String elementMapName) {
+ this.elementMapName = elementMapName;
+ }
+
+ /**
+ * @return the size
+ */
+ public long getSize() {
+ return this.size;
+ }
+
+ /**
+ * @param size
+ * the size to set
+ */
+ public void setSize(long size) {
+ this.size = size;
+ }
+
+ /**
+ * @return the typeOverviews
+ */
+ public List getTypeOverviews() {
+ return this.typeOverviews;
+ }
+
+ /**
+ * @param typeOverviews
+ * the typeOverviews to set
+ */
+ public void setTypeOverviews(List typeOverviews) {
+ this.typeOverviews = typeOverviews;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.elementMapName == null) ? 0 : this.elementMapName.hashCode());
+ result = prime * result + (int) (this.size ^ (this.size >>> 32));
+ result = prime * result + ((this.typeOverviews == null) ? 0 : this.typeOverviews.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ElementMapOverview other = (ElementMapOverview) obj;
+ if (this.elementMapName == null) {
+ if (other.elementMapName != null)
+ return false;
+ } else if (!this.elementMapName.equals(other.elementMapName))
+ return false;
+ if (this.size != other.size)
+ return false;
+ if (this.typeOverviews == null) {
+ if (other.typeOverviews != null)
+ return false;
+ } else if (!this.typeOverviews.equals(other.typeOverviews))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return MessageFormat.format(
+ "ElementMapOverview [elementMapName={0}, size={1}, typeOverviews={2}]", this.elementMapName, //$NON-NLS-1$
+ this.size, this.typeOverviews);
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapType.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapType.java
new file mode 100644
index 000000000..a4cbbf433
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapType.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import li.strolch.model.Tags;
+
+/**
+ * @author Robert von Burg
+ */
+public enum ElementMapType {
+ RESOURCE(Tags.RESOURCE), ORDER(Tags.ORDER);
+ private String name;
+
+ private ElementMapType(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapsOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapsOverview.java
new file mode 100644
index 000000000..3676ecb2f
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ElementMapsOverview.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "ElementMaps")
+public class ElementMapsOverview {
+
+ @XmlAttribute(name = "name")
+ private String name;
+
+ @XmlAttribute(name = "elementMapType")
+ private ElementMapType elementMapType;
+
+ @XmlAttribute(name = "nrOfElements")
+ private long nrOfElements;
+
+ @XmlElement(name = "types")
+ private Set types;
+
+ public ElementMapsOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param elementMapType
+ */
+ public ElementMapsOverview(ElementMapType elementMapType) {
+ this.elementMapType = elementMapType;
+ this.name = elementMapType.getName();
+ }
+
+ /**
+ *
+ * @param elementMapType
+ * @param nrOfElements
+ * @param types
+ */
+ public ElementMapsOverview(ElementMapType elementMapType, long nrOfElements, Set types) {
+ this(elementMapType);
+ this.nrOfElements = nrOfElements;
+ this.types = types;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the elementMapType
+ */
+ public ElementMapType getElementMapType() {
+ return this.elementMapType;
+ }
+
+ /**
+ * @param elementMapType
+ * the elementMapType to set
+ */
+ public void setElementMapType(ElementMapType elementMapType) {
+ this.elementMapType = elementMapType;
+ }
+
+ /**
+ * @return the types
+ */
+ public Set getTypes() {
+ return this.types;
+ }
+
+ /**
+ * @param types
+ * the types to set
+ */
+ public void setTypes(Set types) {
+ this.types = types;
+ }
+
+ /**
+ * @return the nrOfElements
+ */
+ public long getNrOfElements() {
+ return this.nrOfElements;
+ }
+
+ /**
+ * @param nrOfElements
+ * the nrOfElements to set
+ */
+ public void setNrOfElements(long nrOfElements) {
+ this.nrOfElements = nrOfElements;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.elementMapType == null) ? 0 : this.elementMapType.hashCode());
+ result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
+ result = prime * result + (int) (this.nrOfElements ^ (this.nrOfElements >>> 32));
+ result = prime * result + ((this.types == null) ? 0 : this.types.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ElementMapsOverview other = (ElementMapsOverview) obj;
+ if (this.elementMapType != other.elementMapType)
+ return false;
+ if (this.name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!this.name.equals(other.name))
+ return false;
+ if (this.nrOfElements != other.nrOfElements)
+ return false;
+ if (this.types == null) {
+ if (other.types != null)
+ return false;
+ } else if (!this.types.equals(other.types))
+ return false;
+ return true;
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ElementMapsOverview [name=");
+ sb.append(this.name);
+ sb.append(", elementMapType=");
+ sb.append(this.elementMapType);
+ sb.append(", nrOfElements=");
+ sb.append(this.nrOfElements);
+ sb.append(", types=");
+ sb.append(this.types);
+ sb.append("]");
+ return sb.toString();
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/GroupedParameterizedElementDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/GroupedParameterizedElementDetail.java
new file mode 100644
index 000000000..a25e8890e
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/GroupedParameterizedElementDetail.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+import li.strolch.model.GroupedParameterizedElement;
+import li.strolch.model.ParameterBag;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "GroupedParameterizedElement")
+@XmlSeeAlso({ ResourceDetail.class, OrderDetail.class })
+public class GroupedParameterizedElementDetail extends StrolchElementDetail {
+
+ @XmlElement(name = "parameterBags", type = ParameterizedElementDetail.class)
+ private List parameterizedElements;
+
+ public GroupedParameterizedElementDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ public GroupedParameterizedElementDetail(String id, String name, String type,
+ List parameterizedElements) {
+ super(id, name, type);
+ this.parameterizedElements = parameterizedElements;
+ }
+
+ public GroupedParameterizedElementDetail(GroupedParameterizedElement groupedParameterizedElement) {
+ super(groupedParameterizedElement);
+
+ Set bagKeySet = groupedParameterizedElement.getParameterBagKeySet();
+ this.parameterizedElements = new ArrayList<>(bagKeySet.size());
+ for (String bagId : bagKeySet) {
+ ParameterBag parameterBag = groupedParameterizedElement.getParameterBag(bagId);
+ this.parameterizedElements.add(new ParameterizedElementDetail(parameterBag));
+ }
+ }
+
+ /**
+ * @return the parameterizedElements
+ */
+ public List getParameterizedElements() {
+ return this.parameterizedElements;
+ }
+
+ /**
+ * @param parameterizedElements
+ * the parameterizedElements to set
+ */
+ public void setParameterizedElements(List parameterizedElements) {
+ this.parameterizedElements = parameterizedElements;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((this.parameterizedElements == null) ? 0 : this.parameterizedElements.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ GroupedParameterizedElementDetail other = (GroupedParameterizedElementDetail) obj;
+ if (this.parameterizedElements == null) {
+ if (other.parameterizedElements != null)
+ return false;
+ } else if (!this.parameterizedElements.equals(other.parameterizedElements))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/Login.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/Login.java
new file mode 100644
index 000000000..7a573e658
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/Login.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Login")
+public class Login {
+
+ @XmlAttribute
+ private String username;
+ @XmlAttribute
+ private String password;
+
+ public Login() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return this.username;
+ }
+
+ /**
+ * @param username
+ * the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return the password
+ */
+ public String getPassword() {
+ return this.password;
+ }
+
+ /**
+ * @param password
+ * the password to set
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/LoginResult.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/LoginResult.java
new file mode 100644
index 000000000..eaae483ef
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/LoginResult.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "LoginResult")
+public class LoginResult {
+
+ @XmlAttribute(name = "username")
+ private String username;
+
+ @XmlAttribute(name = "sessionId")
+ private String sessionId;
+
+ @XmlAttribute(name = "locale")
+ private String locale;
+
+ @XmlAttribute(name = "parameters")
+ private Map parameters;
+
+ @XmlAttribute(name = "msg")
+ private String msg;
+
+ @XmlAttribute(name = "privileges")
+ private List privileges;
+
+ public LoginResult() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return this.username;
+ }
+
+ /**
+ * @param username
+ * the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return the sessionId
+ */
+ public String getSessionId() {
+ return this.sessionId;
+ }
+
+ /**
+ * @param sessionId
+ * the sessionId to set
+ */
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ /**
+ * @return the locale
+ */
+ public String getLocale() {
+ return this.locale;
+ }
+
+ /**
+ * @param locale
+ * the locale to set
+ */
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+ /**
+ * @param locale
+ * the locale to set
+ */
+ public void setLocale(Locale locale) {
+ this.locale = locale.toString();
+ }
+
+ /**
+ * @return the parameters
+ */
+ public Map getParameters() {
+ return this.parameters;
+ }
+
+ /**
+ * @param parameters
+ * the parameters to set
+ */
+ public void setParameters(Map parameters) {
+ this.parameters = parameters;
+ }
+
+ /**
+ * @return the msg
+ */
+ public String getMsg() {
+ return this.msg;
+ }
+
+ /**
+ * @param msg
+ * the msg to set
+ */
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ /**
+ * @return the privileges
+ */
+ public List getPrivileges() {
+ return this.privileges;
+ }
+
+ /**
+ * @param privileges
+ * the privileges to set
+ */
+ public void setPrivileges(List privileges) {
+ this.privileges = privileges;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/Logout.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/Logout.java
new file mode 100644
index 000000000..881e9d144
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/Logout.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2012, Robert von Burg
+ *
+ * All rights reserved.
+ *
+ * This file is part of the XXX.
+ *
+ * XXX is free software: you can redistribute
+ * it and/or modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the License,
+ * or (at your option) any later version.
+ *
+ * XXX is distributed in the hope that it will
+ * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XXX. If not, see
+ * .
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlRootElement(name = "Logout")
+@XmlAccessorType(XmlAccessType.NONE)
+public class Logout {
+
+ @XmlAttribute(name = "username")
+ private String username;
+
+ @XmlAttribute(name = "sessionId")
+ private String sessionId;
+
+ public Logout() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return this.username;
+ }
+
+ /**
+ * @param username
+ * the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return the sessionId
+ */
+ public String getSessionId() {
+ return this.sessionId;
+ }
+
+ /**
+ * @param sessionId
+ * the sessionId to set
+ */
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/LogoutResult.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/LogoutResult.java
new file mode 100644
index 000000000..db37aa98d
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/LogoutResult.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "LogoutResult")
+public class LogoutResult {
+
+ @XmlAttribute(name = "username")
+ private String username;
+
+ @XmlAttribute(name = "sessionId")
+ private String sessionId;
+
+ @XmlAttribute(name = "msg")
+ private String msg;
+
+ public LogoutResult() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @return the msg
+ */
+ public String getMsg() {
+ return this.msg;
+ }
+
+ /**
+ * @param msg
+ * the msg to set
+ */
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return this.username;
+ }
+
+ /**
+ * @param username
+ * the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return the sessionId
+ */
+ public String getSessionId() {
+ return this.sessionId;
+ }
+
+ /**
+ * @param sessionId
+ * the sessionId to set
+ */
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderDetail.java
new file mode 100644
index 000000000..a84590da2
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderDetail.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import li.strolch.model.Order;
+import li.strolch.model.State;
+import ch.eitchnet.utils.iso8601.ISO8601FormatFactory;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Order")
+@XmlType(name = "")
+public class OrderDetail extends GroupedParameterizedElementDetail {
+
+ @XmlAttribute(name = "date")
+ private String date;
+ @XmlAttribute(name = "state")
+ private State state;
+
+ public OrderDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ * @param date
+ * @param state
+ * @param parameterizedElementDetails
+ */
+ public OrderDetail(String id, String name, String type, Date date, State state,
+ List parameterizedElementDetails) {
+ super(id, name, type, parameterizedElementDetails);
+ this.state = state;
+ this.date = ISO8601FormatFactory.getInstance().formatDate(date);
+ }
+
+ /**
+ * @param order
+ */
+ public OrderDetail(Order order) {
+ super(order);
+ this.state = order.getState();
+ this.date = ISO8601FormatFactory.getInstance().formatDate(order.getDate());
+ }
+
+ /**
+ * @return the date
+ */
+ public String getDate() {
+ return this.date;
+ }
+
+ /**
+ * @param date
+ * the date to set
+ */
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ /**
+ * @return the state
+ */
+ public State getState() {
+ return this.state;
+ }
+
+ /**
+ * @param state
+ * the state to set
+ */
+ public void setState(State state) {
+ this.state = state;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((this.date == null) ? 0 : this.date.hashCode());
+ result = prime * result + ((this.state == null) ? 0 : this.state.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ OrderDetail other = (OrderDetail) obj;
+ if (this.date == null) {
+ if (other.date != null)
+ return false;
+ } else if (!this.date.equals(other.date))
+ return false;
+ if (this.state != other.state)
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderOverview.java
new file mode 100644
index 000000000..46b6581cf
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/OrderOverview.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.Date;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import li.strolch.model.Order;
+import li.strolch.model.State;
+import ch.eitchnet.utils.iso8601.ISO8601FormatFactory;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Order")
+public class OrderOverview extends StrolchElementOverview {
+
+ @XmlAttribute(name = "date")
+ private String date;
+ @XmlAttribute(name = "state")
+ private State state;
+
+ public OrderOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ */
+ public OrderOverview(String id, String name, String type, Date date, State state) {
+ super(id, name, type);
+ this.state = state;
+ this.date = ISO8601FormatFactory.getInstance().formatDate(date);
+ }
+
+ /**
+ * @param order
+ */
+ public OrderOverview(Order order) {
+ super(order);
+ this.state = order.getState();
+ this.date = ISO8601FormatFactory.getInstance().formatDate(order.getDate());
+ }
+
+ /**
+ * @return the date
+ */
+ public String getDate() {
+ return this.date;
+ }
+
+ /**
+ * @param date
+ * the date to set
+ */
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ /**
+ * @return the state
+ */
+ public State getState() {
+ return this.state;
+ }
+
+ /**
+ * @param state
+ * the state to set
+ */
+ public void setState(State state) {
+ this.state = state;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((this.date == null) ? 0 : this.date.hashCode());
+ result = prime * result + ((this.state == null) ? 0 : this.state.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ OrderOverview other = (OrderOverview) obj;
+ if (this.date == null) {
+ if (other.date != null)
+ return false;
+ } else if (!this.date.equals(other.date))
+ return false;
+ if (this.state != other.state)
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterDetail.java
new file mode 100644
index 000000000..460e013fd
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterDetail.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import li.strolch.model.parameter.Parameter;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Parameter")
+public class ParameterDetail extends StrolchElementDetail {
+
+ @XmlAttribute(name = "hidden")
+ private boolean hidden;
+ @XmlAttribute(name = "interpretation")
+ private String interpretation;
+ @XmlAttribute(name = "uom")
+ private String uom;
+ @XmlAttribute(name = "value")
+ private String value;
+
+ public ParameterDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param type
+ * @param hidden
+ * @param interpretation
+ * @param uom
+ * @param value
+ */
+ public ParameterDetail(String id, String name, String type, boolean hidden, String interpretation, String uom,
+ String value) {
+ super(id, name, type);
+ this.hidden = hidden;
+ this.interpretation = interpretation;
+ this.uom = uom;
+ this.value = value;
+ }
+
+ /**
+ * @param parameter
+ */
+ public ParameterDetail(Parameter> parameter) {
+ super(parameter);
+ this.hidden = parameter.isHidden();
+ this.interpretation = parameter.getInterpretation();
+ this.uom = parameter.getUom();
+ this.value = parameter.getValueAsString();
+ }
+
+ /**
+ * @return the hidden
+ */
+ public boolean isHidden() {
+ return this.hidden;
+ }
+
+ /**
+ * @param hidden
+ * the hidden to set
+ */
+ public void setHidden(boolean hidden) {
+ this.hidden = hidden;
+ }
+
+ /**
+ * @return the interpretation
+ */
+ public String getInterpretation() {
+ return this.interpretation;
+ }
+
+ /**
+ * @param interpretation
+ * the interpretation to set
+ */
+ public void setInterpretation(String interpretation) {
+ this.interpretation = interpretation;
+ }
+
+ /**
+ * @return the uom
+ */
+ public String getUom() {
+ return this.uom;
+ }
+
+ /**
+ * @param uom
+ * the uom to set
+ */
+ public void setUom(String uom) {
+ this.uom = uom;
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return this.value;
+ }
+
+ /**
+ * @param value
+ * the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + (this.hidden ? 1231 : 1237);
+ result = prime * result + ((this.interpretation == null) ? 0 : this.interpretation.hashCode());
+ result = prime * result + ((this.uom == null) ? 0 : this.uom.hashCode());
+ result = prime * result + ((this.value == null) ? 0 : this.value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ParameterDetail other = (ParameterDetail) obj;
+ if (this.hidden != other.hidden)
+ return false;
+ if (this.interpretation == null) {
+ if (other.interpretation != null)
+ return false;
+ } else if (!this.interpretation.equals(other.interpretation))
+ return false;
+ if (this.uom == null) {
+ if (other.uom != null)
+ return false;
+ } else if (!this.uom.equals(other.uom))
+ return false;
+ if (this.value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!this.value.equals(other.value))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterizedElementDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterizedElementDetail.java
new file mode 100644
index 000000000..410ae09fb
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ParameterizedElementDetail.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import li.strolch.model.ParameterizedElement;
+import li.strolch.model.parameter.Parameter;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "ParameterBag")
+public class ParameterizedElementDetail extends StrolchElementDetail {
+
+ @XmlElement(name = "parameters", type = ParameterDetail.class)
+ private List parameters;
+
+ public ParameterizedElementDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ public ParameterizedElementDetail(String id, String name, String type, List parameters) {
+ super(id, name, type);
+ this.parameters = parameters;
+ }
+
+ public ParameterizedElementDetail(ParameterizedElement parameterizedElement) {
+ super(parameterizedElement);
+
+ List> parameters = parameterizedElement.getParameters();
+ this.parameters = new ArrayList<>(parameters.size());
+ for (Parameter> parameter : parameters) {
+ this.parameters.add(new ParameterDetail(parameter));
+ }
+ }
+
+ /**
+ * @return the parameters
+ */
+ public List getParameters() {
+ return this.parameters;
+ }
+
+ /**
+ * @param parameters
+ * the parameters to set
+ */
+ public void setParameters(List parameters) {
+ this.parameters = parameters;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((this.parameters == null) ? 0 : this.parameters.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ParameterizedElementDetail other = (ParameterizedElementDetail) obj;
+ if (this.parameters == null) {
+ if (other.parameters != null)
+ return false;
+ } else if (!this.parameters.equals(other.parameters))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmDetail.java
new file mode 100644
index 000000000..b741d3b3e
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmDetail.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Realm")
+public class RealmDetail {
+
+ @XmlElement(name = "elementMaps")
+ private List elementMapOverviews;
+
+ public RealmDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ public RealmDetail(List elementMapOverviews) {
+ this.elementMapOverviews = elementMapOverviews;
+ }
+
+ /**
+ * @return the elementMapOverviews
+ */
+ public List getElementMapOverviews() {
+ return this.elementMapOverviews;
+ }
+
+ /**
+ * @param elementMapOverviews
+ * the elementMapOverviews to set
+ */
+ public void setElementMapOverviews(List elementMapOverviews) {
+ this.elementMapOverviews = elementMapOverviews;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.elementMapOverviews == null) ? 0 : this.elementMapOverviews.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RealmDetail other = (RealmDetail) obj;
+ if (this.elementMapOverviews == null) {
+ if (other.elementMapOverviews != null)
+ return false;
+ } else if (!this.elementMapOverviews.equals(other.elementMapOverviews))
+ return false;
+ return true;
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("RealmDetail [elementMapOverviews=");
+ sb.append(this.elementMapOverviews);
+ sb.append("]");
+ return sb.toString();
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmOverview.java
new file mode 100644
index 000000000..916c110e1
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/RealmOverview.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "RealmOverview")
+public class RealmOverview {
+
+ @XmlAttribute(name = "realmName")
+ private String realmName;
+ @XmlAttribute(name = "size")
+ private long size;
+
+ public RealmOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param realmName
+ * @param size
+ */
+ public RealmOverview(String realmName, long size) {
+ this.realmName = realmName;
+ this.size = size;
+ }
+
+ /**
+ * @return the realmName
+ */
+ public String getRealmName() {
+ return this.realmName;
+ }
+
+ /**
+ * @param realmName
+ * the realmName to set
+ */
+ public void setRealmName(String realmName) {
+ this.realmName = realmName;
+ }
+
+ /**
+ * @return the size
+ */
+ public long getSize() {
+ return this.size;
+ }
+
+ /**
+ * @param size
+ * the size to set
+ */
+ public void setSize(long size) {
+ this.size = size;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.realmName == null) ? 0 : this.realmName.hashCode());
+ result = prime * result + (int) (this.size ^ (this.size >>> 32));
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RealmOverview other = (RealmOverview) obj;
+ if (this.realmName == null) {
+ if (other.realmName != null)
+ return false;
+ } else if (!this.realmName.equals(other.realmName))
+ return false;
+ if (this.size != other.size)
+ return false;
+ return true;
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("RealmOverview [realmName=");
+ sb.append(this.realmName);
+ sb.append(", size=");
+ sb.append(this.size);
+ sb.append("]");
+ return sb.toString();
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceDetail.java
new file mode 100644
index 000000000..cc3303df6
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceDetail.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import li.strolch.model.Resource;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Resource")
+@XmlType(name = "")
+public class ResourceDetail extends GroupedParameterizedElementDetail {
+
+ public ResourceDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ * @param parameterizedElements
+ */
+ public ResourceDetail(String id, String name, String type, List parameterizedElements) {
+ super(id, name, type, parameterizedElements);
+ }
+
+ /**
+ * @param resource
+ */
+ public ResourceDetail(Resource resource) {
+ super(resource);
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceOverview.java
new file mode 100644
index 000000000..5516188c2
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/ResourceOverview.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import li.strolch.model.Resource;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Resource")
+public class ResourceOverview extends StrolchElementOverview {
+
+ public ResourceOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ */
+ public ResourceOverview(String id, String name, String type) {
+ super(id, name, type);
+ }
+
+ /**
+ * @param resource
+ */
+ public ResourceOverview(Resource resource) {
+ super(resource);
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementDetail.java
new file mode 100644
index 000000000..18203a718
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementDetail.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+import li.strolch.model.StrolchElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlSeeAlso({ GroupedParameterizedElementDetail.class, ParameterizedElementDetail.class, ParameterDetail.class })
+public abstract class StrolchElementDetail {
+
+ @XmlAttribute(name = "id", required = true)
+ private String id;
+ @XmlAttribute(name = "name", required = true)
+ private String name;
+ @XmlAttribute(name = "type", required = true)
+ private String type;
+
+ public StrolchElementDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ */
+ public StrolchElementDetail(String id, String name, String type) {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ }
+
+ /**
+ * @param strolchElement
+ */
+ public StrolchElementDetail(StrolchElement strolchElement) {
+ this.id = strolchElement.getId();
+ this.name = strolchElement.getName();
+ this.type = strolchElement.getType();
+ }
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @param id
+ * the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
+ result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
+ result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ StrolchElementDetail other = (StrolchElementDetail) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ if (this.name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!this.name.equals(other.name))
+ return false;
+ if (this.type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!this.type.equals(other.type))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementOverview.java
new file mode 100644
index 000000000..864b2bbaf
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/StrolchElementOverview.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+import li.strolch.model.StrolchElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlSeeAlso({ ResourceOverview.class, OrderOverview.class })
+public abstract class StrolchElementOverview {
+
+ @XmlAttribute(name = "id", required = true)
+ private String id;
+ @XmlAttribute(name = "name", required = true)
+ private String name;
+ @XmlAttribute(name = "type", required = true)
+ private String type;
+
+ public StrolchElementOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param id
+ * @param name
+ * @param type
+ */
+ public StrolchElementOverview(String id, String name, String type) {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ }
+
+ /**
+ * @param strolchElement
+ */
+ public StrolchElementOverview(StrolchElement strolchElement) {
+ this.id = strolchElement.getId();
+ this.name = strolchElement.getName();
+ this.type = strolchElement.getType();
+ }
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @param id
+ * the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
+ result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
+ result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ StrolchElementOverview other = (StrolchElementOverview) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ if (this.name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!this.name.equals(other.name))
+ return false;
+ if (this.type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!this.type.equals(other.type))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeDetail.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeDetail.java
new file mode 100644
index 000000000..52ec0bcd5
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeDetail.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Types")
+public class TypeDetail {
+
+ @XmlAttribute(name = "type")
+ private String type;
+
+ @XmlElements({ @XmlElement(name = "orders", type = OrderOverview.class),
+ @XmlElement(name = "resources", type = ResourceOverview.class) })
+ private List elementOverviews;
+
+ public TypeDetail() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param type
+ * @param elementOverviews
+ */
+ public TypeDetail(String type, List elementOverviews) {
+ this.type = type;
+ this.elementOverviews = elementOverviews;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the elementOverviews
+ */
+ public List getElementOverviews() {
+ return this.elementOverviews;
+ }
+
+ /**
+ * @param elementOverviews
+ * the elementOverviews to set
+ */
+ public void setElementOverviews(List elementOverviews) {
+ this.elementOverviews = elementOverviews;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.elementOverviews == null) ? 0 : this.elementOverviews.hashCode());
+ result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ TypeDetail other = (TypeDetail) obj;
+ if (this.elementOverviews == null) {
+ if (other.elementOverviews != null)
+ return false;
+ } else if (!this.elementOverviews.equals(other.elementOverviews))
+ return false;
+ if (this.type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!this.type.equals(other.type))
+ return false;
+ return true;
+ }
+}
diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeOverview.java b/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeOverview.java
new file mode 100644
index 000000000..1e51bccd7
--- /dev/null
+++ b/li.strolch.rest/src/main/java/li/strolch/rest/model/TypeOverview.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.model;
+
+import java.text.MessageFormat;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Robert von Burg
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement(name = "Types")
+public class TypeOverview {
+
+ @XmlAttribute(name = "type")
+ private String type;
+
+ @XmlAttribute(name = "size")
+ private long size;
+
+ public TypeOverview() {
+ // no-arg constructor for JAXB
+ }
+
+ /**
+ * @param type
+ * @param size
+ */
+ public TypeOverview(String type, long size) {
+ this.type = type;
+ this.size = size;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the size
+ */
+ public long getSize() {
+ return this.size;
+ }
+
+ /**
+ * @param size
+ * the size to set
+ */
+ public void setSize(long size) {
+ this.size = size;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int) (this.size ^ (this.size >>> 32));
+ result = prime * result + ((this.type == null) ? 0 : this.type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ TypeOverview other = (TypeOverview) obj;
+ if (this.size != other.size)
+ return false;
+ if (this.type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!this.type.equals(other.type))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return MessageFormat.format("TypeOverview [type={0}, size={1}]", this.type, this.size); //$NON-NLS-1$
+ }
+}
diff --git a/li.strolch.rest/src/main/resources/componentVersion.properties b/li.strolch.rest/src/main/resources/componentVersion.properties
new file mode 100644
index 000000000..1f050160f
--- /dev/null
+++ b/li.strolch.rest/src/main/resources/componentVersion.properties
@@ -0,0 +1,6 @@
+groupId=${project.groupId}
+artifactId=${project.artifactId}
+artifactVersion=${project.version}
+scmRevision=r${buildNumber}
+scmBranch=${scmBranch}
+buildTimestamp=${buildTimestamp}
\ No newline at end of file
diff --git a/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AbstractRestfulTest.java b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AbstractRestfulTest.java
new file mode 100644
index 000000000..59fa5dd23
--- /dev/null
+++ b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AbstractRestfulTest.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.inspector.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+import javax.ws.rs.core.Application;
+
+import li.strolch.rest.StrolchRestfulClasses;
+import li.strolch.testbase.runtime.RuntimeMock;
+
+import org.glassfish.jersey.filter.LoggingFilter;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.ServerProperties;
+import org.glassfish.jersey.server.TracingConfig;
+import org.glassfish.jersey.servlet.ServletProperties;
+import org.glassfish.jersey.test.DeploymentContext;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.ServletDeploymentContext;
+import org.glassfish.jersey.test.TestProperties;
+import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Robert von Burg
+ */
+@SuppressWarnings("nls")
+public abstract class AbstractRestfulTest extends JerseyTest {
+
+ private static final URI BASE_URI = URI.create("http://localhost:8888/base");
+ protected static final Logger logger = LoggerFactory.getLogger(AbstractRestfulTest.class);
+ private static final String RUNTIME_PATH = "target/withPrivilegeRuntime/"; //$NON-NLS-1$
+ private static final String CONFIG_SRC = "src/test/resources/withPrivilegeRuntime"; //$NON-NLS-1$
+ private static RuntimeMock runtimeMock;
+
+ @BeforeClass
+ public static void beforeClass() throws IllegalArgumentException, IOException {
+
+ File rootPath = new File(RUNTIME_PATH);
+ File configSrc = new File(CONFIG_SRC);
+ runtimeMock = new RuntimeMock();
+ runtimeMock.mockRuntime(rootPath, configSrc);
+ runtimeMock.startContainer();
+ }
+
+ @Override
+ protected URI getBaseUri() {
+ return BASE_URI;
+ }
+
+ @AfterClass
+ public static void afterClass() {
+ runtimeMock.destroyRuntime();
+ }
+
+ @Override
+ protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+ return new GrizzlyWebTestContainerFactory();
+ }
+
+ @Override
+ protected DeploymentContext configureDeployment() {
+ return ServletDeploymentContext.builder(configure()).contextPath("rest").build();
+ }
+
+ @Override
+ protected Application configure() {
+ forceEnable(TestProperties.LOG_TRAFFIC);
+ enable(TestProperties.DUMP_ENTITY);
+ return createApp();
+ }
+
+ public static ResourceConfig createApp() {
+ ResourceConfig resourceConfig = new ResourceConfig();
+ resourceConfig.setApplicationName("RestTest");
+
+ for (Class> clazz : StrolchRestfulClasses.restfulClasses) {
+ resourceConfig.register(clazz);
+ }
+ for (Class> clazz : StrolchRestfulClasses.providerClasses) {
+ resourceConfig.register(clazz);
+ }
+
+ resourceConfig.register(LoggingFilter.class);
+ //.register(createMoxyJsonResolver())
+ // Logging
+ // Tracing support.
+ resourceConfig.property(ServerProperties.TRACING, TracingConfig.ALL.name());
+ resourceConfig.property(ServletProperties.FILTER_FORWARD_ON_404, true);
+ return resourceConfig;
+ }
+}
diff --git a/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AuthenticationTest.java b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AuthenticationTest.java
new file mode 100644
index 000000000..f9b1f7af8
--- /dev/null
+++ b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/AuthenticationTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.inspector.test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.Locale;
+
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation.Builder;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import li.strolch.rest.model.Login;
+import li.strolch.rest.model.LoginResult;
+import li.strolch.rest.model.LogoutResult;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Robert von Burg
+ */
+@Ignore
+@SuppressWarnings("nls")
+public class AuthenticationTest extends AbstractRestfulTest {
+
+ private static final String ROOT_PATH = "strolch/authentication";
+
+ @Test
+ public void shouldAuthenticate() {
+
+ // login
+ Login login = new Login();
+ login.setUsername("jill");
+ login.setPassword("jill");
+ Entity loginEntity = Entity.entity(login, MediaType.APPLICATION_JSON);
+ Response result = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON).post(loginEntity);
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ LoginResult loginResult = result.readEntity(LoginResult.class);
+ assertNotNull(loginResult);
+ assertEquals("jill", loginResult.getUsername());
+ assertEquals(64, loginResult.getSessionId().length());
+ assertNull(loginResult.getMsg());
+
+ // logout
+ result = target().path(ROOT_PATH + "/" + loginResult.getSessionId()).request(MediaType.APPLICATION_JSON)
+ .delete();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ assertNotNull(loginResult);
+ LogoutResult logoutResult = result.readEntity(LogoutResult.class);
+ assertNotNull(logoutResult);
+ assertNull(logoutResult.getMsg());
+ }
+
+ @Test
+ public void shouldUseRequestedLanguage() {
+
+ // login
+ Login login = new Login();
+ login.setUsername("jill");
+ login.setPassword("jill");
+ Entity loginEntity = Entity.entity(login, MediaType.APPLICATION_JSON);
+ Builder builder = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON);
+ builder = builder.acceptLanguage(Locale.ITALY);
+ Response result = builder.post(loginEntity);
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ LoginResult loginResult = result.readEntity(LoginResult.class);
+ assertNotNull(loginResult);
+ assertEquals("jill", loginResult.getUsername());
+ assertEquals(64, loginResult.getSessionId().length());
+ assertEquals(Locale.ITALY.toString(), loginResult.getLocale());
+ assertNull(loginResult.getMsg());
+
+ // logout
+ result = target().path(ROOT_PATH + "/" + loginResult.getSessionId()).request(MediaType.APPLICATION_JSON)
+ .delete();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ assertNotNull(loginResult);
+ LogoutResult logoutResult = result.readEntity(LogoutResult.class);
+ assertNotNull(logoutResult);
+ assertNull(logoutResult.getMsg());
+ }
+
+ @Test
+ public void shouldNotAuthenticate() {
+
+ // login
+ Login login = new Login();
+ login.setUsername("admin");
+ login.setPassword("blalba");
+ Entity loginEntity = Entity.entity(login, MediaType.APPLICATION_JSON);
+ Response result = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON).post(loginEntity);
+ assertEquals(Status.UNAUTHORIZED.getStatusCode(), result.getStatus());
+ LogoutResult logoutResult = result.readEntity(LogoutResult.class);
+ assertNotNull(logoutResult);
+ assertEquals("Could not log in due to: Authentication credentials are invalid", logoutResult.getMsg());
+ }
+
+ @Test
+ public void shouldFailLogoutIllegalSession() {
+
+ // login
+ Login login = new Login();
+ login.setUsername("jill");
+ login.setPassword("jill");
+ Entity loginEntity = Entity.entity(login, MediaType.APPLICATION_JSON);
+ Response result = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON).post(loginEntity);
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ LoginResult loginResult = result.readEntity(LoginResult.class);
+ assertNotNull(loginResult);
+ assertEquals("jill", loginResult.getUsername());
+ assertEquals(64, loginResult.getSessionId().length());
+ assertNull(loginResult.getMsg());
+
+ // logout
+ result = target().path(ROOT_PATH + "/blabla").request(MediaType.APPLICATION_JSON).delete();
+ assertEquals(Status.UNAUTHORIZED.getStatusCode(), result.getStatus());
+ LogoutResult logoutResult = result.readEntity(LogoutResult.class);
+ assertNotNull(logoutResult);
+ assertThat(logoutResult.getMsg(), containsString("No certificate exists for sessionId blabla"));
+ }
+}
diff --git a/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/EnumTest.java b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/EnumTest.java
new file mode 100644
index 000000000..3ae7e0c3a
--- /dev/null
+++ b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/EnumTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.inspector.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Locale;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import li.strolch.runtime.query.enums.StrolchEnum;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Robert von Burg
+ */
+@Ignore
+@SuppressWarnings("nls")
+public class EnumTest extends AbstractRestfulTest {
+
+ private static final String ROOT_PATH = "strolch/enums";
+
+ @Test
+ public void shouldQuerySex() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "/sex").request(MediaType.APPLICATION_JSON)
+ .acceptLanguage(Locale.ENGLISH).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ StrolchEnum strolchEnum = result.readEntity(StrolchEnum.class);
+ assertNotNull(strolchEnum);
+ assertEquals("sex", strolchEnum.getName());
+ assertEquals(4, strolchEnum.getValues().size());
+ }
+
+ @Test
+ public void shouldQuerySalutation() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "/salutation").request(MediaType.APPLICATION_JSON)
+ .acceptLanguage(Locale.ENGLISH).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ StrolchEnum strolchEnum = result.readEntity(StrolchEnum.class);
+ assertNotNull(strolchEnum);
+ assertEquals("salutation", strolchEnum.getName());
+ assertEquals(3, strolchEnum.getValues().size());
+ assertEquals("Mrs", strolchEnum.getValue("mrs"));
+ }
+
+ @Test
+ public void shouldQueryGermanSalutation() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "/salutation").request(MediaType.APPLICATION_JSON)
+ .acceptLanguage(Locale.GERMAN).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ StrolchEnum strolchEnum = result.readEntity(StrolchEnum.class);
+ assertNotNull(strolchEnum);
+ assertEquals("salutation", strolchEnum.getName());
+ assertEquals(3, strolchEnum.getValues().size());
+ assertEquals("Frau", strolchEnum.getValue("mrs"));
+ }
+}
diff --git a/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/InspectorTest.java b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/InspectorTest.java
new file mode 100644
index 000000000..94d474701
--- /dev/null
+++ b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/InspectorTest.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.inspector.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import li.strolch.rest.model.AgentOverview;
+import li.strolch.rest.model.ElementMapOverview;
+import li.strolch.rest.model.ElementMapType;
+import li.strolch.rest.model.ElementMapsOverview;
+import li.strolch.rest.model.RealmDetail;
+import li.strolch.rest.model.RealmOverview;
+import li.strolch.rest.model.TypeOverview;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Robert von Burg
+ */
+@SuppressWarnings("nls")
+@Ignore
+public class InspectorTest extends AbstractRestfulTest {
+
+ private static final String ROOT_PATH = "strolch/inspector/";
+
+ @Test
+ public void shouldGetAgent() {
+
+ Response response = target().path("/").request(MediaType.TEXT_HTML).get();
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+
+ // expected result
+ List realms = new ArrayList<>(1);
+ realms.add(new RealmOverview("defaultRealm", 6));
+ AgentOverview expectedAgentOverview = new AgentOverview(realms);
+
+ // query
+ Response result = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ AgentOverview agentOverview = result.readEntity(AgentOverview.class);
+
+ // assertions
+ assertEquals(expectedAgentOverview, agentOverview);
+ }
+
+ @Test
+ public void shouldGetRealm() {
+
+ // expected result
+ List elementMapOverviews = new ArrayList<>(2);
+ Set resourceTypes = new HashSet<>();
+ resourceTypes.add("Template");
+ resourceTypes.add("TestType");
+ resourceTypes.add("Enumeration");
+ elementMapOverviews.add(new ElementMapsOverview(ElementMapType.RESOURCE, 4, resourceTypes));
+ Set orderTypes = new HashSet<>();
+ orderTypes.add("Template");
+ orderTypes.add("TestType");
+ elementMapOverviews.add(new ElementMapsOverview(ElementMapType.ORDER, 2, orderTypes));
+ RealmDetail expectedRealmDetail = new RealmDetail(elementMapOverviews);
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm").request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ RealmDetail realmDetail = result.readEntity(RealmDetail.class);
+
+ // assertions
+ assertEquals(expectedRealmDetail, realmDetail);
+ }
+
+ @Test
+ public void shouldGetResourcesOverview() {
+
+ // expected result
+ String elementMapName = "Resource";
+ List typeOverviews = new ArrayList<>(2);
+ typeOverviews.add(new TypeOverview("Enumeration", 2));
+ typeOverviews.add(new TypeOverview("Template", 1));
+ typeOverviews.add(new TypeOverview("TestType", 1));
+ ElementMapOverview expectedElementMapOverview = new ElementMapOverview(elementMapName, typeOverviews);
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm/resource").request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ ElementMapOverview elementMapOverview = result.readEntity(ElementMapOverview.class);
+
+ // assertions
+ assertEquals(expectedElementMapOverview, elementMapOverview);
+ }
+
+ @Test
+ public void shouldGetOrdersOverview() {
+
+ // expected result
+ String elementMapName = "Order";
+ List typeOverviews = new ArrayList<>(2);
+ typeOverviews.add(new TypeOverview("Template", 1));
+ typeOverviews.add(new TypeOverview("TestType", 1));
+ ElementMapOverview expectedElementMapOverview = new ElementMapOverview(elementMapName, typeOverviews);
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm/order").request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ ElementMapOverview elementMapOverview = result.readEntity(ElementMapOverview.class);
+
+ // assertions
+ assertEquals(expectedElementMapOverview, elementMapOverview);
+ }
+
+ // TODO modify object model to include discriminator values, so that we can parse the objects
+
+ @Test
+ public void shouldGetResourceTypeDetails() {
+
+ // query
+
+ WebTarget target = target();
+ Response result = target.path(ROOT_PATH + "defaultRealm/resource/Template").request(MediaType.APPLICATION_JSON)
+ .get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ String entity = result.readEntity(String.class);
+ String expected = "{\"type\":\"Template\",\"resources\":[{\"id\":\"TestType\",\"name\":\"TestType Template\",\"type\":\"Template\"}]}";
+ assertEquals(expected, entity);
+ }
+
+ @Test
+ public void shouldGetOrderTypeDetails() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm/order/Template").request(MediaType.APPLICATION_JSON)
+ .get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ String entity = result.readEntity(String.class);
+ String expected = "{\"type\":\"Template\",\"orders\":[{\"id\":\"TestType\",\"name\":\"MyTestOrder Template\",\"type\":\"Template\",\"date\":\"2012-11-30T18:12:05.628+01:00\",\"state\":\"CREATED\"}]}";
+ assertEquals(expected, entity);
+ }
+
+ @Test
+ public void shouldGetResource() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm/resource/Template/TestType")
+ .request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ String entity = result.readEntity(String.class);
+ assertTrue(entity.contains("name\":\"TestType Template\",\"type\":\"Template\",\"parameterBags\":"));
+ }
+
+ @Test
+ public void shouldGetOrder() {
+
+ // query
+ Response result = target().path(ROOT_PATH + "defaultRealm/order/Template/TestType")
+ .request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ String entity = result.readEntity(String.class);
+ assertTrue(entity
+ .contains("\"date\":\"2012-11-30T18:12:05.628+01:00\",\"state\":\"CREATED\",\"parameterBags\""));
+ }
+}
diff --git a/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/VersionQueryTest.java b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/VersionQueryTest.java
new file mode 100644
index 000000000..0aa6fd7dd
--- /dev/null
+++ b/li.strolch.rest/src/test/java/li/strolch/rest/inspector/test/VersionQueryTest.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2013 Robert von Burg
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package li.strolch.rest.inspector.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import li.strolch.agent.api.AgentVersion;
+import li.strolch.agent.api.ComponentVersion;
+import li.strolch.agent.api.VersionQueryResult;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Robert von Burg
+ */
+@Ignore
+@SuppressWarnings("nls")
+public class VersionQueryTest extends AbstractRestfulTest {
+
+ private static final String ROOT_PATH = "strolch/version";
+
+ @Test
+ public void shouldQueryVersion() {
+
+ // query
+ Response result = target().path(ROOT_PATH).request(MediaType.APPLICATION_JSON).get();
+ assertEquals(Status.OK.getStatusCode(), result.getStatus());
+ VersionQueryResult versionQueryResult = result.readEntity(VersionQueryResult.class);
+ if (versionQueryResult.hasErrors()) {
+ for (String error : versionQueryResult.getErrors()) {
+ logger.error(error);
+ }
+ }
+
+ AgentVersion agentVersion = versionQueryResult.getAgentVersion();
+ logger.info(agentVersion.toString());
+ List componentVersions = versionQueryResult.getComponentVersions();
+ assertEquals(6, componentVersions.size());
+ for (ComponentVersion version : componentVersions) {
+ logger.info(version.toString());
+ assertEquals("li.strolch", agentVersion.getGroupId());
+ }
+
+ assertEquals("StrolchPersistenceTest", agentVersion.getAgentName());
+ assertEquals("li.strolch", agentVersion.getGroupId());
+ assertEquals("li.strolch.agent", agentVersion.getArtifactId());
+ }
+}
diff --git a/li.strolch.rest/src/test/resources/log4j.xml b/li.strolch.rest/src/test/resources/log4j.xml
new file mode 100644
index 000000000..0a2a73d06
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/log4j.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeConfig.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeConfig.xml
new file mode 100644
index 000000000..9d7a227e3
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeConfig.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml
new file mode 100644
index 000000000..bad34f118
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+ SYSTEM
+
+ agent
+
+
+
+ Application
+ Administrator
+ ENABLED
+ en_GB
+
+ PrivilegeAdmin
+ AppUser
+
+
+
+
+
+
+
+
+ Bob
+ Bernstein
+ ENABLED
+ en_GB
+
+ AppUser
+
+
+
+
+ Jill
+ Johnson
+ ENABLED
+ en_GB
+
+ OnlyGreetingServiceRole
+
+
+
+
+ System User
+ Administrator
+ SYSTEM
+ en_GB
+
+ sysAdmin
+ AppUser
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+ li.strolch.service.test.GreetingService
+
+
+
+
+
\ No newline at end of file
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml
new file mode 100644
index 000000000..3a04698cf
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml
@@ -0,0 +1,63 @@
+
+
+
+
+ StrolchPersistenceTest
+
+ true
+
+
+
+ PrivilegeHandler
+ li.strolch.runtime.privilege.PrivilegeHandler
+ li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler
+
+ PrivilegeConfig.xml
+
+
+
+ RealmHandler
+ li.strolch.agent.api.RealmHandler
+ li.strolch.agent.impl.DefaultRealmHandler
+ PrivilegeHandler
+
+ TRANSIENT
+ StrolchModel.xml
+
+
+
+ ServiceHandler
+ li.strolch.service.api.ServiceHandler
+ li.strolch.service.api.DefaultServiceHandler
+
+ true
+
+
+
+ RestfulHandler
+ li.strolch.rest.RestfulStrolchComponent
+ li.strolch.rest.RestfulStrolchComponent
+
+
+
+
+ SessionHandler
+ li.strolch.rest.StrolchSessionHandler
+ li.strolch.rest.DefaultStrolchSessionHandler
+
+ true
+
+
+
+ EnumHandler
+ li.strolch.runtime.query.enums.EnumHandler
+ li.strolch.runtime.query.enums.DefaultEnumHandler
+ RealmHandler
+
+ defaultRealm
+ Resource/Enumeration/salutation
+ Resource/Enumeration/sex
+
+
+
+
\ No newline at end of file
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Enums.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Enums.xml
new file mode 100644
index 000000000..8e7afdc99
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Enums.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Orders.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Orders.xml
new file mode 100644
index 000000000..55358bcaa
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Orders.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Resources.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Resources.xml
new file mode 100644
index 000000000..e6259cb83
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/Resources.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/StrolchModel.xml b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/StrolchModel.xml
new file mode 100644
index 000000000..bc5e3d9a6
--- /dev/null
+++ b/li.strolch.rest/src/test/resources/withPrivilegeRuntime/data/StrolchModel.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file