Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.flexdbserver.services.asset
Class ImportAssetService  view ImportAssetService download ImportAssetService.java

java.lang.Object
  extended bycom.flexstor.flexdbserver.services.asset.ImportAssetService
All Implemented Interfaces:
com.flexstor.flexdbserver.services.Service, com.flexstor.common.threadmgr.ThreadCallbackI

public class ImportAssetService
extends java.lang.Object
implements com.flexstor.flexdbserver.services.Service, com.flexstor.common.threadmgr.ThreadCallbackI

ImportAssetService

Manages the entire process of importing assets into the database. This service reads from the input control (*.ctl) file a list of services to be performed against all assets (preservices, for example assigning roles and types to each asset); then it divides the assets in groups by role and type and performs the set of services specified for each group in the roletype_services.config file. Finally, if specified in the roletype_services.config file, it will import the assets into the database.

Input Data Object

com.flexstor.common.importprocessor.ImportData

Output Data Object

com.flexstor.common.importprocessor.ImportResult


Field Summary
private  boolean bContinue
           
private  int id
           
static java.lang.String IDENTIFIER
           
private  com.flexstor.common.importprocessor.ImportData importData
           
private  com.flexstor.common.services.ServiceListenerI listener
           
private  int nManagerRunning
           
private  com.flexstor.common.services.ServiceBrokerI serviceBroker
           
private  java.lang.String sServiceType
           
private  java.lang.String sSubTransId
           
private  java.lang.String sThisService
           
private  com.flexstor.common.importprocessor.ImportData subImportDataReturned
           
 
Constructor Summary
ImportAssetService()
           
 
Method Summary
private  java.util.Hashtable createImportDataSubSets()
          create all subsets of ImportData (one per file type) and return them in a hashtable.
 com.flexstor.common.data.ActionResult go()
          The start of the Asset Service.
 void initData(com.flexstor.common.data.ActionData actionData)
          A data initialization method called at the beginning of the service.
private  void notify(com.flexstor.common.importprocessor.ImportResult importResult)
          update the ImportData after the set of services are executed for a ImportData sub set.
private  void notifyListener()
           
 void setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
          Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running.
 void threadTaskEnd(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
          Called when a thread task has just finished.
 void threadTaskStart(com.flexstor.common.threadmgr.ThreadConsumerI consumer, java.lang.Object obj)
          Called when a thread task is about to begin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final java.lang.String IDENTIFIER
See Also:
Constant Field Values

serviceBroker

private com.flexstor.common.services.ServiceBrokerI serviceBroker

id

private int id

sThisService

private java.lang.String sThisService

importData

private com.flexstor.common.importprocessor.ImportData importData

subImportDataReturned

private com.flexstor.common.importprocessor.ImportData subImportDataReturned

nManagerRunning

private int nManagerRunning

listener

private com.flexstor.common.services.ServiceListenerI listener

sServiceType

private java.lang.String sServiceType

sSubTransId

private java.lang.String sSubTransId

bContinue

private boolean bContinue
Constructor Detail

ImportAssetService

public ImportAssetService()
Method Detail

setServiceContext

public void setServiceContext(com.flexstor.flexdbserver.services.ServiceContext context)
Calls before the service is initialized (before initData is called) to pass information about the environment in which the service is running. This environment consists of information about the properties set for the service in one of these files (services.config, roletype_services.config, or *.ctl), plus methods to access other information such as an instance of the service broker to invoke other services, the transaction id for the service, file separator character and local path for the installation directory and configuration directory.

Specified by:
setServiceContext in interface com.flexstor.flexdbserver.services.Service

initData

public void initData(com.flexstor.common.data.ActionData actionData)
A data initialization method called at the beginning of the service. The input argument, ActionData must be cast into its subclass, ImportData in order to extract the AssetService specific data.

Specified by:
initData in interface com.flexstor.flexdbserver.services.Service

go

public com.flexstor.common.data.ActionResult go()
The start of the Asset Service.

Specified by:
go in interface com.flexstor.flexdbserver.services.Service

createImportDataSubSets

private java.util.Hashtable createImportDataSubSets()
create all subsets of ImportData (one per file type) and return them in a hashtable. key = file type; value = ImportData sub set


notify

private void notify(com.flexstor.common.importprocessor.ImportResult importResult)
update the ImportData after the set of services are executed for a ImportData sub set.


threadTaskStart

public void threadTaskStart(com.flexstor.common.threadmgr.ThreadConsumerI consumer,
                            java.lang.Object obj)
Called when a thread task is about to begin.

Specified by:
threadTaskStart in interface com.flexstor.common.threadmgr.ThreadCallbackI

threadTaskEnd

public void threadTaskEnd(com.flexstor.common.threadmgr.ThreadConsumerI consumer,
                          java.lang.Object obj)
Called when a thread task has just finished.

Specified by:
threadTaskEnd in interface com.flexstor.common.threadmgr.ThreadCallbackI

notifyListener

private void notifyListener()