method2testcases
stringlengths
118
6.63k
### Question: CmdUtils { public static String run(CommandLine commandline) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream errorStream = new ByteArrayOutputStream(); DefaultExecutor exec = new DefaultExecutor(); ExecuteWatchdog watchdog = new ExecuteWatchdog(60*1000); exe...
### Question: TimeViewUtils { public static String format(Date date) { long delta = new Date().getTime() - date.getTime(); if (delta < 1L * ONE_MINUTE) { long seconds = toSeconds(delta); return (seconds <= 0 ? 1 : seconds) + ONE_SECOND_AGO; } if (delta < 45L * ONE_MINUTE) { long minutes = toMinutes(delta); return (minu...
### Question: IOUtils { public static String getPath( String path){ if(path == null || path.equals("") ) return ""; String[] a = path.split("\\/"); path=path.replace(a[a.length-1],""); return path; } IOUtils(String body, String path); void setPath(String path); void setBody(String body); static void createDir(String pa...
### Question: EntityFinder { public <T, ID> T findById(CrudRepository<T, ID> repository, ID id, String notFoundMessage) { Optional<T> findResult = repository.findById(id); return getEntity(findResult, notFoundMessage); } T findById(CrudRepository<T, ID> repository, ID id, ...
### Question: QueryRelProvider implements RelProvider { @Override public String getCollectionResourceRelFor(Class<?> aClass) { return resourceRelationDescriptors.get(aClass).getCollectionResourceRel(); } QueryRelProvider(); @Override String getItemResourceRelFor(Class<?> aClass); @Override String getCollectionResourceR...
### Question: QueryRelProvider implements RelProvider { @Override public boolean supports(Class<?> aClass) { return resourceRelationDescriptors.keySet().contains(aClass); } QueryRelProvider(); @Override String getItemResourceRelFor(Class<?> aClass); @Override String getCollectionResourceRelFor(Class<?> aClass); @Overri...
### Question: ProcessStartedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessStartedEvent startedEvent = (CloudProcessStartedEvent) event; String processInstanceId = startedEvent.getEntity().getId(); LOGGER.debug("Handling start of process Instance " ...
### Question: ProcessStartedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED.name(); } ProcessStartedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> event); @O...
### Question: QueryEventHandlerContext { public void handle(CloudRuntimeEvent<?, ?>... events) { if (events != null) { for (CloudRuntimeEvent<?, ?> event : events) { QueryEventHandler handler = handlers.get(event.getEventType().name()); if (handler != null) { LOGGER.debug("Handling event: " + handler.getHandledEvent())...
### Question: ProcessSuspendedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessSuspendedEvent suspendedEvent = (CloudProcessSuspendedEvent) event; String processInstanceId = suspendedEvent.getEntity().getId(); ProcessInstanceEntity processInstanceEnti...
### Question: ProcessSuspendedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_SUSPENDED.name(); } ProcessSuspendedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> even...
### Question: ProcessCompletedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessCompletedEvent completedEvent = (CloudProcessCompletedEvent) event; String processInstanceId = completedEvent.getEntity().getId(); Optional<ProcessInstanceEntity> findResul...
### Question: EntityFinder { public <T> T findOne(QuerydslPredicateExecutor<T> predicateExecutor, Predicate predicate, String notFoundMessage) { Optional<T> findResult = predicateExecutor.findOne(predicate); return getEntity(findResult, notFoundMessage); } T findById(CrudRepository<T, ID> repository, ...
### Question: ProcessCompletedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED.name(); } ProcessCompletedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> even...
### Question: ProcessUpdatedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessUpdatedEvent updatedEvent = (CloudProcessUpdatedEvent) event; ProcessInstance eventProcessInstance = updatedEvent.getEntity(); ProcessInstanceEntity processInstanceEntity = p...
### Question: ProcessUpdatedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_UPDATED.name(); } ProcessUpdatedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> event); @O...
### Question: ProcessDeployedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessDeployedEvent processDeployedEvent = (CloudProcessDeployedEvent) event; ProcessDefinition eventProcessDefinition = processDeployedEvent.getEntity(); LOGGER.debug("Handling p...
### Question: ProcessDeployedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessDefinitionEvent.ProcessDefinitionEvents.PROCESS_DEPLOYED.name(); } ProcessDeployedEventHandler(ProcessDefinitionRepository processDefinitionRepository, ...
### Question: ProcessResumedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessResumedEvent processResumedEvent = (CloudProcessResumedEvent) event; String processInstanceId = processResumedEvent.getEntity().getId(); Optional<ProcessInstanceEntity> findR...
### Question: ProcessResumedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_RESUMED.name(); } ProcessResumedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> event); @O...
### Question: ProcessCancelledEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessCancelledEvent cancelledEvent = (CloudProcessCancelledEvent) event; LOGGER.debug("Handling cancel of process Instance " + cancelledEvent.getEntity().getId()); updateProcess...
### Question: ProcessCancelledEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_CANCELLED.name(); } ProcessCancelledEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> even...
### Question: ProcessCreatedEventHandler implements QueryEventHandler { @Override public void handle(CloudRuntimeEvent<?, ?> event) { CloudProcessCreatedEvent createdEvent = (CloudProcessCreatedEvent) event; LOGGER.debug("Handling created process Instance " + createdEvent.getEntity().getId()); ProcessInstanceEntity cre...
### Question: ProcessCreatedEventHandler implements QueryEventHandler { @Override public String getHandledEvent() { return ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED.name(); } ProcessCreatedEventHandler(ProcessInstanceRepository processInstanceRepository); @Override void handle(CloudRuntimeEvent<?, ?> event); @O...
### Question: VariableValueJsonConverter implements AttributeConverter<VariableValue<?>, String> { @Override public String convertToDatabaseColumn(VariableValue<?> variableValue) { try { return objectMapper.writeValueAsString(variableValue); } catch (JsonProcessingException e) { throw new QueryException("Unable to seri...
### Question: VariableValueJsonConverter implements AttributeConverter<VariableValue<?>, String> { @Override public VariableValue<?> convertToEntityAttribute(String dbData) { try { return objectMapper.readValue(dbData, VariableValue.class); } catch (IOException e) { throw new QueryException("Unable to deserialize varia...
### Question: QueryRelProvider implements RelProvider { @Override public String getItemResourceRelFor(Class<?> aClass) { return resourceRelationDescriptors.get(aClass).getItemResourceRel(); } QueryRelProvider(); @Override String getItemResourceRelFor(Class<?> aClass); @Override String getCollectionResourceRelFor(Class<...
### Question: MessageProducerCommandContextCloseListener implements CommandContextCloseListener { @Override public void closed(CommandContext commandContext) { List<CloudRuntimeEvent<?, ?>> events = commandContext.getGenericAttribute(PROCESS_ENGINE_EVENTS); if (events != null && !events.isEmpty()) { CloudRuntimeEvent<?...
### Question: ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override public void add(CloudRuntimeEvent<?, ?> element) { CommandContext commandContext = getCurrentCommandContext(); String executionId = resolveExecutionId(el...
### Question: CloudSignalReceivedProducer implements BPMNElementEventListener<BPMNSignalReceivedEvent> { @Override public void onEvent(BPMNSignalReceivedEvent event) { eventsAggregator.add(eventConverter.from(event)); } CloudSignalReceivedProducer(ToCloudProcessRuntimeEventConverter eventConverter, ...
### Question: ExecutionContextMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); if(executionContext != null) { ExecutionEntity processInstance = executionContext.getProcessInstance(); ...
### Question: RuntimeBundleInfoMessageBuilderAppender implements MessageBuilderAppender { @Override public <P> MessageBuilder<P> apply(MessageBuilder<P> request) { Assert.notNull(request, "request must not be null"); return request.setHeader(RuntimeBundleInfoMessageHeaders.APP_NAME, properties.getAppName()) .setHeader(...
### Question: AuditProducerRoutingKeyResolver extends AbstractMessageHeadersRoutingKeyResolver { @Override public String resolve(Map<String, Object> headers) { return build(headers, HEADER_KEYS); } @Override String resolve(Map<String, Object> headers); @Override String getPrefix(); final String ROUTING_KEY_PREFIX; fin...
### Question: ToCloudProcessRuntimeEventConverter { public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAp...
### Question: MQServiceTaskBehavior extends AbstractBpmnActivityBehavior implements TriggerableActivityBehavior { @Override public void execute(DelegateExecution execution) { if (defaultServiceTaskBehavior.hasConnectorBean(execution)) { defaultServiceTaskBehavior.execute(execution); } else { IntegrationContextEntity in...
### Question: MQServiceTaskBehavior extends AbstractBpmnActivityBehavior implements TriggerableActivityBehavior { @Override public void trigger(DelegateExecution execution, String signalEvent, Object signalData) { leave(execution); } MQServiceTaskBehavior(IntegrationContextManager integrationContextManager, ...
### Question: IntegrationContextMessageBuilderAppender implements MessageBuilderAppender { @Override public <T> MessageBuilder<T> apply(MessageBuilder<T> request) { return request .setHeader(IntegrationContextMessageHeaders.CONNECTOR_TYPE, integrationContext.getConnectorType()) .setHeader(IntegrationContextMessageHeade...
### Question: IntegrationContextRoutingKeyResolver extends AbstractMessageHeadersRoutingKeyResolver { @Override public String resolve(Map<String, Object> headers) { return build(headers, HEADER_KEYS); } @Override String resolve(Map<String, Object> headers); @Override String getPrefix(); final String[] HEADER_KEYS; }##...
### Question: IntegrationRequestSender { @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void sendIntegrationRequest(IntegrationRequest event) { resolver.resolveDestination(event.getIntegrationContext().getConnectorType()).send(buildIntegrationRequestMessage(event)); sendAuditEvent(event); } I...
### Question: SuspendProcessInstanceCmdExecutor extends AbstractCommandExecutor<SuspendProcessPayload> { public SuspendProcessInstanceCmdExecutor(ProcessAdminRuntime processAdminRuntime) { this.processAdminRuntime = processAdminRuntime; } SuspendProcessInstanceCmdExecutor(ProcessAdminRuntime processAdminRuntime); @Over...
### Question: CompleteTaskCmdExecutor extends AbstractCommandExecutor<CompleteTaskPayload> { public CompleteTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime) { this.taskAdminRuntime = taskAdminRuntime; } CompleteTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime); @Override TaskResult execute(CompleteTaskPayload comple...
### Question: DeleteProcessInstanceCmdExecutor extends AbstractCommandExecutor<DeleteProcessPayload> { @Override public EmptyResult execute(DeleteProcessPayload deleteProcessPayload) { ProcessInstance processInstance = processAdminRuntime.delete(deleteProcessPayload); if (processInstance != null) { return new EmptyResu...
### Question: ClaimTaskCmdExecutor extends AbstractCommandExecutor<ClaimTaskPayload> { public ClaimTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime) { this.taskAdminRuntime = taskAdminRuntime; } ClaimTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime); @Override TaskResult execute(ClaimTaskPayload claimTaskPayload); }...
### Question: ReceiveMessageCmdExecutor extends AbstractCommandExecutor<ReceiveMessagePayload> { @Override public EmptyResult execute(ReceiveMessagePayload command) { processAdminRuntime.receive(command); return new EmptyResult(command); } ReceiveMessageCmdExecutor(ProcessAdminRuntime processAdminRuntime); @Override Em...
### Question: StartProcessInstanceCmdExecutor extends AbstractCommandExecutor<StartProcessPayload> { public StartProcessInstanceCmdExecutor(ProcessAdminRuntime processAdminRuntime) { this.processAdminRuntime = processAdminRuntime; } StartProcessInstanceCmdExecutor(ProcessAdminRuntime processAdminRuntime); @Override Pro...
### Question: StartMessageCmdExecutor extends AbstractCommandExecutor<StartMessagePayload> { @Override public ProcessInstanceResult execute(StartMessagePayload command) { ProcessInstance result = processAdminRuntime.start(command); return new ProcessInstanceResult(command, result); } StartMessageCmdExecutor(ProcessAdmi...
### Question: SignalCmdExecutor extends AbstractCommandExecutor<SignalPayload> { @Override public EmptyResult execute(SignalPayload signalPayload) { processAdminRuntime.signal(signalPayload); return new EmptyResult(signalPayload); } SignalCmdExecutor(ProcessAdminRuntime processAdminRuntime); @Override EmptyResult execu...
### Question: ReleaseTaskCmdExecutor extends AbstractCommandExecutor<ReleaseTaskPayload> { public ReleaseTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime) { this.taskAdminRuntime = taskAdminRuntime; } ReleaseTaskCmdExecutor(TaskAdminRuntime taskAdminRuntime); @Override TaskResult execute(ReleaseTaskPayload releaseTask...
### Question: BasicAuthenticationProvider implements AuthenticationProvider { @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { String name = authentication.getName(); String password = authentication.getCredentials().toString(); UserDetails userDetails = userD...
### Question: BasicAuthenticationProvider implements AuthenticationProvider { @Override public boolean supports(Class<?> authentication) { return authentication.equals(UsernamePasswordAuthenticationToken.class); } @Autowired BasicAuthenticationProvider(UserDetailsService userDetailsService); @Override Authentication a...
### Question: ToCandidateUserConverter { public List<CandidateUser> from (List<String> users){ List<CandidateUser> list = new ArrayList<>(); users.forEach(user -> list.add(new CandidateUser(user))); return list; } List<CandidateUser> from(List<String> users); }### Answer: @Test public void shouldConvertStringUsersToC...
### Question: TaskResourceAssembler implements ResourceAssembler<Task, Resource<CloudTask>> { @Override public Resource<CloudTask> toResource(Task task) { CloudTask cloudTask = converter.from(task); List<Link> links = new ArrayList<>(); links.add(linkTo(methodOn(TaskControllerImpl.class).getTaskById(cloudTask.getId()))...
### Question: CloudProcessDeployedProducer { @EventListener public void sendProcessDeployedEvents(ProcessDeployedEvents processDeployedEvents) { producer.auditProducer().send( runtimeBundleMessageBuilderFactory.create() .withPayload( processDeployedEvents.getProcessDeployedEvents() .stream() .map(processDeployedEvent -...
### Question: ToCandidateGroupConverter { public List<CandidateGroup> from (List<String> users){ List<CandidateGroup> list = new ArrayList<>(); users.forEach(user -> list.add(new CandidateGroup(user))); return list; } List<CandidateGroup> from(List<String> users); }### Answer: @Test public void shouldConvertStringGro...
### Question: ProcessInstanceResourceAssembler implements ResourceAssembler<ProcessInstance, Resource<CloudProcessInstance>> { @Override public Resource<CloudProcessInstance> toResource(ProcessInstance processInstance) { CloudProcessInstance cloudProcessInstance = toCloudProcessInstanceConverter.from(processInstance); ...
### Question: ProcessDefinitionResourceAssembler implements ResourceAssembler<ProcessDefinition, Resource<CloudProcessDefinition>> { @Override public Resource<CloudProcessDefinition> toResource(ProcessDefinition processDefinition) { CloudProcessDefinition cloudProcessDefinition = converter.from(processDefinition); Link...
### Question: ProcessDefinitionMetaResourceAssembler implements ResourceAssembler<ProcessDefinitionMeta, Resource<ProcessDefinitionMeta>> { @Override public Resource<ProcessDefinitionMeta> toResource(ProcessDefinitionMeta processDefinitionMeta) { Link metadata = linkTo(methodOn(ProcessDefinitionMetaControllerImpl.class...
### Question: ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override protected Class<MessageProducerCommandContextCloseListener> getCloseListenerClass() { return MessageProducerCommandContextCloseListener.class; } ProcessE...
### Question: ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override protected MessageProducerCommandContextCloseListener getCloseListener() { return closeListener; } ProcessEngineEventsAggregator(MessageProducerCommandCon...
### Question: ProcessEngineEventsAggregator extends BaseCommandContextEventsAggregator<CloudRuntimeEvent<?,?>, MessageProducerCommandContextCloseListener> { @Override protected String getAttributeKey() { return MessageProducerCommandContextCloseListener.PROCESS_ENGINE_EVENTS; } ProcessEngineEventsAggregator(MessageProd...
### Question: Score { public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Usage java " + Score.class.getName() + " <FILENAME>.csv <SCORE.csv>"); return; } final String csvFileName = args[0]; File csvFile = new File(csvFileName); if (!csvFile.exists()) { System.err.pri...
### Question: CheckerMain extends AbstractMojo implements PluginBase { void setExcludes(final String[] excludes) { this.excludes = excludes; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> getSearchPathLi...
### Question: FeelExpression { public boolean containsVariable(final String name) { return FeelExpressions.caseOf(this) .Empty_(false) .Null_(false) .BooleanLiteral_(false) .DateLiteral_(false) .DoubleLiteral_(false) .IntegerLiteral_(false) .StringLiteral_(false) .VariableLiteral(variableName -> variableName.equals(nam...
### Question: CheckerMain extends AbstractMojo implements PluginBase { void setSearchPaths(final String[] searchPaths) { this.searchPaths = searchPaths; } @Override void execute(); @Override PrettyPrintValidationResults.PluginLogger getPluginLogger(); @Override List<String> getExcludeList(); @Override List<String> get...
### Question: Subsumption { static Optional<Boolean> subsumes(final FeelExpression expression, final FeelExpression otherExpression, final Comparison comparison) { return FeelExpressions.caseOf(expression) .Empty_(Optional.of(true)) .Null_(FeelExpressions.caseOf(otherExpression).Null_(Optional.of(true)).otherwise_(Opti...
### Question: RequirementGraph extends DirectedAcyclicGraph<DrgElement, DefaultEdge> { public static RequirementGraph from(final DmnModelInstance dmnModelInstance) throws IllegalArgumentException { final Collection<Decision> decisions = dmnModelInstance.getModelElementsByType(Decision.class); final Collection<Knowledge...
### Question: AggregateTrustManager implements X509TrustManager { public static void initialize(KeyStore... keyStores) throws Exception { TrustManager[] trustManagers = new TrustManager[] { new AggregateTrustManager(keyStores) }; SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.secur...
### Question: IdleServiceManager { public IdleServiceManager(final Long maxIdleTime, final ServiceElement serviceElement) { this.maxIdleTime = maxIdleTime; this.serviceElement = serviceElement; long delay = TimeUtil.computeLeaseRenewalTime(maxIdleTime); if(logger.isDebugEnabled()) { logger.debug("Service [{}] idle time...
### Question: ServiceChannel { public void subscribe(final ServiceChannelListener listener, final AssociationDescriptor associationDescriptor, final ServiceChannelEvent.Type type) { subscribe(listener, associationDescriptor.getName(), associationDescriptor.getInterfaceNames(), associationDescriptor.getOperationalString...
### Question: DeploymentVerifier { RemoteRepository[] mergeRepositories(final RemoteRepository[] r1, final RemoteRepository[] r2) { Set<RemoteRepository> remoteRepositories = new HashSet<>(); Collections.addAll(remoteRepositories, r1); Collections.addAll(remoteRepositories, r2); return remoteRepositories.toArray(new Re...
### Question: DeploymentVerifier { void ensureGroups(final ServiceElement serviceElement) throws IOException { if (serviceElement.getServiceBeanConfig().getGroups()==DiscoveryGroupManagement.ALL_GROUPS) { throw new IOException(String.format("Service %s has been declared for ALL_GROUPS", serviceElement.getName())); } fo...
### Question: TransientServiceStatementManager implements ServiceStatementManager { public void terminate() { statementMap.clear(); } TransientServiceStatementManager(Configuration config); void terminate(); ServiceStatement[] get(); ServiceStatement get(ServiceElement sElem); void record(ServiceStatement statement); ...
### Question: TransientServiceStatementManager implements ServiceStatementManager { public ServiceStatement[] get() { ServiceStatement[] statements; synchronized (statementMap) { statements = statementMap.values().toArray(new ServiceStatement[statementMap.values().size()]); } return statements; } TransientServiceStatem...
### Question: SettingsUtil { public static String getLocalRepositoryLocation(final Settings settings) { if(settings==null) throw new IllegalArgumentException("settings must not be null"); String localRepositoryLocation = settings.getLocalRepository(); if (localRepositoryLocation == null) { StringBuilder locationBuilder...
### Question: LocalRepositoryWorkspaceReader implements WorkspaceReader { public LocalRepositoryWorkspaceReader() throws SettingsBuildingException { localRepositoryDir = SettingsUtil.getLocalRepositoryLocation(SettingsUtil.getSettings()); } LocalRepositoryWorkspaceReader(); WorkspaceRepository getRepository(); File fin...
### Question: TCPConnectivity extends ConnectivityCapability { @Override public boolean supports(final SystemComponent requirement) { boolean supports = hasBasicSupport(requirement.getName(), requirement.getClassName()); if(supports) { String hostAddress = (String) requirement.getAttributes().get(HOST_ADDRESS); String ...
### Question: StagedData implements Serializable { public long getDownloadSize() throws IOException { getLocationURL(); return locationURL.openConnection().getContentLengthLong(); } long getDownloadSize(); URL getLocationURL(); String getLocation(); void setLocation(String location); String getInstallRoot(); void setI...
### Question: ServiceStatement implements Serializable { public String getOrganization() { String organization = sElem.getServiceBeanConfig().getOrganization(); organization = (organization==null ? "" : organization); return (organization); } ServiceStatement(final ServiceElement sElem); ServiceElement getServiceElemen...
### Question: JMXConnectionUtil { public static String getPlatformMBeanServerAgentId() throws Exception { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); final String SERVER_DELEGATE = "JMImplementation:type=MBeanServerDelegate"; final String MBEAN_SERVER_ID_KEY = "MBeanServerId"; ObjectName delegateObjNa...
### Question: OpStringLoader { public OpStringLoader() { this(null); } OpStringLoader(); OpStringLoader(ClassLoader loader); void setDefaultGroups(String... groups); OperationalString[] parseOperationalString(File file); OperationalString[] parseOperationalString(URL url); static final String DEFAULT_FDH; }### Answer:...
### Question: StopWatch extends ThresholdWatch implements StopWatchMBean { public void setElapsedTime(long elapsed) { setElapsedTime(elapsed, System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String i...
### Question: StopWatch extends ThresholdWatch implements StopWatchMBean { public void startTiming() { setStartTime(System.currentTimeMillis()); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnings("unused") StopWatch(WatchDataSource watchDataSource, String id); void startTiming(); vo...
### Question: StopWatch extends ThresholdWatch implements StopWatchMBean { public void stopTiming() { long now = System.currentTimeMillis(); long startTime = getStartTime(); long elapsed = now - startTime; setElapsedTime(elapsed, now); } StopWatch(String id); StopWatch(String id, Configuration config); @SuppressWarnin...
### Question: Statistics { public void clearAll() { v.clear(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector getValues(); void ad...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource export() throws RemoteException { if(exported && proxy!=null) return(proxy); if(config != null) { try { exporter = ExporterConfig.getExporter(config, COMPONENT, "watchDataSourceExporter"); } catch(Exception e) { logg...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void unexport(boolean force) { if(!exported) return; try { exporter.unexport(force); exported = false; proxy = null; } catch(IllegalStateException e) { } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config)...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public WatchDataSource getProxy() { return (proxy); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuratio...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getID() { return (id); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration config); void...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setID(String id) { if(id==null) throw new IllegalArgumentException("id is null"); this.id = id; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchD...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void clear() { synchronized(history) { history.clear(); } } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public int getCurrentSize() { int size; synchronized(history) { size = history.size(); } return (size); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataS...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { @SuppressWarnings("unchecked") public void addCalculable(Calculable calculable) { if(calculable==null) throw new IllegalArgumentException("calculable is null"); if(!closed) { addToHistory(calculable); for(WatchDataReplicator replicator : g...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public boolean addWatchDataReplicator(WatchDataReplicator replicator) { boolean added = false; if(replicator==null) return added; synchronized(replicators) { if(!replicators.contains(replicator)) added = replicators.add(replicator); } retu...
### Question: Statistics { public Vector getValues() { return (Vector)v.clone(); } Statistics(); Statistics(Iterable<Double> values); void clearAll(); int count(); double max(); double min(); double mean(); double median(); double mode(); int modeOccurrenceCount(); double range(); double standardDeviation(); Vector ge...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public ThresholdValues getThresholdValues() { ThresholdValues thresholdValues; if(thresholdManager!=null) thresholdValues = thresholdManager.getThresholdValues(); else thresholdValues = new ThresholdValues(); return thresholdValues; } Watc...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setThresholdValues(ThresholdValues tValues) { if(thresholdManager!=null) thresholdManager.setThresholdValues(tValues); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchData...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void close() { for(WatchDataReplicator replicator : getWatchDataReplicators()) replicator.close(); synchronized(replicators) { replicators.clear(); } closed = true; unexport(true); } WatchDataSourceImpl(); WatchDataSourceImpl(Strin...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public String getView() { return (viewClass); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfiguration(Configuration conf...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public void setView(String viewClass) { this.viewClass = viewClass; } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy(); void setConfigurat...
### Question: WatchDataSourceImpl implements WatchDataSource, ServerProxyTrust { public TrustVerifier getProxyVerifier() { return (new BasicProxyTrustVerifier(proxy)); } WatchDataSourceImpl(); WatchDataSourceImpl(String id, Configuration config); void initialize(); WatchDataSource export(); WatchDataSource getProxy();...