Package org.palo.api

Examples of org.palo.api.Connection


            ///tries to get cube
            if(a.getUser().getLoginName().equals(accountName)){
              if(a.getConnection().getName().equals(connection)){
                //use cube name
                accountId = a.getId();
                Connection con = ((PaloAccount) a).login();
                for (Database db: con.getDatabases()) {
                  int connectionType = db.getConnection().getType();
                  Cube c = db.getCubeByName(cubeName);
                  if(c != null){
                    cube = c;
                    //((PaloAccount) a).logout();
View Full Code Here


    ConnectionConfiguration cfg =
      ConnectionFactory.getInstance().getConfiguration(psd.host, psd.port, user, pass);
    cfg.setTimeout(120000);
    cfg.setLoadOnDemand(true);
    try {
      Connection con = ConnectionFactory.getInstance().newConnection(cfg);
      Database db = con.getDatabaseByName("Config");
      if (db != null) {
        Cube c = db.getCubeByName("#_connections");
        if (c != null) {
          Dimension conDim = c.getDimensionByName("connections");
          Dimension conAttribDim = c.getDimensionByName("#_connections_");
View Full Code Here

    ConnectionConfiguration cfg =
      ConnectionFactory.getInstance().getConfiguration(psd.host, psd.port, user, pass);
    cfg.setTimeout(120000);
    cfg.setLoadOnDemand(true);
    try {
      Connection con = ConnectionFactory.getInstance().newConnection(cfg);
      Database db = con.getDatabaseByName("Config");
      if (db != null) {
        return parsePaloStudioConnectionData(user, pass, psd.host, psd.port, db, viewId, log, data, locale);
      } else {
        log.error("No configuration database found...", new NullPointerException());
        return null;
View Full Code Here

  }
  private final boolean doCreateDefaultView(XView xView) {
    return xView.getId() == null;
  }
  private final synchronized Cube getCube(XView xView, String sessionId) {
    Connection paloConnection = getConnection(xView.getAccountId(), sessionId);
    Database database = paloConnection.getDatabaseById(xView.getDatabaseId());
    return database.getCubeById(xView.getCubeId());
  }
View Full Code Here

    Account account = adminService.getAccountById(accountId);
    return ((PaloAccount) account).login();
    */
    Account account = getAccount(accountId);
    if (account instanceof PaloAccount) {
      Connection con = null;
      ServerConnectionPool pool = ConnectionPoolManager.getInstance().
        getPool(account, sessionId);
      con = pool.getConnection("WPaloCubeViewConverter.getConnection")
      return con;
    }
View Full Code Here

      if (accounts != null && !accounts.isEmpty()) {
        for (Account acc: accounts) {
          if (acc.getConnection().getId().equals(xCon.getId())) {
            if (acc instanceof PaloAccountImpl) {
              ServerConnectionPool pool = ConnectionPoolManager.getInstance().getPool(acc, sessionId);
              Connection con = pool.getConnection("getCubes");
              ((PaloAccountImpl) acc).setConnection(con);
              for (Database db: con.getDatabases()) {
                if (db.getId().equals(xDb.getId())) {
                  List <XCube> cubes = new ArrayList<XCube>();
                  for (Cube c: db.getCubes()) {
                    if (c.getType() != Cube.TYPE_ATTRIBUTE &&
                      c.getType() != Cube.TYPE_SYSTEM &&
View Full Code Here

      List <Account> accounts = MapperRegistry.getInstance().getAccountManagement().getAccounts(loggedInUser);
      if (accounts != null && !accounts.isEmpty()) {
        for (Account acc: accounts) {
          if (acc.getConnection().getId().equals(xCon.getId())) {
            if (acc instanceof PaloAccountImpl) {
              Connection con = null;
              try {
                ServerConnectionPool pool = ConnectionPoolManager.getInstance().getPool(acc, sessionId);
                 con = pool.getConnection("getDatabases");
                ((PaloAccountImpl) acc).setConnection(con);
              } catch (Throwable t) {
                ConnectionPoolManager.getInstance().disconnect(acc, sessionId, "getDatabases");
                throw new DbOperationFailedException(t.getMessage());
              }
              List <XDatabase> databases = new ArrayList<XDatabase>();
              for (Database db: con.getDatabases()) {
                if (db.getType() != Database.TYPE_SYSTEM &&
                  db.getType() != Database.TYPE_ATTRIBUTE &&
                  db.getType() != Database.TYPE_USER_INFO &&
                  !db.getName().startsWith("#")) {
                  databases.add((XDatabase) XConverter.createX(db));
View Full Code Here

  }

  private final XObject[] load(XAccount xAccount, AuthUser user, String sessionId) {
    try {
      String accountId = xAccount.getId();
      Connection paloConnection = getConnectionForAccount(accountId, user, sessionId);
      if(paloConnection != null) {
        if (paloConnection.getType() == Connection.TYPE_HTTP) {
          paloConnection.clearCache();
        }
        Database[] databases = paloConnection.getDatabases();
        List<XObject> xDatabases = new ArrayList<XObject>();
        for(Database database : databases) {
          if(isValid(database)) {
            XObject xDatabase = XConverter.createX(database, xAccount.getId());
            xDatabases.add(wrap(xDatabase));
View Full Code Here

    }
    return view;
  }
 
  private final Database getDatabase(XDatabase xDatabase, AuthUser user, String sessionId) {
    Connection paloConnection = getConnectionForAccount(xDatabase
        .getAccountId(), user, sessionId);
    if (paloConnection != null)
      return paloConnection.getDatabaseById(xDatabase.getId());
    return null;
  }
View Full Code Here

      account = getAccount(accountId, user);
    if (account instanceof PaloAccount) {
//      ((PaloAccount) account).login();
      ServerConnectionPool pool =
        ConnectionPoolManager.getInstance().getPool(account, sessionId);
      Connection con = pool.getConnection("ViewImporterTreeLoader.getConnectionForAccount");
      ((PaloAccountImpl) account).setConnection(con);
      return con;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.palo.api.Connection

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.