Package com.sun.xacml.attr

Examples of com.sun.xacml.attr.StringAttribute


        Attribute attribute = null;
        attribute =
                new Attribute(Constants.XACML1_RESOURCE.ID.getURI(),
                              null,
                              null,
                              new StringAttribute(""));
        resources.add(attribute);
        attribute =
                new Attribute(RESOURCE_ID_URI,
                              null,
                              null,
                              new StringAttribute(pid));
        resources.add(attribute);
        attribute =
                new Attribute(RESOURCE_NAMESPACE_URI,
                              null,
                              null,
                              new StringAttribute(namespace));
        resources.add(attribute);
        return resources;
    }
View Full Code Here


            }

            if (actionValueMap != null && actionValueMap.size() > 0) {
                String tmpValue = actionValueMap.get(a.get(uri).encode());
                if (tmpValue != null) {
                    newValue = new StringAttribute(tmpValue);
                }
            }

            newUri = newUri == null ? uri : newUri;
            newValue = newValue == null ? a.get(uri) : newValue;
View Full Code Here

        Map<URI, List<AttributeValue>> subAttr =
                new HashMap<URI, List<AttributeValue>>();
        try {
            List<AttributeValue> attrList = new ArrayList<AttributeValue>();
            attrList.add(new StringAttribute(subject));
            subAttr.put(new URI("urn:fedora:names:fedora:2.1:subject:loginId"),
                        attrList);

            attrList = new ArrayList<AttributeValue>();
            for (int x = 0; x < 10; x++) {
                attrList.add(new StringAttribute("role" + x));
            }
            subAttr.put(new URI("urn:fedora:names:fedora:2.1:subject:role"),
                        attrList);
        } catch (URISyntaxException use) {
            System.out.println(use.getMessage());
        }
        subjects.add(subAttr);

        subAttr = new HashMap<URI, List<AttributeValue>>();
        try {
            List<AttributeValue> attrList = new ArrayList<AttributeValue>();
            attrList.add(new StringAttribute(subject));
            subAttr
                    .put(new URI("urn:oasis:names:tc:xacml:1.0:subject:subject-id"),
                         attrList);
        } catch (URISyntaxException use) {
            System.out.println(use.getMessage());
View Full Code Here

        try {
            if (pid != null && !pid.equals("")) {
                resAttr
                        .put(new URI("urn:fedora:names:fedora:2.1:resource:object:pid"),
                             new StringAttribute(pid));
                resAttr
                        .put(new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id"),
                             new AnyURIAttribute(new URI(pid)));
            }

            if (action != null && !action.equals("")) {
                actionAttr
                        .put(new URI("urn:fedora:names:fedora:2.1:action:id"),
                             new StringAttribute(action));
                actionAttr
                        .put(new URI("urn:oasis:names:tc:xacml:1.0:action:action-id"),
                             new StringAttribute(action));
            }
        } catch (URISyntaxException use) {
            System.out.println(use.getMessage());
        }
View Full Code Here

        List<Map<URI, AttributeValue>> resList =
                new ArrayList<Map<URI, AttributeValue>>();

        resAttr = new HashMap<URI, AttributeValue>();
        resAttr.put(Constants.OBJECT.PID.getURI(),
                    new StringAttribute("melcoe:test:01"));
        resAttr
                .put(new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id"),
                     new AnyURIAttribute(new URI("melcoe:test:01")));
        resAttr.put(Constants.DATASTREAM.ID.getURI(),
                    new AnyURIAttribute(new URI("melcoe:test:02")));
        resAttr.put(Constants.DATASTREAM.MIME_TYPE.getURI(),
                    new StringAttribute("text/xml"));
        resAttr.put(Constants.DATASTREAM.FORMAT_URI.getURI(),
                    new AnyURIAttribute(new URI("some:format:or:the:other")));
        resAttr.put(Constants.DATASTREAM.LOCATION.getURI(),
                    new StringAttribute("http://www.whipitgood.com"));
        resAttr.put(Constants.DATASTREAM.CONTROL_GROUP.getURI(),
                    new StringAttribute("E"));
        resAttr.put(Constants.DATASTREAM.STATE.getURI(),
                    new StringAttribute("ACTIVE"));
        resList.add(resAttr);

        resAttr = new HashMap<URI, AttributeValue>();
        resAttr.put(Constants.OBJECT.PID.getURI(),
                    new StringAttribute("melcoe:test:03"));
        resAttr
                .put(new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id"),
                     new AnyURIAttribute(new URI("melcoe:test:03")));
        resAttr.put(Constants.DATASTREAM.ID.getURI(),
                    new AnyURIAttribute(new URI("melcoe:test:04")));
        resAttr.put(Constants.DATASTREAM.MIME_TYPE.getURI(),
                    new StringAttribute("text/xml"));
        resAttr.put(Constants.DATASTREAM.FORMAT_URI.getURI(),
                    new AnyURIAttribute(new URI("some:format:or:the:other")));
        resAttr.put(Constants.DATASTREAM.LOCATION.getURI(),
                    new StringAttribute("http://www.whipitgood.com"));
        resAttr.put(Constants.DATASTREAM.CONTROL_GROUP.getURI(),
                    new StringAttribute("E"));
        resAttr.put(Constants.DATASTREAM.STATE.getURI(),
                    new StringAttribute("ACTIVE"));
        resList.add(resAttr);

        resAttr = new HashMap<URI, AttributeValue>();
        resAttr.put(Constants.OBJECT.PID.getURI(),
                    new StringAttribute("melcoe:test:05"));
        resAttr
                .put(new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id"),
                     new AnyURIAttribute(new URI("melcoe:test:05")));
        resAttr.put(Constants.DATASTREAM.ID.getURI(),
                    new AnyURIAttribute(new URI("melcoe:test:06")));
        resAttr.put(Constants.DATASTREAM.MIME_TYPE.getURI(),
                    new StringAttribute("text/xml"));
        resAttr.put(Constants.DATASTREAM.FORMAT_URI.getURI(),
                    new AnyURIAttribute(new URI("some:format:or:the:other")));
        resAttr.put(Constants.DATASTREAM.LOCATION.getURI(),
                    new StringAttribute("http://www.whipitgood.com"));
        resAttr.put(Constants.DATASTREAM.CONTROL_GROUP.getURI(),
                    new StringAttribute("E"));
        resAttr.put(Constants.DATASTREAM.STATE.getURI(),
                    new StringAttribute("ACTIVE"));
        resList.add(resAttr);

        return resList;
    }
View Full Code Here

    private static Map<URI, AttributeValue> getActions()
            throws URISyntaxException {
        Map<URI, AttributeValue> actions = new HashMap<URI, AttributeValue>();
        actions.put(Constants.ACTION.API.getURI(),
                    new StringAttribute(Constants.ACTION.APIM.getURI()
                            .toASCIIString()));
        actions.put(Constants.ACTION.ID.getURI(),
                    new StringAttribute(Constants.ACTION.ADD_DATASTREAM
                            .getURI().toASCIIString()));
        actions.put(new URI("urn:oasis:names:tc:xacml:1.0:action:action-id"),
                    new StringAttribute(Constants.ACTION.ADD_DATASTREAM
                            .getURI().toASCIIString()));
        return actions;
    }
View Full Code Here

        Map<URI, List<AttributeValue>> subAttr =
                new HashMap<URI, List<AttributeValue>>();
        List<AttributeValue> attrList = null;
        try {
            attrList = new ArrayList<AttributeValue>();
            attrList.add(new StringAttribute(uid));
            subAttr.put(Constants.SUBJECT.LOGIN_ID.getURI(), attrList);

            attrList = new ArrayList<AttributeValue>();
            attrList.add(new StringAttribute(uid));
            subAttr
                    .put(new URI("urn:oasis:names:tc:xacml:1.0:subject:subject-id"),
                         attrList);
        } catch (URISyntaxException use) {
            throw CXFUtility.getFault(use);
View Full Code Here

            this.parent = parent;
            this.localName = localName;
            this.datatype = datatype;
            uri = (parent != null) ? parent.uri + ":" + localName : localName;
            m_uri = new URI(uri);
            m_att = new StringAttribute(m_uri.toASCIIString());
            m_uri_att = new AnyURIAttribute(m_uri);
        } catch (URISyntaxException e) {
            throw new RuntimeException("Bad URI Syntax", e);
        }
    }
View Full Code Here

                            Constants.ACTION.GET_DATASTREAM
                                    .getStringAttribute());

                resAttr = ResourceAttributes.getResources(pid);
                resAttr.put(Constants.DATASTREAM.ID.getURI(),
                            new StringAttribute(dsid));

                RequestCtx req =
                        getContextHandler()
                                .buildRequest(getSubjects(request),
                                              actions,
View Full Code Here

        Map<URI, AttributeValue> resAttr;
        try {
            resAttr = ResourceAttributes.getResources(parts);
            if (mimeType != null && !"".equals(mimeType)) {
                resAttr.put(Constants.DATASTREAM.NEW_MIME_TYPE.getURI(),
                            new StringAttribute(mimeType));
            }
            if (formatURI != null && !"".equals(formatURI)) {
                resAttr.put(Constants.DATASTREAM.NEW_FORMAT_URI.getURI(),
                            new AnyURIAttribute(new URI(formatURI)));
            }
            if (dsLocation != null && !"".equals(dsLocation)) {
                resAttr.put(Constants.DATASTREAM.NEW_LOCATION.getURI(),
                            new AnyURIAttribute(new URI(dsLocation)));
            }
            if (controlGroup != null && !"".equals(controlGroup)) {
                resAttr.put(Constants.DATASTREAM.NEW_CONTROL_GROUP.getURI(),
                            new StringAttribute(controlGroup));
            }
            if (dsState != null && !"".equals(dsState)) {
                resAttr.put(Constants.DATASTREAM.NEW_STATE.getURI(),
                            new StringAttribute(dsState));
            }
            if (checksumType != null && !"".equals(checksumType)) {
                resAttr.put(Constants.DATASTREAM.NEW_CHECKSUM_TYPE.getURI(),
                            new StringAttribute(checksumType));
            }
            if (checksum != null && !"".equals(checksum)) {
                resAttr.put(Constants.DATASTREAM.NEW_CHECKSUM.getURI(),
                            new StringAttribute(checksum));
            }

            actions.put(Constants.ACTION.ID.getURI(),
                        Constants.ACTION.ADD_DATASTREAM
                                .getStringAttribute());
View Full Code Here

TOP

Related Classes of com.sun.xacml.attr.StringAttribute

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.