|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.database.common.XBRLDatabaseAccessApp
com.ihr.xbrl.store.StorageService
public class StorageService
This class is a storage service for XBRL documents to the XBRL Database.
The idea is that a job to store a DTS is created by an external application and submitted to this service. The service creates a new thread in order to deal with the database.
This class contains handlers for all required interfaces during the storage phase
| Field Summary | |
|---|---|
static int |
CREATED_STATUS
|
static int |
ERROR_STATUS
|
static int |
RUNNING_STATUS
|
static int |
STORED_STATUS
|
static int |
UNKNOWN_STATUS
|
| Constructor Summary | |
|---|---|
StorageService(DatabaseManagerBase dbm,
RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
It must be public because of the way it should be initialized due to the HasURIResolverParameter interface. |
|
StorageService(RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
It must be public because of the way it should be initialized due to the HasURIResolverParameter interface. |
|
| Method Summary | |
|---|---|
void |
clear()
Releases memory in the caches reserved by the surrounding processors. |
void |
disableOpen()
Called when menus has to be set to "disabled" state |
void |
documentStoredEvent(StorageEvent evt)
|
void |
doStoreDTS(java.lang.String instanceUriOnDatabase,
XBRLDocument document,
org.hibernate.Session parameter,
boolean inNewThread,
boolean bForUpdate,
org.apache.log4j.Level logLevel,
StorageEventListener[] listeners)
Starts the storage of a DTS into the database in an unattended new thread. |
void |
doStoreDTS(XBRLDocument document,
org.hibernate.Session parameter,
boolean inNewThread,
boolean bForUpdate,
org.apache.log4j.Level logLevel,
StorageEventListener[] listeners)
Starts the storage of a DTS into the database in an unattended new thread. |
void |
enableOpen()
Called when menus has to be set to "enables" state |
java.lang.String |
getLastMessage(StoreXBRLThread th)
|
int |
getPercentage(StoreXBRLThread th)
|
static StorageService |
getService(RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
Obtains the instance of the static service class that manages storage of information into the XBRL database. |
java.lang.String |
getStackTrace(StoreXBRLThread th)
|
int |
getStatus(StoreXBRLThread th)
|
java.util.Collection<StoreXBRLThread> |
getStorageThreads()
Access to the collection of active threads. |
java.lang.String |
getTooltipMessage(StoreXBRLThread th)
|
boolean |
isStored(java.net.URI uri,
org.hibernate.Session dbSession)
Returns true if the document with URI is already stored in the database |
| Methods inherited from class com.ihr.xbrl.database.common.XBRLDatabaseAccessApp |
|---|
getDbUtil, getStatus, showDbSettings |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CREATED_STATUS
public static final int RUNNING_STATUS
public static final int STORED_STATUS
public static final int ERROR_STATUS
public static final int UNKNOWN_STATUS
| Constructor Detail |
|---|
public StorageService(RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
extra - is an array of RegisterExtraClasses objectsprops - additional Properties object for the connection to the databasehasGUI - this is true if the service can open a window to the end user. false otherwise.RegisterExtraClasses
public StorageService(DatabaseManagerBase dbm,
RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
dbm - the database manager base to use with alternate configuration to connect to the databaseextra - is an array of RegisterExtraClasses objectsprops - additional Properties object for the connection to the database and to the pojo generarion processhasGUI - this is true if the service can open a window to the end user. false otherwise.RegisterExtraClasses| Method Detail |
|---|
public static StorageService getService(RegisterExtraClasses[] extra,
java.util.Properties props,
boolean hasGUI)
The parameters are optional and both can be null.
extra - array of RegisterExtraClasses instances. The RegisterExtraClasses interface allows for extending the database model for additional objectsprops - extra properties that will be added to the connection to the database and to the pojo generarion processhasGUI - this is true if the service can open a window to the end user. false otherwise.
RegisterExtraClasses
public void doStoreDTS(XBRLDocument document,
org.hibernate.Session parameter,
boolean inNewThread,
boolean bForUpdate,
org.apache.log4j.Level logLevel,
StorageEventListener[] listeners)
NOTE: The second parameter is the database session. It MUST be configured with Flush.COMMIT in order to work properly. typically you would do:
Session session = StorageService.getService(null,null).getDbUtil().getSessionFactory(null).openSession();
session.setFlushMode(FlushMode.COMMIT);
StorageService.getService(null,null).doStoreDTS(instance,session,true,false);
document - XBRLDocument to be storedparameter - the database session already openedinNewThread - if this argument is false, the storage will not create a new threadbForUpdate - if this parameter is true and the document already exists in the database, the document content will be updated. (only for XBRL reports)logLevel - listener - array of listeners that will receive a copy of the StorageEvent. null means no listeners will receive a copy of the event.
public void doStoreDTS(java.lang.String instanceUriOnDatabase,
XBRLDocument document,
org.hibernate.Session parameter,
boolean inNewThread,
boolean bForUpdate,
org.apache.log4j.Level logLevel,
StorageEventListener[] listeners)
NOTE: The second parameter is the database session. It MUST be configured with Flush.COMMIT in order to work properly. typically you would do:
Session session = StorageService.getService(null,null).getDbUtil().getSessionFactory(null).openSession();
session.setFlushMode(FlushMode.COMMIT);
StorageService.getService(null,null).doStoreDTS(instance,session,true,false);
instanceUriOnDatabase - this is the URI of the instance document in the database. Also, the URI will be used as base uri for transformation of locally referenced taxonomies and linkbasesdocument - XBRLDocument to be storedparameter - the database session already openedinNewThread - if this argument is false, the storage will not create a new threadbForUpdate - if this parameter is true and the document already exists in the database, the document content will be updated. (only for XBRL reports)logLevel - listener - array of listeners that will receive a copy of the StorageEvent. null means no listeners will receive a copy of the event.public void clear()
public void disableOpen()
HasEnableDisableOpenMenus
disableOpen in interface HasEnableDisableOpenMenuspublic void enableOpen()
HasEnableDisableOpenMenus
enableOpen in interface HasEnableDisableOpenMenuspublic void documentStoredEvent(StorageEvent evt)
documentStoredEvent in interface StorageEventListener
public boolean isStored(java.net.URI uri,
org.hibernate.Session dbSession)
uri - dbSession -
public java.util.Collection<StoreXBRLThread> getStorageThreads()
public int getStatus(StoreXBRLThread th)
public java.lang.String getStackTrace(StoreXBRLThread th)
public java.lang.String getLastMessage(StoreXBRLThread th)
public java.lang.String getTooltipMessage(StoreXBRLThread th)
public int getPercentage(StoreXBRLThread th)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||