Ray Milkey
Committed by Brian O'Connor

Removed deprecated intent operations

Change-Id: I2ca316dab4c1ac1a66fb4ddf101c4adf3302dcd2
......@@ -42,18 +42,6 @@ public final class IntentOperation {
* Indicates that an intent should be removed.
*/
WITHDRAW,
/**
* Indicates that an intent should be replaced with another.
*/
@Deprecated
REPLACE,
/**
* Indicates that an intent should be updated (i.e. recompiled/reinstalled).
*/
@Deprecated
UPDATE,
}
/**
......
......@@ -43,15 +43,6 @@ public interface IntentService {
void withdraw(Intent intent);
/**
* Replaces the specified intent with a new one.
*
* @param oldIntentId identifier of the old intent being replaced
* @param newIntent new intent replacing the old one
*/
@Deprecated
void replace(IntentId oldIntentId, Intent newIntent);
/**
* Returns an iterable of intents currently in the system.
*
* @return set of intents
......
......@@ -186,11 +186,6 @@ public class FakeIntentManager implements TestableIntentService {
}
@Override
public void replace(IntentId oldIntentId, Intent newIntent) {
// TODO: implement later
}
@Override
public Set<Intent> getIntents() {
return Collections.unmodifiableSet(new HashSet<>(intents.values()));
}
......
......@@ -33,11 +33,6 @@ public class IntentServiceAdapter implements IntentService {
}
@Override
public void replace(IntentId oldIntentId, Intent newIntent) {
}
@Override
public Iterable<Intent> getIntents() {
return null;
}
......
......@@ -167,11 +167,6 @@ public class IntentManager
}
@Override
public void replace(IntentId oldIntentId, Intent newIntent) {
throw new UnsupportedOperationException("replace is not implemented");
}
@Override
public Iterable<Intent> getIntents() {
return store.getIntents();
}
......
......@@ -373,31 +373,6 @@ public class IntentManagerTest {
assertEquals(0L, flowRuleService.getFlowRuleCount());
}
@Test
public void replaceIntent() {
flowRuleService.setFuture(true);
MockIntent intent = new MockIntent(MockIntent.nextId());
listener.setLatch(1, Type.INSTALLED);
service.submit(intent);
listener.await(Type.INSTALLED);
assertEquals(1L, service.getIntentCount());
assertEquals(1L, manager.flowRuleService.getFlowRuleCount());
MockIntent intent2 = new MockIntent(MockIntent.nextId());
listener.setLatch(1, Type.WITHDRAWN);
listener.setLatch(1, Type.INSTALL_REQ);
listener.setLatch(1, Type.INSTALLED);
service.replace(intent.id(), intent2);
listener.await(Type.WITHDRAWN);
listener.await(Type.INSTALLED);
delay(10); //FIXME this is a race
assertEquals(1L, service.getIntentCount());
assertEquals(1L, manager.flowRuleService.getFlowRuleCount());
assertEquals(intent2.number().intValue(),
flowRuleService.flows.iterator().next().priority());
}
/**
* Tests for proper behavior of installation of an intent that triggers
* a compilation error.
......