Package com.erudika.para.core

Examples of com.erudika.para.core.App.update()


    return new Inflector<ContainerRequestContext, Response>() {
      public Response apply(ContainerRequestContext ctx) {
        App app = RestUtils.getPrincipalApp();
        if (app != null) {
          app.resetSecret();
          app.update();
          Map<String, String> creds = app.getCredentials();
          creds.put("info", "Save the secret key! It is showed only once!");
          return Response.ok(creds).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found.");
View Full Code Here


      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = dao.read(new App(appid).getId());
        if (app != null) {
          app.resetSecret();
          app.update();
          return Response.ok(app.credentialsMap()).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
      }
    };
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = RestUtils.getApp(appid);
        if (app != null) {
          app.resetSecret();
          app.update();
          Map<String, String> creds = app.getCredentials();
          creds.put("info", "Save the secret key! It is showed only once!");
          return Response.ok(creds).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = RestUtils.getApp(appid);
        if (app != null) {
          app.resetSecret();
          app.update();
          Map<String, String> creds = app.getCredentials();
          creds.put("info", "Save the secret key! It is showed only once!");
          return Response.ok(creds).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = RestUtils.getApp(appid);
        if (app != null) {
          app.resetSecret();
          app.update();
          Map<String, String> creds = app.getCredentials();
          creds.put("info", "Save the secret key! It is showed only once!");
          return Response.ok(creds).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
View Full Code Here

            if (ent != null && ent instanceof ParaObject) {
              type = ((ParaObject) ent).getType();
              typePlural = ((ParaObject) ent).getPlural();
              if (type != null) {
                app.addDatatype(typePlural, type);
                app.update();
              }
            }
            return res;
          }
          if (type == null) {
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = dao.read(new App(appid).getId());
        if (app != null) {
          app.resetSecret();
          app.update();
          return Response.ok(app.credentialsMap()).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
      }
    };
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = Config.APP_NAME_NS; // TODO
        App app = dao.read(new App(appid).getId());
        if (app != null) {
          app.resetSecret();
          app.update();
          return Response.ok(app.credentialsMap()).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
      }
    };
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = RestUtils.getPrincipalAppid(ctx.getSecurityContext().getUserPrincipal());
        App app = dao.read(new App(appid).getId());
        if (app != null) {
          app.resetSecret();
          app.update();
          return Response.ok(app.credentialsMap()).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
      }
    };
View Full Code Here

      public Response apply(ContainerRequestContext ctx) {
        String appid = Config.APP_NAME_NS; // TODO
        App app = dao.read(new App(appid).getId());
        if (app != null) {
          app.resetSecret();
          app.update();
          return Response.ok(app.credentialsMap()).build();
        }
        return RestUtils.getStatusResponse(Response.Status.NOT_FOUND, "App not found: " + appid);
      }
    };
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.