public class WithConnectionValueProvider implements ValueProvider { @Connection ValuesConnection connection; @Override public Set<Value> resolve() { return ValueBuilder.getValuesFor(connection.getEntities()); } }
public OperationTransactionalAction injectTransactionalAction(@Connection TestTransactionalConnection connection, OperationTransactionalAction action) { return action; }
public Counter getConnection(@Connection Counter connection) { return connection; } }
public Integer failOperationWithThrowable(@Connection PetStoreClient client) throws Throwable { connectionThreads.add(currentThread()); throw new Throwable(CONNECTION_FAIL); } }
/** * Test Operation with blank parameter description * * @param value */ public void operationWithBlankParameterDescription(@Connection String con, String value) { }
public static class SomeValueProvider implements ValueProvider { @Connection String connection; @Override public Set<Value> resolve() { return emptySet(); } }
/** * Operation with description * * @param friend This is one of my friends * @param otherFriend Some other friend */ public void operation(@Connection String friend, String otherFriend) {}
public PetStoreClient getClientOnLatch(@Connection PetStoreClient client, Object countDownLatch, Object latch) throws Exception { if (countDownLatch != null) { ((CountDownLatch) countDownLatch).countDown(); } ((Latch) latch).await(); return client; }
public Integer failConnection(@Connection PetStoreClient client) throws ConnectionException { connectionThreads.add(currentThread()); throw new ConnectionException(CONNECTION_FAIL); }
public Banana eatBanana(@Connection Banana banana, @Config BananaConfig config) { banana.bite(); return banana; }
@MediaType(TEXT_PLAIN) public String callSaul(@Connection HeisenbergConnection connection) { return connection.callSaul(); }
@MediaType(TEXT_PLAIN) public String getSaulPhone(@Connection HeisenbergConnection connection) { return connection.getSaulPhoneNumber(); }
public Kiwi eatKiwi(@Connection Kiwi kiwi, @Config KiwiConfig config) { kiwi.bite(); return kiwi; }
@OutputResolver(output = TestOutputResolverWithoutKeyResolver.class) @MediaType(value = ANY, strict = false) public Object outputMetadataWithoutKeysWithKeyId(@Connection MetadataConnection connection, @MetadataKeyId String type) { return null; }
@MediaType(TEXT_PLAIN) public class SourceWithConnection extends AbstractSource { @OfValues(WithConnectionValueProvider.class) @Parameter String channel; @Connection ConnectionProvider<ValuesConnection> connection; }
@OutputResolver(output = TestInputAndOutputResolverWithKeyResolver.class) @MediaType(value = ANY, strict = false) public Object outputOnlyWithoutContentParam(@Connection MetadataConnection connection, @MetadataKeyId(TestInputAndOutputResolverWithKeyResolver.class) String type) { return type; }
@OutputResolver(output = TestResolverWithCache.class) @MediaType(value = ANY, strict = false) public Object outputAndMetadataKeyCacheResolver(@Connection MetadataConnection connection, @MetadataKeyId(TestResolverWithCache.class) String type) { return null; }
public AnimalClade enumMetadataKey(@Connection MetadataConnection connection, @MetadataKeyId AnimalClade type, @Content @TypeResolver(TestEnumMetadataResolver.class) Object content) { return type; }
public void tokenExpired(@Connection TestOAuthConnection connection) { final AuthorizationCodeState state = connection.getState().getState(); if (!state.getAccessToken().endsWith("refreshed")) { throw new AccessTokenExpiredException(state.getResourceOwnerId()); } } }
@Throws(PetStoreCustomErrorProvider.class) @MediaType(TEXT_PLAIN) public String failsToReadStream(@Connection PetStoreClient connection, @Optional String content) throws MuleException { try { if (content == null) { throw new Exception("Null content cannot be processed"); } throw new StreamingBufferSizeExceededException(1); } catch (Exception e) { throw new ModuleException(PET_ERROR, e); } }