Package com.hp.ucmdb.api.customers
Interface CustomersService
public interface CustomersService
User: ashkinaz
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomer
(CustomerInfo newCustomer, int customerConfigurationID, boolean asynch) Registers a new customer in uCMDB, attaches it to the existing CustomerConfiguration and runs the customer.createCluster
(ClusterInfo cluster) Creates new cluster; cluster.getID() must be nullint
createCustomerConfiguration
(CustomerConfiguration newCustomerConfiguration, boolean cmdbCreate) Does the same as written above, however it doesn't create nor trying connect to History schemaint
createCustomerConfiguration
(CustomerConfiguration newCustomerConfiguration, boolean cmdbCreate, boolean historyCreate) Deprecated.Returns all clusters.Returns all registered customer configurations (cmdb/history schemas).Returns all registered customers.Returns all registered customers.Returns all registered servers.CustomerFactory is used for creating customer relating objects.boolean
Returns true if there are passive servers up in the cluster of the connected server.void
removeCluster
(int clusterID) Removes specified cluster.void
removeCustomer
(int customerID) Stops specified customer and removes its registration.void
removeCustomerConfiguration
(int customerConfigurationID) Removes specified customer configuration.void
removeServer
(String serverName) Removes specified server.void
setDefaultCustomerConfig
(Integer configId) void
setIdmConfiguration
(int customerID, IdmConfiguration idmConfiguration) void
startCustomer
(int customerID, boolean asynch) Starts components of existing customervoid
stopCustomer
(int customerID) Stops components of the specified customervoid
updateCluster
(ClusterInfo cluster) updates specified cluster.void
updateCustomer
(CustomerInfo customer) Updates customer properties.
-
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
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 customercustomerConfigurationID
- CustomerConfiguration IDasynch
- 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 schemascmdbCreate
- - if TRUE main schema must be created, else existing schema is usedhistoryCreate
- - if TRUE history schema must be created, else existing schema is used- Returns:
- ID of the created CustomerConfiguration
-
createCustomerConfiguration
Does the same as written above, however it doesn't create nor trying connect to History schema- Parameters:
newCustomerConfiguration
- - parameters of main schemacmdbCreate
- - 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
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 IDasynch
- 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
Creates new cluster; cluster.getID() must be null- Returns:
- ClusterInfo for created cluster
-
updateCluster
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
Removes specified server. If the server is active server IllegalArgumentException is thrown. -
setDefaultCustomerConfig
-
getDefaultCustomerConfigId
Integer getDefaultCustomerConfigId() -
setIdmConfiguration
-