Examples of RmsEntry


Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

    public WfResource asResource (Principal principal)
  throws ResourceNotFoundException, RemoteException {
        RmsConnection con = null;
        try {
            con = conFac.getConnection();
            RmsEntry e = con.lookupUserByAccountName (principal.getName());
            return new DefaultUserResource(rasCtx, e.getKey(), e.getDisplayName());
        } catch (ResourceException e) {
            maybeMapToRemoteException (e);
            throw new ResourceNotFoundException("Not found: " + e.getMessage());
        } catch (NameNotFoundException e) {
            throw new ResourceNotFoundException
                ("No user \"" + principal.getName() + "\" found: "
                 + e.getMessage());
        } finally {
            closeConnection(con);
        }
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

            }
            con = conFac.getConnection();
            Collection resRaw
                = con.authorizers (((DefaultUserResource)wfResource).getId());
            for (Iterator i = resRaw.iterator(); i.hasNext();) {
                RmsEntry e = (RmsEntry)i.next();
                addAsTyped(res, e);
            }
            return res;
        } catch (ResourceException e) {
            maybeMapToRemoteException (e);
            throw new IllegalStateException
                ("Cannot get authorizers: " + e.getMessage());
        } finally {
            closeConnection(con);
        }
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

  throws ResourceNotFoundException, RemoteException {
        RmsConnection con = null;
        try {
            con = conFac.getConnection();
            if (DefaultUserResource.isValidKey(key)) {
                RmsEntry e = con.lookupResource(DefaultUserResource.getId(key));
                return new DefaultUserResource(rasCtx, e.getKey(), e.getDisplayName());
            } else if (DefaultRoleResource.isValidKey(key)) {
                RmsEntry e = con.lookupResource(DefaultRoleResource.getId(key));
                return new DefaultRoleResource(rasCtx, e.getKey(), e.getDisplayName());
            } else if (DefaultGroupResource.isValidKey(key)) {
                RmsEntry e
                    = con.lookupResource(DefaultGroupResource.getId(key));
                return new DefaultGroupResource(rasCtx, e.getKey(), e.getDisplayName());
            } else {
                RmsEntry e = con.lookupResource (key);
                return new DefaultResource(rasCtx, e.getKey(), e.getDisplayName());
            }
        } catch (ResourceException e) {
            maybeMapToRemoteException (e);
            throw new ResourceNotFoundException("Not found: " + e.getMessage());
        } catch (NameNotFoundException e) {
            throw new ResourceNotFoundException
                ("No entry with key \"" + key + "\" found: " + e.getMessage());
        } finally {
            closeConnection(con);
        }
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

        try {
            con = conFac.getConnection();
            Collection resRaw = con.listResources();
            Collection res = new ArrayList ();
            for (Iterator i = resRaw.iterator(); i.hasNext();) {
                RmsEntry e = (RmsEntry)i.next();
                addAsTyped(res, e);
            }
            return res;
        } catch (ResourceException e) {
            maybeMapToRemoteException (e);
            throw new IllegalStateException
                ("Cannot list resources: " + e.getMessage());
        } finally {
            closeConnection(con);
        }
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

        try {
            con = conFac.getConnection();
            Collection resRaw = con.selectResources(resSel);
            Collection res = new ArrayList ();
            for (Iterator i = resRaw.iterator(); i.hasNext();) {
                RmsEntry e = (RmsEntry)i.next();
                addAsTyped(res, e);
            }
            return res;
        } catch (ResourceException e) {
            maybeMapToRemoteException (e);
            throw new IllegalStateException
                ("Cannot select resources: " + e.getMessage());
        } finally {
            closeConnection(con);
        }
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

            Attributes pd = ctx.getAttributes(dn);
            String name = dn;
            if (pd.get(rna) != null) {
                name = (String)pd.get(rna).get();
            }
            return new RmsEntry (resType, key, name);
        } catch (InvalidNameException e) {
            throw (NameNotFoundException)
                (new NameNotFoundException
                 ("Unknown LDAP resource \"" + dn + "\": "
                  + e.getMessage())).initCause(e);
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

            resName = (String)attrs.get(qi.getResourceNameAttribute()).get();
        } else if (qi.getSearchAttribute() != null
               && attrs.get(qi.getSearchAttribute()) != null) {
            resName = (String)attrs.get(qi.getSearchAttribute()).get();
        }
        return new RmsEntry (qi.getResType(), resKey, resName);
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

    /* (non-Javadoc)
     * @see de.danet.an.workflow.rmsimpls.eisrms.aci.RmsConnection#lookupResource
     */
    public RmsEntry lookupResource(String key)
        throws ResourceException, NameNotFoundException {
        RmsEntry entry = findResource(key);
        if (entry == null) {
            throw new NameNotFoundException("Unknown key \"" + key + "\"");
        }
        return entry;
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

        if (key.startsWith("M:")) {
            String propKey = key.substring(2);
            if (!usersProps.containsKey(propKey)) {
                return null;
            }
            return new RmsEntry (type, key, propKey);
        } else if (key.startsWith("G:")) {
            props = groupsProps;
            type = RmsEntry.RESOURCE_TYPE_GROUP;
        } else if (key.startsWith("R:")) {
            props = rolesProps;
            type = RmsEntry.RESOURCE_TYPE_ROLE;
        } else {
            return null;
        }
        String propKey = key.substring(2);
        for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
            String user = (String)e.nextElement();
            String val = props.getProperty(user);
            for (StringTokenizer st = new StringTokenizer(val, ",");
                 st.hasMoreTokens();) {
                String entry = st.nextToken().trim();
                if (entry.equals(propKey)) {
                    return new RmsEntry(type, key, propKey);
                }
            }
        }
        return null;
    }
View Full Code Here

Examples of de.danet.an.workflow.rmsimpls.eisrms.aci.RmsEntry

    public RmsEntry lookupUserByName(String name)
        throws NameNotFoundException {
        if (!usersProps.containsKey(name)) {
            throw new NameNotFoundException("Unknown user \"" + name + "\"");
        }
        return new RmsEntry (RmsEntry.RESOURCE_TYPE_USER, "M:" + name, name);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.