Interface CustomersService


public interface CustomersService
User: ashkinaz
  • Method Details

    • getAllCustomers

      Collection<CustomerInfo> getAllCustomers()
      Returns all registered customers.
    • getAllCustomersIncludingStopped

      Collection<CustomerInfo> getAllCustomersIncludingStopped()
      Returns all registered customers. Including not started custommers.
    • getAllCustomerConfigurations

      Collection<CustomerConfiguration> getAllCustomerConfigurations()
      Returns all registered customer configurations (cmdb/history schemas).
    • getFactory

      CustomerFactory getFactory()
      CustomerFactory is used for creating customer relating objects.
    • addCustomer

      void addCustomer(CustomerInfo newCustomer, int customerConfigurationID, boolean asynch)
      Registers a new customer in uCMDB, attaches it to the existing CustomerConfiguration and runs the customer. Here is an example of using this method:
       CustomersService customersService=ucmdbManagementService.getCustomersService();
       CustomerInfo cust=customersService.getFactory().createCustomer(2);
       cust.setName("Customer #2");
       cust.setDescription("some description");
       customersService.addCustomer(cust, 1, true);
       
      Parameters:
      newCustomer - info for new customer
      customerConfigurationID - CustomerConfiguration ID
      asynch - if TRUE, the new customer is running asynchronously
    • createCustomerConfiguration

      @Deprecated int createCustomerConfiguration(CustomerConfiguration newCustomerConfiguration, boolean cmdbCreate, boolean historyCreate)
      Deprecated.
      Creates CustomerConfiguration and register it in uCMDB. main/history schemas can be created or existing schemas can be used If schema which must be created already exists, the method fails. Here is an example of using this method:
       CustomersService customersService=ucmdbManagementService.getCustomersService();
       DatabaseInfo cmdbInf=customersService.getFactory().createDatabaseInfo();
       DatabaseInfo histInf=customersService.getFactory().createDatabaseInfo();
       DatabaseAdminInfo cmdbAdminInf=customersService.getFactory().createDatabaseAdminInfo();
       DatabaseAdminInfo histAdminInf=customersService.getFactory().createDatabaseAdminInfo();
       cmdbInf.setSchemaType(DatabaseInfo.SchemaType.CMDB);
       cmdbInf.setDbName("cmdb schema name");
       cmdbInf.setDbType(DatabaseInfo.DbType.ORACLE);
       ...
       histInf.setSchemaType(DatabaseInfo.SchemaType.CMDB);
       histInf.setDbName("hist schema name");
       histInf.setDbType(DatabaseInfo.DbType.ORACLE);
       ...
       cmdbAdminInf.setAdminUser("system");
       ...
       histAdminInf.setAdminUser("system");
       ...
       conf.setCmdbDbInfo(cmdbInf);
       conf.setHistoryDbInfo(histInf);
       conf.setCmdbDbAdminInfo(cmdbAdminInf);
       conf.setHistoryDbAdminInfo(histAdminInf);
       int ID=customersService.createCustomerConfiguration(conf, true, true);
       
      Parameters:
      newCustomerConfiguration - - parameters of main/history schemas
      cmdbCreate - - if TRUE main schema must be created, else existing schema is used
      historyCreate - - if TRUE history schema must be created, else existing schema is used
      Returns:
      ID of the created CustomerConfiguration
    • createCustomerConfiguration

      int createCustomerConfiguration(CustomerConfiguration newCustomerConfiguration, boolean cmdbCreate)
      Does the same as written above, however it doesn't create nor trying connect to History schema
      Parameters:
      newCustomerConfiguration - - parameters of main schema
      cmdbCreate - - if TRUE main schema must be created, else existing schema is used
      Returns:
      ID of the created CustomerConfiguration
    • removeCustomer

      void removeCustomer(int customerID)
      Stops specified customer and removes its registration. If specified customer is the only customer in uCMDB IllegalStateException is thrown.
    • removeCustomerConfiguration

      void removeCustomerConfiguration(int customerConfigurationID)
      Removes specified customer configuration. If the configuration has attached customers IllegalStateException is thrown.
    • updateCustomer

      void updateCustomer(CustomerInfo customer)
      Updates customer properties. Here is an example of using this method:
       CustomersService customersService=ucmdbManagementService.getCustomersService();
       Collection lst= customersService.getAllCustomers();
       if (lst!=null) {
           CustomerInfo cust=lst.iterator().next();
           cust.setDescription("new description ");
           customersService.updateCustomer(cust);
       }
       
    • startCustomer

      void startCustomer(int customerID, boolean asynch)
      Starts components of existing customer
      Parameters:
      customerID - customer ID
      asynch - if TRUE, the new customer is running asynchronously
    • stopCustomer

      void stopCustomer(int customerID)
      Stops components of the specified customer
    • getAllClusters

      Collection<ClusterInfo> getAllClusters()
      Returns all clusters.
    • getAllServers

      Collection<ServerInfo> getAllServers()
      Returns all registered servers.
    • hasPassiveServersUp

      boolean hasPassiveServersUp()
      Returns true if there are passive servers up in the cluster of the connected server. Passive server is considered down after it has been shut down and a certain amount of time has elapsed (for example it did not report that it is up for over one minute) Returns false if the connected server is not in a cluster, HA is not configured, or there are no other servers in the cluster.
    • createCluster

      ClusterInfo createCluster(ClusterInfo cluster)
      Creates new cluster; cluster.getID() must be null
      Returns:
      ClusterInfo for created cluster
    • updateCluster

      void updateCluster(ClusterInfo cluster)
      updates specified cluster. Collection of servers and active server are updated.
    • removeCluster

      void removeCluster(int clusterID)
      Removes specified cluster. If the cluster has attached customers IllegalArgumentException is thrown.
    • removeServer

      void removeServer(String serverName)
      Removes specified server. If the server is active server IllegalArgumentException is thrown.
    • setDefaultCustomerConfig

      void setDefaultCustomerConfig(Integer configId)
    • getDefaultCustomerConfigId

      Integer getDefaultCustomerConfigId()
    • setIdmConfiguration

      void setIdmConfiguration(int customerID, IdmConfiguration idmConfiguration)