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 void
addProcessor(Processor proc)
Adds the processor to the instance.void
doInit()
protected void
doStart()
protected void
doStop()
YConfiguration
getConfig()
Returns the main configuration for this Yamcs instanceProcessor
getFirstProcessor()
Returns the first register processor or null if there is no processor registered.int
getInstanceId()
org.yamcs.protobuf.YamcsInstance
getInstanceInfo()
Map<String,String>
getLabels()
LinkManager
getLinkManager()
Object
getMetadata(Object key)
String
getName()
Returns the name of this Yamcs instanceProcessor
getProcessor(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.Service
getService(String serviceName)
List<ServiceWithConfig>
getServices()
<T extends YamcsService>
List<T>getServices(Class<T> serviceClass)
<T extends YamcsService>
List<ServiceWithConfig>getServicesWithConfig(Class<T> serviceClass)
ServiceWithConfig
getServiceWithConfig(String serviceName)
static Spec
getSpec()
TimeService
getTimeService()
XtceDb
getXtceDb()
void
loadTimeService()
void
removeProcessor(String processorName)
void
startService(String serviceName)
void
stop()
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:
doInit
in classYamcsInstanceService
-
doStart
protected void doStart()
- Specified by:
doStart
in classYamcsInstanceService
-
doStop
protected void doStop()
- Specified by:
doStop
in classYamcsInstanceService
-
getXtceDb
public XtceDb getXtceDb()
-
stop
public void stop() throws IllegalStateException
Stops 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()
-
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()
-
-