當前位置: 首頁>>代碼示例>>Java>>正文


Java ProviderHelper類代碼示例

本文整理匯總了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);
	
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:52,代碼來源:ProviderRest.java

示例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);
	}
		
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:56,代碼來源:ProviderRest.java

示例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);
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:53,代碼來源:ProviderRest.java

示例4: getProviderHelper

import eu.atos.sla.service.rest.helpers.ProviderHelper; //導入依賴的package包/類
private ProviderHelper getProviderHelper() {
	return helper;
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:4,代碼來源:ProviderRest.java

示例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);
    
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:52,代碼來源:ProviderRest.java

示例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);
    }
        
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:56,代碼來源:ProviderRest.java

示例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);
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:53,代碼來源:ProviderRest.java

示例8: getProviderHelper

import eu.atos.sla.service.rest.helpers.ProviderHelper; //導入依賴的package包/類
private ProviderHelper getProviderHelper() {
    return helper;
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:4,代碼來源:ProviderRest.java


注:本文中的eu.atos.sla.service.rest.helpers.ProviderHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。