Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Registry


                                " is inactive. Cannot retrieve certificate.</h4>").getBytes());
            outputStream.flush();
        } else {

            RegistryService registryService = dataHolder.getRegistryService();
            Registry registry = registryService.getConfigSystemRegistry();

            String servicePath = RegistryResources.SERVICE_GROUPS
            + axisService.getAxisServiceGroup().getServiceGroupName()
            + RegistryResources.SERVICES + axisService.getName();

            Resource serviceResource = registry.get(servicePath);
            Association[] assoc = registry.getAssociations(servicePath, RegistryResources.Associations.PRIVATE_KEYSTORE);
           
            KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(null);
           
            KeyStore keyStore = null;
            if(assoc.length < 1){

                boolean httpsEnabled = false;
                Association[] associations =
                    registry.getAssociations(servicePath, RegistryResources.Associations.EXPOSED_TRANSPORTS);
                for (Association association : associations) {
                    Resource resource = registry.get(association.getDestinationPath());
                    String transportProtocol = resource.getProperty(RegistryResources.Transports.PROTOCOL_NAME);
                    if(transportProtocol.equals("https")){
                        httpsEnabled = true;
                        break;
                    }
View Full Code Here


    }

    public QueryResult execute() throws InvalidQueryException, RepositoryException {

        QueryResult jcr_result = null;
        Registry registry;
        String sql1 = "";
        registry = session.getUserRegistry();

        if (statement.startsWith("org.wso2.registry.direct.query")) {

            sql1 = statement.split(";;")[1];
        } else {

            sql1 = getConvertedRegQuery(statement);
        }


        Resource q1 = null;
        Set nodes = new HashSet();

        try {
//this modifications are done so that the queries are not stored in the registry.
//            q1 = registry.newResource();

//            q1.setContent(sql1);

//            q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);

//            q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,

//                    RegistryConstants.RESOURCES_RESULT_TYPE);

//            registry.put(RegistryConstants.CONFIG_REGISTRY_BASE_PATH + RegistryConstants.QUERIES_COLLECTION_PATH + "/custom-queries", q1);
            Map parameters = new HashMap();
            parameters.put("query",sql1);
//            Resource result = registry.executeQuery(RegistryConstants.CONFIG_REGISTRY_BASE_PATH + RegistryConstants.QUERIES_COLLECTION_PATH + "/custom-queries", parameters);
            Resource result = registry.executeQuery(null, parameters);

            String[] paths = (String[]) result.getContent();

            for (String path : paths) {
View Full Code Here

    public void setHandlerCollectionLocation(String location) throws Exception {
        CommonUtil.setContextRoot(location);
    }

    public String[] getHandlerList() throws Exception  {
        Registry configSystemRegistry = getConfigSystemRegistry();
        return CommonUtil.getHandlerList(configSystemRegistry);   
    }
View Full Code Here

        Registry configSystemRegistry = getConfigSystemRegistry();
        return CommonUtil.getHandlerList(configSystemRegistry);   
    }

    public String getHandlerConfiguration(String name) throws Exception  {
        Registry configSystemRegistry = getConfigSystemRegistry();
        return CommonUtil.getHandlerConfiguration(configSystemRegistry, name);
    }
View Full Code Here

        Registry configSystemRegistry = getConfigSystemRegistry();
        return CommonUtil.getHandlerConfiguration(configSystemRegistry, name);
    }

    public boolean deleteHandler(String name) throws Exception {
        Registry configSystemRegistry = getConfigSystemRegistry();
        return !RegistryUtils.isRegistryReadOnly(configSystemRegistry.getRegistryContext()) &&
                CommonUtil.deleteHandler(configSystemRegistry, name);
    }
View Full Code Here

        }
        return CommonUtil.serializeHandlerConfiguration(handlerConfigurationBean).toString();
    }

    public boolean createHandler(String payload) throws Exception {
        Registry configSystemRegistry = getConfigSystemRegistry();
        String parsedPayload;
        try {
            parsedPayload = parseHandlerConfiguration(payload);
        } catch (Exception e) {
            log.error("Unable to parse the given handler configuration.", e);
            throw new Exception("Unable to parse the given handler configuration. " +
                    e.getMessage());
        }
        if (parsedPayload == null) {
            throw new Exception("The provided handler configuration is invalid.");
        }
        return !RegistryUtils.isRegistryReadOnly(configSystemRegistry.getRegistryContext()) &&
                CommonUtil.addHandler(configSystemRegistry, parsedPayload);
    }
View Full Code Here

        String domainName = null;
        if (user != null) {
            domainName = TenantUtils.getDomainNameFromOpenId(openID.getOpenID());
        }
        UserRealm userRealm = IdentityTenantUtil.getRealm(domainName, user);
        Registry registry = IdentityTenantUtil.getRegistry(domainName, user);

        RealmService realmService = IdentityRPServiceComponent.getRealmService();

        if (user != null && userRealm.getUserStoreManager().isExistingUser(user)) {
            this.onUserLogin(user, domainName, httpSess);
View Full Code Here

     * @throws RegistryException
     */
    private String getUserName(String ppid, String requestURI) throws IdentityException,
                                                              RegistryException, CarbonException {
        String username = null;
        Registry registry = null;
        String tenantDomain = TenantUtils.getTenantDomainFromRequestURL(requestURI);
        registry = IdentityTenantUtil.getRegistry(tenantDomain, null);
        IdentityPersistenceManager manager = IdentityPersistenceManager.getPersistanceManager();
        username = manager.getUserByPPID(registry, ppid);
        return username;
View Full Code Here

                throw new Exception("The username is null");
            }

            RealmService realmService = IdentityRPServiceComponent.getRealmService();
            UserRealm userRealm = null;
            Registry registry = null;
            int tenantId = realmService.getTenantManager().getTenantId(domainName);

            if (tenantId == -1) {
                tenantId = this.createTenant(domainName, email, username, firstName, lastName);
            }
View Full Code Here

     * @throws RegistryException
     */
    private boolean doOpenIDSignUp(String userName, String openId) throws Exception {
        IdentityPersistenceManager manager = IdentityPersistenceManager.getPersistanceManager();
        String domain = TenantUtils.getDomainNameFromOpenId(openId);
        Registry registry = IdentityTenantUtil.getRegistry(domain, userName);
        UserRealm realm = IdentityTenantUtil.getRealm(domain, userName);
        return manager.doOpenIdSignUp(registry, realm, openId, userName);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.Registry

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.