org.openrdf.http.object.model
Class ResourceRequest

java.lang.Object
  extended by org.openrdf.http.object.model.EditableHttpEntityEnclosingRequest
      extended by org.openrdf.http.object.model.Request
          extended by org.openrdf.http.object.model.ResourceRequest
All Implemented Interfaces:
Cloneable, org.apache.http.HttpEntityEnclosingRequest, org.apache.http.HttpMessage, org.apache.http.HttpRequest
Direct Known Subclasses:
ResourceOperation

public class ResourceRequest
extends Request

Tracks the target resource with the request.

Author:
James Leigh

Constructor Summary
ResourceRequest(File dataDir, Request request, ObjectRepository repository)
           
 
Method Summary
 void begin()
           
 void cleanup()
          Request has been fully read and response status is determined.
 void commit()
           
 ResponseEntity createResultEntity(Object result, Class<?> ctype, Type gtype, String[] mimeTypes)
           
 URI createURI(String uriSpec)
           
 void flush()
           
 SortedSet<? extends MimeType> getAcceptable()
           
 BodyEntity getBody()
           
 String getContentType(Method method)
           
 File getFile()
           
 Entity getHeader(String[] mediaTypes, String... names)
           
 ObjectConnection getObjectConnection()
           
 String getOperation()
           
 Entity getParameter(String[] mediaTypes, String... names)
           
 Entity getQueryString(String[] mediaTypes)
           
 RDFObject getRequestedResource()
           
 Transaction getRevision()
           
 Collection<String> getVary()
           
 String getVaryHeader(String name)
           
 List<String> getVaryHeaders(String... name)
           
 boolean isAcceptable(Class<?> type, Type genericType)
           
 boolean isAcceptable(String mediaType)
           
 boolean isAcceptable(String mediaType, Class<?> type, Type genericType)
           
 boolean isQueryStringPresent()
           
 String revision()
           
 void rollback()
           
 
Methods inherited from class org.openrdf.http.object.model.Request
clone, close, getAuthority, getCredential, getDateHeader, getHeader, getHeaderEnumeration, getHeaderValues, getIRI, getMaxAge, getMaxStale, getMethod, getMinFresh, getQueryString, getRealm, getReceivedOn, getRemoteAddr, getRequestTarget, getRequestURI, getRequestURL, getResolvedHeader, getURIFromRequestTarget, getURLFromRequestTarget, getX509Certificate, invalidatesCache, isMessageBody, isNoCache, isOnlyIfCache, isSafe, isStorable, parseURI, resolve, setCredential, setIRI, setRealm, setReceivedOn, toString
 
Methods inherited from class org.openrdf.http.object.model.EditableHttpEntityEnclosingRequest
addHeader, addHeader, containsHeader, expectContinue, getAllHeaders, getEnclosingRequest, getEntity, getFirstHeader, getHeaders, getLastHeader, getParams, getProtocolVersion, getRequestLine, headerIterator, headerIterator, removeHeader, removeHeaders, setEntity, setHeader, setHeader, setHeaders, setParams, setRequestLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceRequest

public ResourceRequest(File dataDir,
                       Request request,
                       ObjectRepository repository)
                throws QueryEvaluationException,
                       RepositoryException,
                       MimeTypeParseException
Throws:
QueryEvaluationException
RepositoryException
MimeTypeParseException
Method Detail

begin

public void begin()
           throws RepositoryException,
                  QueryEvaluationException,
                  MimeTypeParseException
Throws:
RepositoryException
QueryEvaluationException
MimeTypeParseException

getVaryHeader

public String getVaryHeader(String name)

getVaryHeaders

public List<String> getVaryHeaders(String... name)

getVary

public Collection<String> getVary()

createResultEntity

public ResponseEntity createResultEntity(Object result,
                                         Class<?> ctype,
                                         Type gtype,
                                         String[] mimeTypes)

createURI

public URI createURI(String uriSpec)

flush

public void flush()
           throws RepositoryException,
                  QueryEvaluationException,
                  IOException
Throws:
RepositoryException
QueryEvaluationException
IOException

rollback

public void rollback()
              throws RepositoryException
Throws:
RepositoryException

commit

public void commit()
            throws IOException,
                   RepositoryException
Throws:
IOException
RepositoryException

cleanup

public void cleanup()
             throws RepositoryException,
                    IOException
Description copied from class: Request
Request has been fully read and response status is determined.

Overrides:
cleanup in class Request
Throws:
RepositoryException
IOException

getBody

public BodyEntity getBody()
                   throws MimeTypeParseException
Throws:
MimeTypeParseException

getContentType

public String getContentType(Method method)
                      throws MimeTypeParseException
Throws:
MimeTypeParseException

getFile

public File getFile()

getObjectConnection

public ObjectConnection getObjectConnection()

getOperation

public String getOperation()

getHeader

public Entity getHeader(String[] mediaTypes,
                        String... names)

getParameter

public Entity getParameter(String[] mediaTypes,
                           String... names)

getQueryString

public Entity getQueryString(String[] mediaTypes)

getRequestedResource

public RDFObject getRequestedResource()

getRevision

public Transaction getRevision()

revision

public String revision()

getAcceptable

public SortedSet<? extends MimeType> getAcceptable()
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(Class<?> type,
                            Type genericType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(String mediaType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(String mediaType,
                            Class<?> type,
                            Type genericType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isQueryStringPresent

public boolean isQueryStringPresent()


Copyright © 2004-2011 James Leigh Services Inc.. All Rights Reserved.