• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.axis2.util.JavaUtils的典型用法代码示例。如果您正苦于以下问题:Java JavaUtils类的具体用法?Java JavaUtils怎么用?Java JavaUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JavaUtils类属于org.apache.axis2.util包,在下文中一共展示了JavaUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: authenticateClient

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
@Override
public boolean authenticateClient(OAuthTokenReqMessageContext tokReqMsgCtx)
        throws IdentityOAuth2Exception {

    OAuth2AccessTokenReqDTO oAuth2AccessTokenReqDTO = tokReqMsgCtx.getOauth2AccessTokenReqDTO();

    //Skipping credential validation for saml2 bearer if not configured as needed
    if (StringUtils.isEmpty(oAuth2AccessTokenReqDTO.getClientSecret()) && org.wso2.carbon.identity.oauth.common
            .GrantType.SAML20_BEARER.toString().equals(oAuth2AccessTokenReqDTO.getGrantType()) && JavaUtils
            .isFalseExplicitly(authConfig)) {
        if (log.isDebugEnabled()) {
            log.debug("Grant type : " + oAuth2AccessTokenReqDTO.getGrantType() + " " +
                    "Strict client validation set to : " + authConfig + " Authenticating without client secret");
        }
        return true;
    }

    if (log.isDebugEnabled()) {
        log.debug("Grant type : " + oAuth2AccessTokenReqDTO.getGrantType() + " " +
                "Strict client validation set to : " + authConfig);
    }
    return false;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:24,代码来源:AbstractClientAuthHandler.java


示例2: invoke

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
    Object flag = msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED);
    if (log.isTraceEnabled()) {
        log.trace("invoke: IS_ADDR_INFO_ALREADY_PROCESSED=" + flag);
    }

    if (JavaUtils.isTrueExplicitly(flag)) {
        // Check if the wsa:MessageID is required or not.
        checkMessageIDHeader(msgContext);
        
        // Check that if wsamInvocationPattern flag is in effect that the replyto and faultto are valid.
        if (JavaUtils.isTrue(msgContext.getProperty(ADDR_VALIDATE_INVOCATION_PATTERN), true)) {
            checkWSAMInvocationPattern(msgContext);
        }
    }
    else {
        // Check that if wsaddressing=required that addressing headers were found inbound
        checkUsingAddressing(msgContext);
    }

    return InvocationResponse.CONTINUE;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:AddressingValidationHandler.java


示例3: shouldInvoke

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public boolean shouldInvoke(MessageContext msgContext) throws AxisFault {
    Parameter param = null;
    boolean disableAddressing = false;
    
    Object o = msgContext.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
    if (o == null || !(o instanceof Boolean)) {
        //determine whether outbound addressing has been disabled or not.
        // Get default value from module.xml or axis2.xml files
        param = msgContext.getModuleParameter(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, MODULE_NAME, handlerDesc);
        disableAddressing =
            msgContext.isPropertyTrue(DISABLE_ADDRESSING_FOR_OUT_MESSAGES,
                JavaUtils.isTrueExplicitly(Utils.getParameterValue(param)));
    } else {
        disableAddressing = (Boolean) o;
    }

    if (disableAddressing) {
        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
            log.trace(msgContext.getLogIDString() +
                    " Addressing is disabled. Not adding WS-Addressing headers.");
        }
        return false;
    }
    return true;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:AddressingOutHandler.java


示例4: representAsOccurrence

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * @param value
 * @return true if this value should be represented as a series of occurrence
 * elements
 */
private static boolean representAsOccurrence(Object value, Class inClass) {
    // Represent as a series of occurrence elements if not List/Array
    // but not a byte[].  A byte[] has its own encoding.
    
    boolean rc = false;
    Class cls = (value == null) ? inClass : value.getClass();
  
    if (cls == null) {
        return true;
    }else if (List.class.isAssignableFrom(cls)) {
        rc = true;
    } else if (cls.equals(byte[].class)) {
        rc = false;  // assume base64binary
    } else if (cls.isArray()) {
        rc = true;
    }
    if (log.isDebugEnabled()) {
        log.debug("representAsOccurrence for " + JavaUtils.getObjectIdentity(value) + 
                    " of class: " + inClass + rc);
    }
    return rc;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:DocLitWrappedMinimalMethodMarshaller.java


示例5: setMessage

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public void setMessage(SOAPMessage soapMessage) {
    if(log.isDebugEnabled()){
        log.debug("setMessage new=" + JavaUtils.getObjectIdentity(soapMessage) + 
                " existing=" + JavaUtils.getObjectIdentity(cachedSoapMessage));
    }
    try {
        Message msg =
                ((MessageFactory) FactoryRegistry.getFactory(MessageFactory.class)).createFrom(soapMessage);
        messageCtx.getMEPContext().setMessage(msg);
        cachedMessage = msg;
        cachedSoapMessage = soapMessage;
        cacheSOAPMessageInfo(cachedSoapMessage);
    } catch (XMLStreamException e) {
        if(log.isDebugEnabled()){
            log.debug("Ignoring exception " + e);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:SoapMessageContext.java


示例6: initParams

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * Initializes the Axis2 parameters.
 */
protected void initParams() {
    Parameter parameter;
    // do we need to completely disable REST support
    parameter = axisConfiguration.getParameter(Constants.Configuration.DISABLE_REST);
    if (parameter != null) {
        disableREST = !JavaUtils.isFalseExplicitly(parameter.getValue());
    }

    // Should we close the reader(s)
    parameter = axisConfiguration.getParameter("axis2.close.reader");
    if (parameter != null) {
        closeReader = JavaUtils.isTrueExplicitly(parameter.getValue());
    }

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:AxisServlet.java


示例7: setDeploymentFeatures

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * Sets hotDeployment and hot update.
 */
protected void setDeploymentFeatures() {
    Parameter hotDeployment = axisConfig.getParameter(TAG_HOT_DEPLOYMENT);
    Parameter hotUpdate = axisConfig.getParameter(TAG_HOT_UPDATE);

    if (hotDeployment != null) {
        this.hotDeployment = JavaUtils.isTrue(hotDeployment.getValue(), true);
    }

    if (hotUpdate != null) {
        this.hotUpdate = JavaUtils.isTrue(hotUpdate.getValue(), true);
    }

    String serviceDirPara = (String)
            axisConfig.getParameterValue(DeploymentConstants.SERVICE_DIR_PATH);
    if (serviceDirPara != null) {
        servicesPath = serviceDirPara;
    }

    String moduleDirPara = (String)
            axisConfig.getParameterValue(DeploymentConstants.MODULE_DRI_PATH);
    if (moduleDirPara != null) {
        modulesPath = moduleDirPara;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:DeploymentEngine.java


示例8: addToAllServicesMap

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public void addToAllServicesMap(AxisService axisService) throws AxisFault {
    String serviceName = axisService.getName();
    AxisService oldService = allServices.get(serviceName);
    if (oldService == null) {
        if (log.isDebugEnabled()) {
            log.debug("Adding service to allServices map: [" + serviceName + "] ");
        }
        allServices.put(serviceName, axisService);
        if (log.isTraceEnabled()) {
            //noinspection ThrowableInstanceNeverThrown
            log.trace("After adding to allServices map, size is "
                      + allServices.size() + " call stack is " + 
                      JavaUtils.stackToString(new Exception()));
        }

    } else {
        // If we were already there, that's fine.  If not, fault!
        if (oldService != axisService) {
            throw new AxisFault(Messages.getMessage("twoservicecannothavesamename",
                                                    axisService.getName() +
                                                    " [" + axisService.getFileName() + "]"));
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:AxisConfiguration.java


示例9: setAction

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * Set WS-Addressing Action / SOAP Action string.
 *
 * @param action
 */
public void setAction(String action) {
    if (log.isDebugEnabled()) {
        log.debug("setAction Old action is (" + this.action + ")");
        log.debug("setAction New action is (" + action + ")");
        
        // It is unusual for a non-null action to be set to a different
        // non-null action.  This *might* indicate an error, so the 
        // call stack is dumped in this unusual case.
        if ((this.action != null && this.action.length() > 0) &&
             (action != null && action.length() > 0) &&
             !action.equals(this.action)) {
            log.debug(" The call stack is:" + JavaUtils.callStackToString());
        }
    }
    this.action = action;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:Options.java


示例10: getTargetAddress

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public URL getTargetAddress(MessageContext messageContext, OMOutputFormat format, URL targetURL)
        throws AxisFault {

    // Check whether there is a template in the URL, if so we have to replace then with data
    // values and create a new target URL.
    targetURL = URLTemplatingUtil.getTemplatedURL(targetURL, messageContext, true);
    String ignoreUncited =
            (String) messageContext.getProperty(WSDL2Constants.ATTR_WHTTP_IGNORE_UNCITED);

    // Need to have this check here cause         
    if (ignoreUncited == null || !JavaUtils.isTrueExplicitly(ignoreUncited)) {
        String httpMethod = (String) messageContext.getProperty(Constants.Configuration.HTTP_METHOD);
        if (Constants.Configuration.HTTP_METHOD_GET.equals(httpMethod) || Constants.Configuration.HTTP_METHOD_DELETE.equals(httpMethod)) {
            targetURL = URLTemplatingUtil.appendQueryParameters(messageContext, targetURL);
        }
    } else {
        messageContext.getEnvelope().getBody().getFirstElement().detach();
    }

    return targetURL;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:XFormURLEncodedFormatter.java


示例11: isDoingREST

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
public static boolean isDoingREST(MessageContext msgContext) {
    boolean enableREST = false;

    // check whether isDoingRest is already true in the message context
    if (msgContext.isDoingREST()) {
        return true;
    }

    Object enableRESTProperty = msgContext.getProperty(Constants.Configuration.ENABLE_REST);
    if (enableRESTProperty != null) {
        enableREST = JavaUtils.isTrueExplicitly(enableRESTProperty);
    }

    msgContext.setDoingREST(enableREST);

    return enableREST;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:TransportUtils.java


示例12: addElementToSequence

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
private void addElementToSequence(String name,
                                  QName propertyQName,
                                  XmlSchemaSequence sequence,
                                  boolean isBase64Binary,
                                  boolean isArryType,
                                  boolean isPrimitive) {
    XmlSchemaElement elt1 = new XmlSchemaElement();
    elt1.setName(name);
    elt1.setSchemaTypeName(propertyQName);
    sequence.getItems().add(elt1);
    if (isArryType && !isBase64Binary) {
        elt1.setMaxOccurs(Long.MAX_VALUE);
    }
    elt1.setMinOccurs(0);

    boolean disallowNillables = false;
    Parameter param = service.getParameter(Java2WSDLConstants.DISALLOW_NILLABLE_ELEMENTS_OPTION_LONG);
    if (param != null) {
        disallowNillables = JavaUtils.isTrueExplicitly(param.getValue());
    }

    if (!isPrimitive && !disallowNillables) {
        elt1.setNillable(true);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:DefaultSchemaGenerator.java


示例13: getParameterName

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/** @see TypeMapper#getParameterName(javax.xml.namespace.QName) */
public String getParameterName(QName qname) {
    if (counter == UPPER_PARAM_LIMIT) {
        counter = 0;
    }
    if ((qname != null) && (qname.getLocalPart().length() != 0)) {
        String paramName = JavaUtils.xmlNameToJavaIdentifier(qname.getLocalPart());

        if (parameterNameList.contains(paramName)) {
            paramName = paramName + counter++;
        }
        parameterNameList.add(paramName);
        return paramName;
    } else {
        return PARAMETER_NAME_SUFFIX + counter++;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:TypeMappingAdapter.java


示例14: getParameterName

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
private String getParameterName(Type type, List existingParamNames) {
    String paramName = null;
    if (type instanceof Class) {
        Class classType = (Class) type;
        if (classType.isArray()) {
            paramName = getParameterName(classType.getComponentType(), existingParamNames);
        } else {
            String className = classType.getName();
            if (className.lastIndexOf(".") > 0) {
                className = className.substring(className.lastIndexOf(".") + 1);
            }
            paramName = JavaUtils.xmlNameToJavaIdentifier(className);
            if (existingParamNames.contains(paramName)) {
                paramName = paramName + existingParamNames.size();
            }
            existingParamNames.add(paramName);
        }
    } else if (type instanceof ParameterizedType) {
        ParameterizedType parameterizedType = (ParameterizedType) type;
        paramName = getParameterName(parameterizedType.getRawType(), existingParamNames);
    }
    return paramName;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:AxisServiceBasedMultiLanguageEmitter.java


示例15: addShortType

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * set the short type as it is in the data binding
 *
 * @param paramElement
 * @param xmlName
 */


protected void addShortType(Element paramElement, String xmlName) {

    if (xmlName != null) {
        String javaName;
        if (JavaUtils.isJavaKeyword(xmlName)) {
            javaName = JavaUtils.makeNonJavaKeyword(xmlName);
        } else {
            javaName = JavaUtils.capitalizeFirstChar(JavaUtils
                    .xmlNameToJava(xmlName));
        }
        addAttribute(paramElement.getOwnerDocument(),
                "shorttype",
                javaName,
                paramElement);
    } else {
        addAttribute(paramElement.getOwnerDocument(),
                "shorttype",
                "",
                paramElement);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:30,代码来源:AxisServiceBasedMultiLanguageEmitter.java


示例16: getOpNames

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * Gets an element representing the operation names
 *
 * @param doc
 * @return Returns Element.
 */
protected Element getOpNames(Document doc) {
    Element root = doc.createElement("opnames");
    Element elt;


    for (Iterator operationsIterator = axisService.getOperations();
         operationsIterator.hasNext();) {
        AxisOperation axisOperation = (AxisOperation) operationsIterator.next();
        elt = doc.createElement("name");
        String localPart = axisOperation.getName().getLocalPart();
        elt.appendChild(doc.createTextNode(JavaUtils.xmlNameToJava(localPart)));

        //what needs to be put here as the opertation namespace is actually the
        //traget namespace of the service
        addAttribute(doc, "opnsuri", axisService.getTargetNamespace(), elt);
        root.appendChild(elt);
    }

    return root;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:AxisServiceBasedMultiLanguageEmitter.java


示例17: makeUniqueJavaClassName

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
/**
 * Given the xml name, make a unique class name taking into account that
 * some file systems are case sensitive and some are not. -Consider the
 * Jax-WS spec for this
 *
 * @param listOfNames
 * @param xmlName
 * @return Returns String.
 */
private String makeUniqueJavaClassName(List<String> listOfNames, String xmlName) {
    String javaName;
    if (JavaUtils.isJavaKeyword(xmlName)) {
        javaName = JavaUtils.makeNonJavaKeyword(xmlName);
    } else {
        javaName = JavaUtils.capitalizeFirstChar(JavaUtils
                .xmlNameToJava(xmlName));
    }

    while (listOfNames.contains(javaName.toLowerCase())) {
        if (!listOfNames.contains((javaName + "E").toLowerCase())){
            javaName = javaName + "E";
        } else {
            javaName = javaName + count++;
        }
    }

    listOfNames.add(javaName.toLowerCase());
    return javaName;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:30,代码来源:JavaBeanWriter.java


示例18: canAuthenticate

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
@Override
public boolean canAuthenticate(OAuthTokenReqMessageContext tokReqMsgCtx)
        throws IdentityOAuth2Exception {

    OAuth2AccessTokenReqDTO oAuth2AccessTokenReqDTO = tokReqMsgCtx.getOauth2AccessTokenReqDTO();

    if (StringUtils.isNotEmpty(oAuth2AccessTokenReqDTO.getClientId()) &&
            StringUtils.isNotEmpty(oAuth2AccessTokenReqDTO.getClientSecret())) {
        if (log.isDebugEnabled()) {
            log.debug("Can authenticate with client ID and Secret." +
                    " Client ID: "+ oAuth2AccessTokenReqDTO.getClientId());
        }
        return true;

    } else {
        if (org.wso2.carbon.identity.oauth.common.GrantType.SAML20_BEARER.toString().equals(
                oAuth2AccessTokenReqDTO.getGrantType())) {

            //Getting configured value for client credential validation requirements
            authConfig = properties.getProperty(
                    OAuthConstants.CLIENT_AUTH_CREDENTIAL_VALIDATION);

            if (log.isDebugEnabled()) {
                log.debug("Grant type : " + oAuth2AccessTokenReqDTO.getGrantType());
            }

            //If user has set strict validation to false, can authenticate without credentials
            if (StringUtils.isNotEmpty(authConfig) && JavaUtils.isFalseExplicitly(authConfig)) {
                if (log.isDebugEnabled()) {
                    log.debug("Client auth credential validation set to : " + authConfig + ". " +
                            "can authenticate without client secret");
                }
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:39,代码来源:AbstractClientAuthHandler.java


示例19: processMTOM11Assertion

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
private void processMTOM11Assertion(OMElement element,
        MTOM11Assertion mtomAssertion) {

    // Checking wsp:Optional attribute
    String value = element
            .getAttributeValue(Constants.Q_ELEM_OPTIONAL_ATTR);
    boolean isOptional = JavaUtils.isTrueExplicitly(value);

    mtomAssertion.setOptional(isOptional);

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:12,代码来源:MTOM11AssertionBuilder.java


示例20: processMTOM10Assertion

import org.apache.axis2.util.JavaUtils; //导入依赖的package包/类
private void processMTOM10Assertion(OMElement element,
        MTOM10Assertion mtomAssertion) {

    // Checking wsp:Optional attribute
    String value = element
            .getAttributeValue(Constants.Q_ELEM_OPTIONAL_ATTR);
    boolean isOptional = JavaUtils.isTrueExplicitly(value);

    mtomAssertion.setOptional(isOptional);

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:12,代码来源:MTOM10AssertionBuilder.java



注:本文中的org.apache.axis2.util.JavaUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DeclarationMaker类代码示例发布时间:2022-05-23
下一篇:
Java SecurityConstraint类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap