@Test public void connectedToRyaStreams() { final SharedShellState state = new SharedShellState(); final AccumuloConnectionDetails connectionDetails = mock(AccumuloConnectionDetails.class); final RyaClient connectedCommands = mock(RyaClient.class); state.connectedToAccumulo(connectionDetails, connectedCommands); state.connectedToInstance("instance"); final RyaStreamsClient streamsClient = mock(RyaStreamsClient.class); state.connectedToRyaStreams(streamsClient); assertEquals(streamsClient, state.getShellState().getRyaStreamsCommands().get()); }
public void connectedToRyaStreams( final RyaStreamsClient ryaStreamsCommands) { requireNonNull(ryaStreamsCommands); lock.lock(); try { if(shellState.getConnectionState() != ConnectionState.CONNECTED_TO_INSTANCE) { throw new IllegalStateException("You can not set the connected Rya Streams Client before connected to a Rya Instance."); } shellState = ShellState.builder( shellState ) .setRyaStreamsCommands(ryaStreamsCommands) .build(); } finally { lock.unlock(); } }
SharedShellState { public void connectedToRyaStreams( final RyaStreamsClient ryaStreamsCommands) { requireNonNull(ryaStreamsCommands); lock.lock(); try { if(shellState.getConnectionState() != ConnectionState.CONNECTED_TO_INSTANCE) { throw new IllegalStateException("You can not set the connected Rya Streams Client before connected to a Rya Instance."); } shellState = ShellState.builder( shellState ) .setRyaStreamsCommands(ryaStreamsCommands) .build(); } finally { lock.unlock(); } } }
SharedShellState { public void connectedToRyaStreams( final RyaStreamsClient ryaStreamsCommands) { requireNonNull(ryaStreamsCommands); lock.lock(); try { if(shellState.getConnectionState() != ConnectionState.CONNECTED_TO_INSTANCE) { throw new IllegalStateException("You can not set the connected Rya Streams Client before connected to a Rya Instance."); } shellState = ShellState.builder( shellState ) .setRyaStreamsCommands(ryaStreamsCommands) .build(); } finally { lock.unlock(); } }  }
SharedShellState { public void connectedToRyaStreams( final RyaStreamsClient ryaStreamsCommands) { requireNonNull(ryaStreamsCommands); lock.lock(); try { if(shellState.getConnectionState() != ConnectionState.CONNECTED_TO_INSTANCE) { throw new IllegalStateException("You can not set the connected Rya Streams Client before connected to a Rya Instance."); } shellState = ShellState.builder( shellState ) .setRyaStreamsCommands(ryaStreamsCommands) .build(); } finally { lock.unlock(); } }  ShellState getShellState(); void connectedToAccumulo(
            final AccumuloConnectionDetails connectionDetails,
            final RyaClient connectedCommands); void connectedToMongo(
            final MongoConnectionDetails connectionDetails,
            final RyaClient connectedCommands); void connectedToInstance(final String instanceName); void connectedToRyaStreams(
            final RyaStreamsClient ryaStreamsCommands); void disconnected(); }
SharedShellState { public void connectedToRyaStreams( final RyaStreamsClient ryaStreamsCommands) { requireNonNull(ryaStreamsCommands); lock.lock(); try { if(shellState.getConnectionState() != ConnectionState.CONNECTED_TO_INSTANCE) { throw new IllegalStateException("You can not set the connected Rya Streams Client before connected to a Rya Instance."); } shellState = ShellState.builder( shellState ) .setRyaStreamsCommands(ryaStreamsCommands) .build(); } finally { lock.unlock(); } }  ShellState getShellState(); void connectedToAccumulo(
            final AccumuloConnectionDetails connectionDetails,
            final RyaClient connectedCommands); void connectedToMongo(
            final MongoConnectionDetails connectionDetails,
            final RyaClient connectedCommands); void connectedToInstance(final String instanceName); void connectedToRyaStreams(
            final RyaStreamsClient ryaStreamsCommands); void disconnected();  }