com.tensegrity.palowebviewer.modules.engine.client
Interface IEngineService

All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService
All Known Implementing Classes:
EngineService

public interface IEngineService
extends com.google.gwt.user.client.rpc.RemoteService

Interface for communication with server


Method Summary
 java.lang.Boolean authenticate(java.lang.String login, java.lang.String password, boolean remember)
          This method authenticates the user.
 boolean checkExistance(XPath path)
          This methods checks existance of objects, specified via path.
 boolean checkExistance(XPath contextPath, java.lang.String elementName)
          More specified version of checkExistance(XPath) : it checks existance by name in some context.
 void forceReload()
          forces reload of all connection pools, e.g.
 IClientProperties getClientProperties()
          Retuns client properties from server.
 XElement[] getParentsOf(XPath contextPath, java.lang.String elementName)
          This method returns parents elements in element hierarchy for particular element.
 java.lang.Boolean isAuthenticated()
          Checks if user is already authenticated.
 XObject loadChild(XPath path, java.lang.String childId, int type)
          This methods loads single child specified by path to parend, id and type
 XObject loadChildByName(XPath path, java.lang.String name, int type)
           
 XObject[] loadChildren(XPath path, int type)
          This method loads all children (XObjects) of type of object specified by path.
 XDefaultView loadDefaultView(XPath path)
          This method constructs "default view", i.e.
 XFolder loadFavoriteViews()
          Loads favorite views from server.
 void logoff()
          Log off from the server.
 XResult[] query(XQueryPath[] paths)
          This method returns data for cube, specified by query.
 java.lang.String saveView(XViewPath viewPath)
          This method updates view if the one already exists and adds view otherwise.
 void updateData(XPath cubePath, IXPoint point, IResultElement value)
          This method sets value of some cell of cube pointed by point
 

Method Detail

isAuthenticated

java.lang.Boolean isAuthenticated()
Checks if user is already authenticated. If not, tries to do that via cookies.

If authentication succeed cookies max age setted up to 1 month.

Returns:
true, is authentication succeed.

authenticate

java.lang.Boolean authenticate(java.lang.String login,
                               java.lang.String password,
                               boolean remember)
                               throws InternalErrorException
This method authenticates the user.

Parameters:
login - - user login. Can't be null.
password - - user password. Can't be null.
remember - - remember user and password hash in cookies.
Returns:
true, if authentication succeed.
Throws:
AuthenticationError - if something fatal-like occurred.
InternalErrorException

logoff

void logoff()
Log off from the server. The cookies are NOT DELETED, i.e. when user types application url the next time #authenticate() will return TRUE.


getParentsOf

XElement[] getParentsOf(XPath contextPath,
                        java.lang.String elementName)
                        throws InvalidObjectPathException
This method returns parents elements in element hierarchy for particular element.

Parameters:
contextPath - defines context of element hierarcy. Can point only to dimension or subset. Can't be null.
elementName - element name. Can't be null.
Returns:
array of ancestors elements.
Throws:
InvalidObjectPathException - if 1. contextPath is invalid; 2. contextPath doesn't point to dimension or subset. 3. element with elementName can't be found.

loadDefaultView

XDefaultView loadDefaultView(XPath path)
                             throws InvalidObjectPathException
This method constructs "default view", i.e. when user opens cube (e.g. first two dimensions are col- and row-axices etc.)

Parameters:
path - points to cube. Can't be null.
Returns:
constructed default view.
Throws:
InvalidObjectPathException - if path it invalid or it doen't point to cube.

loadChildren

XObject[] loadChildren(XPath path,
                       int type)
                       throws InvalidObjectPathException
This method loads all children (XObjects) of type of object specified by path.

Parameters:
path - for object. Can't be null.
type - specifies chilren type. IXConsts. If object has only one chilren type, type param have to be ingnored.
Returns:
children array.
Throws:
InvalidObjectPathException - will be thrown if path is wrong if type is wrong program behavior is unpredicted (e.g. runtime exception will be thrown)

checkExistance

boolean checkExistance(XPath path)
This methods checks existance of objects, specified via path.

Parameters:
path - for object. Can't be null.
Returns:
true, if object defined via path exists; and false otherwise

checkExistance

boolean checkExistance(XPath contextPath,
                       java.lang.String elementName)
                       throws InvalidObjectPathException
More specified version of checkExistance(XPath) : it checks existance by name in some context.

Parameters:
contextPath - context path (currently: dimension/subset)
elementName - element name
Returns:
true, if element exists, false otherwise
Throws:
InvalidObjectPathException - if contextPath is invalid or not points to dimension/subset

query

XResult[] query(XQueryPath[] paths)
                throws InvalidObjectPathException
This method returns data for cube, specified by query. @{link XResult} This is batch version of query, e.g. it returs data for array of paths.

Assumption: all paths points to one server. Otherwise behavior is unpredicted (runtime exception will be thrown).

Parameters:
paths - - array of requests XQueryPath. It can't be null.
Returns:
array of results.
Throws:
InvalidObjectPathException - is thrown if one of paths doesn't points to cube or is invalid.

updateData

void updateData(XPath cubePath,
                IXPoint point,
                IResultElement value)
                throws InvalidObjectPathException
This method sets value of some cell of cube pointed by point

Parameters:
cubePath - points to target cube
point - contains coordinates of point. @{link IXPoint}
value - of the point.
Throws:
InvalidObjectPathException - if cubePath is not valid path.

saveView

java.lang.String saveView(XViewPath viewPath)
                          throws InvalidObjectPathException
This method updates view if the one already exists and adds view otherwise.

Parameters:
viewPath - defines the view. @{link XViewPath}.
Returns:
id of saved or newly created view
Throws:
InvalidObjectPathException - one of paths in viewPath is invalid.

forceReload

void forceReload()
forces reload of all connection pools, e.g. all opened connections are marked to be reload. They will be actualy reloaded on the next use (e.g. query, updateData etc.)


getClientProperties

IClientProperties getClientProperties()
Retuns client properties from server.

Returns:
client properties.

loadFavoriteViews

XFolder loadFavoriteViews()
Loads favorite views from server.

Returns:
root folder of all favorite views. @{link XFolder}

loadChild

XObject loadChild(XPath path,
                  java.lang.String childId,
                  int type)
                  throws InvalidObjectPathException
This methods loads single child specified by path to parend, id and type

Parameters:
path - poinst to parent object.
childId - child identificator
type - child type.
Returns:
loaded child. Null if child can't be found.
Throws:
InvalidObjectPathException - if path is invalid.

loadChildByName

XObject loadChildByName(XPath path,
                        java.lang.String name,
                        int type)
                        throws InvalidObjectPathException
Throws:
InvalidObjectPathException