@ImplementedBy(DecoratorServiceImpl.class) public interface DecoratorService { List<Decorator> findForStream(String streamId); List<Decorator> findForGlobal(); List<Decorator> findAll(); Decorator findById(String decoratorId) throws NotFoundException; Decorator create(String type, Map<String, Object> config, String stream, int order); Decorator create(String type, Map<String, Object> config, int order); Decorator save(Decorator decorator); int delete(String decoratorId); }
/** Creates a binding for a type annotated with @ImplementedBy. */ private <T> BindingImpl<T> createImplementedByBinding( Key<T> key, Scoping scoping, ImplementedBy implementedBy, Errors errors) throws ErrorsException { Class<?> rawType = key.getTypeLiteral().getRawType(); Class<?> implementationType = implementedBy.value(); // Make sure it's not the same type. TODO: Can we check for deeper cycles? if (implementationType == rawType) { throw errors.recursiveImplementationType().toException(); } // Make sure implementationType extends type. if (!rawType.isAssignableFrom(implementationType)) { throw errors.notASubtype(implementationType, rawType).toException(); } @SuppressWarnings("unchecked") // After the preceding check, this cast is safe. Class<? extends T> subclass = (Class<? extends T>) implementationType; // Look up the target binding. final Key<? extends T> targetKey = Key.get(subclass); Object source = rawType; FactoryProxy<T> factory = new FactoryProxy<>(this, key, targetKey, source); factory.notify(errors); // causes the factory to initialize itself internally return new LinkedBindingImpl<T>( this, key, source, Scoping.<T>scope(key, this, factory, source, scoping), scoping, targetKey); }
@ImplementedBy(AlarmCallbackConfigurationServiceImpl.class) public interface AlarmCallbackConfigurationService { List<AlarmCallbackConfiguration> getForStreamId(String streamId); List<AlarmCallbackConfiguration> getForStream(Stream stream); AlarmCallbackConfiguration load(String alarmCallbackId); AlarmCallbackConfiguration create(String streamId, CreateAlarmCallbackRequest request, String userId); long count(); Map<String, Long> countPerType(); String save(AlarmCallbackConfiguration model) throws ValidationException; int destroy(AlarmCallbackConfiguration model); }
@ImplementedBy(AlarmCallbackHistoryServiceImpl.class) public interface AlarmCallbackHistoryService { List<AlarmCallbackHistory> getForAlertId(String alertId); AlarmCallbackHistory save(AlarmCallbackHistory alarmCallbackHistory); AlarmCallbackHistory success(AlarmCallbackConfiguration alarmCallbackConfiguration, Alert alert, AlertCondition alertCondition); AlarmCallbackHistory error(AlarmCallbackConfiguration alarmCallbackConfiguration, Alert alert, AlertCondition alertCondition, String error); }
@ImplementedBy(DecoratorProcessorImpl.class) public interface DecoratorProcessor { SearchResponse decorate(SearchResponse searchResponse, Optional<String> stream); }
/** * A simple contract for <em>eureka</em> clients to fallback for getting * registry information in case eureka clients are unable to retrieve this * information from any of the <em>eureka</em> servers. * * <p> * This is normally not required, but for applications that cannot exist without * the registry information it can provide some additional reslience. * </p> * * @author Karthik Ranganathan * */ @ImplementedBy(NotImplementedRegistryImpl.class) public interface BackupRegistry { Applications fetchRegistry(); Applications fetchRegistry(String[] includeRemoteRegions); }
/** * This interface represents a file item provider, to create {@link FileItem} for each uploaded file. * * The provider to use can be defined using the {@link FileProvider} on the controller's classes or methods. * * @author Christian Bourgeois */ @ImplementedBy(NoFileItemProvider.class) public interface FileItemProvider { FileItem create(FileItemStream item); }
/** * * @author subwiz */ @ImplementedBy(ReqTestPanelImpl.class) public interface ReqTestPanel extends ViewPanel { String getTestScript(); void setTestScript(String script); void runClonedRequestTest(Request request, Response response); }
/** * * @author subwiz */ @ImplementedBy(RESTMain.class) public interface RESTUserInterface { public JFrame getFrame(); public File getOpenFile(final FileChooserType type); public File getOpenFile(final FileChooserType type, final Component parent); public File getSaveFile(final FileChooserType type); public RESTView getView(); }
@ImplementedBy(OutputServiceImpl.class) public interface OutputService { Output load(String streamOutputId) throws NotFoundException; Set<Output> loadByIds(Collection<String> ids); Set<Output> loadAll(); Output create(Output request) throws ValidationException; Output create(CreateOutputRequest request, String userId) throws ValidationException; void destroy(Output model) throws NotFoundException; Output update(String id, Map<String, Object> deltas); /** * @return the total number of outputs */ long count(); /** * @return the total number of outputs grouped by type */ Map<String, Long> countByType(); }
@ImplementedBy(ClockImpl.class) public interface Clock { long currentTimeMillis(); }
/** * * @author subwiz */ @ImplementedBy(ReqMethodPanelImpl.class) public interface ReqMethodPanel extends ViewPanel { boolean doesSelectedMethodSupportEntityBody(); HTTPMethod getSelectedMethod(); void setSelectedMethod(HTTPMethod method); }
/** * * @author subwiz */ @ImplementedBy(ResBodyPanelImpl.class) public interface ResBodyPanel extends ViewPanel { void setBody(byte[] data, ContentType type); byte[] getBody(); }
/** * * @author subhash */ @ImplementedBy(ResStatsPanelImpl.class) public interface ResStatsPanel extends ViewPanel { long getExecutionTime(); long getBodySize(); void setExecutionTime(long time); void setBodySize(long size); }
/** * * @author subwiz */ @ImplementedBy(ResTestPanelImpl.class) public interface ResTestPanel extends ViewPanel { TestResult getTestResult(); void setTestResult(TestResult result); }
/** * * @author subwiz */ @ImplementedBy(ResStatusPanelImpl.class) public interface ResStatusPanel extends ViewPanel { String getStatus(); void setStatus(String status); }
/** * * @author subwiz */ @ImplementedBy(LifecycleManagerImpl.class) public interface LifecycleManager { void registerStartupListener(Startup startupListener); void registerShutdownListener(Shutdown shutdownListener); void runStartupListeners(); }
/** * * @author subwiz */ @ImplementedBy(ReqBodyPanelImpl.class) public interface ReqBodyPanel extends ViewPanel { void enableBody(); void disableBody(); void setEntity(ReqEntity entity); ReqEntity getEntity(); }
/** * * @author subwiz */ @ImplementedBy(ReqSSLPanelImpl.class) public interface ReqSSLPanel extends ViewPanel { SSLReq getSslReq(); void setSslReq(SSLReq sslReq); }
/** * * @author subwiz */ @ImplementedBy(ResHeaderPanelImpl.class) public interface ResHeaderPanel extends ViewPanel { MultiValueMap<String, String> getHeaders(); void setHeaders(MultiValueMap<String, String> headers); }