Search in sources :

Example 16 with DefaultInstanceDescription

use of org.apache.sling.discovery.commons.providers.DefaultInstanceDescription in project sling by apache.

the class TopologyHelper method clone.

public static DefaultClusterView clone(DefaultClusterView original) {
    DefaultClusterView c = new DefaultClusterView(original.getId());
    Iterator<InstanceDescription> it = original.getInstances().iterator();
    while (it.hasNext()) {
        DefaultInstanceDescription id = (DefaultInstanceDescription) it.next();
        c.addInstanceDescription(cloneWOClusterView(id));
    }
    return c;
}
Also used : DefaultClusterView(org.apache.sling.discovery.commons.providers.DefaultClusterView) InstanceDescription(org.apache.sling.discovery.InstanceDescription) DefaultInstanceDescription(org.apache.sling.discovery.commons.providers.DefaultInstanceDescription) DefaultInstanceDescription(org.apache.sling.discovery.commons.providers.DefaultInstanceDescription)

Aggregations

DefaultInstanceDescription (org.apache.sling.discovery.commons.providers.DefaultInstanceDescription)16 DefaultClusterView (org.apache.sling.discovery.commons.providers.DefaultClusterView)11 InstanceDescription (org.apache.sling.discovery.InstanceDescription)8 Test (org.junit.Test)7 DefaultTopologyView (org.apache.sling.discovery.base.commons.DefaultTopologyView)4 DummyTopologyView (org.apache.sling.discovery.commons.providers.DummyTopologyView)4 HashMap (java.util.HashMap)3 LoginException (org.apache.sling.api.resource.LoginException)3 PersistenceException (org.apache.sling.api.resource.PersistenceException)3 URL (java.net.URL)2 Collection (java.util.Collection)2 LinkedList (java.util.LinkedList)2 Map (java.util.Map)2 Activate (org.apache.felix.scr.annotations.Activate)2 ModifiableValueMap (org.apache.sling.api.resource.ModifiableValueMap)2 TopologyEventListener (org.apache.sling.discovery.TopologyEventListener)2 UndefinedClusterViewException (org.apache.sling.discovery.base.commons.UndefinedClusterViewException)2 ClusterSyncService (org.apache.sling.discovery.commons.providers.spi.ClusterSyncService)2 LocalClusterView (org.apache.sling.discovery.commons.providers.spi.LocalClusterView)2 Iterator (java.util.Iterator)1