当前位置: 首页>>代码示例>>Java>>正文


Java JavaUtils类代码示例

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


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


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