Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.GeneralException


            }
            return new SimpleTriple(new SimpleURIReference(new URI(subject)),
                                    new SimpleURIReference(new URI(predicate)),
                                    o);
        } catch (URISyntaxException e) {
            throw new GeneralException(e.getMessage(), e);
        }
    }
View Full Code Here


            tmp_parser.parse(fis, this);
        } catch (IOException ioe) {
            throw new StreamIOException("BackendSecurityDeserializer: "
                    + "Stream IO problem while parsing backend security config file.");
        } catch (SAXException se) {
            throw new GeneralException("BackendSecurityDeserializer: "
                    + "Error parsing backend security config file. "
                    + se.getMessage());
        }
        if (!tmp_rootElementFound) {
            throw new GeneralException("BackendSecurityDeserializer: "
                    + "Root element not found in backend security config file.");
        }

        logger.debug("Parse successful.");
        return beSS;
View Full Code Here

        if (!beProperties.containsKey(CALLBACK_SSL)) {
            setProperty(CALLBACK_SSL, "false");
        }
        if (beProperties.get(CALL_BASIC_AUTH).equals("true")) {
            if (!beProperties.containsKey(CALL_USERNAME)) {
                throw new GeneralException("BackendSecurityDeserializer: "
                        + "callBasicAuth is set to true, but callUsername is missing"
                        + "for role of " + tmp_role);
            }
            if (!beProperties.containsKey(CALL_PASSWORD)) {
                throw new GeneralException("BackendSecurityDeserializer: "
                        + "callBasicAuth is set to true, but callPassword is missing"
                        + "for role of " + tmp_role);
            }
        }
    }
View Full Code Here

        logger.debug(">>>>>> setSecuritySpec: " + " serviceRoleID="
                + serviceRoleID + " methodName=" + methodName
                + " property count=" + properties.size());
        if (serviceRoleID == null || serviceRoleID.equals("")) {
            throw new GeneralException("serviceRoleID is missing.");
        }
        // if methodRoleID is missing, then set properties at the service level.
        if (methodName == null || methodName.equals("")) {
            rolePropertiesTable.put(serviceRoleID, properties);

            // otherwise set properties at the method level, but only if
            // parent service-level properties already exist.
        } else {
            Hashtable<String, String> serviceProps = rolePropertiesTable.get(serviceRoleID);
            if (serviceProps == null) {
                throw new GeneralException("Cannot add method-level security properties"
                        + " if there are no properties defined for the backend service that the "
                        + " method is part of. ");
            }
            String roleKey = serviceRoleID + "/" + methodName;
            rolePropertiesTable.put(roleKey, properties);
View Full Code Here

        }
        if (checksumType.equalsIgnoreCase("WHIRLPOOL")) {
            csType = "WHIRLPOOL";
        }
        if (csType == null) {
            throw new GeneralException("Unknown checksum algorithm specified: "
                    + checksumType);
        }
        try {
            MessageDigest.getInstance(csType);
        } catch (NoSuchAlgorithmException e) {
            throw new GeneralException("Checksum algorithm not yet implemented: "
                    + csType);
        }
        return csType;
    }
View Full Code Here

            try {
                m_validateObjectPoliciesFromDatastream =
                        Boolean.parseBoolean(moduleParameters
                                .get(VALIDATE_OBJECT_POLICIES_FROM_DATASTREAM_KEY));
            } catch (Exception e) {
                throw new GeneralException("bad init parm boolean value for "
                                                        + VALIDATE_OBJECT_POLICIES_FROM_DATASTREAM_KEY,
                                                        e);
            }
        } else {
            m_validateObjectPoliciesFromDatastream = false;
        }

        // Initialize the policy parser given the POLICY_SCHEMA_PATH_KEY
        if (moduleParameters.containsKey(POLICY_SCHEMA_PATH_KEY)) {
            String schemaPath = moduleParameters.get(POLICY_SCHEMA_PATH_KEY);
            File schema;
            if (schemaPath.startsWith(File.separator)){ // absolute
                schema = new File(schemaPath);
            } else {
                schema = new File(new File(m_serverHome), schemaPath);
            }
            try {
                FileInputStream in = new FileInputStream(schema);
                m_policyParser = new PolicyParser(in);
                ValidationUtility.setPolicyParser(m_policyParser);
            } catch (Exception e) {
                throw new GeneralException("Error loading policy"
                                                        + " schema: " + schema.getAbsolutePath(), e);
            }
        } else {
            throw new GeneralException("Policy schema path not"
                                                    + " specified.  Must be given as " + POLICY_SCHEMA_PATH_KEY);
        }

        m_repositoryPolicies = new ArrayList<AbstractPolicy>();
    }
View Full Code Here

    public ProtocolPort(String protocol, String port)
            throws GeneralException {
        if (!ServerUtility.HTTP.equals(protocol)
                && !ServerUtility.HTTPS.equals(protocol)) {
            throw new GeneralException("bad protocol in ProtocolPort constructor");
        }
        if (port == null || "".equals(port)) {
            throw new GeneralException("bad port in ProtocolPort constructor");
        }
        this.protocol = protocol;
        this.port = port;
    }
View Full Code Here

                    "ServiceMapper returned error. "
                            + "The underlying error was a "
                            + e.getClass().getName() + ".  "
                            + "The message was " + "\"" + e.getMessage() + "\"";
            e.printStackTrace();
            throw new GeneralException(msg);
        }
    }
View Full Code Here

        try {
            policy = IOUtils.toString(dsContent);
            dsContent.close();
            m_policyIndex.addPolicy(pid, policy);
        } catch (IOException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        } catch (PolicyIndexException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        }


    }
View Full Code Here

        try {
            policy = IOUtils.toString(dsContent);
            dsContent.close();
            m_policyIndex.updatePolicy(pid, policy);
        } catch (IOException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        } catch (PolicyIndexException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        }

    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.GeneralException

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.