method2testcases stringlengths 118 6.63k |
|---|
### Question:
GZIPUtils { public static byte[] uncompressBufferToArray(ByteBuffer contentBuffer) { if(contentBuffer != null) { try (ByteBufferInputStream input = new ByteBufferInputStream(contentBuffer)) { return uncompressStreamToArray(input); } } else { return null; } } static byte[] compressBufferToArray(ByteBuffer... |
### Question:
GZIPUtils { public static byte[] uncompressStreamToArray(InputStream stream) { if(stream != null) { try (GZIPInputStream gzipInputStream = new GZIPInputStream(stream)) { ByteArrayOutputStream inflatedContent = new ByteArrayOutputStream(); int read; byte[] buf = new byte[4096]; while ((read = gzipInputStre... |
### Question:
GZIPUtils { public static byte[] compressBufferToArray(ByteBuffer input) { if(input != null) { try (ByteArrayOutputStream compressedBuffer = new ByteArrayOutputStream()) { try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(compressedBuffer)) { if (input.hasArray()) { gzipOutputStream.write(inpu... |
### Question:
FileHelper { public Path createNewFile(File newFile, String posixFileAttributes) throws IOException { return createNewFile(newFile.toPath(), posixFileAttributes); } void writeFileSafely(Path targetFile, BaseAction<File, IOException> operation); void writeFileSafely(Path targetFile, Path backupFile, Path ... |
### Question:
FileHelper { public void writeFileSafely(Path targetFile, BaseAction<File, IOException> operation) throws IOException { String name = targetFile.toFile().getName(); writeFileSafely(targetFile, targetFile.resolveSibling(name + ".bak"), targetFile.resolveSibling(name + ".tmp"), operation); } void writeFile... |
### Question:
FileHelper { public Path atomicFileMoveOrReplace(Path sourceFile, Path targetFile) throws IOException { try { return Files.move(sourceFile, targetFile, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); } catch(AtomicMoveNotSupportedException e) { if (sourceFile.toFile().renameTo(target... |
### Question:
FileHelper { public boolean isWritableDirectory(String path) { File storePath = new File(path).getAbsoluteFile(); if (storePath.exists()) { if (!storePath.isDirectory()) { return false; } } else { do { storePath = storePath.getParentFile(); if (storePath == null) { return false; } } while (!storePath.exis... |
### Question:
Strings { public static String hexDump(ByteBuffer buf) { StringBuilder builder = new StringBuilder(); int count = 0; for(int p = buf.position(); p < buf.position() + buf.remaining(); p++) { if (count % 16 == 0) { if (count > 0) { builder.append(String.format("%n")); } builder.append(String.format("%07x ",... |
### Question:
CommandLineParser { public String getOptionsInForce() { if (parsedProperties == null) { return ""; } StringBuilder result = new StringBuilder("Options in force:\n"); for (Map.Entry<Object, Object> property : parsedProperties.entrySet()) { result.append(property.getKey()) .append(" = ") .append(property.ge... |
### Question:
CommandLineParser { public String getUsage() { String result = "Options:\n"; for (CommandLineOption optionInfo : optionMap.values()) { result += "-" + optionInfo.option + " " + ((optionInfo.argument != null) ? (optionInfo.argument + " ") : "") + optionInfo.comment + "\n"; } return result; } CommandLinePar... |
### Question:
StringUtil { public String randomAlphaNumericString(int maxLength) { char[] result = new char[maxLength]; for (int i = 0; i < maxLength; i++) { result[i] = (char) CHARACTERS[_random.nextInt(CHARACTERS.length)]; } return new String(result); } static String elideDataUrl(final String path); static String to... |
### Question:
StringUtil { public String createUniqueJavaName(String managerName) { StringBuilder builder = new StringBuilder(); boolean initialChar = true; for (int i = 0; i < managerName.length(); i++) { char c = managerName.charAt(i); if ((initialChar && Character.isJavaIdentifierStart(c)) || (!initialChar && Charac... |
### Question:
FileUtils { public static void copyRecursive(File source, File dst) throws FileNotFoundException, UnableToCopyException { if (!source.exists()) { throw new FileNotFoundException("Unable to copy '" + source.toString() + "' as it does not exist."); } if (dst.exists() && !dst.isDirectory()) { throw new Illeg... |
### Question:
FileUtils { public static boolean deleteFile(String filePath) { return delete(new File(filePath), false); } private FileUtils(); static byte[] readFileAsBytes(String filename); static String readFileAsString(String filename); static String readFileAsString(File file); @SuppressWarnings("resource") static... |
### Question:
FileUtils { @SuppressWarnings("resource") public static InputStream openFileOrDefaultResource(String filename, String defaultResource, ClassLoader cl) { InputStream is = null; if (filename != null) { try { is = new BufferedInputStream(new FileInputStream(new File(filename))); } catch (FileNotFoundExceptio... |
### Question:
FileUtils { public static boolean deleteDirectory(String directoryPath) { File directory = new File(directoryPath); if (directory.isDirectory()) { if (directory.listFiles().length == 0) { return delete(directory, true); } } return false; } private FileUtils(); static byte[] readFileAsBytes(String filenam... |
### Question:
CachingUUIDFactory { public UUID createUuidFromBits(final long mostSigBits, final long leastSigBits) { UUID candidate = new UUID(mostSigBits, leastSigBits); return cacheIfNecessary(candidate); } UUID createUuidFromString(final String name); UUID createUuidFromBits(final long mostSigBits, final long least... |
### Question:
ByteBufferInputStream extends InputStream { @Override public int read() throws IOException { if (_buffer.hasRemaining()) { return _buffer.get() & 0xFF; } return -1; } ByteBufferInputStream(ByteBuffer buffer); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void mark(int rea... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public String getActiveFileName() { return _decorated.getActiveFileName(); } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listener, ScheduledExecutorService executorService); @Override void rollover(); @Override String get... |
### Question:
ByteBufferInputStream extends InputStream { @Override public long skip(long n) throws IOException { _buffer.position(_buffer.position()+(int)n); return n; } ByteBufferInputStream(ByteBuffer buffer); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void mark(int readlimit); @... |
### Question:
ByteBufferInputStream extends InputStream { @Override public int available() throws IOException { return _buffer.remaining(); } ByteBufferInputStream(ByteBuffer buffer); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void mark(int readlimit); @Override void reset(); @Overr... |
### Question:
ByteBufferInputStream extends InputStream { @Override public boolean markSupported() { return true; } ByteBufferInputStream(ByteBuffer buffer); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void mark(int readlimit); @Override void reset(); @Override boolean markSupported(... |
### Question:
AMQPProtocolVersionWrapper { public AMQPProtocolVersionWrapper(Protocol amqpProtocol) { if (!amqpProtocol.isAMQP()) { throw new IllegalArgumentException("Protocol must be of type " + Protocol.ProtocolType.AMQP); } final String[] parts = amqpProtocol.name().split(DELIMITER); for (int i = 0; i < parts.lengt... |
### Question:
AMQPProtocolVersionWrapper { public Protocol getProtocol() { return Protocol.valueOf(this.toString()); } AMQPProtocolVersionWrapper(Protocol amqpProtocol); int getMajor(); int getMinor(); int getPatch(); Protocol getProtocol(); @Override boolean equals(Object o); @Override int hashCode(); @Override String... |
### Question:
ProtocolEngineCreatorComparator implements Comparator<ProtocolEngineCreator> { @Override public int compare(ProtocolEngineCreator pec1, ProtocolEngineCreator pec2) { final AMQPProtocolVersionWrapper v1 = new AMQPProtocolVersionWrapper(pec1.getVersion()); final AMQPProtocolVersionWrapper v2 = new AMQPProto... |
### Question:
StandardQueueEntryList extends OrderedQueueEntryList { @Override public QueueEntry getLeastSignificantOldestEntry() { return getOldestEntry(); } StandardQueueEntryList(final StandardQueue<?> queue, QueueStatistics queueStatistics); @Override QueueEntry getLeastSignificantOldestEntry(); }### Answer:
@Test... |
### Question:
SortedQueueEntryList extends AbstractQueueEntryList { @Override public QueueEntryIterator iterator() { return new QueueEntryIteratorImpl(_head); } SortedQueueEntryList(final SortedQueueImpl queue, final QueueStatistics queueStatistics); @Override SortedQueueImpl getQueue(); @Override SortedQueueEntry add(... |
### Question:
SortedQueueEntryList extends AbstractQueueEntryList { @Override public QueueEntry getLeastSignificantOldestEntry() { return getOldestEntry(); } SortedQueueEntryList(final SortedQueueImpl queue, final QueueStatistics queueStatistics); @Override SortedQueueImpl getQueue(); @Override SortedQueueEntry add(fin... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public CompressionMode getCompressionMode() { return _decorated.getCompressionMode(); } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listener, ScheduledExecutorService executorService); @Override void rollover(); @Override... |
### Question:
ProducerFlowControlOverflowPolicyHandler implements OverflowPolicyHandler { @Override public void checkOverflow(final QueueEntry newlyEnqueued) { _handler.checkOverflow(newlyEnqueued); } ProducerFlowControlOverflowPolicyHandler(Queue<?> queue, EventLogger eventLogger); @Override void checkOverflow(final Q... |
### Question:
ProducerFlowControlOverflowPolicyHandler implements OverflowPolicyHandler { boolean isQueueFlowStopped() { return _handler.isQueueFlowStopped(); } ProducerFlowControlOverflowPolicyHandler(Queue<?> queue, EventLogger eventLogger); @Override void checkOverflow(final QueueEntry newlyEnqueued); }### Answer:
... |
### Question:
RejectPolicyHandler { void checkReject(final ServerMessage<?> newMessage) throws MessageUnacceptableException { _handler.checkReject(newMessage); } RejectPolicyHandler(final Queue<?> queue); }### Answer:
@Test public void testOverfullBytes() throws Exception { ServerMessage incomingMessage = createIncom... |
### Question:
RingOverflowPolicyHandler implements OverflowPolicyHandler { @Override public void checkOverflow(final QueueEntry newlyEnqueued) { _handler.checkOverflow(); } RingOverflowPolicyHandler(final Queue<?> queue,
final EventLogger eventLogger); @Override void checkOverflow(final Qu... |
### Question:
SortedQueueEntry extends QueueEntryImpl { @Override public int compareTo(final QueueEntry other) { SortedQueueEntry o = (SortedQueueEntry)other; final String otherKey = o._key; final int compare = _key == null ? (otherKey == null ? 0 : -1) : otherKey == null ? 1 : _key.compareTo(otherKey); return compare ... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public void setParent(FileAppender appender) { _decorated.setParent(appender); } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listener, ScheduledExecutorService executorService); @Override void rollover(); @Override String... |
### Question:
SortedQueueEntry extends QueueEntryImpl { @Override public SortedQueueEntry getNextValidEntry() { return getNextNode(); } SortedQueueEntry(final SortedQueueEntryList queueEntryList); SortedQueueEntry(final SortedQueueEntryList queueEntryList,
final ServerMessage message,
... |
### Question:
InternalMessageMutator implements ServerMessageMutator<InternalMessage> { @Override public void setPriority(final byte priority) { _priority = priority; } InternalMessageMutator(final InternalMessage message, final MessageStore messageStore); @Override void setPriority(final byte priority); @Override byte... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public void start() { ScanTask task = createScanTaskAndCancelInProgress(); _decorated.start(); _executorService.execute(task); } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listener, ScheduledExecutorService executorServi... |
### Question:
InternalMessageMutator implements ServerMessageMutator<InternalMessage> { @Override public byte getPriority() { return _priority; } InternalMessageMutator(final InternalMessage message, final MessageStore messageStore); @Override void setPriority(final byte priority); @Override byte getPriority(); @Overri... |
### Question:
InternalMessageMutator implements ServerMessageMutator<InternalMessage> { @Override public InternalMessage create() { final InternalMessageHeader messageHeader = _message.getMessageHeader(); final InternalMessageHeader newHeader = new InternalMessageHeader(new HashMap<>(messageHeader.getHeaderMap()), mess... |
### Question:
UUIDGenerator { public static UUID generateQueueUUID(String queueName, String virtualHostName) { return createUUID(Queue.class.getName(), virtualHostName, queueName); } static UUID generateRandomUUID(); static UUID generateExchangeUUID(String exchangeName, String virtualHostName); static UUID generateQue... |
### Question:
UUIDGenerator { public static UUID generateExchangeUUID(String exchangeName, String virtualHostName) { return createUUID(Exchange.class.getName(), virtualHostName, exchangeName); } static UUID generateRandomUUID(); static UUID generateExchangeUUID(String exchangeName, String virtualHostName); static UUID... |
### Question:
UUIDGenerator { public static UUID generateBindingUUID(String exchangeName, String queueName, String bindingKey, String virtualHostName) { return createUUID(Binding.class.getName(), virtualHostName, exchangeName, queueName, bindingKey); } static UUID generateRandomUUID(); static UUID generateExchangeUUID... |
### Question:
UUIDGenerator { public static UUID generateVhostUUID(String virtualHostName) { return createUUID(VirtualHost.class.getName(), virtualHostName); } static UUID generateRandomUUID(); static UUID generateExchangeUUID(String exchangeName, String virtualHostName); static UUID generateQueueUUID(String queueName... |
### Question:
UUIDGenerator { public static UUID generateVhostAliasUUID(String virtualHostName, String portName) { return createUUID(VirtualHostAlias.class.getName(), virtualHostName, portName); } static UUID generateRandomUUID(); static UUID generateExchangeUUID(String exchangeName, String virtualHostName); static UU... |
### Question:
UUIDGenerator { public static UUID generateUserUUID(String authenticationProviderName, String userName) { return createUUID(User.class.getName(), authenticationProviderName, userName); } static UUID generateRandomUUID(); static UUID generateExchangeUUID(String exchangeName, String virtualHostName); stati... |
### Question:
ConfiguredObjectJacksonModule extends SimpleModule { public static ObjectMapper newObjectMapper(final boolean forPersistence) { final ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(forPersistence ? PERSISTENCE_INSTANCE : INSTANCE); return objectMapper; } private ConfiguredObj... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public void stop() { _decorated.stop(); synchronized (_publishResultsLock) { if (_currentScanTask != null) { _currentScanTask.cancel(); } _previousScanResults = null; } } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listen... |
### Question:
FileBasedGroupProviderImpl extends AbstractCaseAwareGroupProvider<FileBasedGroupProviderImpl> implements FileBasedGroupProvider<FileBasedGroupProviderImpl> { @Override public Set<Principal> getGroupPrincipalsForUser(Principal userPrincipal) { Set<String> groups = _groupDatabase == null ? Collections.<Stri... |
### Question:
ArrivalTimeFilterFactory implements MessageFilterFactory { @Override public MessageFilter newInstance(final List<String> arguments) { if(arguments == null || arguments.size() != 1) { throw new IllegalArgumentException(String.format("Cannot create a %s filter from these arguments: %s", getType(), arguments... |
### Question:
JMSSelectorFilter implements MessageFilter { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final JMSSelectorFilter that = (JMSSelectorFilter) o; return getSelector().equals(that.getSelector()); } JMSSelector... |
### Question:
ExchangeMessages { public static LogMessage CREATED(String param1, String param2, boolean opt1) { String rawMessage = _messages.getString("CREATED"); StringBuffer msg = new StringBuffer(); String[] parts = rawMessage.split("\\["); msg.append(parts[0]); int end; if (parts.length > 1) { end = parts[1].index... |
### Question:
ExchangeMessages { public static LogMessage DELETED() { String rawMessage = _messages.getString("DELETED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return DELETED_LOG_HIERARCHY; } @Overr... |
### Question:
ExchangeMessages { public static LogMessage DISCARDMSG(String param1, String param2) { String rawMessage = _messages.getString("DISCARDMSG"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format... |
### Question:
BrokerMessages { public static LogMessage STARTUP(String param1, String param2) { String rawMessage = _messages.getString("STARTUP"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(message... |
### Question:
RollingPolicyDecorator implements RollingPolicy { @Override public boolean isStarted() { return _decorated.isStarted(); } RollingPolicyDecorator(RollingPolicyBase decorated, RolloverListener listener, ScheduledExecutorService executorService); @Override void rollover(); @Override String getActiveFileName(... |
### Question:
BrokerMessages { public static LogMessage LISTENING(String param1, Number param2) { String rawMessage = _messages.getString("LISTENING"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(mes... |
### Question:
BrokerMessages { public static LogMessage SHUTTING_DOWN(String param1, Number param2) { String rawMessage = _messages.getString("SHUTTING_DOWN"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.fo... |
### Question:
BrokerMessages { public static LogMessage READY() { String rawMessage = _messages.getString("READY"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return READY_LOG_HIERARCHY; } @Override publ... |
### Question:
BrokerMessages { public static LogMessage STOPPED() { String rawMessage = _messages.getString("STOPPED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return STOPPED_LOG_HIERARCHY; } @Overrid... |
### Question:
BrokerMessages { public static LogMessage CONFIG(String param1) { String rawMessage = _messages.getString("CONFIG"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return new Lo... |
### Question:
BrokerMessages { public static LogMessage PLATFORM(String param1, String param2, String param3, String param4, String param5, String param6) { String rawMessage = _messages.getString("PLATFORM"); final Object[] messageArguments = {param1, param2, param3, param4, param5, param6}; MessageFormat formatter = ... |
### Question:
BrokerMessages { public static LogMessage MAX_MEMORY(Number param1, Number param2) { String rawMessage = _messages.getString("MAX_MEMORY"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(m... |
### Question:
VirtualHostMessages { public static LogMessage CREATED(String param1) { String rawMessage = _messages.getString("CREATED"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return... |
### Question:
VirtualHostMessages { public static LogMessage CLOSED(String param1) { String rawMessage = _messages.getString("CLOSED"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return n... |
### Question:
ChannelMessages { public static LogMessage CREATE() { String rawMessage = _messages.getString("CREATE"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CREATE_LOG_HIERARCHY; } @Override ... |
### Question:
ChannelMessages { public static LogMessage FLOW(String param1) { String rawMessage = _messages.getString("FLOW"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return new LogMe... |
### Question:
ChannelMessages { public static LogMessage CLOSE() { String rawMessage = _messages.getString("CLOSE"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSE_LOG_HIERARCHY; } @Override pub... |
### Question:
ChannelMessages { public static LogMessage CLOSE_FORCED(Number param1, String param2) { String rawMessage = _messages.getString("CLOSE_FORCED"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.for... |
### Question:
ConnectionMessages { public static LogMessage CLOSE(String param1, boolean opt1) { String rawMessage = _messages.getString("CLOSE"); StringBuffer msg = new StringBuffer(); String[] parts = rawMessage.split("\\["); msg.append(parts[0]); int end; if (parts.length > 1) { end = parts[1].indexOf(']'); if (opt1... |
### Question:
AppenderUtils { static void validateMaxFileSize(final int maxFileSize) { if (maxFileSize < 1) { throw new IllegalConfigurationException(String.format("Maximum file size must be at least 1. Cannot set to %d.", maxFileSize)); } } static void configureRollingFileAppender(FileLoggerSettings fileLoggerSetting... |
### Question:
QueueMessages { public static LogMessage DELETED(String param1) { String rawMessage = _messages.getString("DELETED"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return new L... |
### Question:
ManagementConsoleMessages { public static LogMessage STARTUP(String param1) { String rawMessage = _messages.getString("STARTUP"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); ... |
### Question:
ManagementConsoleMessages { public static LogMessage LISTENING(String param1, String param2, Number param3) { String rawMessage = _messages.getString("LISTENING"); final Object[] messageArguments = {param1, param2, param3}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final Str... |
### Question:
ManagementConsoleMessages { public static LogMessage SHUTTING_DOWN(String param1, Number param2) { String rawMessage = _messages.getString("SHUTTING_DOWN"); final Object[] messageArguments = {param1, param2}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = f... |
### Question:
ManagementConsoleMessages { public static LogMessage READY(String param1) { String rawMessage = _messages.getString("READY"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); retu... |
### Question:
ManagementConsoleMessages { public static LogMessage STOPPED(String param1) { String rawMessage = _messages.getString("STOPPED"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); ... |
### Question:
MessageStoreMessages { public static LogMessage CREATED() { String rawMessage = _messages.getString("CREATED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CREATED_LOG_HIERARCHY; } @O... |
### Question:
QpidLoggerTurboFilter extends TurboFilter { public static void uninstall(LoggerContext context) { context.getTurboFilterList().remove(new QpidLoggerTurboFilter()); } QpidLoggerTurboFilter(); @Override FilterReply decide(final Marker marker,
final Logger logger,
... |
### Question:
MessageStoreMessages { public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArg... |
### Question:
MessageStoreMessages { public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Over... |
### Question:
MessageStoreMessages { public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_STAR... |
### Question:
TrustStoreMessageSource extends AbstractSystemMessageSource { @Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integ... |
### Question:
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = C... |
### Question:
StartupAppender extends AppenderBase<ILoggingEvent> { public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternL... |
### Question:
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encry... |
### Question:
GroupPrincipal implements QpidPrincipal { @Override public String getName() { return _groupName; } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Principal user); boolean isMember(Principal membe... |
### Question:
GroupPrincipal implements QpidPrincipal { public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Princi... |
### Question:
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _orig... |
### Question:
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); @Override Set<String> getAllGroups(); synchronized void setGroupFile(String groupFile); @Ov... |
### Question:
StartupAppender extends AppenderBase<ILoggingEvent> { public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } } StartupAppender(); synchronized void replayAccumulatedEvents(Appender<ILoggingEven... |
### Question:
FileGroupDatabase implements GroupDatabase { public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); } FileGroupDatab... |
### Question:
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), ... |
### Question:
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet()... |
### Question:
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.... |
### Question:
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_... |
### Question:
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final Name... |
### Question:
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username))... |
### Question:
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); } @ManagedObjectFactoryConstructor protected AnonymousAuthenticationManager(final Map<String, Object> at... |
### Question:
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new Ano... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.