Package org.yamcs.xtce
Class XtceDb
- java.lang.Object
-
- org.yamcs.xtce.XtceDb
-
- All Implemented Interfaces:
Serializable
public class XtceDb extends Object implements Serializable
XtceDB database It contains a SpaceSystem as defined in the Xtce schema and has lots of hashes to help find things quickly- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringYAMCS_CMD_SPACESYSTEM_NAMEstatic StringYAMCS_CMDHIST_SPACESYSTEM_NAMEstatic StringYAMCS_SPACESYSTEM_NAMENamespaces system parameters
-
Constructor Summary
Constructors Constructor Description XtceDb(SpaceSystem spaceSystem)
-
Method Summary
-
-
-
Field Detail
-
YAMCS_SPACESYSTEM_NAME
public static final String YAMCS_SPACESYSTEM_NAME
Namespaces system parameters- See Also:
- Constant Field Values
-
YAMCS_CMD_SPACESYSTEM_NAME
public static final String YAMCS_CMD_SPACESYSTEM_NAME
- See Also:
- Constant Field Values
-
YAMCS_CMDHIST_SPACESYSTEM_NAME
public static final String YAMCS_CMDHIST_SPACESYSTEM_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XtceDb
public XtceDb(SpaceSystem spaceSystem)
-
-
Method Detail
-
getSequenceContainer
public SequenceContainer getSequenceContainer(String qualifiedName)
-
getSequenceContainer
public SequenceContainer getSequenceContainer(String namespace, String name)
-
getSequenceContainer
public SequenceContainer getSequenceContainer(Yamcs.NamedObjectId id)
-
toNamedObjectId
public static Yamcs.NamedObjectId toNamedObjectId(String qualifiedName)
-
getParameter
public Parameter getParameter(Yamcs.NamedObjectId id)
-
getParameterType
public ParameterType getParameterType(String qualifiedName)
-
getParameterType
public ParameterType getParameterType(String namespace, String name)
-
getParameterType
public ParameterType getParameterType(Yamcs.NamedObjectId id)
-
getRootSequenceContainer
public SequenceContainer getRootSequenceContainer()
-
setRootSequenceContainer
public void setRootSequenceContainer(SequenceContainer sc)
-
getAlgorithm
public Algorithm getAlgorithm(Yamcs.NamedObjectId id)
-
getAlgorithms
public Collection<Algorithm> getAlgorithms()
-
getParameters
public Collection<Parameter> getParameters()
-
getParameterTypes
public Collection<ParameterType> getParameterTypes()
-
containsNamespace
public boolean containsNamespace(String namespace)
-
getMetaCommand
public MetaCommand getMetaCommand(String qualifiedName)
Returns a meta command by fully qualified name.- Parameters:
qualifiedName- - fully qualified name of the command to be returned.- Returns:
- the meta command having the given qualified name. If no such command exists,
nullis returned.
-
getMetaCommand
public MetaCommand getMetaCommand(String namespace, String name)
Returns a command based on a name in a namespace- Parameters:
namespace-name-- Returns:
- the meta command having the given name in the given namespace. If no such meta command exists,
nullis returned.
-
getMetaCommand
public MetaCommand getMetaCommand(Yamcs.NamedObjectId id)
-
getMetaCommands
public Collection<MetaCommand> getMetaCommands()
Returns the list of MetaCommmands in the XTCE database- Returns:
-
getRootSpaceSystem
public SpaceSystem getRootSpaceSystem()
-
getSpaceSystem
public SpaceSystem getSpaceSystem(String qualifiedName)
-
getSpaceSystem
public SpaceSystem getSpaceSystem(String namespace, String name)
-
getSpaceSystem
public SpaceSystem getSpaceSystem(Yamcs.NamedObjectId id)
-
getSequenceContainers
public Collection<SequenceContainer> getSequenceContainers()
-
getParameterEntries
public List<ParameterEntry> getParameterEntries(Parameter p)
- Returns:
- list of ParameterEntry corresponding to a given parameter or
nullif no such entry exists.
-
getContainerEntries
public List<ContainerEntry> getContainerEntries(SequenceContainer sc)
- Returns:
- list of ContainerEntry corresponding to a given sequence container or
nullif no such entry exists.
-
getParameterNames
public Collection<String> getParameterNames()
-
getNonStandardDataOfType
public <T extends NonStandardData<T>> T getNonStandardDataOfType(Class<T> clazz)
-
getNonStandardData
public Collection<NonStandardData> getNonStandardData()
-
buildIndexMaps
public void buildIndexMaps()
Called after the database has been populated to build the maps for quickly finding things
-
getInheritingContainers
public List<SequenceContainer> getInheritingContainers(SequenceContainer container)
-
addParameter
public void addParameter(Parameter p, boolean createSpaceSystem)
Adds a new parameter to the XTCE db. If the SpaceSystem where this parameter belongs does not exist, and createSpaceSystem is false, throws an IllegalArgumentException If the SpaceSystem where this parameter belongs exists and already contains an parameter by this name, throws and IllegalArgumentException If the SpaceSystem where this parameter belongs does not exist, and createSpaceSystem is true, the whole SpaceSystem hierarchy is created. Note that this method is used to create parameters on the fly. The parameters are not saved anywhere and they will not be available when this object is created by the XtceDbFactory.- Parameters:
p-createSpaceSystem- - if true, create all the necessary space systems
-
createSystemParameter
public SystemParameter createSystemParameter(String parameterQualifiedNamed)
Creates and returns a system parameter with the given qualified name. If the parameter already exists it is returned.- Parameters:
parameterQualifiedNamed- - the name of the parmaeter to be created. It must start withYAMCS_SPACESYSTEM_NAME- Returns:
- the parameter created or already existing.
- Throws:
IllegalArgumentException- if theparameterQualifiedNameddoes not start withYAMCS_SPACESYSTEM_NAME
-
addMetaCommand
public void addMetaCommand(MetaCommand c)
Adds a new command definition to the XTCE db.Note that this method is used to create commands on the fly.
The commands are not saved anywhere and they will not be available when this object is created with the XtceDbFactory.
-
addSpaceSystem
public void addSpaceSystem(SpaceSystem system)
Adds a newSpaceSystemto the XTCE database. It throws an IllegalArgumentException in the following circumstances:- if a SpaceSystem with this name already exists
- if
system.getParent()does not return null - if the parent SpaceSystem (identified based on the
NameDescription.getSubsystemName()) does not exist - if the space system is not empty
- Parameters:
system- - the space system to be added.
-
isSystemParameter
public static boolean isSystemParameter(Yamcs.NamedObjectId id)
Checks if the named object refers to a system parameter:- either the namespace starts with
YAMCS_SPACESYSTEM_NAME - or there is no namespace and the fully qualified name starts with
YAMCS_SPACESYSTEM_NAME
- Parameters:
id-- Returns:
- either the namespace starts with
-
isSystemParameter
public static boolean isSystemParameter(String fqn)
Checks if a fully qualified name is the name of a system parameter. That is iffqnstarts withYAMCS_SPACESYSTEM_NAME- Parameters:
fqn-- Returns:
-
getSpaceSystems
public Collection<SpaceSystem> getSpaceSystems()
Returns a collection of all theSpaceSystemobjects in the XTCE database.- Returns:
- the collection of space systems.
-
getIndirectParameterRefEntries
public Collection<IndirectParameterRefEntry> getIndirectParameterRefEntries(String namespace)
Retrieve the list ofIndirectParameterRefEntryfor a given alias namespace.- Parameters:
namespace- - the namespace for which the indirect parameter reference entries should be retrieved. Can be null to return the entries without a namespace.- Returns:
- the list of indirect parameter reference entries whose alias namespace is equal to the given namespace.
If no such entry exists,
nullis returned.
-
print
public void print(PrintStream out)
-
-