Package org.glite.authz.pap.common

Examples of org.glite.authz.pap.common.Pap


            if (papAlias == null) {
                papAlias = Pap.DEFAULT_PAP_ALIAS;
            }

            Pap ps = PapManager.getInstance().getPap(papAlias);

            synchronized (ServicesUtils.highLevelOperationLock) {
                if (ps.isLocal()) {
                    return ListLocalPolicySetOperation.instance(ps).execute();
                } else {
                    return ListRemotePolicySetOperation.instance(ps).execute();
                }
            }
View Full Code Here


        if (Pap.DEFAULT_PAP_ALIAS.equals(alias)) {
            updateDefaultPap(newPap);
            return;
        }

        Pap oldPap = papDAO.get(alias);

        // id (and alias) cannot change
        newPap.setId(oldPap.getId());

        distributionConfiguration.savePap(newPap);
        papDAO.update(newPap);
    }
View Full Code Here

    }

    /** Create the <i>default</i> pap if it doesn't exist. */
    private void createDefaultPapIfNotExists() {

        Pap defaultPap;

        if (!papDAO.exists(Pap.DEFAULT_PAP_ALIAS)) {

            defaultPap = Pap.makeDefaultPAP();
            papDAO.store(defaultPap);
View Full Code Here

        for (Pap papFromConfiguration : papListFromConfiguration) {
            try {

                String papAlias = papFromConfiguration.getAlias();

                Pap papFromRepository = papDAO.get(papAlias);

                if (papFromConfiguration.equals(papFromRepository)) {
                    continue;
                }
View Full Code Here

        if (!Pap.DEFAULT_PAP_ALIAS.equals(newDefaultPap.getAlias())) {
            throw new RepositoryException("Invalid alias for default pap. Cannot perform updateDefaultPap request.");
        }

        Pap oldDefaultPap = getPap(Pap.DEFAULT_PAP_ALIAS);

        newDefaultPap.setId(oldDefaultPap.getId());

        papDAO.update(newDefaultPap);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Pap get(String papAlias) {

        Pap pap = getPapFromINIConfiguration(papAlias);

        if (pap == null) {
            throw new NotFoundException(String.format("Not found: papAlias=%s", papAlias));
        }

View Full Code Here

        String path = iniConfiguration.getString(pathKey(papAlias));
        String id = iniConfiguration.getString(idKey(papAlias));
        boolean visibilityPublic = iniConfiguration.getBoolean(visibilityPublicKey(papAlias));
        boolean enabled = iniConfiguration.getBoolean(enabledKey(papAlias), false);

        Pap pap = new Pap(papAlias, Pap.isLocal(type), dn, host, port, path, protocol, visibilityPublic);
        pap.setId(id);
        pap.setEnabled(enabled);

        long policyLastModificationTime;
        try {
            policyLastModificationTime = Long.parseLong(iniConfiguration.getString(policyLastModificationTimeKey(papAlias)));
        } catch (NumberFormatException e) {
            policyLastModificationTime = 0;
        }
        pap.setPolicyLastModificationTime(policyLastModificationTime);

        return pap;
    }
View Full Code Here

        if (alias == null) {
            alias = Pap.DEFAULT_PAP_ALIAS;
        }
       
        Pap pap = PapManager.getInstance().getPap(alias);

        if (pap.isRemote()) {
            throw new XACMLPolicyManagementServiceException("Forbidden operation for a remote PAP");
        }

        PapContainer papContainer = new PapContainer(pap);
View Full Code Here

        if (alias == null) {
            alias = Pap.DEFAULT_PAP_ALIAS;
        }

        Pap pap = PapManager.getInstance().getPap(alias);

        if (pap.isRemote()) {
            throw new XACMLPolicyManagementServiceException("Forbidden operation for a remote PAP");
        }

        PapContainer papContainer = new PapContainer(pap);
View Full Code Here

           
            path = AddPap.getPath(args[2]);
            dn = args[3];
        }

        Pap pap = new Pap(alias, isLocal, dn, host, port, path, protocol, isPublic);

        String msg = "Updating PAP: ";

        if (verboseMode) {
            System.out.println(msg + pap.toFormattedString(0, msg.length()));
        }

        if (!(papMgmtClient.exists(pap.getAlias()))) {
            System.out.println("PAP doesn't exists.");
            return ExitStatus.FAILURE.ordinal();
        }

        papMgmtClient.updatePap(pap);

        if (pap.isRemote()) {

            if (!commandLine.hasOption(OPT_NO_POLICIES_LONG)) {

                if (verboseMode) {
                    System.out.print("Retrieving policies... ");
                }

                try {
                    papMgmtClient.refreshCache(pap.getAlias());
                } catch (RemoteException e) {
                    System.out.println("Error: pap information successfully updated but cannot retrieve policies.");
                    throw e;
                }
View Full Code Here

TOP

Related Classes of org.glite.authz.pap.common.Pap

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.