|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 2 of 7
According to Fielding's dissertation, representational state for resources in an HTTP-based REST system should be accessed using the standard HTTP methods. What follows is a simple breakdown of these methods:
GET is used to transfer the current representational state of a resource from a server to a client.
PUT is used to transfer the modified representational state of a resource from the client to the server.
POST is used to transfer the new representational state of a resource from the client to the server.
DELETE is used to transfer information needed to change a resource to a deleted representational state.
The four standard HTTP methods are supported by Java language and server technologies, such as servlets and JavaServer Pages (JSP). You can also use JAF to extend these technologies to support a REST-based system.
JAF is a standard extension to the Java platform. It presents a framework of Java-based APIs and components in which information about data presented by Java objects or beans can be recognized easily and accessed.
JAF defines APIs that are used to register and discover data by content or Multi-purpose Internet Mail Extensions (MIME) type. Standard methods defined by JAF components then can be used to instantiate data handlers, on which commands and operations are performed to access and modify the data.
Simply put, JAF does the following:
With JAF, developers use standard APIs to determine the content type of data for a given resource encapsulated by a Java object
or bean. For example, an image resource in JAF might be identified by a content or MIME type of image/png. A DataHandler component representing the image then could be used to access and modify the content of the image using the same standard
streaming operations that would be used to access and modify content from a component representing an XML document, that is,
a component with a content type of application/atom+xml.
Figure 2 shows the primary components defined by the JAF architecture.
As shown in Figure 2, the DataHandler class provides a standard interface between JAF clients and resources.
The DataSource component encapsulates data for a resource by providing stream access to the data and by providing the content or MIME type
describing the data. JAF provides two DataSource implementations: FileDataSource, representing file-system data, and URLDataSource, representing data located by a given URL.
DataContentHandler components can be implemented to provide cut-and-paste capabilities to a given DataHandler via the java.awt.datatransfer.Transferable interface.
The CommandMap object represents a registry of command/verbs available for specific MIME types supported by a resource. The CommandMap registry lets a DataHandler component retrieve JavaBeans, which implement the CommandObject interface, to operate on a representation of a resource supporting a particular MIME type.
Once a DataHandler for a given resource is instantiated, a DataSource object is created and associated with the DataHandler. The DataSource object provides content-type information to the DataHandler component. A CommandMap object can be associated with the DataHandler component if the developer so chooses. The CommandMap object is used to associate a collection of verb/JavaBean pairs with a DataHandler. The verb/JavaBean pairs are used by a DataHandler to present components to clients for handling customized commands for a given resource.