Class WarrantManager

    • Method Detail

      • getXMLOrder

        public int getXMLOrder()
        Description copied from interface: Manager
        Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.

        Yes, that's an overly-centralized methodology, but it works for now.

        Specified by:
        getXMLOrder in interface Manager<Warrant>
        write order for this Manager; larger is later.
      • createNewWarrant

        public Warrant createNewWarrant​(java.lang.String systemName,
                                        java.lang.String userName,
                                        boolean SCWa,
                                        long TTP)
        Method to create a new Warrant if it does not exist.

        Returns null if a Warrant with the same systemName or userName already exists, or if there is trouble creating a new Warrant.

        systemName - the system name.
        userName - the user name.
        SCWa - true for a new SCWarrant, false for a new Warrant.
        TTP - the time to platform.
        an existing warrant if found or a new warrant, may be null.
      • getWarrant

        public Warrant getWarrant​(java.lang.String name)
        Method to get an existing Warrant. First looks up assuming that name is a User Name. If this fails looks up assuming that name is a System Name. If both fail, returns null.
        name - the system name or user name
        the warrant if found or null
      • portalNameChange

        protected void portalNameChange​(java.lang.String oldName,
                                        java.lang.String newName)
      • pathNameChange

        protected void pathNameChange​(OBlock block,
                                      java.lang.String oldName,
                                      java.lang.String newName)
      • getDefault

        public static WarrantManager getDefault()
        Get the default WarrantManager.
        the default WarrantManager, creating it if necessary
      • getBeanTypeHandled

        public java.lang.String getBeanTypeHandled​(boolean plural)
        Description copied from interface: Manager
        Get the user-readable name of the type of NamedBean handled by this manager.

        For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.

        Specified by:
        getBeanTypeHandled in interface Manager<Warrant>
        plural - true to return plural form of the type; false to return singular form
        a string of the bean type that the manager handles, eg Turnout, Sensor etc
      • getNamedBeanClass

        public java.lang.Class<WarrantgetNamedBeanClass()
        Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.
        Specified by:
        getNamedBeanClass in interface Manager<Warrant>
        the class supported by this Manager.
      • getMergeProfile

        protected RosterSpeedProfile getMergeProfile​(java.lang.String id)
        Return a copy of the RosterSpeedProfile for Roster entry
        id - roster id