|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.smf.data.XMLDataManager
The XMLDataManager is the central class providing XML specific access to the optics file (which represents static accelerator data) and the table files (which represent dynamic data). A single main file lists the references to the optics file and the table files to load for a particular session. XMLDataManager is the central class providing access to parse and write all of this data. It generates the appropriate data adaptors for populating the object graph. Three private inner member classes provide help to the XMLDataManager for parsing and writing the three data files (Main reference file, Static optics file and the dynamic table files).
| Nested Class Summary | |
protected class |
XMLDataManager.MissingUrlForGroup
Exception thrown when a URL has not been specified for the given group and an attempt is made to read or write the group. |
| Field Summary | |
protected gov.sns.xal.smf.data.TimingDataManager |
_timingManager
|
protected gov.sns.xal.smf.data.XMLDataManager.AcceleratorManager |
acceleratorManager
|
protected static java.lang.String |
MAIN_PATH_PREF_KEY
|
protected gov.sns.xal.smf.data.XMLDataManager.MainManager |
mainManager
|
protected gov.sns.xal.smf.data.XMLDataManager.TableManager |
tableManager
|
| Constructor Summary | |
XMLDataManager(java.lang.String urlPath)
Creates new XMLDataManager |
|
| Method Summary | |
static Accelerator |
acceleratorWithPath(java.lang.String filePath)
Read the accelerator from the data source at the file path. |
static Accelerator |
acceleratorWithPath(java.lang.String filePath,
boolean isValidating)
Read the accelerator from the data source at the file path and using DTD validation if if the user specifies. |
static Accelerator |
acceleratorWithUrlSpec(java.lang.String urlPath)
Read the accelerator from the data source at the URL path. |
static java.lang.String |
defaultPath()
Get the path to the default main data source specified in the user's preferences. |
Accelerator |
getAccelerator()
Parse the accelerator from the optics URL without DTD validation and also populate the dynamic data. |
Accelerator |
getAccelerator(boolean isValidating)
Parse the accelerator from the optics URL with the specified DTD validation flag and also populate the dynamic data. |
static XMLDataManager |
getDefaultInstance()
Get the default XMLDataManager based on the user's preferred path to the Main data source |
java.util.Collection |
getTableGroups()
Get the table groups (names) read from the edit context of the accelerator data source. |
TimingCenter |
getTimingCenter()
Read the timing center from the timing URL. |
static Accelerator |
loadDefaultAccelerator()
Load the accelerator corresponding to the default accelerator data source specified in the user's preferences. |
java.net.URL |
mainUrl()
Get the URL to the accelerator data source which includes pointers to the optics and other supporting data such as the edit context and optics corrections. |
java.lang.String |
mainUrlSpec()
Get the URL spec to the accelerator data source which includes pointers to the optics and other supporting data such as the edit context and optics corrections. |
static XMLDataManager |
managerWithFilePath(java.lang.String filePath)
Create and return a new XMLDataManager with its source given by the specified file path. |
java.lang.String |
opticsDtdUrlSpec()
Get the URL spec of the DTD file used in the optics XML file. |
java.lang.String |
opticsUrlSpec()
Get the URL spec to the accelerator optics. |
void |
readTableGroup(EditContext editContext,
java.lang.String group)
Reads the tables of the table group into the editContext getting its data from the URL associated with the group. |
static void |
readTableGroupFromUrl(EditContext editContext,
java.lang.String group,
java.lang.String urlSpec)
Reads the tables of the table group into the editContext getting its data from the specified URL. |
static void |
setDefaultPath(java.lang.String path)
Set the path to the default main data source and store it in the user's preferences. |
void |
setMainPath(java.lang.String filePath)
Set the file path to use as the accelerator data source which includes pointers to the optics and other supporting data such as the edit context and optics corrections. |
void |
setMainUrlSpec(java.lang.String urlSpec)
Set the URL spec to use as the accelerator data source which includes pointers to the optics and other supporting data such as the edit context and optics corrections. |
void |
setOpticsDtdUrlSpec(java.lang.String urlSpec)
Set the URL spec of the DTD file to use in the optics XML file. |
void |
setOpticsUrlSpec(java.lang.String urlSpec)
Set the URL spec to the accelerator optics. |
void |
setUrlSpecForTableGroup(java.lang.String urlSpec,
java.lang.String tableGroup)
Set the URL spec of the data source for the specified table group. |
void |
updateOptics(Accelerator accelerator,
boolean isValidating)
update the accelerator with data from the optics URL with a DTD validation flag |
java.lang.String |
urlSpecForTableGroup(java.lang.String tableGroup)
Get the URL spec of the data source of the specified table group. |
void |
writeAccelerator(Accelerator accelerator)
Write the entire accelerator including the optics to the optics file, edit context to the appropriate files for the table groups and the main file which references these sources. |
void |
writeEditContext(EditContext editContext)
|
void |
writeMain()
Write the main file which lists the pointers to the optics, edit context and extra optics files. |
void |
writeOptics(Accelerator accelerator)
Write the optics part of the accelerator to an optics file using the location set in this data manager. |
void |
writeTableGroup(EditContext editContext,
java.lang.String groupName)
|
static void |
writeTableGroupToUrl(EditContext editContext,
java.lang.String tableGroup,
java.lang.String urlSpec)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String MAIN_PATH_PREF_KEY
protected gov.sns.xal.smf.data.XMLDataManager.MainManager mainManager
protected gov.sns.xal.smf.data.XMLDataManager.AcceleratorManager acceleratorManager
protected gov.sns.xal.smf.data.XMLDataManager.TableManager tableManager
protected gov.sns.xal.smf.data.TimingDataManager _timingManager
| Constructor Detail |
public XMLDataManager(java.lang.String urlPath)
| Method Detail |
public static XMLDataManager managerWithFilePath(java.lang.String filePath)
throws UrlTool.FilePathException
filePath - The file path of the accelerator data source.
UrlTool.FilePathExceptionpublic static XMLDataManager getDefaultInstance()
gov.sns.apps.opticsswitcher.Switcher
public TimingCenter getTimingCenter()
throws XmlDataAdaptor.ParseException
XmlDataAdaptor.ParseException - if the TimingCenter cannot be generatedpublic static Accelerator acceleratorWithUrlSpec(java.lang.String urlPath)
urlPath - The URL spec of the data source.
public static Accelerator acceleratorWithPath(java.lang.String filePath)
throws UrlTool.FilePathException
filePath - The file path of the data source.
UrlTool.FilePathException
public static Accelerator acceleratorWithPath(java.lang.String filePath,
boolean isValidating)
throws UrlTool.FilePathException
filePath - The file path of the data source.isValidating - enable DTD validation if true and disable DTD validation if false
UrlTool.FilePathExceptionpublic static Accelerator loadDefaultAccelerator()
gov.sns.apps.opticsswitcher.Switcherpublic static java.lang.String defaultPath()
gov.sns.apps.opticsswitcher.Switcherpublic static void setDefaultPath(java.lang.String path)
path - the new file path to the default accelerator data sourcegov.sns.apps.opticsswitcher.Switcher,
gov.sns.smf.data.OpticsSwitcherpublic java.net.URL mainUrl()
public java.lang.String mainUrlSpec()
public void setMainUrlSpec(java.lang.String urlSpec)
urlSpec - The new URL spec to the accelerator data source.
public void setMainPath(java.lang.String filePath)
throws UrlTool.FilePathException
filePath - The new file path to the accelerator data source.
UrlTool.FilePathExceptionpublic java.lang.String opticsUrlSpec()
public void setOpticsUrlSpec(java.lang.String urlSpec)
urlSpec - The new URL spec to the accelerator optics.public java.lang.String opticsDtdUrlSpec()
public void setOpticsDtdUrlSpec(java.lang.String urlSpec)
urlSpec - the URL spec of the DTD file to use in the optics XML file.public java.util.Collection getTableGroups()
EditContextpublic java.lang.String urlSpecForTableGroup(java.lang.String tableGroup)
tableGroup - The table group name
public void setUrlSpecForTableGroup(java.lang.String urlSpec,
java.lang.String tableGroup)
urlSpec - The URL spec of the file where the table group resides.tableGroup - The table group name
public Accelerator getAccelerator()
throws XmlDataAdaptor.ParseException
XmlDataAdaptor.ParseException
public Accelerator getAccelerator(boolean isValidating)
throws XmlDataAdaptor.ParseException
isValidating - use DTD validation if true and don't validate if it is valse
XmlDataAdaptor.ParseException
public void updateOptics(Accelerator accelerator,
boolean isValidating)
throws XmlDataAdaptor.ParseException
accelerator - The accelerato to update with data from the sourcesisValidating - use DTD validation if true and don't validate if false
XmlDataAdaptor.ParseException
public void readTableGroup(EditContext editContext,
java.lang.String group)
editContext - The edit context into which to place the tables which are readgroup - The table group to read from its associated URl
public static void readTableGroupFromUrl(EditContext editContext,
java.lang.String group,
java.lang.String urlSpec)
editContext - The edit context into which to place the tables which are readgroup - The table group to read from the specified URLurlSpec - The URL spec of the table group sourcepublic void writeMain()
public void writeAccelerator(Accelerator accelerator)
accelerator - The accelerator which holds the optics and the edit context.public void writeOptics(Accelerator accelerator)
accelerator - The accelerator to store in the optics file.public void writeEditContext(EditContext editContext)
public static void writeTableGroupToUrl(EditContext editContext,
java.lang.String tableGroup,
java.lang.String urlSpec)
public void writeTableGroup(EditContext editContext,
java.lang.String groupName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||