本文整理汇总了Java中org.jboss.resteasy.annotations.GZIP类的典型用法代码示例。如果您正苦于以下问题:Java GZIP类的具体用法?Java GZIP怎么用?Java GZIP使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GZIP类属于org.jboss.resteasy.annotations包,在下文中一共展示了GZIP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: valueOfTaskResultByTag
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Returns the value of the task result for a set of tasks of the job
* <code>jobId</code> filtered by a given tag. <strong>the result is
* deserialized before sending to the client, if the class is not found the
* content is replaced by the string 'Unknown value type' </strong>. To get
* the serialized form of a given result, one has to call the following
* restful service jobs/{jobid}/tasks/tag/{tasktag}/result/serializedvalue
*
* @param sessionId
* a valid session id
* @param jobId
* the id of the job
* @param taskTag
* the tag used to filter the tasks.
* @return the value of the task result
*/
@Override
@GET
@GZIP
@Path("jobs/{jobid}/tasks/tag/{tasktag}/result/value")
@Produces("application/json")
public Map<String, String> valueOfTaskResultByTag(@HeaderParam("sessionid") String sessionId,
@PathParam("jobid") String jobId, @PathParam("tasktag") String taskTag) throws Throwable {
Scheduler s = checkAccess(sessionId, "jobs/" + jobId + "/tasks/tag/" + taskTag + "/result/value");
List<TaskResult> taskResults = s.getTaskResultsByTag(jobId, taskTag);
Map<String, String> result = new HashMap<String, String>(taskResults.size());
for (TaskResult currentTaskResult : taskResults) {
result.put(currentTaskResult.getTaskId().getReadableName(),
getTaskResultValueAsStringOrExceptionStackTrace(currentTaskResult));
}
return result;
}
示例2: metadataOfTaskResultByTag
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Returns the metadata of the task result of task <code>taskName</code> of the
* job <code>jobId</code>filtered by a given tag.
* <p>
* Metadata is a map containing additional information associated with a result. For example a file name if the result represents a file.
*
* @param sessionId a valid session id
* @param jobId the id of the job
* @param taskTag the tag used to filter the tasks.
* @return a map containing for each task entry, the metadata of the task result
*/
@Override
@GET
@GZIP
@Path("jobs/{jobid}/tasks/tag/{tasktag}/result/metadata")
@Produces("application/json")
public Map<String, Map<String, String>> metadataOfTaskResultByTag(@HeaderParam("sessionid") String sessionId,
@PathParam("jobid") String jobId, @PathParam("tasktag") String taskTag) throws Throwable {
Scheduler s = checkAccess(sessionId, "jobs/" + jobId + "/tasks/tag" + taskTag + "/result/serializedvalue");
List<TaskResult> trs = s.getTaskResultsByTag(jobId, taskTag);
Map<String, Map<String, String>> result = new HashMap<>(trs.size());
for (TaskResult currentResult : trs) {
TaskResult r = PAFuture.getFutureValue(currentResult);
result.put(r.getTaskId().getReadableName(), r.getMetadata());
}
return result;
}
示例3: serializedValueOfTaskResultByTag
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Returns the values of a set of tasks of the job <code>jobId</code>
* filtered by a given tag. This method returns the result as a byte array
* whatever the result is.
*
* @param sessionId
* a valid session id
* @param jobId
* the id of the job
* @param taskTag
* the tag used to filter the tasks.
* @return the values of the set of tasks result as a byte array, indexed by
* the readable name of the task.
*/
@Override
@GET
@GZIP
@Path("jobs/{jobid}/tasks/tag/{tasktag}/result/serializedvalue")
@Produces("application/json")
public Map<String, byte[]> serializedValueOfTaskResultByTag(@HeaderParam("sessionid") String sessionId,
@PathParam("jobid") String jobId, @PathParam("tasktag") String taskTag) throws Throwable {
Scheduler s = checkAccess(sessionId, "jobs/" + jobId + "/tasks/tag" + taskTag + "/result/serializedvalue");
List<TaskResult> trs = s.getTaskResultsByTag(jobId, taskTag);
Map<String, byte[]> result = new HashMap<>(trs.size());
for (TaskResult currentResult : trs) {
TaskResult r = PAFuture.getFutureValue(currentResult);
result.put(r.getTaskId().getReadableName(), r.getSerializedValue());
}
return result;
}
示例4: getNodeMBeanInfo
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Retrieves attributes of the specified mbean.
*
* @param sessionId current session
* @param nodeJmxUrl mbean server url
* @param objectName name of mbean
* @param attrs set of mbean attributes
*
* @return mbean attributes values
*/
@Override
@GET
@GZIP
@Produces("application/json")
@Path("node/mbean")
public Object getNodeMBeanInfo(@HeaderParam("sessionid") String sessionId,
@QueryParam("nodejmxurl") String nodeJmxUrl, @QueryParam("objectname") String objectName,
@QueryParam("attrs") List<String> attrs)
throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException,
NotConnectedException, MalformedObjectNameException, NullPointerException {
// checking that still connected to the RM
RMProxyUserInterface rmProxy = checkAccess(sessionId);
return rmProxy.getNodeMBeanInfo(nodeJmxUrl, objectName, attrs);
}
示例5: getNodeMBeansInfo
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Retrieves attributes of the specified mbeans.
*
* @param sessionId current session
* @param objectNames mbean names (@see ObjectName format)
* @param nodeJmxUrl mbean server url
* @param attrs set of mbean attributes
*
* @return mbean attributes values
*/
@Override
@GET
@GZIP
@Produces("application/json")
@Path("node/mbeans")
public Object getNodeMBeansInfo(@HeaderParam("sessionid") String sessionId,
@QueryParam("nodejmxurl") String nodeJmxUrl, @QueryParam("objectname") String objectNames,
@QueryParam("attrs") List<String> attrs)
throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException,
NotConnectedException, MalformedObjectNameException, NullPointerException {
// checking that still connected to the RM
RMProxyUserInterface rmProxy = checkAccess(sessionId);
return rmProxy.getNodeMBeansInfo(nodeJmxUrl, objectNames, attrs);
}
示例6: getMBeanInfo
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
/**
* Returns the attributes <code>attr</code> of the mbean
* registered as <code>name</code>.
* @param sessionId a valid session
* @param name mbean's object name
* @param attrs attributes to enumerate
* @return returns the attributes of the mbean
* @throws InstanceNotFoundException
* @throws IntrospectionException
* @throws ReflectionException
* @throws IOException
* @throws NotConnectedException
*/
@Override
@GET
@GZIP
@Path("info/{name}")
@Produces("application/json")
public Object getMBeanInfo(@HeaderParam("sessionid") String sessionId, @PathParam("name") ObjectName name,
@QueryParam("attr") List<String> attrs) throws InstanceNotFoundException, IntrospectionException,
ReflectionException, IOException, NotConnectedException {
RMProxyUserInterface rm = checkAccess(sessionId);
if ((attrs == null) || (attrs.size() == 0)) {
// no attribute is requested, we return
// the description of the mbean
return rm.getMBeanInfo(name);
} else {
return rm.getMBeanAttributes(name, attrs.toArray(new String[attrs.size()]));
}
}
示例7: executeNodeScript
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@Override
@POST
@GZIP
@Path("node/script")
@Produces("application/json")
public ScriptResult<Object> executeNodeScript(@HeaderParam("sessionid") String sessionId,
@FormParam("nodeurl") String nodeUrl, @FormParam("script") String script,
@FormParam("scriptEngine") String scriptEngine) throws Throwable {
RMProxyUserInterface rm = checkAccess(sessionId);
List<ScriptResult<Object>> results = rm.executeScript(script,
scriptEngine,
TargetType.NODE_URL.name(),
Collections.singleton(nodeUrl));
if (results.isEmpty()) {
throw new IllegalStateException("Empty results from script execution");
}
return results.get(0);
}
示例8: executeNodeSourceScript
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@Override
@POST
@GZIP
@Path("nodesource/script")
@Produces("application/json")
public List<ScriptResult<Object>> executeNodeSourceScript(@HeaderParam("sessionid") String sessionId,
@FormParam("nodesource") String nodeSource, @FormParam("script") String script,
@FormParam("scriptEngine") String scriptEngine) throws Throwable {
RMProxyUserInterface rm = checkAccess(sessionId);
return rm.executeScript(script,
scriptEngine,
TargetType.NODESOURCE_NAME.name(),
Collections.singleton(nodeSource));
}
示例9: createFile
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@PUT
@Path("/contents/{path}/{fileName}")
@Produces("application/json; charset=utf-8")
@Consumes("application/json; charset=utf-8")
@GZIP
public GitHubResponse createFile(@PathParam("user") String user,
@PathParam("repository") String repository,
@PathParam("path") String path,
@PathParam("fileName") String fileName,
@HeaderParam("Authorization") String authorization,
GitHubCreateFileRequest content);
示例10: updateFile
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@PUT
@Path("/contents/{path}/{fileName}")
@Produces("application/json; charset=utf-8")
@Consumes("application/json; charset=utf-8")
@GZIP
public GitHubResponse updateFile(@PathParam("user") String user,
@PathParam("repository") String repository,
@PathParam("path") String path,
@PathParam("fileName") String fileName,
@HeaderParam("Authorization") String authorization,
GitHubUpdateFileRequest content);
示例11: getJob
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@GET
@GZIP
public Response getJob(@PathParam("jobId") String jobId) {
Job job = jobManager.getJob(jobId).orElseThrow(NotFoundException::new);
EntityTag etag = EntityTagGenerator.entityTagFromLong(job.getLastModified().getTime());
Response.ResponseBuilder responseBuilder = request.evaluatePreconditions(etag);
if (responseBuilder != null) {
return responseBuilder.tag(etag).build();
} else {
JobModel jobModel = jobRepresentationConverter.from(uriInfo, job);
return Response.ok(jobModel).tag(etag).build();
}
}
示例12: getJobConfiguration
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@GET
@GZIP
public Response getJobConfiguration(@PathParam("jobId") String jobId) {
Job job = jobManager.getJob(jobId).orElseThrow(NotFoundException::new);
JobConfiguration jobConfiguration = job.getJobConfiguration();
JobConfigurationModel jobConfigurationModel = jobConfigurationRepresentationConverter.from(uriInfo, jobConfiguration);
return Response.ok(jobConfigurationModel).build();
}
示例13: getVersion
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@GET
@GZIP
public Response getVersion() throws IOException {
EntityTag etag = EntityTagGenerator.entityTagFromString(version.getVersion() + version.getBuildTag() + version.getBuildTime());
Response.ResponseBuilder responseBuilder = request.evaluatePreconditions(etag);
if (responseBuilder != null) {
return responseBuilder.tag(etag).build();
} else {
JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder();
jsonObjectBuilder.add("version", version.getVersion()).add("buildTag", version.getBuildTag()).add("buildTime", version.getBuildTime());
return Response.ok(jsonObjectBuilder.build()).tag(etag).build();
}
}
示例14: getRepository
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@GET
@GZIP
@Path("/{repositoryId}")
public Response getRepository(@PathParam("repositoryId") String repositoryId) {
Repository repository = repositoryManager.getRepository(repositoryId).orElseThrow(NotFoundException::new);
EntityTag etag = EntityTagGenerator.entityTagFromLong(repository.getLastModified().getTime());
Response.ResponseBuilder responseBuilder = request.evaluatePreconditions(etag);
if (responseBuilder != null) {
return responseBuilder.tag(etag).build();
} else {
return Response.ok(representationConverter.from(uriInfo, repository)).tag(etag).build();
}
}
示例15: getRepositoryConfiguration
import org.jboss.resteasy.annotations.GZIP; //导入依赖的package包/类
@GET
@GZIP
@Path("/{repositoryId}/configuration")
public Response getRepositoryConfiguration(@PathParam("repositoryId") String repositoryId) {
Repository repository = repositoryManager.getRepository(repositoryId).orElseThrow(NotFoundException::new);
return Response.ok().entity(repository.getRepositoryConfiguration()).build();
}