Package org.fcrepo.server

Examples of org.fcrepo.server.MultiValueMap


    /**
     * Read a multi-map, with its nested tags.
     */
    private MultiValueMap readMultiMap(XMLEventReader reader, String mapName)
            throws JournalException, XMLStreamException {
        MultiValueMap map = new MultiValueMap();

        // must start with a multi-map tag
        XMLEvent event = reader.nextTag();
        if (!isStartTagEvent(event, QNAME_TAG_MULTI_VALUE_MAP)) {
            throw getNotStartTagException(QNAME_TAG_MULTI_VALUE_MAP, event);
View Full Code Here


    public InputStream getContentStreamForChecksum() throws StreamIOException {
        /**
         * What should the context be here?
         */
        MultiValueMap environmentAttributes = beginEnvironmentMap("");
        try {
            environmentAttributes.set(Constants.HTTP_REQUEST.CLIENT_IP_ADDRESS.uri, "127.0.0.1");
        } catch (Exception e) {
            logger.warn("Could not set client IP for checksum context!");
        }
        ReadOnlyContext context;
        try {
View Full Code Here

        target.DSChecksumType = DSChecksumType;
        target.DSChecksum = DSChecksum;
    }

    private static final MultiValueMap beginEnvironmentMap(String messageProtocol) {
        MultiValueMap environmentMap = new MultiValueMap();
        try {
        environmentMap.set(Constants.HTTP_REQUEST.MESSAGE_PROTOCOL.uri,
                           messageProtocol);
        Date now = new Date();
        environmentMap.set(Constants.ENVIRONMENT.CURRENT_DATE_TIME.uri,
                           DateUtility.convertDateToString(now));
        environmentMap.set(Constants.ENVIRONMENT.CURRENT_DATE.uri, DateUtility
                .convertDateToDateString(now));
        environmentMap.set(Constants.ENVIRONMENT.CURRENT_TIME.uri, DateUtility
                .convertDateToTimeString(now));
        } catch (Exception e) {
            logger.warn("Datastream could not set envAttributes for checksum context");
        }
        return environmentMap;
View Full Code Here

        return resourceAttributes.getStringArray(name);
    }

    public void setActionAttributes(MultiValueMap actionAttributes) {
        if (actionAttributes == null) {
            actionAttributes = new MultiValueMap();
        }
        this.actionAttributes = actionAttributes;
    }
View Full Code Here

        this.actionAttributes = actionAttributes;
    }

    public void setResourceAttributes(MultiValueMap resourceAttributes) {
        if (resourceAttributes == null) {
            resourceAttributes = new MultiValueMap();
        }
        this.resourceAttributes = resourceAttributes;
    }
View Full Code Here

            throws AuthzException {
        try {
            logger.debug("Entered enforceGetDatastream");
            String target = Constants.ACTION.GET_DATASTREAM.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            String name = null;
            try {
                name = Constants.DATASTREAM.ID.uri;
                resourceAttributes.set(name, datastreamId);
                name = Constants.DATASTREAM.AS_OF_DATETIME.uri;
                resourceAttributes.set(name, ensureDate(asOfDateTime, context));
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + name, e);
            }
View Full Code Here

            throws AuthzException {
        try {
            logger.debug("Entered enforceGetDatastreamHistory");
            String target = Constants.ACTION.GET_DATASTREAM_HISTORY.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            try {
                resourceAttributes.set(Constants.DATASTREAM.ID.uri,
                                       datastreamId);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + Constants.DATASTREAM.ID.uri, e);
View Full Code Here

            throws AuthzException {
        try {
            logger.debug("Entered enforceGetDatastreams");
            String target = Constants.ACTION.GET_DATASTREAMS.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            String name = null;
            try {
                name = Constants.DATASTREAM.STATE.uri;
                resourceAttributes.set(name, datastreamState);
                name = Constants.RESOURCE.AS_OF_DATETIME.uri;
                resourceAttributes.set(name, ensureDate(asOfDate, context));
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + name, e);
            }
View Full Code Here

            throws AuthzException {
        try {
            logger.debug("Entered enforceGetObjectXML");
            String target = Constants.ACTION.GET_OBJECT_XML.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            try {
                resourceAttributes
                        .set(Constants.OBJECT.ENCODING.uri,
                             objectXmlEncoding);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
View Full Code Here

            throws AuthzException {
        try {
            logger.debug("Entered enforceIngest");
            String target = Constants.ACTION.INGEST.uri;
            context.setActionAttributes(null);
            MultiValueMap resourceAttributes = new MultiValueMap();
            String name = null;
            try {
                name = Constants.OBJECT.FORMAT_URI.uri;
                resourceAttributes.set(name, format);
                name = Constants.OBJECT.ENCODING.uri;
                resourceAttributes.set(name, ingestEncoding);
            } catch (Exception e) {
                context.setResourceAttributes(null);
                throw new AuthzOperationalException(target + " couldn't set "
                                                    + name, e);
            }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.MultiValueMap

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.