Package org.wso2.carbon.registry.core

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


        return value;
    }

    public boolean associationTypeExists(String path, String assoType) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = false;

        for (int i = 0; i < association.length; i++) {
            association[i].getAssociationType();
            if (assoType.equals(association[i].getAssociationType()))
View Full Code Here


        return value;
    }

    public boolean associationSourcepathExists(String path, String sourcePath) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = false;

        for (int i = 0; i < association.length; i++) {
            association[i].getAssociationType();
            if (sourcePath.equals(association[i].getSourcePath()))
View Full Code Here

        }
        return assoFound;
    }

    public boolean associationNotExists(String path) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = true;
        if (association.length > 0)
            value = false;
        return value;
    }
View Full Code Here

        return value;
    }

    public boolean associationPathExists(String path, String assoPath)
            throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = false;

        for (int i = 0; i < association.length; i++) {
            //System.out.println(association[i].getDestinationPath());
            if (assoPath.equals(association[i].getDestinationPath()))
View Full Code Here

        return value;
    }

    public boolean associationTypeExists(String path, String assoType) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = false;

        for (int i = 0; i < association.length; i++) {
            association[i].getAssociationType();
            if (assoType.equals(association[i].getAssociationType()))
View Full Code Here

        return value;
    }

    public boolean associationSourcepathExists(String path, String sourcePath) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = false;

        for (int i = 0; i < association.length; i++) {
            association[i].getAssociationType();
            if (sourcePath.equals(association[i].getSourcePath()))
View Full Code Here

        }
        return assoFound;
    }

    public boolean associationNotExists(String path) throws Exception {
        Association association[] = registry.getAllAssociations(path);
        boolean value = true;
        if (association.length > 0)
            value = false;
        return value;
    }
View Full Code Here

            ps.setInt(3, CurrentSession.getTenantId());
            result = ps.executeQuery();
            allAssociations = new ArrayList<Association>();

            while (result.next()) {
                Association association = new Association();
                association.setSourcePath(result.getString(DatabaseConstants.SOURCEPATH_FIELD));
                association
                        .setDestinationPath(result.getString(DatabaseConstants.TARGETPATH_FIELD));
                association.setAssociationType(
                        result.getString(DatabaseConstants.ASSOCIATION_TYPE_FIELD));
                allAssociations.add(association);
            }
        } catch (SQLException e) {
            String msg = "Failed to get all associations of resource " +
View Full Code Here

            result = ps.executeQuery();
            associations = new ArrayList<Association>();

            while (result.next()) {
                Association association = new Association();
                association.setSourcePath(result.getString(DatabaseConstants.SOURCEPATH_FIELD));
                association
                        .setDestinationPath(result.getString(DatabaseConstants.TARGETPATH_FIELD));
                association.setAssociationType(associationType);
                associations.add(association);
            }
        } catch (SQLException e) {
            String msg = "Failed to get associations of type " +
                    associationType + " for resource " + resourcePath + ". " + e.getMessage();
View Full Code Here

            result = ps.executeQuery();
            ArrayList<Association> arrayList = new ArrayList<Association>();

            // Read all results first
            while (result.next()) {
                Association association = new Association();
                association.setSourcePath(toPath);
                association
                        .setDestinationPath(result.getString(DatabaseConstants.TARGETPATH_FIELD));
                association.setAssociationType(
                        result.getString(DatabaseConstants.ASSOCIATION_TYPE_FIELD));
                arrayList.add(association);
            }

            // Then add associations
            for (Association association : arrayList) {
                addAssociation(toPath, association.getDestinationPath(),
                        association.getAssociationType());
            }
        } catch (SQLException e) {
            String msg = "SQLException occurred during copyAssociations";
            log.error(msg, e);
            throw new RegistryException(msg, e);
View Full Code Here

TOP

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

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.