================================================================================================================
432657
@GET
	@Path("/{keyspace}/{columnFamily}")
	@Produces({ "application/json" })
	public JSONArray getColumnFamily(@PathParam("keyspace") String keyspace,
			@PathParam("columnFamily") String columnFamily,
			@QueryParam("q") String query,
			@HeaderParam(CONSISTENCY_LEVEL_HEADER) String consistencyLevel) throws Exception {
		if (logger.isDebugEnabled())
			logger.debug("Listing column family [" + keyspace + "]:[" + columnFamily + "]");
		logger.debug("STORAGE [" + getCassandraStorage() + "]");
		logger.debug("CONFG [" +config + "]");
		
		return getCassandraStorage().getRows(keyspace, columnFamily, query, config.getConsistencyLevel(consistencyLevel));
	}
1051183
public function init()
    {
        $this->createTableSQLCollector->init();
        $this->dropTableSQLCollector->init();
        $this->alterTableSQLCollector->init();

        $this->dropSequenceQueries = array();
        $this->dropViewQueries = array();
        $this->createViewQueries = array();
        $this->createSequenceQueries = array();
        $this->renameSchemaQueries = array();
    }
729579
void upd_database(AttributeConfig conf,String dev_name) throws DevFailed
	{
		Util.out4.println("Entering upd_database method for attribute " + name);
		
		DbAttribute	db_attr = new DbAttribute(name);

		// Check if each attribute property is not the default value. Only properties
		// not having the default value will be sent to the database
		if (conf.description.equals(Tango_DescNotSpec) != true)
			db_attr.add("description", new String[] {conf.description});
	
		if (conf.label.equals(Tango_LabelNotSpec) != true)
			db_attr.add("label", new String[] {conf.label});
	
		if (conf.unit.equals(Tango_UnitNotSpec) != true)
			db_attr.add("unit", new String[] {conf.unit});
	
		if (conf.standard_unit.equals(Tango_StdUnitNotSpec) != true)
			db_attr.add("standard_unit", new String[] {conf.standard_unit});

		if (conf.display_unit.equals(Tango_DispUnitNotSpec) != true)
			db_attr.add("display_unit", new String[] {conf.display_unit});

		if (conf.format.equals(Tango_FormatNotSpec) != true)
			db_attr.add("format", new String[] {conf.format});

		if (conf.min_value.equals(Tango_AlrmValueNotSpec) != true)
			db_attr.add("min_value", new String[] {conf.min_value});

		if (conf.max_value.equals(Tango_AlrmValueNotSpec) != true)
			db_attr.add("max_value", new String[] {conf.max_value});

		if (conf.min_alarm.equals(Tango_AlrmValueNotSpec) != true)
			db_attr.add("min_alarm", new String[] {conf.min_alarm});
	
		if (conf.max_alarm.equals(Tango_AlrmValueNotSpec) != true)
			db_attr.add("max_alarm", new String[] {conf.max_alarm});

		// Update db only if needed
		if (db_attr.size()>0)
		{		
			Util.out4.println(db_attr.size() + " properties to update in db");
			ApiUtil.get_db_obj().put_device_attribute_property(dev_name, db_attr);
		}
						
		Util.out4.println("Leaving upd_database method");
	}
1079014
public void addTangoDataReadyListener(ITangoDataReadyListener listener, String attrName, String[] filters, boolean stateless)
            throws DevFailed {
        TangoDataReady tangoDataReady;
        String key = deviceName+"/"+attrName;
        if ((tangoDataReady = tango_data_ready_source.get(key)) == null) {
            tangoDataReady = new TangoDataReady(deviceProxy, attrName, filters);
            tango_data_ready_source.put(key, tangoDataReady);
        }

        synchronized (moni) {
            tangoDataReady.addTangoDataReadyListener(listener, stateless);
        }
    }
833317
public function run(): void
    {
        if ('' === (string)$this->catName) {
            throw new \RuntimeException('You must call setCatName before running this action');
        }
        if ('' === (string)$this->name) {
            throw new \RuntimeException('You must call setName before running this action');
        }
        $this->fakerDataCreator->setCatName($this->catName)->setName($this->name)->createTargetFileObject()->write();
        $this->interfaceCreator->setCatName($this->catName)->setName($this->name)->createTargetFileObject()->write();
        $this->hasInterfaceCreator->setCatName($this->catName)->setName($this->name)->createTargetFileObject()->write();
        $this->embeddableCreator->setCatName($this->catName)->setName($this->name)->createTargetFileObject()->write();
        $this->hasCreator->setCatName($this->catName)->setName($this->name)->createTargetFileObject()->write();
    }
572983
public void restart(final String dev_name) throws DevFailed {
        Util.out4.println("In DServer.restart(" + dev_name + ") method");
        //
        // Check if the wanted device exists in each class
        //

        final Util tg = Util.instance();
        Vector dev_list = tg.get_device_list_by_class(((DeviceClass) class_list.elementAt(0))
                .get_name());
        final int nb_class = class_list.size();
        int i, j, nb_dev;
        DeviceImpl dev_to_del = null;
        DeviceClass dev_cl = null;

        j = 0;
        for (i = 0; i < nb_class; i++) {
            dev_list = tg.get_device_list_by_class(((DeviceClass) class_list.elementAt(i))
                    .get_name());
            nb_dev = dev_list.size();
            for (j = 0; j < nb_dev; j++) {
                if (((DeviceImpl) dev_list.elementAt(j)).get_name().equals(dev_name) == true) {
                    // Get device & class reference
                    dev_to_del = (DeviceImpl) dev_list.elementAt(j);
                    dev_cl = (DeviceClass) class_list.elementAt(i);
                    break;
                }
            }
            if (dev_to_del != null && dev_cl != null) {
                break;
            }
        }

        //
        // Throw exception if the device is not found
        //

        if (dev_to_del == null || dev_cl == null) // Have been found
        {
            final StringBuffer o = new StringBuffer("Device ");
            o.append(dev_name);
            o.append(" not found");

            Except.throw_exception("API_DeviceNotFound", new String(o), "Dserver.restart()");
        }

        //
        // Remove ourself from device list
        //

        dev_list.removeElementAt(j);

        // Store polling conditions if any
        assert dev_to_del != null;
        final Vector p_obj = dev_to_del.get_poll_obj_list(); // PollObj
        final Vector dev_pol = new Vector(); // Pol

        for (i = 0; i < p_obj.size(); i++) {
            dev_pol.add(p_obj.elementAt(i));
        }
        if (dev_pol.size() > 0) {
            stop_polling();
        }

        // Delete the device (deactivate it and remove it)
        final POA r_poa = tg.get_poa();
        if (dev_to_del.get_exported_flag() == true) {
            try {
                r_poa.deactivate_object(dev_to_del.get_obj_id());
            } catch (final WrongPolicy ex) {
            } catch (final ObjectNotActive ex) {
            }
        }

        // Re-create device
        final String[] dev_name_list = new String[1];
        dev_name_list[0] = dev_name;
        assert dev_cl != null;
        dev_cl.device_factory(dev_name_list);

        // Re-start device polling (if any)
        final DevVarLongStringArray send = new DevVarLongStringArray();
        send.lvalue = new int[1];
        send.svalue = new String[3];

        for (i = 0; i < dev_pol.size(); i++) {
            final PollObj poll_obj = (PollObj) dev_pol.elementAt(i);
            // Send command to the polling thread
            send.lvalue[0] = poll_obj.get_upd_i();
            send.svalue[0] = poll_obj.get_name();
            if (poll_obj.type == Tango_POLL_CMD) {
                send.svalue[1] = "command";
            } else {
                send.svalue[1] = "attribute";
            }
            send.svalue[2] = poll_obj.name;

            try {
                add_obj_polling(send, false);
            } catch (final DevFailed e) {
                if (Util._tracelevel >= 4) {
                    Except.print_exception(e);
                }
            }
        }
    }
970680
public function init()
    {
        if ($this->countRows < 1) {
            $this->totalPages = 0;
            $this->currentPage = 0;

            return;
        }

        if ($this->limit < 10) {
            $this->limit = 10;
        }

        $this->totalPages = (int)($this->countRows / $this->limit);

        if ($this->countRows % $this->limit) {
            $this->totalPages++;
        }

        if ($this->totalPages === 0) {
            $this->totalPages = 1;
        }

        if ($this->currentPage < 0) {
            $this->currentPage = 0;
        }

        if ($this->currentPage > $this->totalPages) {
            $this->currentPage = $this->totalPages;
        }
    }
1093632
public void add_device(String devname, String classname, String servname) throws DevFailed {
		databaseDAO.add_device(this, devname, classname, servname);
    }
1373082
public static function reInit() {
        self::$startValues = array();
        self::$stackLevel = 0;
        self::$stack = array();
        self::$stackLevelMax = array();
        self::$stackLog = array();
        self::$uniqueCounter = 0;
        self::$currentPointerStack = array();
        self::$_enabled = false;
        self::$_checkedEnabled = false;
        self::$_logCallStack = false;
        self::$_configuration = null;
    }
132156
public function initialize()
    {
        if ($this->initialized === false) {
            $this->data = $this->cursor->toArray();
        }
        $this->initialized = true;
    }
1285295
public static synchronized void init(final boolean useDb, final String adminDeviceName) throws DevFailed {
        // Modified properties fo ORB usage.
        final Properties props = System.getProperties();
        props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
        props.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");
        // register interceptors
        props.put("org.omg.PortableInterceptor.ORBInitializerClass.ForwardInit",
                InterceptorInitializer.class.getCanonicalName());
        // Set retry properties
        props.put("jacorb.retries", "0");
        props.put("jacorb.retry_interval", "100");

        props.put("jacorb.codeset", true);
        // props.put("jacorb.config.dir", "fr/esrf/TangoApi");

        // Initial timeout for establishing a connection.
        props.put("jacorb.connection.client.connect_timeout", "5000");

        // Set the Largest transfert.
        final String str = checkORBgiopMaxMsgSize();
        props.put("jacorb.maxManagedBufSize", str);

        // Set jacorb verbosity at minimum value
        props.put("jacorb.config.log.verbosity", "0");

        // only used for no db device
        props.setProperty("jacorb.implname", SERVER_IMPL_NAME);
        // System.setProperties(props);
        // props.setProperty("jacorb.net.tcp_listener",
        // ConnectionListener.class.getName());

        // Initialize ORB
        orb = ORB.init(new String[] {}, props);

        try {
            poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            // boot_manager =
            // BootManagerHelper.narrow(orb.resolve_initial_references("BootManager"));
        } catch (final InvalidName e) {
            throw DevFailedUtils.newDevFailed(e);
        } catch (final INITIALIZE e) {
            // ignore, occurs when starting several times a server that failed
            if (!useDb) {
                throw DevFailedUtils.newDevFailed(e);
            }
        }

        try {
            if (!useDb) {
                // If the database is not used, create a POA with the
                // USER_ID policy
                final org.omg.CORBA.Policy[] policies = new org.omg.CORBA.Policy[2];
                policies[0] = poa.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID);
                policies[1] = poa.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
                final org.omg.PortableServer.POAManager manager = poa.the_POAManager();
                poa = poa.create_POA(NODB_POA, manager, policies);
            }
        } catch (final org.omg.PortableServer.POAPackage.AdapterAlreadyExists e) {
            throw DevFailedUtils.newDevFailed(e);
        } catch (final org.omg.PortableServer.POAPackage.InvalidPolicy e) {
            throw DevFailedUtils.newDevFailed(e);
        }

        final POAManager manager = poa.the_POAManager();
        try {
            manager.activate();
        } catch (final org.omg.PortableServer.POAManagerPackage.AdapterInactive ex) {
            throw DevFailedUtils.newDevFailed("API_CantActivatePOAManager", "The POA activate method throws an exception");
        }

        if (useDb) {

            // Build device name and try to import it from database
            final DeviceImportInfo importInfo = DatabaseFactory.getDatabase().importDevice(adminDeviceName);
            if (importInfo.isExported()) {
                LOGGER.debug("{} is set as exported in tango db - checking if it is already running", adminDeviceName);
                // if is exported, try to connect to it
                ORBManager.checkServerRunning(importInfo, adminDeviceName);
            }
        }
    }
1373143
public static void initPoolConf() throws DevFailed {
        polledDevices.clear();
        final Map<String, String[]> prop = PropertiesUtils.getDeviceProperties(ServerManager.getInstance()
                .getAdminDeviceName());
        if (prop.containsKey(POLLING_THREADS_POOL_CONF)) {
            final String[] pollingThreadsPoolConf = prop.get(POLLING_THREADS_POOL_CONF);
            for (int i = 0; i < pollingThreadsPoolConf.length; i++) {
                if (cacheList.containsKey(pollingThreadsPoolConf[i]) && !pollingThreadsPoolConf[i].isEmpty()
                        && !polledDevices.contains(pollingThreadsPoolConf[i])) {
                    polledDevices.add(pollingThreadsPoolConf[i]);
                }
            }
        }
    }
221131
public void execute() throws DevFailed {
        GroupCmdReplyList replies;
        if (isArginVoid()) {
            replies = group.command_inout(commandName, true);
        } else {
            replies = group.command_inout(commandName, inData, true);
        }
        if (replies.has_failed()) {
            // get data to throw e
            for (final Object obj : replies) {
                ((GroupCmdReply) obj).get_data();
            }
        }
    }
386572
void check_command_exists(final String cmd_name) throws DevFailed {
	final Vector cmd_list = device_class.get_command_list();
	for (int i = 0; i < cmd_list.size(); i++) {
	    final Command cmd = (Command) cmd_list.elementAt(i);
	    if (cmd.get_name().toLowerCase().equals(cmd_name)) {
		if (cmd.get_in_type() != Tango_DEV_VOID) {
		    Except.throw_exception("API_IncompatibleCmdArgumentType", "Command " + cmd_name
			    + " cannot be polled because it needs input value",
			    "DeviceImpl.check_command_exists");
		}
		return;
	    }
	}

	Except.throw_exception("API_CommandNotFound", "Command " + cmd_name + " not found",
		"DeviceImpl.check_command_exists");
    }
1308940
synchronized void get_monitor() throws DevFailed {
	boolean interupted;
	Util.out4.println("In get_monitor(), used = " + used);

	final boolean owner_thread = false;
	/*
	 * if ((locking_thread != NULL) && (omni_thread::self() ==
	 * locking_thread)) { owner_thread = true;
	 * Util.out4.println("owner_thread !!"); }
	 */

	while (used == true && owner_thread == false) {
	    Util.out4.println("waiting !!");
	    interupted = wait_it(_timeout);

	    if (used == true && interupted == false) {
		Util.out4.println("TIME OUT for thread ");
		Except.throw_exception("API_CommandTimedOut", "Not able to acquire device monitor",
			"TangoMonitor.get_monitor");
	    }
	}
	locked_ctr++;
	if (!owner_thread) {
	    // locking_thread = omni_thread::self();
	    used = true;
	}
    }
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
252069
public void init(Database database, String host, String port) throws DevFailed {
        super.init(database, host, port);
    }