|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Engine
com.noelios.restlet.Engine
public class Engine
Restlet factory supported by the engine.
Field Summary | |
---|---|
static java.lang.String |
DESCRIPTOR_AUTHENTICATION
|
static java.lang.String |
DESCRIPTOR_AUTHENTICATION_PATH
|
static java.lang.String |
DESCRIPTOR_CLIENT
|
static java.lang.String |
DESCRIPTOR_CLIENT_PATH
|
static java.lang.String |
DESCRIPTOR_PATH
|
static java.lang.String |
DESCRIPTOR_SERVER
|
static java.lang.String |
DESCRIPTOR_SERVER_PATH
|
static java.lang.String |
VERSION
Complete version. |
static java.lang.String |
VERSION_HEADER
Complete version header. |
Fields inherited from class org.restlet.util.Engine |
---|
MAJOR_NUMBER, MINOR_NUMBER, RELEASE_NUMBER |
Constructor Summary | |
---|---|
Engine()
Constructor that will automatically attempt to discover connectors. |
|
Engine(boolean discoverHelpers)
Constructor. |
Method Summary | |
---|---|
int |
authenticate(Request request,
Guard guard)
|
void |
challenge(Response response,
boolean stale,
Guard guard)
|
void |
copyResponseHeaders(java.lang.Iterable<Parameter> responseHeaders,
Response response)
Copies the given header parameters into the given Response . |
void |
copyResponseHeaders(Response response,
Series<Parameter> headers)
Copies the headers of the given Response into the given
Series . |
Resource |
createDirectoryResource(Directory directory,
Request request,
Response response)
|
ApplicationHelper |
createHelper(Application application)
|
ClientHelper |
createHelper(Client client,
java.lang.String helperClass)
|
ComponentHelper |
createHelper(Component component)
|
ServerHelper |
createHelper(Server server,
java.lang.String helperClass)
|
AuthenticationHelper |
findHelper(ChallengeScheme challengeScheme,
boolean clientSide,
boolean serverSide)
Finds the authentication helper supporting the given scheme. |
void |
fireContextChanged(Restlet restlet,
Context context)
Indicates that a Restlet's context has changed. |
java.lang.String |
formatCookie(Cookie cookie)
|
java.lang.String |
formatCookieSetting(CookieSetting cookieSetting)
|
java.lang.String |
formatDimensions(java.util.Collection<Dimension> dimensions)
|
java.lang.String |
formatUserAgent(java.util.List<Product> products)
|
static Engine |
getInstance()
Returns the registered Noelios Restlet engine. |
static int |
getJavaMajorVersion()
Parses the "java.version" system property and returns the first digit of the version number of the Java Runtime Environment (e.g. |
static int |
getJavaMinorVersion()
Parses the "java.version" system property and returns the second digit of the version number of the Java Runtime Environment (e.g. |
static int |
getJavaUpdateVersion()
Parses the "java.version" system property and returns the update release number of the Java Runtime Environment (e.g. |
Variant |
getPreferredVariant(ClientInfo client,
java.util.List<Variant> variants,
Language defaultLanguage)
|
java.util.List<AuthenticationHelper> |
getRegisteredAuthentications()
Returns the list of available authentication helpers. |
java.util.List<ClientHelper> |
getRegisteredClients()
Returns the list of available client connectors. |
java.util.List<ServerHelper> |
getRegisteredServers()
Returns the list of available server connectors. |
void |
parse(Form form,
Representation webForm)
|
void |
parse(Form form,
java.lang.String queryString,
CharacterSet characterSet,
boolean decode,
char separator)
|
MediaType |
parseContentType(java.lang.String contentType)
|
Cookie |
parseCookie(java.lang.String cookie)
|
CookieSetting |
parseCookieSetting(java.lang.String cookieSetting)
|
java.util.List<Product> |
parseUserAgent(java.lang.String userAgent)
|
static Engine |
register()
Registers a new Noelios Restlet Engine. |
static Engine |
register(boolean discoverConnectors)
Registers a new Noelios Restlet Engine. |
void |
registerDefaultAuthentications()
Registers the default authentication helpers. |
void |
registerDefaultConnectors()
Registers the default client and server connectors. |
void |
registerHelper(java.lang.ClassLoader classLoader,
java.net.URL configUrl,
java.util.List helpers,
java.lang.Class constructorClass)
Registers a helper. |
void |
registerHelpers(java.lang.ClassLoader classLoader,
java.util.Enumeration<java.net.URL> configUrls,
java.util.List helpers,
java.lang.Class constructorClass)
Registers a list of helpers. |
void |
registerUrlFactory()
Registers a factory that is used by the URL class to create the URLConnection instances when the URL.openConnection() or
URL.openStream() methods are invoked. |
java.lang.String |
toBase64(byte[] target)
|
java.lang.String |
toMd5(java.lang.String target)
|
Methods inherited from class org.restlet.util.Engine |
---|
getClassLoader, hashCode, loadClass, setInstance, setUserClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DESCRIPTOR_AUTHENTICATION
public static final java.lang.String DESCRIPTOR_PATH
public static final java.lang.String DESCRIPTOR_AUTHENTICATION_PATH
public static final java.lang.String DESCRIPTOR_CLIENT
public static final java.lang.String DESCRIPTOR_CLIENT_PATH
public static final java.lang.String DESCRIPTOR_SERVER
public static final java.lang.String DESCRIPTOR_SERVER_PATH
public static final java.lang.String VERSION
public static final java.lang.String VERSION_HEADER
Constructor Detail |
---|
public Engine()
public Engine(boolean discoverHelpers)
discoverHelpers
- True if helpers should be automatically discovered.Method Detail |
---|
public static Engine getInstance()
public static int getJavaMajorVersion()
public static int getJavaMinorVersion()
public static int getJavaUpdateVersion()
public static Engine register()
public static Engine register(boolean discoverConnectors)
discoverConnectors
- True if connectors should be automatically discovered.
public int authenticate(Request request, Guard guard)
authenticate
in class Engine
public void challenge(Response response, boolean stale, Guard guard)
challenge
in class Engine
public void copyResponseHeaders(java.lang.Iterable<Parameter> responseHeaders, Response response)
Response
.
copyResponseHeaders
in class Engine
responseHeaders
- The headers to copy.response
- The response to update. Must contain a Representation
to copy the representation headers in it.Engine.copyResponseHeaders(java.lang.Iterable,
org.restlet.data.Response)
public void copyResponseHeaders(Response response, Series<Parameter> headers)
Response
into the given
Series
.
copyResponseHeaders
in class Engine
response
- The response to update. Should contain a
Representation
to copy the representation headers from
it.headers
- The Series to copy the headers in.Engine.copyResponseHeaders(Response, Series)
public Resource createDirectoryResource(Directory directory, Request request, Response response) throws java.io.IOException
createDirectoryResource
in class Engine
java.io.IOException
public ApplicationHelper createHelper(Application application)
createHelper
in class Engine
public ClientHelper createHelper(Client client, java.lang.String helperClass)
createHelper
in class Engine
public ComponentHelper createHelper(Component component)
createHelper
in class Engine
public ServerHelper createHelper(Server server, java.lang.String helperClass)
createHelper
in class Engine
public AuthenticationHelper findHelper(ChallengeScheme challengeScheme, boolean clientSide, boolean serverSide)
challengeScheme
- The challenge scheme to match.clientSide
- Indicates if client side support is required.serverSide
- Indicates if server side support is required.
public void fireContextChanged(Restlet restlet, Context context)
fireContextChanged
in class Engine
restlet
- The Restlet with a changed context.context
- The new context.public java.lang.String formatCookie(Cookie cookie) throws java.lang.IllegalArgumentException
formatCookie
in class Engine
java.lang.IllegalArgumentException
public java.lang.String formatCookieSetting(CookieSetting cookieSetting) throws java.lang.IllegalArgumentException
formatCookieSetting
in class Engine
java.lang.IllegalArgumentException
public java.lang.String formatDimensions(java.util.Collection<Dimension> dimensions)
formatDimensions
in class Engine
public java.lang.String formatUserAgent(java.util.List<Product> products) throws java.lang.IllegalArgumentException
formatUserAgent
in class Engine
java.lang.IllegalArgumentException
public Variant getPreferredVariant(ClientInfo client, java.util.List<Variant> variants, Language defaultLanguage)
getPreferredVariant
in class Engine
public java.util.List<AuthenticationHelper> getRegisteredAuthentications()
public java.util.List<ClientHelper> getRegisteredClients()
public java.util.List<ServerHelper> getRegisteredServers()
public void parse(Form form, Representation webForm)
parse
in class Engine
public void parse(Form form, java.lang.String queryString, CharacterSet characterSet, boolean decode, char separator)
parse
in class Engine
public MediaType parseContentType(java.lang.String contentType) throws java.lang.IllegalArgumentException
parseContentType
in class Engine
java.lang.IllegalArgumentException
public Cookie parseCookie(java.lang.String cookie) throws java.lang.IllegalArgumentException
parseCookie
in class Engine
java.lang.IllegalArgumentException
public CookieSetting parseCookieSetting(java.lang.String cookieSetting) throws java.lang.IllegalArgumentException
parseCookieSetting
in class Engine
java.lang.IllegalArgumentException
public java.util.List<Product> parseUserAgent(java.lang.String userAgent) throws java.lang.IllegalArgumentException
parseUserAgent
in class Engine
java.lang.IllegalArgumentException
public void registerDefaultAuthentications()
public void registerDefaultConnectors()
public void registerHelper(java.lang.ClassLoader classLoader, java.net.URL configUrl, java.util.List helpers, java.lang.Class constructorClass)
classLoader
- The classloader to use.configUrl
- Configuration URL to parsehelpers
- The list of helpers to update.constructorClass
- The constructor parameter class to look for.public void registerHelpers(java.lang.ClassLoader classLoader, java.util.Enumeration<java.net.URL> configUrls, java.util.List helpers, java.lang.Class constructorClass)
classLoader
- The classloader to use.configUrls
- Configuration URLs to parsehelpers
- The list of helpers to update.constructorClass
- The constructor parameter class to look for.public void registerUrlFactory()
URLConnection
instances when the URL.openConnection()
or
URL.openStream()
methods are invoked.
The implementation is based on the client dispatcher of the current
context, as provided by Context.getCurrent()
method.
public java.lang.String toBase64(byte[] target)
toBase64
in class Engine
public java.lang.String toMd5(java.lang.String target)
toMd5
in class Engine
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |