Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGUserAccess


       
        // Build hsql path
        String hsqlPath = de.innovationgate.webgate.api.hsql.WGDatabaseImpl.buildHsqlPath(db, path);
        path = "jdbc:hsqldb:" + hsqlPath;
       
        WGUserAccess userAccess = super.open(db, path, user, pwd, prepareOnly);
       
        if (userAccess.getAccessLevel() > WGDatabase.ACCESSLEVEL_NOACCESS && db.getCreationOptions().containsKey(de.innovationgate.webgate.api.hsql.WGDatabaseImpl.COPTION_JDBCPORT)) {
            try {
                int port = Integer.parseInt((String) db.getCreationOptions().get(de.innovationgate.webgate.api.hsql.WGDatabaseImpl.COPTION_JDBCPORT));
                _hsqlServer = new HsqlJDBCServer(hsqlPath, port);
                WGFactory.getLogger().info("JDBC Server for HSQL database '" + db.getDbReference() + "' started on port " + _hsqlServer.getPort());
            }
View Full Code Here


            WGFactory.getLogger().info("Initializing empty database " + db.getDbReference() + " as a WGA Content Store");
            initializeContentStore(jdbcPath, user, pwd, null, false);
        }
       
       
        WGUserAccess userAccess = super.open(db, jdbcPath, user, pwd, prepareOnly);
       
        // In case of success
        if (userAccess.getAccessLevel() > WGDatabase.ACCESSLEVEL_NOACCESS) {
           
            // When the database gets connected we try to import the backed up pre5 database
            if (migrateToCS5) {
                db.onConnect(new ImportPre5ConnectAction(importSource));
            }
View Full Code Here

       
        // Build hsql path
        String hsqlPath = de.innovationgate.webgate.api.hsql.WGDatabaseImpl.buildHsqlPath(db, path);
        path = "jdbc:hsqldb:" + hsqlPath;
       
        WGUserAccess userAccess = super.open(db, path, user, pwd, prepareOnly);
       
        if (userAccess.getAccessLevel() > WGDatabase.ACCESSLEVEL_NOACCESS && db.getCreationOptions().containsKey(de.innovationgate.webgate.api.hsql.WGDatabaseImpl.COPTION_JDBCPORT)) {
            try {
                int port = Integer.parseInt((String) db.getCreationOptions().get(de.innovationgate.webgate.api.hsql.WGDatabaseImpl.COPTION_JDBCPORT));
                _hsqlServer = new HsqlJDBCServer(hsqlPath, port);
                WGFactory.getLogger().info("JDBC Server for HSQL database '" + db.getDbReference() + "' started on port " + _hsqlServer.getPort());
            }
View Full Code Here

  /**
   * @throws WGBackendException
   * @see de.innovationgate.webgate.api.WGDatabaseCore#openSession(String, String)
   */
  public WGUserAccess openSession(AuthenticationSession authSession, Object pwd, boolean master) throws WGBackendException {
      return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_READER);
  }
View Full Code Here

        if (hqlType != null) {
            _hqlLazyByDefault = hqlType.equals(HQL_FETCHTYPE_LAZY);
        }
       
        // open session
        WGUserAccess accessLevel;
        try {
            accessLevel = openSession(MasterLoginAuthSession.getInstance(), pwd, true);
        }
        catch (WGUnavailableException e) {
            throw new WGInvalidDatabaseException("Error opening initial session", e);
        }
        catch (WGBackendException e) {
            throw new WGInvalidDatabaseException("Error opening initial session", e);
        }
        if (accessLevel.getAccessLevel() <= WGDatabase.ACCESSLEVEL_NOACCESS) {
            try {
                close();
            }
            catch (WGBackendException e1) {
                WGFactory.getLogger().error(e1);
View Full Code Here

            }

            if (master) {
                // Master login always has manager access
                getSessionStatus().setUserDetails(new WGUserDetails(WGDatabase.ACCESSLEVEL_MANAGER, WGDatabase.MASTER_USERNAME ,"(None)", null, null, null, null, null, true, true));
                return new WGUserAccess(WGDatabase.MASTER_USERNAME, WGDatabase.ACCESSLEVEL_MANAGER);
            }

            // Determine access
            WGUserDetails userDetails;
            try {
View Full Code Here

    _path = path;

    // Initialize
    _specs = init(db, path);
    if (_specs == null) {
      return new WGUserAccess(WGDatabase.ANONYMOUS_USER, WGDatabase.ACCESSLEVEL_NOTLOGGEDIN);
    }
   
    // Init fake language
    _fakeLanguage = (String) db.getCreationOptions().get(COPTION_LANGUAGE);
    if (_fakeLanguage == null) {
View Full Code Here

   * @see de.innovationgate.webgate.api.WGDatabaseCore#openSession(java.lang.String, java.lang.String)
   */
  public WGUserAccess openSession(AuthenticationSession authSession, Object pwd, boolean master) throws WGAPIException {
   
    if (master && !_specs.isUseMasterLogin()) {
      return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_READER);
    }
   
        String pwdStr = (String) pwd;
       
    int accLevel;
    try {
      accLevel = login(authSession.getDistinguishedName(), pwdStr);
    }
    catch (WGAuthorisationException e) {
      return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_NOTLOGGEDIN);
    }
    catch (WGAPIException e) {
      WGFactory.getLogger().error("Error opening scs session", e);
      return new WGUserAccess(authSession.getDistinguishedName(), WGDatabase.ACCESSLEVEL_NOTLOGGEDIN);
    }
    if (accLevel > WGDatabase.ACCESSLEVEL_NOACCESS) {
      userName.set(authSession.getDistinguishedName());
    }
    return new WGUserAccess(authSession.getDistinguishedName(), accLevel);
  }
View Full Code Here

    }
    else if (name.startsWith("user")) {
        return getDatabaseUserMetaData(db().getSessionContext().getUserAccess(), name, originalName);
    }
    else if (name.startsWith("original_user")) {
        WGUserAccess userAccess = getoriginaluserdata();
        if (userAccess != null) {
            return getDatabaseUserMetaData(userAccess, name.substring(9), originalName.substring(9));
        }
        else {
            return null;
View Full Code Here

    this.enclosingDB = db;
    this.path = path;
    this.user = user;
    this.pwd = pwd;
    this.openingTime = new Date();
    return new WGUserAccess(WGDatabase.MASTER_USERNAME, WGDatabase.ACCESSLEVEL_MANAGER);
  }
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGUserAccess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.