| java.lang.Object org.xins.common.manageable.Manageable org.xins.server.API
Constructor Summary | |
protected | API(String name) Constructs a new API object. |
Method Summary | |
final protected void | add(Manageable m) Adds the specified manageable object. | public boolean | allow(String ip, String functionName, String conventionName) Determines if the specified IP address is allowed to access the
specified function, returning a boolean value.
This method finds the first matching rule and then returns the
allow property of that rule (see
AccessRule.isAllowRule ). | final protected void | bootstrapImpl(PropertyReader buildSettings) Bootstraps this API (wrapper method). | protected void | bootstrapImpl2(PropertyReader buildSettings) Bootstraps this API (implementation method).
The implementation of this method in class
API is empty.
Custom subclasses can perform any necessary bootstrapping in this
class.
Note that bootstrapping and initialization are different. | final protected void | deinitImpl() Performs shutdown of this XINS API. | final void | functionAdded(Function function) Callback method invoked when a function is constructed. | final public APISpec | getAPISpecification() Get the specification of the API. | public PropertyReader | getBootstrapProperties() Gets the bootstrap properties specified for the API. | final Function | getFunction(String name) Returns the function with the specified name. | final public List | getFunctionList() Gets the list of the functions of this API. | final public String | getName() Gets the name of this API. | public RuntimeProperties | getProperties() Gets the runtime properties specified in the implementation. | final public InputStream | getResourceAsStream(String path) Gets the resource in the WAR file. | PropertyReader | getRuntimeProperties() Gets the API runtime properties. | final public long | getStartupTimestamp() Gets the timestamp that indicates when this API instance
was created. | final public TimeZone | getTimeZone() Returns the applicable time zone. | final FunctionResult | handleCall(long start, FunctionRequest functionRequest, String ip, CallingConvention cc) Forwards a call to a function, using an IP address. | FunctionResult | handleFunctionException(long start, FunctionRequest functionRequest, String ip, int callID, Throwable exception) Handles an exception caught while a function was executed. | final protected void | initImpl(PropertyReader runtimeSettings) Initializes this API. | boolean | isDisabled() Indicates whether the API is down for maintenance or not. | final protected void | reinitializeImpl() Triggers re-initialization of this API. | void | setEngine(Engine engine) Stores a reference to the Engine that owns this
API object. |
API_VERSION_PROPERTY | final static String API_VERSION_PROPERTY(Code) | | The name of the bootstrap property that specifies the version of the API.
|
allow | public boolean allow(String ip, String functionName, String conventionName) throws IllegalArgumentException(Code) | | Determines if the specified IP address is allowed to access the
specified function, returning a boolean value.
This method finds the first matching rule and then returns the
allow property of that rule (see
AccessRule.isAllowRule ). If there is no matching rule, then
false is returned.
Parameters: ip - the IP address, cannot be null . Parameters: functionName - the name of the function, cannot be null . Parameters: conventionName - the name of the calling convention, can be null .true if the request is allowed, false ifthe request is denied. throws: IllegalArgumentException - if ip == null || functionName == null . since: XINS 2.1. |
deinitImpl | final protected void deinitImpl()(Code) | | Performs shutdown of this XINS API. This method will never throw any
exception.
|
getBootstrapProperties | public PropertyReader getBootstrapProperties()(Code) | | Gets the bootstrap properties specified for the API.
the bootstrap properties, cannot be null . since: XINS 1.5.0. |
getFunction | final Function getFunction(String name)(Code) | | Returns the function with the specified name.
Parameters: name - the name of the function, will not be checked if it isnull .the function with the specified name, or null if thereis no match. |
getFunctionList | final public List getFunctionList()(Code) | | Gets the list of the functions of this API.
the functions of this API as a List of Function objects, never null . since: XINS 1.5.0. |
getName | final public String getName()(Code) | | Gets the name of this API.
the name of this API, never null and never an emptystring. |
getProperties | public RuntimeProperties getProperties()(Code) | | Gets the runtime properties specified in the implementation.
the runtime properties for the API, cannot be null . |
getResourceAsStream | final public InputStream getResourceAsStream(String path) throws IllegalArgumentException(Code) | | Gets the resource in the WAR file.
Parameters: path - the path for the resource, cannot be null and should start with /.the InputStream to use to read this resource or null ifthe resource cannot be found. throws: IllegalArgumentException - if path == null or if the path doesn't start with /. since: XINS 2.0. |
getRuntimeProperties | PropertyReader getRuntimeProperties()(Code) | | Gets the API runtime properties.
the runtime properties, cannot be null . |
getStartupTimestamp | final public long getStartupTimestamp()(Code) | | Gets the timestamp that indicates when this API instance
was created.
the time this instance was constructed, as a number of millisecondssince theUNIX Epoch. |
getTimeZone | final public TimeZone getTimeZone()(Code) | | Returns the applicable time zone.
the time zone, never null . |
handleCall | final FunctionResult handleCall(long start, FunctionRequest functionRequest, String ip, CallingConvention cc) throws IllegalStateException, NullPointerException, NoSuchFunctionException, AccessDeniedException(Code) | | Forwards a call to a function, using an IP address. The call will
actually be handled by
Function.handleCall(longFunctionRequestString) .
Parameters: start - the start time of the request, in milliseconds since theUNIX Epoch. Parameters: functionRequest - the function request, never null . Parameters: ip - the remote IP address, never null . Parameters: cc - the calling convention to use to handle the call, never null .the result of the call, never null . throws: IllegalStateException - if this object is currently not initialized. throws: NullPointerException - if functionRequest == null . throws: NoSuchFunctionException - if there is no matching function for the specified request. throws: AccessDeniedException - if access is denied for the specified combination of IP address andfunction name. |
handleFunctionException | FunctionResult handleFunctionException(long start, FunctionRequest functionRequest, String ip, int callID, Throwable exception)(Code) | | Handles an exception caught while a function was executed.
Parameters: start - the start time of the call, as milliseconds since theUNIX Epoch. Parameters: functionRequest - the request, never null . Parameters: ip - the IP address of the requester, never null . Parameters: callID - the call identifier, never null . Parameters: exception - the exception caught, never null .the call result, never null . |
isDisabled | boolean isDisabled()(Code) | | Indicates whether the API is down for maintenance or not.
true if the API is disable, false otherwise. |
reinitializeImpl | final protected void reinitializeImpl()(Code) | | Triggers re-initialization of this API. This method is meant to be
called by API function implementations when it is anticipated that the
API should be re-initialized.
|
setEngine | void setEngine(Engine engine)(Code) | | Stores a reference to the Engine that owns this
API object.
Parameters: engine - the Engine instance, should not be null . |
Methods inherited from org.xins.common.manageable.Manageable | final protected void assertUsable() throws IllegalStateException(Code)(Java Doc) final public void bootstrap(PropertyReader properties) throws IllegalStateException, MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)(Java Doc) protected void bootstrapImpl(PropertyReader properties) throws MissingRequiredPropertyException, InvalidPropertyValueException, BootstrapException(Code)(Java Doc) final public void deinit() throws IllegalStateException, DeinitializationException(Code)(Java Doc) protected void deinitImpl() throws Throwable(Code)(Java Doc) final public State getState()(Code)(Java Doc) final public void init(PropertyReader properties) throws IllegalStateException, MissingRequiredPropertyException, InvalidPropertyValueException, InitializationException(Code)(Java Doc) protected void initImpl(PropertyReader properties) throws MissingRequiredPropertyException, InvalidPropertyValueException, InitializationException(Code)(Java Doc) final public boolean isBootstrapped()(Code)(Java Doc) final public boolean isUsable()(Code)(Java Doc)
|
|
|