sav.z
Class Session

java.lang.Object
  extended bysav.z.Session
All Implemented Interfaces:
sav.outfit.Lexis

public class Session
extends java.lang.Object
implements sav.outfit.Lexis

Is a central class executing Zigzag scripts. Session object provides connection with Zigzag database and variables. Via Session the Base, Variable, Printer and Status objects are created. Session is used to analyze and execute Zigzag Scripts. Session keeps Report and Warnings (Errors and Failures) as results of Zigzag Script execution. Session synchronizes execution. It is usual practice to associate one Session with one database and one user (or thread).

Following is a complete simple example of using Zigzag request and Zigzag description. If request has been unsuccessful, program initiates description. Description (or writing new relations) is easy, and Database schema is formed automatically.

  import sav.z.*;
  public class SessionDemo extends Session {
    public static void main(String arg[]) {
      SessionDemo ss = new SessionDemo("Users");
      System.out.println("Requesting...");
      String result = ss.request("User:ann1");
      if (result.length() == 0) {
        System.out.println("Describing...");
        ss.describe("User:ann1", "Password:111111");
        result = ss.request("User:ann1");
      }
      System.out.println(result);
    }
    SessionDemo(String dbPath) {
      super();
      z("$base \"" + dbPath + "\"");
    }
    String request(String object) {
      z("= " + object + ";");
      return report();
    }
    public describe(String object, String attributes) {
      z(object + "(" + attributes + ") =;");
    }
  }
 
One thread may service one or several Sessions. One Session may provide connection with distinct databases but only in a some sequence. To work with several distinct databases simultaneously, a simple solution is to create several Sessions.

Following two equal examples illustrate the use of Zigzag multitude variable "$var owners" and data base "$base Users". Firstly, Zigzag script opens the "Owners" database and selects values of "Owner" Zigzag class into the "$owners" variable. Then the "Users" database is explored, namely some values of "User" Zigzag class, equal to "Owner" values, are printed.

So let's look at the first variant using Zigzag script.

  String script =
  "$print(OWNER USERS - first variant);\n" +
  "= $base 'Owners';\n" +
  "$owners = Owner/;\n" +
  "= $base 'Users';\n" +
  "$print(User/$owners);"
  ;
  Session ss = new Session();
  ss.z(script);
  System.out.println(ss.report());
 
Below is a second variant based on this API, namely on Variable and Base Java classes.
  System.out.println("OWNER USERS - second variant");
  ss.exploreBase("Owners");
  ss.z("$owners = Owner/;");
  Variable owners = ss.var("owners");
  ss.closeBase();
  Base users = ss.exploreBase("Users");
  for (String owner = owners.first(); owner != null; owner = owners.next()) {
    if (users.has("User", owner))
      System.out.println(owner);
  }
  ss.close();
  owners.clear();
 
Databases may be opened as in modifiable so in non-modifiable (explore) mode. When a few Sessions (threads) perform connection with one database file, they will run faster if the databases have non-modifiable (explore) mode. Modifying session locks other sessions. In this case sessions work in asynchronous regime. The Sav Zigzag provides support of multi-connection to local databases from threads produced on one JVM.

See Also:
Script, Warning, Printer, Status, LineStatus

Field Summary
 
Fields inherited from interface sav.outfit.Lexis
BASE, BRACE, BRACE_TERM, BRACKET, BRACKET_TERM, CATEGORY, COLON, COMMA, DECLARATION, DECLARED, DESCRIPTIVE, DEVS, DIVIDE, ELLIPSIS, EQUALITY, EXTRACTION, FILE, FILED, FUNCTION, INEQUALITY, INTERNAL, KEYS, LEFT_SLASH, MDERIVABLE, NONE, NUMBER, P1, P2, PARENTHESIS, PARENTHESIS_TERM, POINT, PROCEDURE, QUOTE, RANGE, REVERSE_SOLIDUS, SPACE, SPECIFICATION, STRING, TERMINATION, VARIABLE, VDERIVABLE, VERTICAL_LINE, WORD
 
Constructor Summary
Session()
          Constructs a Session.
Session(java.lang.String rootPath)
          Constructs a Session with root directory path that will be concatenated to relative file name.
 
Method Summary
 void analyse(Script scr)
          Analyzes syntax of a Script within a Session context.
 Base base()
          Constructs a Base object for the current Session's database.
 Base base(int category)
          Constructs a Base object of the current Session's database for navigation through category values.
 void clearBase()
          Deletes the contents of Session's current database and sets up it as modifiable .
 void clearBase(java.lang.String path)
          Deletes the contents of Session's path database and sets up it as modifiable .
 void clearDataBaseStatus()
          Clears Status used to determine a current Session's database.
 void clearDataLineStatus()
          Clears LineStatus used to determine current line of a processed (read or printed) out data text.
 void clearErrors()
          Clears list of Errors in a Session.
 void clearFailures()
          Clears list of Failures in a Session.
 void clearMessagePrinter()
          Clears Printer the Warning messages are prented via.
 void clearProcessStatus()
          Clears process Status used to determine a current Session's process.
 void clearReportPrinter()
          Clears current Printer used for reporting by Zigzag print procedure or Zigzag request statement.
 void clearScriptLine()
          Clears a current Script line number.
 void clearScriptLineStatus()
          Clears LineStatus used to determine a current line of a processed (executed or analyzed) Script.
 void clearWarnings()
          Clears list of Warnings (Errors and Failures) in a Session.
 void close()
          Completes session.
 void closeBase()
          Closes the Session's current database.
 void closeBase(java.lang.String path)
          Closes the Session's path database.
 void closeBases()
          Closes all the databases opened in this Session.
 void closeVar(java.lang.String name)
          Closes Zigzag's variable.
 int countErrors()
          Counts Errors of a Session.
 int countFailures()
          Counts Failures of a Session.
 int countWarnings()
          Counts Warnings of a Session.
 Statement curStatement()
          Returns a current executed/analyzed Statement or Statement at that Session makes Exception.
 Error[] errors()
          Returns array of Errors produced by Script analysis.
 void execute(Script scr)
          Executes a Script within a Session context.
 Base exploreBase()
          Sets up the Session's current database as readable.
 Base exploreBase(java.lang.String path)
          Sets up the Session's path database as readable.
 Failure[] failures()
          Returns array of Failures produced by Script execution.
 Commutator getCommutator()
          Returns Session's Commutator, which permits to interrupt current process.
 java.lang.Object getContext()
          Returns context object.
 Status getDataBaseStatus()
          Returns Status used to determine a current Session's database.
 LineStatus getDataLineStatus()
          Returns LineStatus used to determine a current line of a processed (read or printed) out data text.
 Printer getMessagePrinter()
          Returns Printer the Warning messages are printed via.
 Status getProcessStatus()
          Returns process Status used to determine a current Session's process.
 Printer getReportPrinter()
          Returns Printer used for reporting by Zigzag print procedure or Zigzag request statement.
 int getScriptLine()
          Returns a current Script line number.
 LineStatus getScriptLineStatus()
          Returns LineStatus used to determine a current line of a processed (executed or analyzed) Script.
 boolean hasErrors()
          Tests to see if Session has Errors.
 boolean hasFailures()
          Tests to see if Session has Failures.
 boolean hasWarnings()
          Tests to see if Session has Warnings.
 void hideScriptStatus(boolean yes)
          Hides statuses for z scripts: current process, and current line.
 void initSpec()
          Initiates Zigzag specifications (default names of variables, procedures and others).
 boolean isEmptyLineReporting()
          Checks the setting of EmptyLineReporting regime.
 boolean isErrExcepted()
          Determines if ZException is produced in case of Error.
 boolean isFailExcepted()
          Indicates whether the ZException will be in case of Failure.
 int login(User user)
          Registers a user and determines User's access that is defined in the current Session's database.
 void modifyBase()
          Sets up the Session's current database as modifiable .
 void modifyBase(java.lang.String path)
          Sets up the Session's path database as modifiable.
 void openBase()
          Opens the Session's current database, if it was closed.
 void openBase(java.lang.String path)
          Opens the Session's path database, if it was closed.
 java.lang.String report()
          Returns string of the default report WStatus.
 java.lang.String rootPath()
          Returns root directory path for databases with relative name.
 void setCommutator(Commutator comm)
          Sets Commutator, which permits to interrupt current process.
 void setContext(java.lang.Object context)
          Sets context object.
 void setDataBaseStatus(Status stDataBase)
          Sets Status used to determine a current Session's database.
 void setDataLineStatus(LineStatus stDataLine)
          Sets LineStatus used to determine a current line of a processed (read or printed) out data text.
 void setEmptyLineReporting(boolean emptyLineReporting)
          Enables to print the ";" line when no object is printed.
 void setErrExcepted(boolean excepted)
          Sets up ZException in case of Error.
 void setFailExcepted(boolean excepted)
          Sets up ZException in case of Failure.
 void setMessagePrinter(Printer prtMessage)
          Sets Printer the Warning messages are printed via.
 void setProcessStatus(Status stProcess)
          Sets process Status used to determine a current Session's process.
 void setReportPrinter(Printer prtReport)
          Sets Printer for reporting by Zigzag print procedure or Zigzag request statement.
 void setScriptLine(int number)
          Sets up a current Script line number.
 void setScriptLineStatus(LineStatus stLine)
          Sets LineStatus used to determine a current line of a processed (executed or analyzed) Script.
 User user()
          Returns User, registered through the login(User).
 Variable var(java.lang.String name)
          Returns a Variable object corresponding to Zigzag's variable.
 Variable var(java.lang.String name, int category)
          Returns a Variable object corresponding to Zigzag's variable for navigation through category values.
 Warning[] warnings()
          Returns array of Warnings, namely Errors or Failures, produced by Script analysis or execution.
 int z(java.lang.String text)
          Executes a text of Zigzag script within a Session context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()
Constructs a Session.
  Session ss = new Session();
  ss.z("= $base Users");   //opens non-modifiable "Users.ass" database
 

See Also:
close()

Session

public Session(java.lang.String rootPath)
        throws java.io.IOException
Constructs a Session with root directory path that will be concatenated to relative file name.
  Session ss = new Session("/MyDirectory");
  ss.z("$base Users =");   //opens modifiable "/MyDirectory/Users.ass" database
 

See Also:
rootPath(), close()
Method Detail

rootPath

public java.lang.String rootPath()
Returns root directory path for databases with relative name.

See Also:
Session(String)

initSpec

public void initSpec()
              throws java.io.IOException
Initiates Zigzag specifications (default names of variables, procedures and others). Last method of example restores $pr as procedure name by default in place of $pr variable.
  ss.z("$var pr");
  ...
  ss.initSpec();
 

Throws:
java.io.IOException

z

public int z(java.lang.String text)
Executes a text of Zigzag script within a Session context. Context is formed by Zigzag specifications ("$var, $base, $..."), Printers, Statuses. If Warnings (Errors and Failures) are, the Session contents its.
  Session ss;
  String text;
  ...
  if (ss.z(text) <= 0) {
    Warning w[] = ss.warnings();
    ...
  }

 

Returns:
1 if text Script dose not have Warnings; 0 if failures; -1 if errors
See Also:
hasWarnings(), report()

analyse

public void analyse(Script scr)
Analyzes syntax of a Script within a Session context. Context is formed by Zigzag specification names ("$..."), message Printer, Statuses. Script is prepared for efficient execution multiple times. If Warnings (Errors) are, the Session and Script content its.
   Session ss;
   Script scr;
   ...
   ss.analyse(scr);
   if (scr.hasErrors())
   ...
 

See Also:
hasErrors(), execute(sav.z.Script)

execute

public void execute(Script scr)
Executes a Script within a Session context. Context is formed by Zigzag specifications ($var, $base, $"..."), Printers, Statuses. Script will be analyzed if it was not before, so it is prepared for efficient execution multiple times. If Warnings (Failures) are, the Session and Script content its.
   Session ss;
   Script scr;
   ...
   ss.execute(scr);
   if (scr.hasFailures())
   ...
 

See Also:
hasFailures(), analyse(sav.z.Script)

report

public java.lang.String report()
Returns string of the default report WStatus. The memory of the WStatus is realized after getting. The following example prints row with two fields, for instance "ann1; Ann". User and Name.
   Session ss;
   ...
   ss.z("$printTableRows(User:ann1, User, Name)");
   String result = ss.report();
 

See Also:
z(java.lang.String)

warnings

public Warning[] warnings()
Returns array of Warnings, namely Errors or Failures, produced by Script analysis or execution.

See Also:
hasWarnings()

errors

public Error[] errors()
Returns array of Errors produced by Script analysis.

See Also:
hasErrors()

failures

public Failure[] failures()
Returns array of Failures produced by Script execution.

See Also:
hasFailures()

hasWarnings

public boolean hasWarnings()
Tests to see if Session has Warnings.

See Also:
z(java.lang.String), warnings()

hasErrors

public boolean hasErrors()
Tests to see if Session has Errors.

See Also:
analyse(sav.z.Script), errors()

hasFailures

public boolean hasFailures()
Tests to see if Session has Failures.

See Also:
execute(sav.z.Script), failures()

countWarnings

public int countWarnings()
Counts Warnings of a Session.


countErrors

public int countErrors()
Counts Errors of a Session.


countFailures

public int countFailures()
Counts Failures of a Session.


clearWarnings

public void clearWarnings()
Clears list of Warnings (Errors and Failures) in a Session.


clearErrors

public void clearErrors()
Clears list of Errors in a Session.


clearFailures

public void clearFailures()
Clears list of Failures in a Session.


curStatement

public Statement curStatement()
Returns a current executed/analyzed Statement or Statement at that Session makes Exception.


setReportPrinter

public void setReportPrinter(Printer prtReport)
Sets Printer for reporting by Zigzag print procedure or Zigzag request statement.
  PrintWriter pw;
  ...
  Printer prt = new WPrinter(pw);
  ss.setReportPrinter(prt);
  ss.z("= User:");
  pw.close();
 


getReportPrinter

public Printer getReportPrinter()
Returns Printer used for reporting by Zigzag print procedure or Zigzag request statement.
  Printer prt = ss.getReportPrinter();
  prt.println("Report has been finished");
  prt.flush();
 


clearReportPrinter

public void clearReportPrinter()
Clears current Printer used for reporting by Zigzag print procedure or Zigzag request statement. So it sets up default string Printer for that we can use report().
   ...
   ss.clearReportPrinter();
   ss.z("= User:");
   String result = ss.report();
 


setMessagePrinter

public void setMessagePrinter(Printer prtMessage)
Sets Printer the Warning messages are printed via.
   PrintWriter pw = new PrintWriter(new FileWriter("Messages.log"));
   Printer prt = new WPrinter(pw);
   ss.setMessagePrinter(prt);
   ...
   pw.close();
   if (ss.hasErrors())
     System.out("See errors in Messages.log file");
 


getMessagePrinter

public Printer getMessagePrinter()
Returns Printer the Warning messages are printed via.


clearMessagePrinter

public void clearMessagePrinter()
Clears Printer the Warning messages are prented via.


setProcessStatus

public void setProcessStatus(Status stProcess)
Sets process Status used to determine a current Session's process.


getProcessStatus

public Status getProcessStatus()
Returns process Status used to determine a current Session's process.


clearProcessStatus

public void clearProcessStatus()
Clears process Status used to determine a current Session's process.


setScriptLineStatus

public void setScriptLineStatus(LineStatus stLine)
Sets LineStatus used to determine a current line of a processed (executed or analyzed) Script. Example prints executed text lines over 10 (only 1 number from 10).
  LineStatus ls = new ConsoleLineStatus(10);
  ss.setScriptLineStatus(ls);
  String text = 
    "User:ann1 (Name:Ann);\n" +
    "User:dan  (Name:Daniel);\n" +
    ...
  ;
  ss.z(text);
 


getScriptLineStatus

public LineStatus getScriptLineStatus()
Returns LineStatus used to determine a current line of a processed (executed or analyzed) Script.


clearScriptLineStatus

public void clearScriptLineStatus()
Clears LineStatus used to determine a current line of a processed (executed or analyzed) Script.


setDataLineStatus

public void setDataLineStatus(LineStatus stDataLine)
Sets LineStatus used to determine a current line of a processed (read or printed) out data text. Example prints table line numbers over 1000 (with 1000 interval). Out data is in the "<", ">" brackets.
  LineStatus ls = new ConsoleLineStatus(1000);
  ss.setDataLineStatus(ls);
  String text = 
    "User; Name  \n" +
    "ann1; Ann   \n" +
    "dan ; Daniel\n" +
     ...
  ;
  ss.z("$readTable()<\n" + text + ">");
 


getDataLineStatus

public LineStatus getDataLineStatus()
Returns LineStatus used to determine a current line of a processed (read or printed) out data text.


clearDataLineStatus

public void clearDataLineStatus()
Clears LineStatus used to determine current line of a processed (read or printed) out data text.


setDataBaseStatus

public void setDataBaseStatus(Status stDataBase)
Sets Status used to determine a current Session's database.


getDataBaseStatus

public Status getDataBaseStatus()
Returns Status used to determine a current Session's database.


clearDataBaseStatus

public void clearDataBaseStatus()
Clears Status used to determine a current Session's database.


setScriptLine

public void setScriptLine(int number)
Sets up a current Script line number.


getScriptLine

public int getScriptLine()
Returns a current Script line number.


clearScriptLine

public void clearScriptLine()
Clears a current Script line number.


setCommutator

public void setCommutator(Commutator comm)
Sets Commutator, which permits to interrupt current process.


getCommutator

public Commutator getCommutator()
Returns Session's Commutator, which permits to interrupt current process.


close

public void close()
           throws java.io.IOException
Completes session. Namely, it closes a Session's databases, clears Warnings. Below, $x will be the same after $x = b**, because of error in b** (x1 and x2 arrays will be equal). After close() all the databases are closed, error warnings are cleared, the x variable is not stored (x3 == null).
  Session ss = new Session();
  ss.exploreBase("Users");
  ss.z("$x = a");
  String x1[] = ss.var("x").array();
  ss.z("$x = b**");
  String x2[] = ss.var("x").array();
  if (ss.hasErrors()) {
    ss.close();
  }
  String x3[] = ss.var("x").array();
 
Note: A Session resources are automatically released in the course of garbage collection.

Throws:
java.io.IOException
See Also:
Session(), Session(String), closeBases()

setContext

public void setContext(java.lang.Object context)
Sets context object. Context may be useful for keeping informative parameters.

See Also:
getContext()

getContext

public java.lang.Object getContext()
Returns context object. Context may be useful for keeping informative parameters.

See Also:
setContext(java.lang.Object)

hideScriptStatus

public void hideScriptStatus(boolean yes)
Hides statuses for z scripts: current process, and current line. May be useful for auxiliary scripts.


openBase

public void openBase(java.lang.String path)
              throws java.io.IOException
Opens the Session's path database, if it was closed.

Throws:
java.io.IOException
See Also:
exploreBase(String), modifyBase(String), closeBase(String)

openBase

public void openBase()
              throws java.io.IOException
Opens the Session's current database, if it was closed.

Throws:
java.io.IOException
See Also:
openBase(String), exploreBase(), modifyBase(), closeBase()

exploreBase

public Base exploreBase(java.lang.String path)
                 throws java.io.IOException
Sets up the Session's path database as readable. The database is not modifiable. Simultaneously other sessions can read (use) the same database, but not modify. This method together with modifyBase() is basic mechanism for implementation of multithread and multi-user work in a server.
  Session ss = new Session();
  ss.exploreBase("Users");
  ss.z("= User:ann1");
  ss.z("= User:dan");
  ...
  ss.closeBase();
 
Note: In place of exploreBase("Users") the Zigzag expression ss.z("= $base Users") may be used. In this case database will be closed at end of each successful Script execution, so closeBase() is not needed.

Parameters:
path - pathname of a database
Throws:
java.io.IOException
See Also:
Base, modifyBase(String), closeBase(String)

exploreBase

public Base exploreBase()
                 throws java.io.IOException
Sets up the Session's current database as readable.

Throws:
java.io.IOException
See Also:
exploreBase(String), modifyBase(), closeBase()

modifyBase

public void modifyBase(java.lang.String path)
                throws java.io.IOException
Sets up the Session's path database as modifiable. This method together with exploreBase() is basic mechanism for implementation of multithread and multi-user work in a server.
  Session ss = new Session();
  ss.modifyBase("Users");
  ss.z("User:ann1 =");
  ss.z("User:dan =");
  ...
  ss.closeBase();
 
Note: In place of modifyBase("Users") the Zigzag expression ss.z("$base Users =") may be used. In this case database will be closed at end of each successful Script execution, so closeBase() is not needed.

Parameters:
path - pathname of a database
Throws:
java.io.IOException
See Also:
exploreBase(String), closeBase(String)

modifyBase

public void modifyBase()
                throws java.io.IOException
Sets up the Session's current database as modifiable .

Throws:
java.io.IOException
See Also:
modifyBase(String), exploreBase(), closeBase()

clearBase

public void clearBase(java.lang.String path)
               throws java.io.IOException
Deletes the contents of Session's path database and sets up it as modifiable .

Throws:
java.io.IOException
See Also:
exploreBase(String), modifyBase(String), closeBase(String)

clearBase

public void clearBase()
               throws java.io.IOException
Deletes the contents of Session's current database and sets up it as modifiable .

Throws:
java.io.IOException
See Also:
clearBase(String), exploreBase(), modifyBase(), closeBase()

closeBase

public void closeBase()
               throws java.io.IOException
Closes the Session's current database.
  Session ss = new Session();
  ss.modifyBase("Users");
  ...
  ss.closeBase();
 
Note: Closed database may be opened repeatedly.

Throws:
java.io.IOException
See Also:
exploreBase(), exploreBase(String), modifyBase(), modifyBase(String), openBase(), openBase(String)

closeBase

public void closeBase(java.lang.String path)
               throws java.io.IOException
Closes the Session's path database.
  Session ss = new Session();
  ss.modifyBase("Users");
  ss.exploreBase("Owners");
  ...
  ss.closeBase("Users");
  ...
 
Note: Closed database may be opened repeatedly.

Throws:
java.io.IOException
See Also:
exploreBase(), exploreBase(String), modifyBase(), modifyBase(String), openBase(), openBase(String)

closeBases

public void closeBases()
                throws java.io.IOException
Closes all the databases opened in this Session.

Throws:
java.io.IOException
See Also:
closeBase()

var

public Variable var(java.lang.String name)
             throws java.io.IOException
Returns a Variable object corresponding to Zigzag's variable. Following example retrieves values of department.
  Session ss = new Session();
  ...
  ss.z("$x = department/");
  Variable x = ss.var("x");
 

Throws:
java.io.IOException
See Also:
closeVar(String), Variable

var

public Variable var(java.lang.String name,
                    int category)
             throws java.io.IOException
Returns a Variable object corresponding to Zigzag's variable for navigation through category values. The category may be PN.SIMPLE or PN.COMPLEX. In example below the value is simple name department, the value1 is department:'software support'
  Session ss = new Session();
  ss.z("$x = department:'software support'");
  String value = ss.var("x", PN.SIMPLE).value();
  String value1 = ss.var("x", PN.COMPLEX).value();
  ss.close();
 

Throws:
java.io.IOException
See Also:
closeVar(String), Variable

closeVar

public void closeVar(java.lang.String name)
              throws java.io.IOException
Closes Zigzag's variable. Really it removes a record in a Session's Hashtable of variables. Correspondent Variable may be used meantime. Following example transfers all the department values in a Vector. Last statements x.clear() and x = null enables to free memory before garbage collection by JVM.
  Session ss = new Session();
  ...
  ss.z("$x = department/");
  Variable x = ss.var("x");
  Vector v = x.values();
  ss.closeVar("$x");
  x.clear();
  x = null;
 

Throws:
java.io.IOException
See Also:
var(String), Variable

base

public Base base()
Constructs a Base object for the current Session's database.
  Session ss = new Session();
  ss.exploreBase("CompanyX");
  ...
  Base base = ss.base();
 

See Also:
Base, exploreBase(java.lang.String), modifyBase(java.lang.String)

base

public Base base(int category)
Constructs a Base object of the current Session's database for navigation through category values. The category may be PN.SIMPLE or PN.COMPLEX. In example below the value is simple name programmer, the value1 is programmer:'Smit'.
  Session ss = new Session();
  ss.modifyBase("CompanyX");
  ss.z("worker:programmer:'Smit' =;");
  ss.exploreBase();
  String value = ss.base(PN.SIMPLE).value("worker");
  String value1 = ss.base(PN.COMPLEX).value("worker");
  ss.close();
 

See Also:
Base, exploreBase(java.lang.String), modifyBase(java.lang.String), base()

setEmptyLineReporting

public void setEmptyLineReporting(boolean emptyLineReporting)
Enables to print the ";" line when no object is printed. For example if ss.z("$printTable(A:)") and A isn't in database, then result string of ss.report() will be ";".

See Also:
report()

isEmptyLineReporting

public boolean isEmptyLineReporting()
Checks the setting of EmptyLineReporting regime.

See Also:
setEmptyLineReporting(boolean)

setErrExcepted

public void setErrExcepted(boolean excepted)
Sets up ZException in case of Error. In case of excepted = false exception is not executed and program continues to work.

See Also:
Error

isErrExcepted

public boolean isErrExcepted()
Determines if ZException is produced in case of Error.

See Also:
Error, setErrExcepted(boolean)

setFailExcepted

public void setFailExcepted(boolean excepted)
Sets up ZException in case of Failure. By default excepted = false and program may execute another scripts, irrespective of found data.

See Also:
Failure

isFailExcepted

public boolean isFailExcepted()
Indicates whether the ZException will be in case of Failure.

See Also:
Failure, setFailExcepted(boolean)

login

public int login(User user)
          throws java.io.IOException
Registers a user and determines User's access that is defined in the current Session's database. The User's access is defined as role via database relation $User ($Password, $Role). If database does not have such relation, this method returns User.ADMIN access. This method is intended for the advanced developers.

Throws:
java.io.IOException
See Also:
User, User.access()

user

public User user()
Returns User, registered through the login(User).