Package org.yamcs
Class YamcsServerInstance
- java.lang.Object
-
- org.yamcs.YamcsInstanceService
-
- org.yamcs.YamcsServerInstance
-
public class YamcsServerInstance extends YamcsInstanceService
Represents a Yamcs instance together with the instance specific services and the processors
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProcessor(Processor proc)Adds the processor to the instance.voiddoInit()protected voiddoStart()protected voiddoStop()YConfigurationgetConfig()Returns the main configuration for this Yamcs instanceProcessorgetFirstProcessor()Returns the first register processor or null if there is no processor registered.intgetInstanceId()org.yamcs.protobuf.YamcsInstancegetInstanceInfo()Map<String,String>getLabels()LinkManagergetLinkManager()ObjectgetMetadata(Object key)StringgetName()Returns the name of this Yamcs instanceProcessorgetProcessor(String processorName)List<Processor>getProcessors()<T extends YamcsService>
TgetService(Class<T> serviceClass, String serviceName)Return the service of the given class and name or null if not existing.com.google.common.util.concurrent.ServicegetService(String serviceName)List<ServiceWithConfig>getServices()<T extends YamcsService>
List<T>getServices(Class<T> serviceClass)<T extends YamcsService>
List<ServiceWithConfig>getServicesWithConfig(Class<T> serviceClass)ServiceWithConfiggetServiceWithConfig(String serviceName)static SpecgetSpec()StringgetTemplate()Map<String,Object>getTemplateArgs()StringgetTemplateSource()TimeServicegetTimeService()XtceDbgetXtceDb()voidloadTimeService()voidremoveProcessor(String processorName)voidstartService(String serviceName)voidstop()Stops this instance, and waits until it terminates-
Methods inherited from class org.yamcs.YamcsInstanceService
addStateListener, awaitInitialized, awaitOffline, awaitRunning, failureCause, initAsync, notifyFailed, notifyInitialized, notifyStarted, notifyStopped, offline, removeStateListener, startAsync, state, stopAsync, stopping
-
-
-
-
Method Detail
-
getSpec
public static Spec getSpec()
-
doInit
public void doInit()
- Specified by:
doInitin classYamcsInstanceService
-
doStart
protected void doStart()
- Specified by:
doStartin classYamcsInstanceService
-
doStop
protected void doStop()
- Specified by:
doStopin classYamcsInstanceService
-
getXtceDb
public XtceDb getXtceDb()
-
stop
public void stop() throws IllegalStateExceptionStops this instance, and waits until it terminates- Throws:
IllegalStateException- if the instance fails to do a clean stop
-
loadTimeService
public void loadTimeService()
-
getConfig
public YConfiguration getConfig()
Returns the main configuration for this Yamcs instance
-
getServiceWithConfig
public ServiceWithConfig getServiceWithConfig(String serviceName)
-
getService
public com.google.common.util.concurrent.Service getService(String serviceName)
-
getServices
public <T extends YamcsService> List<T> getServices(Class<T> serviceClass)
-
getServicesWithConfig
public <T extends YamcsService> List<ServiceWithConfig> getServicesWithConfig(Class<T> serviceClass)
-
getService
public <T extends YamcsService> T getService(Class<T> serviceClass, String serviceName)
Return the service of the given class and name or null if not existing.If a service of the given name but a different class exists (or the other way around), this function returns null.
- Parameters:
serviceClass-serviceName-- Returns:
-
getTimeService
public TimeService getTimeService()
-
getServices
public List<ServiceWithConfig> getServices()
-
startService
public void startService(String serviceName) throws ConfigurationException, ValidationException, InitException
-
getName
public String getName()
Returns the name of this Yamcs instance
-
getInstanceInfo
public org.yamcs.protobuf.YamcsInstance getInstanceInfo()
-
getTemplate
public String getTemplate()
-
getTemplateSource
public String getTemplateSource()
-
addProcessor
public void addProcessor(Processor proc) throws ProcessorException
Adds the processor to the instance. If already existing a processor with the same name, an exception is thrown- Parameters:
proc-- Throws:
ProcessorException
-
getFirstProcessor
public Processor getFirstProcessor()
Returns the first register processor or null if there is no processor registered.- Returns:
- the first registered processor
-
removeProcessor
public void removeProcessor(String processorName)
-
getLinkManager
public LinkManager getLinkManager()
-
getInstanceId
public int getInstanceId()
-
-