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


Java Parameter类代码示例

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


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

示例1: getParameterValue

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
private String getParameterValue(String key, String def) {
    String value = System.getenv(key);
    if (StringUtils.isEmpty(value)) {
        value = System.getProperty(key);
    }
    if (StringUtils.isEmpty(value)) {
        Parameter parameter = parameters.get(key);
        if (parameter == null || StringUtils.isEmpty((String) parameter.getValue())) {
            if (def == null) {
                throw new IllegalArgumentException(String.format("Clustering parameter [Name] %s not found", key));
            } else {
                value = def;
            }
        } else {
            value = (String) parameter.getValue();
        }
    }
    return value;
}
 
开发者ID:wso2,项目名称:mesos-artifacts,代码行数:20,代码来源:MesosMembershipScheme.java

示例2: applyPolicyToBindings

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
private Policy applyPolicyToBindings(AxisService axisService) throws ServerException {
    Parameter parameter = axisService.getParameter(APPLY_POLICY_TO_BINDINGS);
    if (parameter != null && "true".equalsIgnoreCase(parameter.getValue().toString()) &&
            axisService.getPolicySubject() != null && axisService.getPolicySubject().getAttachedPolicyComponents()
            != null) {
        Iterator iterator = axisService.getPolicySubject().
                getAttachedPolicyComponents().iterator();
        while (iterator.hasNext()) {
            PolicyComponent currentPolicyComponent = (PolicyComponent) iterator.next();
            if (currentPolicyComponent instanceof Policy) {
                Policy policy = ((Policy) currentPolicyComponent);
                String policyId = policy.getId();
                axisService.getPolicySubject().detachPolicyComponent(policyId);
                addPolicyToAllBindings(axisService, policy);
                return policy;
            }
        }
    }
    return null;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:21,代码来源:SecurityDeploymentInterceptor.java

示例3: removeTrustedService

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public void removeTrustedService(String serviceAddress) throws SecurityConfigException {
    try {
        AxisService stsService = getAxisConfig().getService(ServerConstants.STS_NAME);
        Parameter origParam = stsService.getParameter(SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG
                .getLocalPart());
        if (origParam != null) {
            OMElement samlConfigElem = origParam.getParameterElement().getFirstChildWithName(
                    SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG);
            SAMLTokenIssuerConfig samlConfig = new SAMLTokenIssuerConfig(samlConfigElem);
            samlConfig.getTrustedServices().remove(serviceAddress);
            setSTSParameter(samlConfig);
            removeTrustedService(ServerConstants.STS_NAME, ServerConstants.STS_NAME,
                    serviceAddress);
        } else {
            throw new AxisFault("missing parameter : "
                    + SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG.getLocalPart());
        }

    } catch (Exception e) {
        log.error("Error while removing a trusted service", e);
        throw new SecurityConfigException(e.getMessage(), e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:24,代码来源:STSAdminServiceImpl.java

示例4: getProofKeyType

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
@Override
public String getProofKeyType() throws SecurityConfigException {
    try {
        AxisService service = getAxisConfig().getService(ServerConstants.STS_NAME);
        Parameter origParam = service.getParameter(SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG
                .getLocalPart());
        if (origParam != null) {
            OMElement samlConfigElem = origParam.getParameterElement().getFirstChildWithName(
                    SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG);
            SAMLTokenIssuerConfig samlConfig = new SAMLTokenIssuerConfig(samlConfigElem);
            return samlConfig.getProofKeyType();
        } else {
            throw new SecurityConfigException("missing parameter : "
                    + SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG.getLocalPart());
        }
    } catch (Exception e) {
        log.error("Error while retrieving proof key type", e);
        throw new SecurityConfigException(e.getMessage(), e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:21,代码来源:STSAdminServiceImpl.java

示例5: setProofKeyType

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
@Override
public void setProofKeyType(String keyType) throws SecurityConfigException {
    try {
        AxisService service = getAxisConfig().getService(ServerConstants.STS_NAME);
        Parameter origParam = service.getParameter(SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG
                .getLocalPart());
        if (origParam != null) {
            OMElement samlConfigElem = origParam.getParameterElement().getFirstChildWithName(
                    SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG);
            SAMLTokenIssuerConfig samlConfig = new SAMLTokenIssuerConfig(samlConfigElem);
            samlConfig.setProofKeyType(keyType);
            setSTSParameter(samlConfig);
        } else {
            throw new AxisFault("missing parameter : "
                    + SAMLTokenIssuerConfig.SAML_ISSUER_CONFIG.getLocalPart());
        }

    } catch (Exception e) {
        log.error("Error setting proof key type", e);
        throw new SecurityConfigException(e.getMessage(), e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:23,代码来源:STSAdminServiceImpl.java

示例6: setServiceParameterElement

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public void setServiceParameterElement(String serviceName, Parameter parameter)
        throws AxisFault {
    AxisService axisService = axisConfig.getService(serviceName);

    if (axisService == null) {
        throw new AxisFault("Invalid service name '" + serviceName + "'");
    }

    Parameter p = axisService.getParameter(parameter.getName());
    if (p != null) {
        if (!p.isLocked()) {
            axisService.addParameter(parameter);
        }
    } else {
        axisService.addParameter(parameter);
    }

}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:19,代码来源:SecurityServiceAdmin.java

示例7: disableRESTCalls

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
protected void disableRESTCalls(String serviceName, String scenrioId)
        throws SecurityConfigException {

    if (scenrioId.equals(SecurityConstants.USERNAME_TOKEN_SCENARIO_ID)) {
        return;
    }

    try {
        AxisService service = axisConfig.getServiceForActivation(serviceName);
        if (service == null) {
            throw new SecurityConfigException("nullService");
        }

        Parameter param = new Parameter();
        param.setName(DISABLE_REST);
        param.setValue(Boolean.TRUE.toString());
        service.addParameter(param);

    } catch (AxisFault e) {
        log.error(e);
        throw new SecurityConfigException("disablingREST", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:24,代码来源:SecurityConfigAdmin.java

示例8: getTokenCancelerConfigParameter

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public static Parameter getTokenCancelerConfigParameter() {

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement paramElem = fac.createOMElement(new QName("parameter"), null);
        paramElem.addAttribute(fac.createOMAttribute("name",
                null,
                TokenCancelerConfig.TOKEN_CANCELER_CONFIG.
                        getLocalPart()));
        paramElem.addAttribute(fac.createOMAttribute("type",
                null, Integer.toString(Parameter.OM_PARAMETER).
                        toString()));

        fac.createOMElement(TokenCancelerConfig.TOKEN_CANCELER_CONFIG,
                paramElem);
        Parameter param = new Parameter();
        param.setName(TokenCancelerConfig.TOKEN_CANCELER_CONFIG.getLocalPart());
        param.setParameterElement(paramElem);
        param.setValue(paramElem);
        param.setParameterType(Parameter.OM_PARAMETER);
        return param;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:22,代码来源:RahasUtil.java

示例9: loadTransportProperties

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
private static Properties loadTransportProperties() throws Exception {
	
	transportProperties = new Properties();

	try {
		ConfigurationContext configContext = CarbonConfigurationContextFactory.getConfigurationContext();
		AxisConfiguration axisConfig = configContext.getAxisConfiguration();
		TransportOutDescription mailto = axisConfig.getTransportOut("mailto"); 
		ArrayList<Parameter> parameters = mailto.getParameters();
		
           for (Parameter parameter : parameters) {
			String prop = parameter.getName();
			String value = (String)parameter.getValue();
			transportProperties.setProperty(prop, value);
		}
	}
	catch (Exception e) {
		throw e;
	}
	
	return transportProperties;
}
 
开发者ID:vasttrafik,项目名称:wso2-community-api,代码行数:23,代码来源:MailUtil.java

示例10: overrideCallbackHandler

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
/**
 * Override WSAS callback handler to be able to auth users with usermanager.
 *
 * @param axisConfig
 * @throws AxisFault
 */
public static void overrideCallbackHandler(AxisConfiguration axisConfig, String service) throws AxisFault {
    AxisService sts = axisConfig.getService(service);
    Parameter cbHandlerParam = sts.getParameter(WSHandlerConstants.PW_CALLBACK_REF);
    if (cbHandlerParam != null) {
        sts.removeParameter(cbHandlerParam);
        if (log.isDebugEnabled()) {
            log.debug("removedParameter");
        }
    }

    Parameter param = getPasswordCallBackRefParameter();

    sts.addParameter(param);

    if (log.isDebugEnabled()) {
        log.debug("addedParameter");
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:25,代码来源:STSConfigAdmin.java

示例11: testRequired

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public void testRequired() {
    ServiceDescription sd  = DescriptionFactory.createServiceDescription(RequiredService.class);
    EndpointDescription ed = sd.getEndpointDescription(new QName(ns, requiredServicePortName));
    assertNotNull(ed);
    
    AxisService axisService = ed.getAxisService();
    Parameter versionParam  = axisService.getParameter(AddressingConstants.WS_ADDRESSING_VERSION);
    Parameter disabledParam = axisService.getParameter(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES);
    Parameter requiredParam = axisService.getParameter(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);

    String version  = Utils.getParameterValue(versionParam);
    String disabled = Utils.getParameterValue(disabledParam);
    String required = Utils.getParameterValue(requiredParam);
    
    assertEquals(AddressingConstants.Submission.WSA_NAMESPACE, version);
    assertEquals("false", disabled);
    assertEquals(AddressingConstants.ADDRESSING_REQUIRED, required);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:SubmissionAddressingFeatureTests.java

示例12: isProxyEnabled

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
/**
 * Check whether http proxy is configured or active.
 * This is not a deep check.
 *
 * @param messageContext in message context
 * @param targetURL      URL of the edpoint which we are sending the request
 * @return true if proxy is enabled, false otherwise
 */
public static boolean isProxyEnabled(MessageContext messageContext, URL targetURL) {
    boolean proxyEnabled = false;

    Parameter param = messageContext.getConfigurationContext().getAxisConfiguration()
            .getParameter(ATTR_PROXY);

    //If configuration is over ridden
    Object obj = messageContext.getProperty(HTTPConstants.PROXY);

    //From Java Networking Properties
    String sp = System.getProperty(HTTP_PROXY_HOST);

    if (param != null || obj != null || sp != null) {
        proxyEnabled = true;
    }

    boolean isNonProxyHost = validateNonProxyHosts(targetURL.getHost());

    return proxyEnabled && !isNonProxyHost;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:HTTPProxyConfigurationUtil.java

示例13: createMessageContext

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public MessageContext createMessageContext() throws AxisFault {
    MessageContext msgContext = listener.createMessageContext();
    
    if (service != null) {
        msgContext.setAxisService(service);

        // find the operation for the message, or default to one
        Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM);
        QName operationQName = (
            operationParam != null ?
                BaseUtils.getQNameFromString(operationParam.getValue()) :
                BaseConstants.DEFAULT_OPERATION);

        AxisOperation operation = service.getOperation(operationQName);
        if (operation != null) {
            msgContext.setAxisOperation(operation);
            msgContext.setAxisMessage(
                    operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN));
            msgContext.setSoapAction("urn:" + operation.getName().getLocalPart());
        }
    }
    return msgContext;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:ProtocolEndpoint.java

示例14: testPlainAnnotation

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
public void testPlainAnnotation() {
    ServiceDescription sd  = DescriptionFactory.createServiceDescription(PlainService.class);
    EndpointDescription ed = sd.getEndpointDescription(new QName(ns, plainServicePortName));
    assertNotNull(ed);
    
    AxisService axisService = ed.getAxisService();
    Parameter versionParam  = axisService.getParameter(AddressingConstants.WS_ADDRESSING_VERSION);
    Parameter disabledParam = axisService.getParameter(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES);
    Parameter requiredParam = axisService.getParameter(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);

    String version  = Utils.getParameterValue(versionParam);
    String disabled = Utils.getParameterValue(disabledParam);
    String required = Utils.getParameterValue(requiredParam);
    
    assertEquals(AddressingConstants.Final.WSA_NAMESPACE, version);
    assertEquals("false", disabled);
    assertEquals(AddressingConstants.ADDRESSING_UNSPECIFIED, required);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:AddressingFeatureTests.java

示例15: updateStatistics

import org.apache.axis2.description.Parameter; //导入依赖的package包/类
private void updateStatistics(MessageContext msgContext) throws AxisFault {
    // Process System Request count
    Parameter globalRequestCounter =
        msgContext.getParameter(StatisticsConstants.GLOBAL_REQUEST_COUNTER);
    ((AtomicInteger) globalRequestCounter.getValue()).incrementAndGet();

    // Increment the global fault count
    Parameter globalFaultCounter =
            msgContext.getParameter(StatisticsConstants.GLOBAL_FAULT_COUNTER);
    ((AtomicInteger) globalFaultCounter.getValue()).incrementAndGet();

    updateCurrentInvocationGlobalStatistics(msgContext);

    // Calculate response times
    ResponseTimeCalculator.calculateResponseTimes(msgContext);
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:17,代码来源:FaultHandler.java


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