@Serializer(value="com.netflix.discovery.converters.EntityBodyConverter") public class Application extends java.lang.Object
Constructor and Description |
---|
Application() |
Application(java.lang.String name) |
Application(java.lang.String name,
java.util.List<InstanceInfo> instances) |
Modifier and Type | Method and Description |
---|---|
void |
addInstance(InstanceInfo i)
Add the given instance info the list.
|
InstanceInfo |
getByInstanceId(java.lang.String id)
Get the instance info that matches the given id.
|
java.util.List<InstanceInfo> |
getInstances()
Gets the list of instances associated with this particular application.
|
java.util.List<InstanceInfo> |
getInstancesAsIsFromEureka()
Gets the list of non-shuffled and non-filtered instances associated with this particular
application.
|
java.lang.String |
getName()
Gets the name of the application.
|
void |
removeInstance(InstanceInfo i)
Remove the given instance info the list.
|
void |
setName(java.lang.String name)
Sets the name of the application.
|
void |
shuffleAndStoreInstances(boolean filterUpInstances)
Shuffles the list of instances in the application and stores it for
future retrievals.
|
void |
shuffleAndStoreInstances(java.util.Map<java.lang.String,Applications> remoteRegionsRegistry,
EurekaClientConfig clientConfig,
InstanceRegionChecker instanceRegionChecker) |
int |
size() |
java.lang.String |
toString() |
public Application()
public Application(java.lang.String name)
public Application(java.lang.String name, java.util.List<InstanceInfo> instances)
public java.lang.String toString()
toString
in class java.lang.Object
public void addInstance(InstanceInfo i)
i
- the instance info object to be added.public void removeInstance(InstanceInfo i)
i
- the instance info object to be removed.public java.util.List<InstanceInfo> getInstances()
Note that the instances are always returned with random order after
shuffling to avoid traffic to the same instances during startup. The
shuffling always happens once after every fetch cycle as specified in
EurekaClientConfig.getRegistryFetchIntervalSeconds()
.
public java.util.List<InstanceInfo> getInstancesAsIsFromEureka()
public InstanceInfo getByInstanceId(java.lang.String id)
id
- the id for which the instance info needs to be returned.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the application.public int size()
public void shuffleAndStoreInstances(boolean filterUpInstances)
filterUpInstances
- indicates whether only the instances with status
InstanceInfo.InstanceStatus.UP
needs to be stored.public void shuffleAndStoreInstances(java.util.Map<java.lang.String,Applications> remoteRegionsRegistry, EurekaClientConfig clientConfig, InstanceRegionChecker instanceRegionChecker)