Commit 57bc439a authored by Andre Freyssinet's avatar Andre Freyssinet

Returns links to frame parameter methods.

Logging enhancements.
parent 5939afa5
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2016 - 2018 ScalAgent Distributed Technologies
* Copyright (C) 2016 - 2020 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -72,28 +72,25 @@ import fr.dyade.aaa.common.Debug;
@Path("/")
@Singleton
public class AdminService implements ContainerRequestFilter {
public static Logger logger = Debug.getLogger(AdminService.class.getName());
private static final String AUTHORIZATION_PROPERTY = "Authorization";
private static final String AUTHENTICATION_SCHEME = "Basic";
public static Logger logger = Debug.getLogger(AdminService.class.getName());
private final AdminHelper helper = AdminHelper.getInstance();
public static final String ADMIN = "admin";
public static void logLinks(Response.ResponseBuilder builder) {
if (builder == null)
if ((builder == null) || !logger.isLoggable(BasicLevel.DEBUG))
return;
Response response = builder.build();
if (response != null) {
Set<Link> links = response.getLinks();
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, "links: ");
logger.log(BasicLevel.DEBUG, "links: ");
for (Link link : links) {
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, "\t" + link.getRel() + ": " + link.getUri());
logger.log(BasicLevel.DEBUG, "\t" + link.getRel() + ": " + link.getUri());
}
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, "");
}
}
......
......@@ -40,8 +40,8 @@ import fr.dyade.aaa.common.Debug;
*
*/
public class Activator implements BundleActivator {
public static Logger logger = Debug.getLogger(Activator.class.getName());
public static final String SERVICE_NAME = "rest.service.name";
private BundleContext context = null;
private HttpService httpService;
......
......@@ -56,6 +56,8 @@ public class JmsService {
public static final String JMS = "jms";
public static final String JMS_CREATE_PROD = "create-producer";
public static final String JMS_CREATE_CONS = "create-consumer";
public static final String JMS_CREATE_PROD_FP = "create-producer-fp";
public static final String JMS_CREATE_CONS_FP = "create-consumer-fp";
@GET
@Produces(MediaType.TEXT_HTML)
......
......@@ -158,6 +158,8 @@ public class JndiService {
builder = Response.status(Response.Status.CREATED);
// Links for old style API
//link to the create producer
UriBuilder nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_PROD);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_PROD);
......@@ -184,6 +186,36 @@ public class JndiService {
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_CONS);
nextBuilder.queryParam("session-mode", JMSContext.SESSION_TRANSACTED);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_CONS+"-transacted");
// Links for frame parameters API
//link to the create producer
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_PROD_FP);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_PROD_FP);
//link to the create producer DUPS_OK_ACKNOWLEDGE
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_PROD_FP);
nextBuilder.queryParam("session-mode", JMSContext.DUPS_OK_ACKNOWLEDGE);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_PROD_FP+"-dups-ok");
//link to the create producer SESSION_TRANSACTED
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_PROD_FP);
nextBuilder.queryParam("session-mode", JMSContext.SESSION_TRANSACTED);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_PROD_FP+"-transacted");
//link to the create consumer
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_CONS_FP);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_CONS_FP);
//link to the create consumer DUPS_OK_ACKNOWLEDGE
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_CONS_FP);
nextBuilder.queryParam("session-mode", JMSContext.DUPS_OK_ACKNOWLEDGE);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_CONS_FP+"-dups-ok");
//link to the create consumer CLIENT_ACKNOWLEDGE
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_CONS_FP);
nextBuilder.queryParam("session-mode", JMSContext.CLIENT_ACKNOWLEDGE);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_CONS_FP+"-client-ack");
//link to create consumer SESSION_TRANSACTED
nextBuilder = uriInfo.getAbsolutePathBuilder().path(JmsService.JMS_CREATE_CONS_FP);
nextBuilder.queryParam("session-mode", JMSContext.SESSION_TRANSACTED);
builder.link(nextBuilder.build(), JmsService.JMS_CREATE_CONS_FP+"-transacted");
//link to the lookup
nextBuilder = uriInfo.getAbsolutePathBuilder();
builder.link(nextBuilder.build(), "lookup");
......@@ -399,8 +431,8 @@ public class JndiService {
@DefaultValue(""+Message.DEFAULT_PRIORITY)@QueryParam("priority") int priority,
@DefaultValue(""+Message.DEFAULT_TIME_TO_LIVE)@QueryParam("time-to-live")long timeToLive,
@DefaultValue("0")@QueryParam("idle-timeout") long idleTimeout,
@QueryParam("user") String userName, // TODO: deprecates
@QueryParam("password")String password, // TODO: deprecates
@QueryParam("user") String userName, // TODO: Removes and renames userName2
@QueryParam("password")String password, // TODO: Removes and renames password2
@FormParam("user") String userName2,
@FormParam("password")String password2,
@Context UriInfo uriInfo) {
......@@ -511,8 +543,8 @@ public class JndiService {
@DefaultValue("false")@QueryParam("shared") boolean shared,
@QueryParam("sub-name") String subName,
@DefaultValue("0")@QueryParam("idle-timeout") long idleTimeout,
@QueryParam("user") String userName, // TODO: deprecates
@QueryParam("password")String password, // TODO: deprecates
@QueryParam("user") String userName, // TODO: removes and renames userName2
@QueryParam("password")String password, // TODO: removes and renames password2
@FormParam("user") String userName2,
@FormParam("password")String password2,
@Context UriInfo uriInfo) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment