|
||||||||||
| 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 String |
DESCRIPTOR_AUTHENTICATION
|
static String |
DESCRIPTOR_AUTHENTICATION_PATH
|
static String |
DESCRIPTOR_CLIENT
|
static String |
DESCRIPTOR_CLIENT_PATH
|
static String |
DESCRIPTOR_PATH
|
static String |
DESCRIPTOR_SERVER
|
static String |
DESCRIPTOR_SERVER_PATH
|
static String |
VERSION
Complete version. |
static 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(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,
String helperClass)
|
ComponentHelper |
createHelper(Component component)
|
ServerHelper |
createHelper(Server server,
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. |
String |
formatCookie(Cookie cookie)
|
String |
formatCookieSetting(CookieSetting cookieSetting)
|
String |
formatDimensions(Collection<Dimension> dimensions)
|
String |
formatUserAgent(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,
List<Variant> variants,
Language defaultLanguage)
|
List<AuthenticationHelper> |
getRegisteredAuthentications()
Returns the list of available authentication helpers. |
List<ClientHelper> |
getRegisteredClients()
Returns the list of available client connectors. |
List<ServerHelper> |
getRegisteredServers()
Returns the list of available server connectors. |
void |
parse(Form form,
Representation webForm)
|
void |
parse(Form form,
String queryString,
CharacterSet characterSet,
boolean decode,
char separator)
|
MediaType |
parseContentType(String contentType)
|
Cookie |
parseCookie(String cookie)
|
CookieSetting |
parseCookieSetting(String cookieSetting)
|
List<Product> |
parseUserAgent(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(ClassLoader classLoader,
URL configUrl,
List helpers,
Class constructorClass)
Registers a helper. |
void |
registerHelpers(ClassLoader classLoader,
Enumeration<URL> configUrls,
List helpers,
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. |
String |
toBase64(byte[] target)
|
String |
toMd5(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 String DESCRIPTOR_AUTHENTICATION
public static final String DESCRIPTOR_PATH
public static final String DESCRIPTOR_AUTHENTICATION_PATH
public static final String DESCRIPTOR_CLIENT
public static final String DESCRIPTOR_CLIENT_PATH
public static final String DESCRIPTOR_SERVER
public static final String DESCRIPTOR_SERVER_PATH
public static final String VERSION
public static final 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(Iterable<Parameter> responseHeaders,
Response response)
Response.
copyResponseHeaders in class EngineresponseHeaders - 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 Engineresponse - 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 IOException
createDirectoryResource in class EngineIOExceptionpublic ApplicationHelper createHelper(Application application)
createHelper in class Engine
public ClientHelper createHelper(Client client,
String helperClass)
createHelper in class Enginepublic ComponentHelper createHelper(Component component)
createHelper in class Engine
public ServerHelper createHelper(Server server,
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 Enginerestlet - The Restlet with a changed context.context - The new context.
public String formatCookie(Cookie cookie)
throws IllegalArgumentException
formatCookie in class EngineIllegalArgumentException
public String formatCookieSetting(CookieSetting cookieSetting)
throws IllegalArgumentException
formatCookieSetting in class EngineIllegalArgumentExceptionpublic String formatDimensions(Collection<Dimension> dimensions)
formatDimensions in class Engine
public String formatUserAgent(List<Product> products)
throws IllegalArgumentException
formatUserAgent in class EngineIllegalArgumentException
public Variant getPreferredVariant(ClientInfo client,
List<Variant> variants,
Language defaultLanguage)
getPreferredVariant in class Enginepublic List<AuthenticationHelper> getRegisteredAuthentications()
public List<ClientHelper> getRegisteredClients()
public List<ServerHelper> getRegisteredServers()
public void parse(Form form,
Representation webForm)
parse in class Engine
public void parse(Form form,
String queryString,
CharacterSet characterSet,
boolean decode,
char separator)
parse in class Engine
public MediaType parseContentType(String contentType)
throws IllegalArgumentException
parseContentType in class EngineIllegalArgumentException
public Cookie parseCookie(String cookie)
throws IllegalArgumentException
parseCookie in class EngineIllegalArgumentException
public CookieSetting parseCookieSetting(String cookieSetting)
throws IllegalArgumentException
parseCookieSetting in class EngineIllegalArgumentException
public List<Product> parseUserAgent(String userAgent)
throws IllegalArgumentException
parseUserAgent in class EngineIllegalArgumentExceptionpublic void registerDefaultAuthentications()
public void registerDefaultConnectors()
public void registerHelper(ClassLoader classLoader,
URL configUrl,
List helpers,
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(ClassLoader classLoader,
Enumeration<URL> configUrls,
List helpers,
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 String toBase64(byte[] target)
toBase64 in class Enginepublic String toMd5(String target)
toMd5 in class Engine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||