本文整理汇总了Java中eu.atos.sla.service.rest.helpers.ProviderHelper类的典型用法代码示例。如果您正苦于以下问题:Java ProviderHelper类的具体用法?Java ProviderHelper怎么用?Java ProviderHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProviderHelper类属于eu.atos.sla.service.rest.helpers包,在下文中一共展示了ProviderHelper类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProviders
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Get the list of available providers
*
* <pre>
* GET /providers
*
* Request:
* GET /providers HTTP/1.1
* Accept: application/xml
*
* Response:
*
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <collection href="/providers">
* <items offset="0" total="1">
*
* <provider>
* <uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-prueba</name>
* </provider>
* </items>
* </collection>
* }
*
* </pre>
*
* Example: <li>curl http://localhost:8080/sla-service/providers</li>
*
* @return XML information with the different details of the providers
*
* @throws JAXBException
*/
@GET
@Produces(MediaType.APPLICATION_XML)
public Response getProviders() {
logger.debug("StartOf getProviders - REQUEST for /providers");
ProviderHelper providerRestService = getProviderHelper();
String serializedProviders = null;
try {
serializedProviders = providerRestService.getProviders();
} catch (HelperException e) {
logger.info("getTemplates exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getTemplates");
return buildResponse(200, serializedProviders);
}
示例2: getProviderByUuid
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Gets the information of an specific provider If the provider it is not in
* the database, it returns 404 with empty payload
*
* <pre>
* GET /providers/{uuid}
*
* Request:
* GET /providers HTTP/1.1
*
* Response:
*
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <provider>
* <uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-prueba</name>
* </provider>
* }
*
* </pre>
*
* Example: <li>curl
* http://localhost:8080/sla-service/providers/fc923960-03f
* e-41eb-8a21-a56709f9370f</li>
*
* @param uuid
* of the provider
* @return XML information with the different details of the provider
*/
@GET
@Path("{uuid}")
@Produces(MediaType.APPLICATION_XML)
public Response getProviderByUuid(@PathParam("uuid") String provider_uuid)
throws IOException, JAXBException {
logger.debug("StartOf getProviderByUuid - REQUEST for /providers/" + provider_uuid);
try {
ProviderHelper providerRestService = getProviderHelper();
String serializedProvider = providerRestService.getProviderByUUID(provider_uuid);
if (serializedProvider!=null){
logger.debug("EndOf getProviderByUuid");
return buildResponse(200, serializedProvider);
}else{
logger.debug("EndOf getProviderByUuid");
return buildResponse(404, printError(404, "There is no provider with uuid " + provider_uuid
+ " in the SLA Repository Database"));
}
} catch (HelperException e) {
logger.info("getProviderByUuid exception:"+e.getMessage());
return buildResponse(e);
}
}
示例3: createProvider
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Creates a new provider
*
*
* <pre>
* POST /providers
* Request:
* POST /providers HTTP/1.1
* Accept: application/xml
*
* Response:
*
* {@code
* <provider>
* <uuid>fc993580-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-3</name>
* </provider>
*
* }
*
* </pre>
*
* Example: <li>curl -H "Content-type: application/xml" -X POST -d
* @provider.xml localhost:8080/sla-service/providers/</li>
*
* @return XML information with the different details of the provider
*/
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
logger.debug("StartOf createProvider - REQUEST Insert /providers");
ProviderHelper providerRestService = getProviderHelper();
String location;
try {
location = providerRestService.createProvider(
hh, uriInfo.getAbsolutePath().toString(), payload);
} catch (HelperException e) {
logger.info("createProvider exception", e);
return buildResponse(e);
}
logger.debug("EndOf createProvider");
return buildResponsePOST(
HttpStatus.CREATED,
printMessage(HttpStatus.CREATED,
"The createProvider has been stored successfully in the SLA Repository Database"),
location);
}
示例4: getProviderHelper
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
private ProviderHelper getProviderHelper() {
return helper;
}
示例5: getProviders
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Get the list of available providers
*
* <pre>
* GET /providers
*
* Request:
* GET /providers HTTP/1.1
* Accept: application/xml
*
* Response:
*
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <collection href="/providers">
* <items offset="0" total="1">
*
* <provider>
* <uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-prueba</name>
* </provider>
* </items>
* </collection>
* }
*
* </pre>
*
* Example: <li>curl http://localhost:8080/sla-service/providers</li>
*
* @return XML information with the different details of the providers
*
* @throws JAXBException
*/
@GET
@Produces(MediaType.APPLICATION_XML)
public Response getProviders() {
logger.debug("StartOf getProviders - REQUEST for /providers");
ProviderHelper providerRestService = getProviderHelper();
String serializedProviders = null;
try {
serializedProviders = providerRestService.getProviders();
} catch (HelperException e) {
logger.info("getTemplates exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getTemplates");
return buildResponse(200, serializedProviders);
}
示例6: getProviderByUuid
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Gets the information of an specific provider If the provider it is not in
* the database, it returns 404 with empty payload
*
* <pre>
* GET /providers/{uuid}
*
* Request:
* GET /providers HTTP/1.1
*
* Response:
*
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <provider>
* <uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-prueba</name>
* </provider>
* }
*
* </pre>
*
* Example: <li>curl
* http://localhost:8080/sla-service/providers/fc923960-03f
* e-41eb-8a21-a56709f9370f</li>
*
* @param uuid
* of the provider
* @return XML information with the different details of the provider
*/
@GET
@Path("{uuid}")
@Produces(MediaType.APPLICATION_XML)
public Response getProviderByUuid(@PathParam("uuid") String provider_uuid)
throws IOException, JAXBException {
logger.debug("StartOf getProviderByUuid - REQUEST for /providers/" + provider_uuid);
try {
ProviderHelper providerRestService = getProviderHelper();
String serializedProvider = providerRestService.getProviderByUUID(provider_uuid);
if (serializedProvider!=null){
logger.debug("EndOf getProviderByUuid");
return buildResponse(200, serializedProvider);
}else{
logger.debug("EndOf getProviderByUuid");
return buildResponse(404, printError(404, "There is no provider with uuid " + provider_uuid
+ " in the SLA Repository Database"));
}
} catch (HelperException e) {
logger.info("getProviderByUuid exception:"+e.getMessage());
return buildResponse(e);
}
}
示例7: createProvider
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
/**
* Creates a new provider
*
*
* <pre>
* POST /providers
* Request:
* POST /providers HTTP/1.1
* Accept: application/xml
*
* Response:
*
* {@code
* <provider>
* <uuid>fc993580-03fe-41eb-8a21-a56709f9370f</uuid>
* <name>provider-3</name>
* </provider>
*
* }
*
* </pre>
*
* Example: <li>curl -H "Content-type: application/xml" -X POST -d
* @provider.xml localhost:8080/sla-service/providers/</li>
*
* @return XML information with the different details of the provider
*/
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
logger.debug("StartOf createProvider - REQUEST Insert /providers");
ProviderHelper providerRestService = getProviderHelper();
String location;
try {
location = providerRestService.createProvider(
hh, uriInfo.getAbsolutePath().toString(), payload);
} catch (HelperException e) {
logger.info("createProvider exception", e);
return buildResponse(e);
}
logger.debug("EndOf createProvider");
return buildResponsePOST(
HttpStatus.CREATED,
printMessage(HttpStatus.CREATED,
"The createProvider has been stored successfully in the SLA Repository Database"),
location);
}
示例8: getProviderHelper
import eu.atos.sla.service.rest.helpers.ProviderHelper; //导入依赖的package包/类
private ProviderHelper getProviderHelper() {
return helper;
}