public ValidationRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _validationManager = (ValidationManager) getApplication().getContext() .getAttributes().get(ValidationManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(SourceKafkaClusterValidationManager.class.toString())) { _srcKafkaValidationManager = (SourceKafkaClusterValidationManager) getApplication().getContext() .getAttributes().get(SourceKafkaClusterValidationManager.class.toString()); } else { _srcKafkaValidationManager = null; } }
public TopicManagementRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); _autoTopicWhitelistingManager = (AutoTopicWhitelistingManager) getApplication().getContext() .getAttributes().get(AutoTopicWhitelistingManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(KafkaBrokerTopicObserver.class.toString())) { _srcKafkaBrokerTopicObserver = (KafkaBrokerTopicObserver) getApplication().getContext() .getAttributes().get(KafkaBrokerTopicObserver.class.toString()); } else { _srcKafkaBrokerTopicObserver = null; } }
public static List<Variant> getVariants() { if (null == VARIANTS) { VARIANTS = new LinkedList<>(); for (SparqlResultFormat f : SparqlResultFormat.values()) { VARIANTS.add(new Variant(f.mediaType)); } } return VARIANTS; } }
public AdminRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _helixMirrorMakerManager = (ControllerHelixManager) getApplication().getContext() .getAttributes().get(ControllerHelixManager.class.toString()); }
public TopicManagementRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _conf = (ManagerConf) getApplication().getContext().getAttributes().get(ManagerConf.class.toString()); _helixMirrorMakerManager = (ControllerHelixManager) getApplication().getContext() .getAttributes().get(ControllerHelixManager.class.toString()); SourceKafkaClusterValidationManager srcKafkaValidationManager = (SourceKafkaClusterValidationManager) getApplication() .getContext().getAttributes().get(SourceKafkaClusterValidationManager.class.toString()); _clusterToObserverMap = srcKafkaValidationManager.getClusterToObserverMap(); }
/** * Returns a variant corresponding to the extensions of this entity. * * @return A variant corresponding to the extensions of this entity. */ public Variant getVariant() { Variant result = new Variant(); updateMetadata(getName(), result, true, getMetadataService()); return result; }
@Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { List<? extends Variant> variants; try { Variant targetVariant = new Variant(toRestletMediaType(mediaType)); variants = getConverterService().getVariants(type, targetVariant); } catch (IOException e) { throw new ResourceException(e); } return (variants != null) && !variants.isEmpty(); }