本文整理汇总了Java中com.sun.jersey.core.spi.factory.ResponseBuilderImpl.status方法的典型用法代码示例。如果您正苦于以下问题:Java ResponseBuilderImpl.status方法的具体用法?Java ResponseBuilderImpl.status怎么用?Java ResponseBuilderImpl.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jersey.core.spi.factory.ResponseBuilderImpl
的用法示例。
在下文中一共展示了ResponseBuilderImpl.status方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateAgreementFromTemplate
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
@GET
@Path("commands/fromtemplate")
@Produces(MediaType.APPLICATION_XML)
public Response generateAgreementFromTemplate(@QueryParam("templateId") String templateId) throws JAXBException {
ITemplate template = templateDAO.getByUuid(templateId);
Template wsagTemplate;
try {
wsagTemplate = templateParser.getWsagObject(template.getText());
} catch (ParserException e) {
throw new SlaGeneratorException(e.getMessage(), e);
}
Agreement wsagAgreement = new AgreementGenerator(wsagTemplate).generate();
logger.debug(JaxbUtils.toString(wsagAgreement));
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(HttpStatus.OK.value());
builder.entity(wsagAgreement);
return builder.build();
}
示例2: buildResponsePOST
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
protected Response buildResponsePOST(HttpStatus status, MessageResponse message, String location) {
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.header("location", location);
builder.status(status.value());
builder.entity(message);
return builder.build();
}
示例3: getResourceRESTParameterList
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public ResourceModel getResourceRESTParameterList(ResourceModel oResource)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
oResource = (ResourceModel) hibernateSession.get(ResourceModel.class, oResource.getResourceId());
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oResource;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例4: deleteOutputParameter
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public OutputParameterModel deleteOutputParameter(OutputParameterModel oOutputParameter)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
//retrieve the whole resource
oOutputParameter = (OutputParameterModel) hibernateSession.get(OutputParameterModel.class, oOutputParameter.getOutputParameterId());
if(oOutputParameter == null)
{
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
oOutputParameter.deleteAllCollections(hibernateSession);
hibernateSession.delete(oOutputParameter);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oOutputParameter;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例5: getOutputParameterOutputParameterList
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public OutputParameterModel getOutputParameterOutputParameterList(OutputParameterModel oOutputParameter)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
oOutputParameter = (OutputParameterModel) hibernateSession.get(OutputParameterModel.class, oOutputParameter.getOutputParameterId());
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oOutputParameter;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例6: putAccount
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public AccountModel putAccount(AccountModel oAccount)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//update the <ResourceName> to database
hibernateSession.update(oAccount);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oAccount;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例7: deleteInputMessage
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public InputMessageModel deleteInputMessage(InputMessageModel oInputMessage)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
//retrieve the whole resource
oInputMessage = (InputMessageModel) hibernateSession.get(InputMessageModel.class, oInputMessage.getInputMessageId());
if(oInputMessage == null)
{
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
oInputMessage.deleteAllCollections(hibernateSession);
hibernateSession.delete(oInputMessage);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oInputMessage;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例8: putInputParameter
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public InputParameterModel putInputParameter(InputParameterModel oInputParameter)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//update the <ResourceName> to database
hibernateSession.update(oInputParameter);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oInputParameter;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例9: getOutputMessageList
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public SOAPOperationModel getOutputMessageList(SOAPOperationModel oSOAPOperation)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
oSOAPOperation = (SOAPOperationModel) hibernateSession.get(SOAPOperationModel.class, oSOAPOperation.getSOAPOperationId());
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oSOAPOperation;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例10: putRESTService
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public RESTServiceModel putRESTService(RESTServiceModel oRESTService)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//update the <ResourceName> to database
hibernateSession.update(oRESTService);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oRESTService;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例11: getInputMessageInputParameterList
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public InputMessageModel getInputMessageInputParameterList(InputMessageModel oInputMessage)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
oInputMessage = (InputMessageModel) hibernateSession.get(InputMessageModel.class, oInputMessage.getInputMessageId());
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oInputMessage;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例12: getResource
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public ResourceModel getResource(ResourceModel oResource)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
oResource = (ResourceModel) hibernateSession.get(ResourceModel.class, oResource.getResourceId());
if(oResource == null)
{
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oResource;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例13: putResource
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public ResourceModel putResource(ResourceModel oResource)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//update the <ResourceName> to database
hibernateSession.update(oResource);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oResource;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例14: deleteOutputMessage
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public OutputMessageModel deleteOutputMessage(OutputMessageModel oOutputMessage)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//find the <ResourceName> in the database
//retrieve the whole resource
oOutputMessage = (OutputMessageModel) hibernateSession.get(OutputMessageModel.class, oOutputMessage.getOutputMessageId());
if(oOutputMessage == null)
{
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
oOutputMessage.deleteAllCollections(hibernateSession);
hibernateSession.delete(oOutputMessage);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
return oOutputMessage;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}
示例15: postRESTMethod
import com.sun.jersey.core.spi.factory.ResponseBuilderImpl; //导入方法依赖的package包/类
public RESTMethodModel postRESTMethod(RESTMethodModel oRESTMethod)
{
try
{
//create a new session and begin the transaction
Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction hibernateTransaction = hibernateSession.beginTransaction();
//insert the new <ResourceName> to database
int RESTMethodId = (Integer) hibernateSession.save(oRESTMethod);
//commit and terminate the session
hibernateTransaction.commit();
hibernateSession.close();
//return the <accountModelName> with updated <accountModelName>Id
oRESTMethod.setRESTMethodId(RESTMethodId);
return oRESTMethod;
}
catch (HibernateException exception)
{
System.out.println(exception.getCause());
ResponseBuilderImpl builder = new ResponseBuilderImpl();
builder.status(Response.Status.BAD_REQUEST);
builder.entity(String.format("%s",exception.getCause()));
Response response = builder.build();
throw new WebApplicationException(response);
}
}