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


Java AgreementParam類代碼示例

本文整理匯總了Java中eu.atos.sla.service.types.AgreementParam的典型用法代碼示例。如果您正苦於以下問題:Java AgreementParam類的具體用法?Java AgreementParam怎麽用?Java AgreementParam使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AgreementParam類屬於eu.atos.sla.service.types包,在下文中一共展示了AgreementParam類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readFrom

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public AgreementParam readFrom(Class<AgreementParam> type, Type genericType,
		Annotation[] annotations, MediaType mediaType,
		MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
		throws IOException, WebApplicationException {
	String str = MessageBodyUtils.getStringFromInputStream(entityStream);
	try {
		Agreement agreement = (xmlParser==null)?defaultParser.getWsagObject(str):xmlParser.getWsagObject(str);
		AgreementParam agreementParam = new AgreementParam();
		agreementParam.setAgreement(agreement);
		String agreementData = (xmlParser==null)?defaultParser.getWsagAsSerializedData(str):xmlParser.getWsagAsSerializedData(str);
		agreementParam.setOriginalSerialzedAgreement(removeXMLHeader(agreementData));
		return agreementParam;
	} catch (ParserException e) {
		logger.error("Error parsing with "+xmlParser.getClass().getName() );
		throw new WebApplicationException(e, Response.Status.NOT_ACCEPTABLE);
	}
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:19,代碼來源:AgreementParamXmlMessageBodyReader.java

示例2: readFrom

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public AgreementParam readFrom(Class<AgreementParam> type, Type genericType,
		Annotation[] annotations, MediaType mediaType,
		MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
		throws IOException, WebApplicationException {
		String str = MessageBodyUtils.getStringFromInputStream(entityStream);
		try {
			logger.debug("Received information:"+str);
			Agreement agreementWSAG = jsonParser.getWsagObject(str);
			String serializedWsagData = jsonParser.getWsagAsSerializedData(str);
			AgreementParam agreementParam = new AgreementParam();
			agreementParam.setAgreement(agreementWSAG);
			agreementParam.setOriginalSerialzedAgreement(removeXMLHeader(serializedWsagData));
			return agreementParam;
		} catch (ParserException e) {
			logger.error("Error parsing"+e.getMessage());
			throw new WebApplicationException(e,Response.Status.NOT_ACCEPTABLE);
		}
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:20,代碼來源:AgreementParamJsonMessageBodyReader.java

示例3: readFrom

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public AgreementParam readFrom(Class<AgreementParam> type, Type genericType,
        Annotation[] annotations, MediaType mediaType,
        MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
        throws IOException, WebApplicationException {
    String str = MessageBodyUtils.getStringFromInputStream(entityStream);
    try {
        Agreement agreement = (xmlParser==null)?defaultParser.getWsagObject(str):xmlParser.getWsagObject(str);
        AgreementParam agreementParam = new AgreementParam();
        agreementParam.setAgreement(agreement);
        String agreementData = (xmlParser==null)?defaultParser.getWsagAsSerializedData(str):xmlParser.getWsagAsSerializedData(str);
        agreementParam.setOriginalSerialzedAgreement(removeXMLHeader(agreementData));
        return agreementParam;
    } catch (ParserException e) {
        logger.error("Error parsing with "+xmlParser.getClass().getName() );
        throw new WebApplicationException(e, Response.Status.NOT_ACCEPTABLE);
    }
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:19,代碼來源:AgreementParamXmlMessageBodyReader.java

示例4: readFrom

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public AgreementParam readFrom(Class<AgreementParam> type, Type genericType,
        Annotation[] annotations, MediaType mediaType,
        MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
        throws IOException, WebApplicationException {
        String str = MessageBodyUtils.getStringFromInputStream(entityStream);
        try {
            logger.debug("Received information:"+str);
            Agreement agreementWSAG = jsonParser.getWsagObject(str);
            String serializedWsagData = jsonParser.getWsagAsSerializedData(str);
            AgreementParam agreementParam = new AgreementParam();
            agreementParam.setAgreement(agreementWSAG);
            agreementParam.setOriginalSerialzedAgreement(removeXMLHeader(serializedWsagData));
            return agreementParam;
        } catch (ParserException e) {
            logger.error("Error parsing"+e.getMessage());
            throw new WebApplicationException(e,Response.Status.NOT_ACCEPTABLE);
        }
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:20,代碼來源:AgreementParamJsonMessageBodyReader.java

示例5: isReadable

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
	initParser();
	boolean isUsed = (type == AgreementParam.class) && mediaType.toString().contains(MediaType.APPLICATION_XML);
	if (isUsed)
		logger.debug("isReadable:{} --> type:{} genericType:{} mediaType:{} with parser:{}",
				isUsed, type, genericType, mediaType, xmlParser);
	return isUsed;
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:10,代碼來源:AgreementParamXmlMessageBodyReader.java

示例6: isReadable

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
	initParser();
	boolean isUsed = (type == AgreementParam.class) && 
			mediaType.toString().contains(MediaType.APPLICATION_JSON) && 
			jsonParser!=null; 
	if (isUsed)
		logger.debug("isReadable:{} --> type:{} genericType:{} mediaType:{} with parser:{}", 
				isUsed, type, genericType, mediaType, jsonParser);
	return isUsed;
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:12,代碼來源:AgreementParamJsonMessageBodyReader.java

示例7: isReadable

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
    initParser();
    boolean isUsed = (type == AgreementParam.class) && mediaType.toString().contains(MediaType.APPLICATION_XML);
    if (isUsed)
        logger.debug("isReadable:{} --> type:{} genericType:{} mediaType:{} with parser:{}",
                isUsed, type, genericType, mediaType, xmlParser);
    return isUsed;
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:10,代碼來源:AgreementParamXmlMessageBodyReader.java

示例8: isReadable

import eu.atos.sla.service.types.AgreementParam; //導入依賴的package包/類
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
    initParser();
    boolean isUsed = (type == AgreementParam.class) && 
            mediaType.toString().contains(MediaType.APPLICATION_JSON) && 
            jsonParser!=null; 
    if (isUsed)
        logger.debug("isReadable:{} --> type:{} genericType:{} mediaType:{} with parser:{}", 
                isUsed, type, genericType, mediaType, jsonParser);
    return isUsed;
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:12,代碼來源:AgreementParamJsonMessageBodyReader.java


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