当前位置: 首页>>代码示例>>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;未经允许,请勿转载。