APISonar


org.glassfish.admin.rest.RestLogging.restLogger.log

> org > glassfish > admin > rest > RestLogging > restLogger > log
org APIs glassfish APIs admin APIs rest APIs RestLogging APIs restLogger APIs log APIs

Example 1
public void generateRestLeafGetter(String className) {
        try {
            source.append(TMPL_COLLECTION_LEAF_RESOURCE.replace("CLASSNAME", className));
        } catch (IOException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
    }
Example 2
public void generateGetSegment(String tagName) {
        try {
            source.append(TMPL_GET_SEGMENT.replace("TAGNAME", tagName));
        } catch (IOException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
    }
Example 3
public JavaClientGenerator(ServiceLocator habitat) {
        super(habitat);
        baseDirectory = Util.createTempDirectory();
        try {
            LOGGER.log(Level.INFO, "Generating class in {0}", baseDirectory.getCanonicalPath());
        } catch (IOException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
        messages.add(MSG_INSTALL.replace("VERSION", versionString));
    }
Example 4
public void generateGettersAndSetters(String type, String methodName, String fieldName) {
        try {
            source.append(TMPL_GETTERS_AND_SETTERS
                .replace("METHOD", methodName)
                .replace("TYPE", type)
                .replace("FIELDNAME", fieldName));
        } catch (IOException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
    }
Example 5
public static void logTimingMessage(String msg) {
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
        RestLogging.restLogger.log(Level.INFO, RestLogging.TIMESTAMP_MESSAGE, new Object[]{sdf.format(new Date()), msg});
    }
Example 6
public JerseyContainer getJerseyContainer() throws EndpointRegistrationException {
        try {
            return future.get();
        } catch (InterruptedException ex) {
            return exposeContext();
        } catch (ExecutionException ex) {
            Throwable orig = ex.getCause();
            if (orig instanceof EndpointRegistrationException) {
                throw (EndpointRegistrationException) orig;
            } else {
                RestLogging.restLogger.log(Level.INFO, RestLogging.INIT_FAILED, orig);
            }
            return null;
        }
    }
Example 7
public String getContent(ResponseBody body) {
        StringBuilder sb = new StringBuilder();
        try {
            sb.append(body.toJson().toString());
        } catch (JsonException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }

        return sb.toString();
    }
Example 8
public String getContent(Map proxy) {
        String json = null;
        try {
            json = new JSONObject(proxy).toString(getFormattingIndentLevel());
        } catch (JSONException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
        return json;
    }
Example 9
public ClassWriter getClassWriter(String className, String baseClassName, String resourcePath) {
        ClassWriter writer = null;
        try {
            writer = new TextClassWriter( habitat ,generationDir, className, baseClassName, resourcePath);
        } catch (IOException e) {
            // Log the root cause. The generation is going to fail with NPE.
            RestLogging.restLogger.log(Level.SEVERE, e.getMessage());
            throw new GeneratorException(e);
        }
        return writer;
    }
Example 10
public Set<Class<?>> getRestModels() {
        Set<Class<?>>classes = new HashSet<Class<?>>();
        for (ActiveDescriptor ad : Globals.getDefaultBaseServiceLocator()
                .getDescriptors(BuilderHelper.createContractFilter(RestModel.class.getName()))) {
            try {
                classes.add(CompositeUtil.instance().getModel(Class.forName(ad.getImplementation())).getClass());
            } catch (ClassNotFoundException ex) {
                RestLogging.restLogger.log(Level.SEVERE, null, ex);
            }
        }

        return classes;
    }
Example 11
public String getContent(OptionsResult proxy) {
        JSONObject obj = new JSONObject();
        try {
            obj.put(proxy.getName(), getRespresenationForMethodMetaData(proxy));
        } catch (JSONException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
        return obj.toString();
    }
Example 12
public String getContent(RestModel proxy) {
        StringBuilder sb = new StringBuilder();
        final List<String> wrapObjectHeader = requestHeaders.get().getRequestHeader("X-Wrap-Object");
        boolean wrapObject = ((wrapObjectHeader != null) && (!wrapObjectHeader.isEmpty()));
        try {
            JsonValue object = JsonUtil.getJsonValue(proxy);
            sb.append(object.toString());
        } catch (JsonException ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }

        return (wrapObject ? " { item : " : "") + sb.toString() + (wrapObject ? "}" : "");
    }
Example 13
private void generateASM(ServiceLocator habitat) {
        try {
            Domain entity = habitat.getService(Domain.class);
            Dom dom = Dom.unwrap(entity);

            ResourcesGenerator resourcesGenerator = new ASMResourcesGenerator(habitat);
            resourcesGenerator.generateSingle(dom.document.getRoot().model, dom.document);
            resourcesGenerator.endGeneration();
        } catch (Exception ex) {
            RestLogging.restLogger.log(Level.SEVERE, null, ex);
        }
    }
Example 14
public Response execCommandMultInSseOut(@PathParam("command") String command,
                @HeaderParam(RemoteRestAdminCommand.COMMAND_MODEL_MATCH_HEADER) String modelETag,
                @CookieParam(SESSION_COOKIE_NAME) Cookie jSessionId,
                ParamsWithPayload pwp) {
        CommandName commandName = new CommandName(normalizeCommandName(command));
        if (RestLogging.restLogger.isLoggable(Level.FINEST)) {
            RestLogging.restLogger.log(Level.FINEST, "execCommandMultInMultOut({0})", commandName);
        }
        ParameterMap data = null;
        if (pwp != null) {
            data = pwp.getParameters();
        }
        return executeSseCommand(commandName, null, data, modelETag, jSessionId);
    }
Example 15
public Response getCommandModel(@PathParam("command") String command) throws WebApplicationException {
        CommandName commandName = new CommandName(normalizeCommandName(command));
        if (RestLogging.restLogger.isLoggable(Level.FINEST)) {
            RestLogging.restLogger.log(Level.FINEST, "getCommandModel({0})", commandName);
        }
        CommandModel model = getCommandModel(commandName);
        String eTag = CachedCommandModel.computeETag(model);
        return Response.ok(model).tag(new EntityTag(eTag, true)).build();
    }