public void createPollingScheme(String schemeName, int interval,
            String notificationMethod, String notificationHost, int port,
            String readinessProperty, String readinessValue) {
        Folder pollingSchemeFolder;

        try {

            try {
                pollingSchemeFolder = (Folder) session.getObjectByPath("/PollingSchemes");
            } catch (CmisObjectNotFoundException e) {
                System.out.println("PollingSchemes folder not found: "
                        + e.getMessage());
                Map<String, String> properties = new HashMap<String, String>();
                properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
                properties.put(PropertyIds.NAME, "PollingSchemes");
                session.getRootFolder().createFolder(properties);
                pollingSchemeFolder = (Folder) session.getObjectByPath("/PollingSchemes");
            }
            Map<String, Object> properties = new HashMap<String, Object>();
            if (repositoryType == REP_TYPE_ALFRESCO) {
                properties.put(PropertyIds.OBJECT_TYPE_ID,
                        "cmis:folder,P:poll:scheme");
            } else if (repositoryType == REP_TYPE_NUXEO) {
                properties.put(PropertyIds.OBJECT_TYPE_ID, "PollingScheme");
            }
            properties.put(PropertyIds.NAME, schemeName);
            properties.put("poll:interval", interval);
            properties.put("poll:notificationmethod", notificationMethod);
            properties.put("poll:notificationhost", notificationHost);
            properties.put("poll:notificationport", port);
            properties.put("poll:readinessproperty", readinessProperty);
            properties.put("poll:readinessvalue", readinessValue);

            try {
                if (repositoryType == REP_TYPE_ALFRESCO) {
                    pollingSchemeFolder.createFolder(properties);
                } else if (repositoryType == REP_TYPE_NUXEO) {
                    pollingSchemeFolder.createFolder(properties);
                }
            } catch (CmisContentAlreadyExistsException e) {
                System.out.println("Could not create polling scheme '"
                        + schemeName + "': " + e.getMessage());

            }

        } catch (ClassCastException e) {
            System.out.println("Object is not a CMIS folder.");
        }
    }