Package org.wso2.securevault

Examples of org.wso2.securevault.SecretResolver


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here

            if (hostNameAttrValue != null && hostNameAttrValue.length() != 0) {
                hostAddress = hostNameAttrValue;
            }
        }
            
        SecretResolver secretResolver = SecretResolverFactory.create(rootEle, false);
        NodeList childNodes = rootEle.getElementsByTagName("transport");
        for (int i = 0; i < childNodes.getLength(); i++) {
            Element transportEle = (Element) childNodes.item(i);
            NamedNodeMap transportAttribs = transportEle.getAttributes();
            //Create the password manager
            Node nameAttrib = transportAttribs.getNamedItem("name");
            String transportName;
            if (nameAttrib == null ||
                (transportName = nameAttrib.getNodeValue()) == null ||
                transportName.trim().length() == 0) {
                throw new RuntimeException("Required attribute, transport name is not specified.");
            }

            Node classAttrib = transportAttribs.getNamedItem("class");
            String clazz;
            if (classAttrib == null ||
                (clazz = classAttrib.getNodeValue()) == null ||
                clazz.trim().length() == 0) {
                throw new RuntimeException("Required attribute, transport class is not specified.");
            }
            Transport transportImpl = (Transport) Class.forName(clazz).newInstance();
            transports.put(transportName, transportImpl);

            Map<String, TransportParameter> transportParameters =
                    new HashMap<String, TransportParameter>();
            NodeList parameterList = transportEle.getElementsByTagName("parameter");
            for (int j = 0; j < parameterList.getLength(); j++) {
                Element paramEle = (Element) parameterList.item(j);
                String value = null;
                NodeList values = paramEle.getChildNodes();
                for (int k = 0; k < values.getLength(); k++) {
                    Node node = values.item(k);
                    if ((value = node.getNodeValue().trim()).length() != 0) {
                        break;
                    }
                }
                String paramName = paramEle.getAttribute("name");
                if (secretResolver != null && secretResolver.isInitialized() &&
                        secretResolver.isTokenProtected("transports." + transportName + "." + paramName)) {
                    value = secretResolver.resolve("transports." + transportName + "." + paramName);
                }
                value = replaceSystemProperty(value);
                transportParameters.put(paramName, new TransportParameter(paramName, value));
            }
            transportImpl.setName(transportName);
View Full Code Here

                        configElement.getFirstChildWithName(new QName("enableCache"));
                if (enableCachingEle != null) {
                    registryContext.setCacheEnabled("true".equals(enableCachingEle.getText()));
                }

                SecretResolver secretResolver = SecretResolverFactory.create(configElement, false);
                Iterator dbConfigs = configElement.getChildrenWithName(new QName("dbConfig"));
                // Read Database configurations
                while (dbConfigs.hasNext()) {
                    OMElement dbConfig = (OMElement) dbConfigs.next();
                    DataBaseConfiguration dataBaseConfiguration = new DataBaseConfiguration();
View Full Code Here

        OMElement passwordProviderEl = fac.createOMElement("passwordProvider", null);
        passwordProviderEl.setText(passwordProvider);
        passwordManagerEl.addChild(protectedTokensEl);
        passwordManagerEl.addChild(passwordProviderEl);   
            dataEl.addChild(passwordManagerEl);
            SecretResolver secretResolver = SecretResolverFactory.create(dataEl, false);
            if (secretResolver != null && secretResolver.isTokenProtected(password)) {
              resolvePwd = secretResolver.resolve(password);
        } else {
          resolvePwd = password;
        }
    } else {
      resolvePwd = password;
View Full Code Here

        OMElement passwordProviderEl = fac.createOMElement("passwordProvider", null);
        passwordProviderEl.setText(passwordProvider);
        passwordManagerEl.addChild(protectedTokensEl);
        passwordManagerEl.addChild(passwordProviderEl);   
            dataEl.addChild(passwordManagerEl);
            SecretResolver secretResolver = SecretResolverFactory.create(dataEl, false);
            if (secretResolver.isInitialized() && secretResolver.isTokenProtected(password)) {
                resolvePwd = secretResolver.resolve(password);
            } else {
                resolvePwd = password;
            }
    } else {
      resolvePwd = password;
View Full Code Here

     *
     * @return Actual password
     */
    public String getResolvedSecret() {

        SecretResolver secretResolver = null;

        if (localSecretResolver != null && localSecretResolver.isInitialized()) {
            secretResolver = localSecretResolver;
        } else if (globalSecretResolver != null && globalSecretResolver.isInitialized()
                && globalSecretResolver.isTokenProtected(token)) {
            secretResolver = globalSecretResolver;
        }

        if (secretResolver != null) {
            if (aliasSecret != null && !"".equals(aliasSecret)) {
                if (secretPrompt == null) {
                    return secretResolver.resolve(aliasSecret);
                } else {
                    return secretResolver.resolve(aliasSecret, secretPrompt);
                }
            }
        }
        return aliasSecret;
    }
View Full Code Here

        if (password != null && !"".equals(password)) {
            secretInformation.setAliasSecret(password);
        }

        SecretResolver secretResolver = SecretResolverFactory.create(properties,
                configurationPrefix);
        secretInformation.setLocalSecretResolver(secretResolver);
        secretInformation.setSecretPrompt(passwordPrompt);

        return secretInformation;
View Full Code Here

                                                            String aliasPassword,
                                                            String passwordPrompt) {

        SecretInformation secretInformation = new SecretInformation();
        secretInformation.setAliasSecret(aliasPassword);
        SecretResolver secretResolver = new SecretResolver();
        secretResolver.init(
                SecretCallbackHandlerFactory.createSecretCallbackHandler(secretProvider));
        secretInformation.setLocalSecretResolver(secretResolver);
        secretInformation.setSecretPrompt(passwordPrompt);
        return secretInformation;
    }
View Full Code Here

TOP

Related Classes of org.wso2.securevault.SecretResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.