Package org.glite.authz.pap.repository.exceptions

Examples of org.glite.authz.pap.repository.exceptions.NotFoundException


            if (!policyFile.delete()) {
                throw new RepositoryException("Cannot delete file: " + policyFile.getAbsolutePath());
            }

        } else {
            throw new NotFoundException(policyNotFoundExceptionMsg(policyId));
        }
    }
View Full Code Here


        String papDirAbsolutePath = FileSystemRepositoryManager.getPAPDirAbsolutePath(papId);

        File papDir = new File(papDirAbsolutePath);

        if (!papDir.exists()) {
            throw new NotFoundException(papDirNotFoundExceptionMsg(papDirAbsolutePath));
        }

        for (File file : papDir.listFiles()) {

            if (file.isDirectory()) {
View Full Code Here

    public synchronized List<PolicyType> getAll(String papId) {

        File papDir = new File(FileSystemRepositoryManager.getPAPDirAbsolutePath(papId));

        if (!papDir.exists()) {
            throw new NotFoundException(papDirNotFoundExceptionMsg(papDir.getAbsolutePath()));
        }

        Map<String, PolicyTypeString> papCache = getPapCache(papId);

        List<PolicyType> policyList = new LinkedList<PolicyType>();
View Full Code Here

            if (!policyFile.exists()) {
                if (papCache.size() == 0) {
                    cache.remove(papId);
                }
                throw new NotFoundException(policyNotFoundExceptionMsg(policyId));
            }

            try {
                policy = new PolicyTypeString(policyId, policyHelper.readFromFileAsString(policyFile));
            } catch (Throwable e) {
View Full Code Here

        TypeStringUtils.releaseUnneededMemory(policy);

        File papDir = new File(FileSystemRepositoryManager.getPAPDirAbsolutePath(papId));

        if (!papDir.exists()) {
            throw new NotFoundException(papDirNotFoundExceptionMsg(papDir.getAbsolutePath()));
        }

        String policyId = policyTypeString.getPolicyId();

        File policyFile = new File(getPolicyFileAbsolutePath(papId, policyId));
View Full Code Here

        String policyId = newPolicyTypeString.getPolicyId();

        File policyFile = new File(getPolicyFileAbsolutePath(papId, policyId));
        if (!policyFile.exists()) {
            throw new NotFoundException(policyNotFoundExceptionMsg(policyId));
        }

        Map<String, PolicyTypeString> papCache = getPapCache(papId);

        PolicyTypeString oldPolicy = papCache.get(policyId);
View Full Code Here

    protected PolicySetType doExecute() {

        PapContainer papContainer = new PapContainer(ps);

        if (!papContainer.hasPolicySet(policySetId))
            throw new NotFoundException("PolicySet '" + policySetId + "' not found.");

        PolicySetType policySet = papContainer.getPolicySet(policySetId);

        return policySet;
    }
View Full Code Here

    protected PolicySetType doExecute() {
     
        PapContainer papContainer = new PapContainer(ps);
       
        if (!papContainer.hasPolicySet(policySetId))
            throw new NotFoundException("PolicySet '" + policySetId + "' not found.");
       
        PolicySetType policySet = papContainer.getPolicySet(policySetId);
       
        return policySet;
       
View Full Code Here

     *             hasn't been modified nor corrupted.
     */
    public void addPolicy(int index, String policySetId, PolicyType policy) {

        if (!policySetDAO.exists(papId, policySetId)) {
            throw new NotFoundException("PolicySetId \"" + policySetId + "\" not found");
        }

        String policyId = policy.getPolicyId();

        policyDAO.store(papId, policy);
View Full Code Here

     * @throws RepositoryException if an error occurred (e.g. a corrupted policy file).
     */
    public void removePolicyAndReferences(String policyId) {

        if (!policyDAO.exists(papId, policyId)) {
            throw new NotFoundException("PolicyId \"" + policyId + "\" does not exists");
        }

        boolean policyAlreadyRemoved = false;
       
        List<PolicySetType> policySetList = policySetDAO.getAll(papId);
View Full Code Here

TOP

Related Classes of org.glite.authz.pap.repository.exceptions.NotFoundException

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.