Unnamed: 0
int64 0
6.7k
| func
stringlengths 12
89.6k
| target
bool 2
classes | project
stringlengths 45
151
|
|---|---|---|---|
6,500
|
public interface BranchCollisionPolicy extends org.neo4j.graphdb.traversal.BranchCollisionPolicy
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_traversal_BranchCollisionPolicy.java
|
6,501
|
private static enum Types implements RelationshipType
{
A, B
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_traversal_TestConstantDirectionExpander.java
|
6,502
|
private static enum Types implements RelationshipType
{
A,B,C;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_traversal_TestEvaluators.java
|
6,503
|
protected interface Representation<T>
{
String represent( T item );
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_traversal_TraversalTestBase.java
|
6,504
|
public interface TraverserIterator extends ResourceIterator<Path>, TraversalContext
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_traversal_TraverserIterator.java
|
6,505
|
public enum BufferNumberPutter
{
BYTE( Byte.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.put( value.byteValue() );
}
@Override
public void put( LogBuffer buffer, Number value ) throws IOException
{
buffer.put( value.byteValue() );
}
},
SHORT( Short.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.putShort( value.shortValue() );
}
@Override
public void put( LogBuffer buffer, Number value )
{
throw new UnsupportedOperationException();
}
},
INT( Integer.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.putInt( value.intValue() );
}
@Override
public void put( LogBuffer buffer, Number value ) throws IOException
{
buffer.putInt( value.intValue() );
}
},
LONG( Long.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.putLong( value.longValue() );
}
@Override
public void put( LogBuffer buffer, Number value ) throws IOException
{
buffer.putLong( value.longValue() );
}
},
FLOAT( Float.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.putFloat( value.floatValue() );
}
@Override
public void put( LogBuffer buffer, Number value ) throws IOException
{
buffer.putFloat( value.floatValue() );
}
},
DOUBLE( Double.SIZE )
{
@Override
public void put( ByteBuffer buffer, Number value )
{
buffer.putDouble( value.doubleValue() );
}
@Override
public void put( LogBuffer buffer, Number value ) throws IOException
{
buffer.putDouble( value.doubleValue() );
}
};
private final int size;
private BufferNumberPutter( int size )
{
this.size = size/8;
}
public int size()
{
return this.size;
}
public abstract void put( ByteBuffer buffer, Number value );
public abstract void put( LogBuffer buffer, Number value ) throws IOException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_BufferNumberPutter.java
|
6,506
|
public interface Switch<T> extends Predicate<T>
{
void reset();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_CappedOperation.java
|
6,507
|
private enum Phase
{
FILTERED_SOURCE
{
@Override
void computeNext( DiffApplyingPrimitiveIntIterator self )
{
self.computeNextFromSourceAndFilter();
}
},
ADDED_ELEMENTS
{
@Override
void computeNext( DiffApplyingPrimitiveIntIterator self )
{
self.computeNextFromAddedElements();
}
},
NO_ADDED_ELEMENTS
{
@Override
void computeNext( DiffApplyingPrimitiveIntIterator self )
{
self.endReached();
}
};
abstract void computeNext( DiffApplyingPrimitiveIntIterator self );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_DiffApplyingPrimitiveIntIterator.java
|
6,508
|
private enum Phase
{
FILTERED_SOURCE
{
@Override
void computeNext( DiffApplyingPrimitiveLongIterator self )
{
self.computeNextFromSourceAndFilter();
}
},
ADDED_ELEMENTS
{
@Override
void computeNext( DiffApplyingPrimitiveLongIterator self )
{
self.computeNextFromAddedElements();
}
},
NO_ADDED_ELEMENTS
{
@Override
void computeNext( DiffApplyingPrimitiveLongIterator self )
{
self.endReached();
}
};
abstract void computeNext( DiffApplyingPrimitiveLongIterator self );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_DiffApplyingPrimitiveLongIterator.java
|
6,509
|
public interface Visitor<T>
{
void visitAdded( T element );
void visitRemoved( T element );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_DiffSets.java
|
6,510
|
public interface Printer extends AutoCloseable
{
PrintStream getFor( String file ) throws FileNotFoundException;
@Override
void close();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_DumpLogicalLog.java
|
6,511
|
public interface LineListener
{
void line( String line );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_FileUtils.java
|
6,512
|
public interface JobScheduler extends Lifecycle
{
/**
* This is an exhaustive list of job types that run in the database. It should be expanded as needed for new groups
* of jobs.
*
* For now, this does naming only, but it will allow us to define per-group configuration, such as how to handle
* failures, shared threads and (later on) affinity strategies.
*/
enum Group
{
indexPopulation,
masterTransactionPushing,
serverTransactionTimeout,
}
void schedule( Group group, Runnable job );
void scheduleRecurring( Group group, Runnable runnable, long period, TimeUnit timeUnit );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_JobScheduler.java
|
6,513
|
enum Group
{
indexPopulation,
masterTransactionPushing,
serverTransactionTimeout,
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_JobScheduler.java
|
6,514
|
public interface PrimitiveIntIterator
{
boolean hasNext();
int next();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_PrimitiveIntIterator.java
|
6,515
|
public interface PrimitiveLongIterator
{
boolean hasNext();
long next();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_PrimitiveLongIterator.java
|
6,516
|
public interface PrimitiveLongResourceIterator extends PrimitiveLongIterator, Resource
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_PrimitiveLongResourceIterator.java
|
6,517
|
public static enum DirectionWrapper
{
OUTGOING( Direction.OUTGOING )
{
@Override
RelIdIterator iterator( RelIdArray ids )
{
return new RelIdIteratorImpl( ids, DIRECTIONS_FOR_OUTGOING );
}
@Override
IdBlock getBlock( RelIdArray ids )
{
return ids.outBlock;
}
@Override
void setBlock( RelIdArray ids, IdBlock block )
{
ids.outBlock = block;
}
},
INCOMING( Direction.INCOMING )
{
@Override
RelIdIterator iterator( RelIdArray ids )
{
return new RelIdIteratorImpl( ids, DIRECTIONS_FOR_INCOMING );
}
@Override
IdBlock getBlock( RelIdArray ids )
{
return ids.inBlock;
}
@Override
void setBlock( RelIdArray ids, IdBlock block )
{
ids.inBlock = block;
}
},
BOTH( Direction.BOTH )
{
@Override
RelIdIterator iterator( RelIdArray ids )
{
return new RelIdIteratorImpl( ids, DIRECTIONS_FOR_BOTH );
}
@Override
IdBlock getBlock( RelIdArray ids )
{
return ids.getLastLoopBlock();
}
@Override
void setBlock( RelIdArray ids, IdBlock block )
{
ids.setLastLoopBlock( block );
}
};
private final Direction direction;
private DirectionWrapper( Direction direction )
{
this.direction = direction;
}
abstract RelIdIterator iterator( RelIdArray ids );
/*
* Only used during add
*/
abstract IdBlock getBlock( RelIdArray ids );
/*
* Only used during add
*/
abstract void setBlock( RelIdArray ids, IdBlock block );
public Direction direction()
{
return this.direction;
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_RelIdArray.java
|
6,518
|
public interface RelIdIterator
{
int getType();
RelIdIterator updateSource( RelIdArray newSource, DirectionWrapper direction );
boolean hasNext();
/**
* Tells this iterator to try another round with all its directions
* starting from each their previous states. Called from IntArrayIterator,
* when it finds out it has gotten more relationships of this type.
*/
void doAnotherRound();
long next();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_RelIdIterator.java
|
6,519
|
public interface LineLogger
{
void logLine( String line );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_util_StringLogger.java
|
6,520
|
private enum Level
{
DEBUG,
INFO,
WARN,
ERROR
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_util_TestLogger.java
|
6,521
|
public interface DiagnosticsExtractor<T>
{
/**
* A {@link DiagnosticsExtractor} capable of
* {@link DiagnosticsProvider#acceptDiagnosticsVisitor(Object) accepting
* visitors}.
*
* @author Tobias Lindaaker <tobias.lindaaker@neotechnology.com>
*
* @param <T> the type of the source to extract diagnostics information
* from.
*/
interface VisitableDiagnostics<T> extends DiagnosticsExtractor<T>
{
/**
* Accept a visitor that may or may not be capable of visiting this
* object.
*
* @see DiagnosticsProvider#acceptDiagnosticsVisitor(Object)
* @param source the source to get diagnostics information from.
* @param visitor the visitor visiting the diagnostics information.
*/
void dispatchDiagnosticsVisitor( T source, Object visitor );
}
/**
* Dump the diagnostic information of the specified source for the specified
* {@link DiagnosticsPhase phase} to the provided {@link StringLogger log}.
*
* @see DiagnosticsProvider#dump(DiagnosticsPhase, StringLogger)
* @param source the source to get diagnostics information from.
* @param phase the {@link DiagnosticsPhase phase} to dump information for.
* @param log the {@link StringLogger log} to dump information to.
*/
void dumpDiagnostics( T source, DiagnosticsPhase phase, StringLogger log );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_DiagnosticsExtractor.java
|
6,522
|
interface VisitableDiagnostics<T> extends DiagnosticsExtractor<T>
{
/**
* Accept a visitor that may or may not be capable of visiting this
* object.
*
* @see DiagnosticsProvider#acceptDiagnosticsVisitor(Object)
* @param source the source to get diagnostics information from.
* @param visitor the visitor visiting the diagnostics information.
*/
void dispatchDiagnosticsVisitor( T source, Object visitor );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_DiagnosticsExtractor.java
|
6,523
|
private enum State
{
INITIAL
{
@Override
boolean startup( DiagnosticsManager manager )
{
manager.state = STARTED;
return true;
}
},
STARTED,
STOPPED
{
@Override
boolean shutdown( DiagnosticsManager manager )
{
return false;
}
};
boolean startup( DiagnosticsManager manager )
{
return false;
}
boolean shutdown( DiagnosticsManager manager )
{
manager.state = STOPPED;
return true;
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_DiagnosticsManager.java
|
6,524
|
public enum DiagnosticsPhase
{
REQUESTED( true, false ),
EXPLICIT( true, false ),
CREATED( false, true ),
INITIALIZED( false, true ),
STARTED( false, true ),
LOG_ROTATION( false, true ),
STOPPING( false, false ),
SHUTDOWN( false, false ), ;
private final boolean requested;
private final boolean initial;
private DiagnosticsPhase( boolean requested, boolean initial )
{
this.requested = requested;
this.initial = initial;
}
void emitStart( StringLogger log )
{
log.info( "--- " + this + " START ---" );
}
void emitDone( StringLogger log )
{
log.info( "--- " + this + " END ---" );
}
void emitStart( StringLogger log, DiagnosticsProvider provider )
{
log.info( "--- " + this + " for " + provider.getDiagnosticsIdentifier() + " START ---" );
}
void emitDone( StringLogger log, DiagnosticsProvider provider )
{
log.info( "--- " + this + " for " + provider.getDiagnosticsIdentifier() + " END ---" );
}
public boolean isInitialization()
{
return initial;
}
public boolean isExplicitlyRequested()
{
return requested;
}
@Override
public String toString()
{
return name() + " diagnostics";
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_DiagnosticsPhase.java
|
6,525
|
public interface DiagnosticsProvider
{
/**
* Return an identifier for this {@link DiagnosticsProvider}. The result of
* this method must be stable, i.e. invoking this method multiple times on
* the same object should return {@link Object#equals(Object) equal}
* {@link String strings}.
*
* For {@link DiagnosticsProvider}s where there is only one instance of that
* {@link DiagnosticsProvider}, an implementation like this is would be a
* sane default, given that the implementing class has a sensible name:
*
* <code><pre>
* public String getDiagnosticsIdentifier()
* {
* return getClass().getName();
* }
* </pre></code>
*
* @return the identifier of this diagnostics provider.
*/
String getDiagnosticsIdentifier();
/**
* Accept a visitor that may or may not be capable of visiting this object.
*
* Typical example:
*
* <code><pre>
* class OperationalStatistics implements {@link DiagnosticsProvider}
* {
* public void {@link #acceptDiagnosticsVisitor(Object) acceptDiagnosticsVisitor}( {@link Object} visitor )
* {
* if ( visitor instanceof OperationalStatisticsVisitor )
* {
* ((OperationalStatisticsVisitor)visitor).visitOperationalStatistics( this );
* }
* }
* }
*
* interface OperationalStatisticsVisitor
* {
* void visitOperationalStatistics( OperationalStatistics statistics );
* }
* </pre></code>
*
* @param visitor the visitor visiting this {@link DiagnosticsProvider}.
*/
void acceptDiagnosticsVisitor( Object visitor );
/**
* Dump the diagnostic information of this {@link DiagnosticsProvider} for
* the specified {@link DiagnosticsPhase phase} to the provided
* {@link StringLogger log}.
*
* @param phase the {@link DiagnosticsPhase phase} to dump information for.
* @param log the {@link StringLogger log} to dump information to.
*/
void dump( DiagnosticsPhase phase, StringLogger log );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_DiagnosticsProvider.java
|
6,526
|
public enum ResourceType
{
NODE
{
@Override
public String toString( String resourceId )
{
return "Node[" + resourceId + "]";
}
},
RELATIONSHIP
{
@Override
public String toString( String resourceId )
{
return "Relationship[" + resourceId + "]";
}
},
OTHER
{
@Override
public String toString( String resourceId )
{
return resourceId;
}
};
public abstract String toString( String resourceId );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_ResourceType.java
|
6,527
|
enum SystemDiagnostics implements DiagnosticsProvider
{
SYSTEM_MEMORY( "System memory information:" )
{
private static final String SUN_OS_BEAN = "com.sun.management.OperatingSystemMXBean";
private static final String IBM_OS_BEAN = "com.ibm.lang.management.OperatingSystemMXBean";
@Override
void dump( StringLogger.LineLogger logger )
{
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
logBeanBytesProperty( logger, "Total Physical memory: ", os, SUN_OS_BEAN, "getTotalPhysicalMemorySize" );
logBeanBytesProperty( logger, "Free Physical memory: ", os, SUN_OS_BEAN, "getFreePhysicalMemorySize" );
logBeanBytesProperty( logger, "Committed virtual memory: ", os, SUN_OS_BEAN, "getCommittedVirtualMemorySize" );
logBeanBytesProperty( logger, "Total swap space: ", os, SUN_OS_BEAN, "getTotalSwapSpaceSize" );
logBeanBytesProperty( logger, "Free swap space: ", os, SUN_OS_BEAN, "getFreeSwapSpaceSize" );
logBeanBytesProperty( logger, "Total physical memory: ", os, IBM_OS_BEAN, "getTotalPhysicalMemory" );
logBeanBytesProperty( logger, "Free physical memory: ", os, IBM_OS_BEAN, "getFreePhysicalMemorySize" );
}
private void logBeanBytesProperty( StringLogger.LineLogger logger, String message, Object bean, String type,
String method )
{
Object value = getBeanProperty( bean, type, method, null );
if ( value instanceof Number ) logger.logLine( message + bytes( ( (Number) value ).longValue() ) );
}
},
JAVA_MEMORY( "JVM memory information:" )
{
@Override
void dump( StringLogger.LineLogger logger )
{
logger.logLine( "Free memory: " + bytes( Runtime.getRuntime().freeMemory() ) );
logger.logLine( "Total memory: " + bytes( Runtime.getRuntime().totalMemory() ) );
logger.logLine( "Max memory: " + bytes( Runtime.getRuntime().maxMemory() ) );
for ( GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans() )
{
logger.logLine( "Garbage Collector: " + gc.getName() + ": " + Arrays.toString( gc.getMemoryPoolNames() ) );
}
for ( MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans() )
{
MemoryUsage usage = pool.getUsage();
logger.logLine( String.format( "Memory Pool: %s (%s): committed=%s, used=%s, max=%s, threshold=%s",
pool.getName(), pool.getType(), usage == null ? "?" : bytes( usage.getCommitted() ),
usage == null ? "?" : bytes( usage.getUsed() ), usage == null ? "?" : bytes( usage.getMax() ),
pool.isUsageThresholdSupported() ? bytes( pool.getUsageThreshold() ) : "?" ) );
}
}
},
OPERATING_SYSTEM( "Operating system information:" )
{
private static final String SUN_UNIX_BEAN = "com.sun.management.UnixOperatingSystemMXBean";
@Override
void dump( StringLogger.LineLogger logger )
{
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
logger.logLine( String.format( "Operating System: %s; version: %s; arch: %s; cpus: %s", os.getName(),
os.getVersion(), os.getArch(), os.getAvailableProcessors() ) );
logBeanProperty( logger, "Max number of file descriptors: ", os, SUN_UNIX_BEAN, "getMaxFileDescriptorCount" );
logBeanProperty( logger, "Number of open file descriptors: ", os, SUN_UNIX_BEAN, "getOpenFileDescriptorCount" );
logger.logLine( "Process id: " + runtime.getName() );
logger.logLine( "Byte order: " + ByteOrder.nativeOrder() );
logger.logLine( "Local timezone: " + getLocalTimeZone() );
}
private String getLocalTimeZone()
{
TimeZone tz = Calendar.getInstance().getTimeZone();
return tz.getID();
}
private void logBeanProperty( StringLogger.LineLogger logger, String message, Object bean, String type, String method )
{
Object value = getBeanProperty( bean, type, method, null );
if ( value != null ) logger.logLine( message + value );
}
},
JAVA_VIRTUAL_MACHINE( "JVM information:" )
{
@Override
void dump( StringLogger.LineLogger logger )
{
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
logger.logLine( "VM Name: " + runtime.getVmName() );
logger.logLine( "VM Vendor: " + runtime.getVmVendor() );
logger.logLine( "VM Version: " + runtime.getVmVersion() );
CompilationMXBean compiler = ManagementFactory.getCompilationMXBean();
logger.logLine( "JIT compiler: " + ( ( compiler == null ) ? "unknown" : compiler.getName() ) );
logger.logLine( "VM Arguments: " + runtime.getInputArguments() );
}
},
CLASSPATH( "Java classpath:" )
{
@Override
void dump( StringLogger.LineLogger logger )
{
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
Collection<String> classpath;
if ( runtime.isBootClassPathSupported() )
{
classpath = buildClassPath( getClass().getClassLoader(),
new String[] { "bootstrap", "classpath" },
runtime.getBootClassPath(), runtime.getClassPath() );
}
else
{
classpath = buildClassPath( getClass().getClassLoader(),
new String[] { "classpath" }, runtime.getClassPath() );
}
for ( String path : classpath )
{
logger.logLine( path );
}
}
private Collection<String> buildClassPath( ClassLoader loader, String[] pathKeys, String... classPaths )
{
Map<String, String> paths = new HashMap<String, String>();
assert pathKeys.length == classPaths.length;
for ( int i = 0; i < classPaths.length; i++ )
for ( String path : classPaths[i].split( File.pathSeparator ) )
paths.put( canonicalize( path ), pathValue( paths, pathKeys[i], path ) );
for ( int level = 0; loader != null; level++ )
{
if ( loader instanceof URLClassLoader )
{
URLClassLoader urls = (URLClassLoader) loader;
for ( URL url : urls.getURLs() )
if ( "file".equalsIgnoreCase( url.getProtocol() ) )
paths.put( url.toString(), pathValue( paths, "loader." + level, url.getPath() ) );
}
loader = loader.getParent();
}
List<String> result = new ArrayList<String>( paths.size() );
for ( Map.Entry<String, String> path : paths.entrySet() )
{
result.add( " [" + path.getValue() + "] " + path.getKey() );
}
return result;
}
private String pathValue( Map<String, String> paths, String key, String path )
{
String value;
if ( null != ( value = paths.remove( canonicalize( path ) ) ) )
{
value += " + " + key;
}
else
{
value = key;
}
return value;
}
},
LIBRARY_PATH( "Library path:" )
{
@Override
void dump( StringLogger.LineLogger logger )
{
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
for ( String path : runtime.getLibraryPath().split( File.pathSeparator ) )
{
logger.logLine( canonicalize( path ) );
}
}
},
SYSTEM_PROPERTIES( "System.properties:" )
{
@Override
void dump( StringLogger.LineLogger logger )
{
for ( Object property : System.getProperties().keySet() )
{
if ( property instanceof String )
{
String key = (String) property;
if ( key.startsWith( "java." ) || key.startsWith( "os." ) || key.endsWith( ".boot.class.path" )
|| key.equals( "line.separator" ) ) continue;
logger.logLine( key + " = " + System.getProperty( key ) );
}
}
}
},
LINUX_SCHEDULERS( "Linux scheduler information:" )
{
private final File SYS_BLOCK = new File( "/sys/block" );
@Override
boolean isApplicable()
{
return SYS_BLOCK.isDirectory();
}
@Override
void dump( StringLogger.LineLogger logger )
{
for ( File subdir : SYS_BLOCK.listFiles( new java.io.FileFilter()
{
@Override
public boolean accept( File path )
{
return path.isDirectory();
}
} ) )
{
File scheduler = new File( subdir, "queue/scheduler" );
if ( scheduler.isFile() )
{
try
{
BufferedReader reader = newBufferedFileReader( scheduler, UTF_8 );
try
{
for ( String line; null != ( line = reader.readLine() ); )
logger.logLine( line );
}
finally
{
reader.close();
}
}
catch ( IOException e )
{
// ignore
}
}
}
}
},
NETWORK( "Network information:" )
{
@Override
void dump( LineLogger logger )
{
try
{
Enumeration<NetworkInterface> networkInterfaces = getNetworkInterfaces();
while ( networkInterfaces.hasMoreElements() )
{
NetworkInterface iface = networkInterfaces.nextElement();
logger.logLine( String.format( "Interface %s:", iface.getDisplayName() ) );
Enumeration<InetAddress> addresses = iface.getInetAddresses();
while ( addresses.hasMoreElements() )
{
InetAddress address = addresses.nextElement();
String hostAddress = address.getHostAddress();
logger.logLine( String.format( " address: %s", hostAddress ) );
}
}
} catch ( SocketException e )
{
logger.logLine( "ERROR: failed to inspect network interfaces and addresses: " + e.getMessage() );
}
}
},
;
private final String message;
private SystemDiagnostics(String message) {
this.message = message;
}
static void registerWith( DiagnosticsManager manager )
{
for ( SystemDiagnostics provider : values() )
{
if ( provider.isApplicable() ) manager.appendProvider( provider );
}
}
boolean isApplicable()
{
return true;
}
@Override
public String getDiagnosticsIdentifier()
{
return name();
}
@Override
public void acceptDiagnosticsVisitor( Object visitor )
{
// nothing visits this
}
@Override
public void dump( DiagnosticsPhase phase, StringLogger log )
{
if ( phase.isInitialization() || phase.isExplicitlyRequested() )
{
log.logLongMessage( message, new Visitor<StringLogger.LineLogger, RuntimeException>()
{
@Override
public boolean visit( LineLogger logger )
{
dump( logger );
return false;
}
}, true );
}
}
abstract void dump( StringLogger.LineLogger logger );
private static String canonicalize( String path )
{
try
{
return new File( path ).getCanonicalFile().getAbsolutePath();
}
catch ( IOException e )
{
return new File( path ).getAbsolutePath();
}
}
private static Object getBeanProperty( Object bean, String type, String method, String defVal )
{
try
{
return Class.forName( type ).getMethod( method ).invoke( bean );
}
catch ( Exception e )
{
return defVal;
}
catch ( LinkageError e )
{
return defVal;
}
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_info_SystemDiagnostics.java
|
6,528
|
public interface Lifecycle
{
void init()
throws Throwable;
void start()
throws Throwable;
void stop()
throws Throwable;
void shutdown()
throws Throwable;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_lifecycle_Lifecycle.java
|
6,529
|
public interface LifecycleListener
{
void notifyStatusChanged(Object instance, LifecycleStatus from, LifecycleStatus to);
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_lifecycle_LifecycleListener.java
|
6,530
|
public enum LifecycleStatus
{
NONE,
INITIALIZING,
STARTING,
STARTED,
STOPPING,
STOPPED,
SHUTTING_DOWN,
SHUTDOWN;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_lifecycle_LifecycleStatus.java
|
6,531
|
private static enum Level
{
LOG,
WARN,
ERROR;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_logging_BufferingConsoleLogger.java
|
6,532
|
public interface Logging
{
/**
* @param loggingClass the context for the return logger.
* @return a {@link StringLogger} that logs messages with the {@code loggingClass} as context.
*/
StringLogger getMessagesLog( Class loggingClass );
/**
*
* @param loggingClass
* @return a {@link ConsoleLogger} that logs message with the {@code loggingClass} as context.
* Messages logged with a {@link ConsoleLogger} will be logged to a console
*/
ConsoleLogger getConsoleLog( Class loggingClass );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_logging_Logging.java
|
6,533
|
public interface BackupMonitor {
void startCopyingFiles();
void finishedCopyingStoreFiles();
void finishedRotatingLogicalLogs();
void streamedFile( File storefile );
void streamingFile( File storefile );
public static final BackupMonitor NONE = new BackupMonitor()
{
@Override
public void streamingFile( File storefile )
{ // Do nothing
}
@Override
public void streamedFile( File storefile )
{ // Do nothing
}
@Override
public void startCopyingFiles()
{ // Do nothing
}
@Override
public void finishedRotatingLogicalLogs()
{ // Do nothing
}
@Override
public void finishedCopyingStoreFiles()
{ // Do nothing
}
};
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_monitoring_BackupMonitor.java
|
6,534
|
public interface ByteCounterMonitor
{
void bytesWritten( long numberOfBytes );
void bytesRead( long numberOfBytes );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_monitoring_ByteCounterMonitor.java
|
6,535
|
public interface MonitorListenerInvocationHandler
{
public void invoke( Object proxy, Method method, Object[] args, String... tags ) throws Throwable;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_monitoring_MonitorListenerInvocationHandler.java
|
6,536
|
public interface Monitor
{
void monitorCreated( Class<?> monitorClass, String... tags );
void monitorListenerException( Throwable throwable );
public class Adapter
implements Monitor
{
@Override
public void monitorCreated( Class<?> monitorClass, String... tags )
{
}
@Override
public void monitorListenerException( Throwable throwable )
{
}
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_monitoring_Monitors.java
|
6,537
|
interface MyMonitor
{
void aVoid();
void takesArgs( String arg1, long arg2, Object ... moreArgs );
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_monitoring_MonitorsTest.java
|
6,538
|
@ManagementInterface( name = BranchedStore.NAME )
@Description( "Information about the branched stores present in this HA cluster member" )
public interface BranchedStore
{
String NAME = "Branched Store";
@Description( "A list of the branched stores" )
BranchedStoreInfo[] getBranchedStores();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_BranchedStore.java
|
6,539
|
@ManagementInterface( name = Cache.NAME )
@Description( "Information about the caching in Neo4j" )
public interface Cache
{
String NAME = "Cache";
@Description( "The type of cache used by Neo4j" )
String getCacheType();
@Description( "The size of this cache (nr of entities or total size in bytes)" )
long getCacheSize();
@Description( "The number of times a cache query returned a result" )
long getHitCount();
@Description( "The number of times a cache query did not return a result" )
long getMissCount();
@Description( value = "Clears the Neo4j caches", impact = MBeanOperationInfo.ACTION )
void clear();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_Cache.java
|
6,540
|
@ManagementInterface( name = Diagnostics.NAME )
@Description( "Diagnostics provided by Neo4j" )
public interface Diagnostics
{
final String NAME = "Diagnostics";
@Description( "Dump diagnostics information to the log." )
void dumpToLog();
@Description( "Dump diagnostics information for the diagnostics provider with the specified id." )
void dumpToLog( String providerId );
@Description("Dump diagnostics information to JMX")
String dumpAll( );
@Description( "Extract diagnostics information for the diagnostics provider with the specified id." )
String extract( String providerId );
@Description( "A list of the ids for the registered diagnostics providers." )
List<String> getDiagnosticsProviders();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_Diagnostics.java
|
6,541
|
@ManagementInterface( name = HighAvailability.NAME )
@Description( "Information about an instance participating in a HA cluster" )
public interface HighAvailability
{
final String NAME = "High Availability";
@Description( "The identifier used to identify this server in the HA cluster" )
String getInstanceId();
@Description( "Whether this instance is available or not" )
boolean isAvailable();
@Description( "Whether this instance is alive or not" )
boolean isAlive();
@Description( "The role this instance has in the cluster" )
String getRole();
@Description( "The time when the data on this instance was last updated from the master" )
String getLastUpdateTime();
@Description( "The latest transaction id present in this instance's store" )
long getLastCommittedTxId();
@Description( "Information about all instances in this cluster" )
ClusterMemberInfo[] getInstancesInCluster();
@Description( "(If this is a slave) Update the database on this "
+ "instance with the latest transactions from the master" )
String update();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_HighAvailability.java
|
6,542
|
@ManagementInterface( name = LockManager.NAME )
@Description( "Information about the Neo4j lock status" )
public interface LockManager
{
final String NAME = "Locking";
@Description( "The number of lock sequences that would have lead to a deadlock situation that "
+ "Neo4j has detected and averted (by throwing DeadlockDetectedException)." )
long getNumberOfAvertedDeadlocks();
@Description( "Information about all locks held by Neo4j" )
List<LockInfo> getLocks();
@Description( "Information about contended locks (locks where at least one thread is waiting) held by Neo4j. "
+ "The parameter is used to get locks where threads have waited for at least the specified number "
+ "of milliseconds, a value of 0 retrieves all contended locks." )
List<LockInfo> getContendedLocks( long minWaitTime );
}
| false
|
advanced_management_src_main_java_org_neo4j_management_LockManager.java
|
6,543
|
@ManagementInterface( name = MemoryMapping.NAME )
@Description( "The status of Neo4j memory mapping" )
public interface MemoryMapping
{
final String NAME = "Memory Mapping";
@Description( "Get information about each pool of memory mapped regions from store files with "
+ "memory mapping enabled" )
WindowPoolInfo[] getMemoryPools();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_MemoryMapping.java
|
6,544
|
@ManagementInterface( name = RemoteConnection.NAME )
public interface RemoteConnection
{
final String NAME = "Remote Connection";
}
| false
|
advanced_management_src_main_java_org_neo4j_management_RemoteConnection.java
|
6,545
|
private enum CacheBean
{
NUMBER_OF_CACHED_ELEMENTS
{
@Override
long get( Cache bean )
{
return bean.getCacheSize();
}
},
HIT_COUNT
{
@Override
long get( Cache bean )
{
return bean.getHitCount();
}
},
MISS_COUNT
{
@Override
long get( Cache bean )
{
return bean.getMissCount();
}
};
abstract long get( Cache bean );
}
| false
|
advanced_management_src_test_java_org_neo4j_management_TestCacheBeans.java
|
6,546
|
@ManagementInterface( name = TransactionManager.NAME )
@Description( "Information about the Neo4j transaction manager" )
public interface TransactionManager
{
final String NAME = "Transactions";
@Description( "The number of currently open transactions" )
int getNumberOfOpenTransactions();
@Description( "The highest number of transactions ever opened concurrently" )
int getPeakNumberOfConcurrentTransactions();
@Description( "The total number started transactions" )
int getNumberOfOpenedTransactions();
@Description( "The total number of committed transactions" )
long getNumberOfCommittedTransactions();
@Description( "The total number of rolled back transactions" )
long getNumberOfRolledBackTransactions();
@Description( "The id of the latest committed transaction" )
long getLastCommittedTxId();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_TransactionManager.java
|
6,547
|
@ManagementInterface( name = XaManager.NAME )
@Description( "Information about the XA transaction manager" )
public interface XaManager
{
final String NAME = "XA Resources";
@Description( "Information about all XA resources managed by the transaction manager" )
XaResourceInfo[] getXaResources();
}
| false
|
advanced_management_src_main_java_org_neo4j_management_XaManager.java
|
6,548
|
private interface Callback extends Remote
{
void callBack() throws RemoteException;
}
| false
|
community_kernel_src_test_java_org_neo4j_metatest_SubProcessTest.java
|
6,549
|
private interface Handover extends Remote
{
Callback handOver() throws RemoteException;
}
| false
|
community_kernel_src_test_java_org_neo4j_metatest_SubProcessTest.java
|
6,550
|
public interface Dependencies
{
Monitors monitors();
Config config();
FileSystemAbstraction fileSystem();
TxManager txManager();
}
| false
|
enterprise_ha_src_test_java_org_neo4j_metrics_MetricsLogExtensionFactory.java
|
6,551
|
enum CheckerVersion
{
NEW
{
@Override
void run( ProgressMonitorFactory progress, DirectStoreAccess directStoreAccess, Config tuningConfiguration ) throws ConsistencyCheckIncompleteException
{
new FullCheck( tuningConfiguration, progress ).execute( directStoreAccess, StringLogger.DEV_NULL );
}
};
abstract void run( ProgressMonitorFactory progress, DirectStoreAccess directStoreAccess, Config tuningConfiguration )
throws ConsistencyCheckIncompleteException;
}
| false
|
enterprise_enterprise-performance-tests_src_main_java_org_neo4j_perftest_enterprise_ccheck_CheckerVersion.java
|
6,552
|
public interface Visitor
{
void beginTimingProgress( long totalElementCount, long totalTimeNanos ) throws IOException;
void phaseTimingProgress( String phase, long elementCount, long timeNanos ) throws IOException;
void endTimingProgress() throws IOException;
}
| false
|
enterprise_enterprise-performance-tests_src_main_java_org_neo4j_perftest_enterprise_ccheck_TimingProgress.java
|
6,553
|
enum PropertyGenerator
{
INTEGER
{
@Override
Object generate()
{
return DataGenerator.RANDOM.nextInt( 16 );
}
},
SINGLE_STRING
{
@Override
Object generate()
{
return name();
}
},
STRING
{
@Override
Object generate()
{
int length = 50 + DataGenerator.RANDOM.nextInt( 70 );
StringBuilder result = new StringBuilder( length );
for ( int i = 0; i < length; i++ )
{
result.append( (char) ('a' + DataGenerator.RANDOM.nextInt( 'z' - 'a' )) );
}
return result.toString();
}
},
BYTE_ARRAY
{
@Override
Object generate()
{
// int length = 4 + RANDOM.nextInt( 60 );
int length = 50;
int[] array = new int[length];
for ( int i = 0; i < length; i++ )
{
array[i] = DataGenerator.RANDOM.nextInt( 256 );
}
return array;
}
};
abstract Object generate();
}
| false
|
enterprise_enterprise-performance-tests_src_main_java_org_neo4j_perftest_enterprise_generator_PropertyGenerator.java
|
6,554
|
public interface Conversion<FROM, TO>
{
TO convert( FROM source );
public static final Conversion<Number, Integer> TO_INTEGER = new Conversion<Number, Integer>()
{
@Override
public Integer convert( Number source )
{
return source.intValue();
}
};
}
| false
|
enterprise_enterprise-performance-tests_src_main_java_org_neo4j_perftest_enterprise_util_Conversion.java
|
6,555
|
public interface Dump
{
void dump() throws Exception;
}
| false
|
community_kernel_src_test_java_org_neo4j_qa_tooling_DumpProcessInformationRule.java
|
6,556
|
public enum State
{
COUNTING,
IDLE
}
| false
|
community_server_src_main_java_org_neo4j_server_InterruptThreadTimer.java
|
6,557
|
public interface NeoServer
{
void init();
void start();
void stop();
Configuration getConfiguration();
Database getDatabase();
TransactionRegistry getTransactionRegistry();
Configurator getConfigurator();
PluginManager getExtensionManager();
URI baseUri();
Iterable<AdvertisableService> getServices();
}
| false
|
community_server_src_main_java_org_neo4j_server_NeoServer.java
|
6,558
|
public interface ServerManagementMBean {
void restartServer();
}
| false
|
advanced_server-advanced_src_main_java_org_neo4j_server_advanced_jmx_ServerManagementMBean.java
|
6,559
|
public interface Configurator
{
String SECURITY_RULES_KEY = "org.neo4j.server.rest.security_rules";
String DB_TUNING_PROPERTY_FILE_KEY = "org.neo4j.server.db.tuning.properties";
String DEFAULT_CONFIG_DIR = File.separator + "etc" + File.separator + "neo";
String DATABASE_LOCATION_PROPERTY_KEY = "org.neo4j.server.database.location";
String NEO_SERVER_CONFIG_FILE_KEY = "org.neo4j.server.properties";
String DB_MODE_KEY = "org.neo4j.server.database.mode";
String DEFAULT_DATABASE_LOCATION_PROPERTY_KEY = "data/graph.db";
int DEFAULT_WEBSERVER_PORT = 7474;
String WEBSERVER_PORT_PROPERTY_KEY = "org.neo4j.server.webserver.port";
String DEFAULT_WEBSERVER_ADDRESS = "localhost";
String WEBSERVER_ADDRESS_PROPERTY_KEY = "org.neo4j.server.webserver.address";
String WEBSERVER_MAX_THREADS_PROPERTY_KEY = "org.neo4j.server.webserver.maxthreads";
String WEBSERVER_LIMIT_EXECUTION_TIME_PROPERTY_KEY = "org.neo4j.server.webserver.limit.executiontime";
String WEBSERVER_ENABLE_STATISTICS_COLLECTION = "org.neo4j.server.webserver.statistics";
String REST_API_PATH_PROPERTY_KEY = "org.neo4j.server.webadmin.data.uri";
String REST_API_PACKAGE = "org.neo4j.server.rest.web";
String DEFAULT_DATA_API_PATH = "/db/data";
String DISCOVERY_API_PACKAGE = "org.neo4j.server.rest.discovery";
String MANAGEMENT_API_PACKAGE = "org.neo4j.server.webadmin.rest";
String MANAGEMENT_PATH_PROPERTY_KEY = "org.neo4j.server.webadmin.management.uri";
String DEFAULT_MANAGEMENT_API_PATH = "/db/manage";
String BROWSER_PATH = "/browser";
String RRDB_LOCATION_PROPERTY_KEY = "org.neo4j.server.webadmin.rrdb.location";
String MANAGEMENT_CONSOLE_ENGINES = "org.neo4j.server.manage.console_engines";
List<String> DEFAULT_MANAGEMENT_CONSOLE_ENGINES = new ArrayList<String>(){
private static final long serialVersionUID = 6621747998288594121L;
{
add(new ShellSessionCreator().name());
}};
String THIRD_PARTY_PACKAGES_KEY = "org.neo4j.server.thirdparty_jaxrs_classes";
String SCRIPT_SANDBOXING_ENABLED_KEY = "org.neo4j.server.script.sandboxing.enabled";
Boolean DEFAULT_SCRIPT_SANDBOXING_ENABLED = true;
String WEBSERVER_HTTPS_ENABLED_PROPERTY_KEY = "org.neo4j.server.webserver.https.enabled";
Boolean DEFAULT_WEBSERVER_HTTPS_ENABLED = false;
String WEBSERVER_HTTPS_PORT_PROPERTY_KEY = "org.neo4j.server.webserver.https.port";
int DEFAULT_WEBSERVER_HTTPS_PORT = 7473;
String WEBSERVER_KEYSTORE_PATH_PROPERTY_KEY = "org.neo4j.server.webserver.https.keystore.location";
String DEFAULT_WEBSERVER_KEYSTORE_PATH = "neo4j-home/ssl/keystore";
String WEBSERVER_HTTPS_CERT_PATH_PROPERTY_KEY = "org.neo4j.server.webserver.https.cert.location";
String DEFAULT_WEBSERVER_HTTPS_CERT_PATH = "neo4j-home/ssl/snakeoil.cert";
String WEBSERVER_HTTPS_KEY_PATH_PROPERTY_KEY = "org.neo4j.server.webserver.https.key.location";
String DEFAULT_WEBSERVER_HTTPS_KEY_PATH = "neo4j-home/ssl/snakeoil.key";
String HTTP_LOGGING = "org.neo4j.server.http.log.enabled";
boolean DEFAULT_HTTP_LOGGING = false;
String HTTP_LOG_CONFIG_LOCATION = "org.neo4j.server.http.log.config";
String WADL_ENABLED = "unsupported_wadl_generation_enabled";
String STARTUP_TIMEOUT = "org.neo4j.server.startup_timeout";
int DEFAULT_STARTUP_TIMEOUT = 120;
String TRANSACTION_TIMEOUT = "org.neo4j.server.transaction.timeout";
int DEFAULT_TRANSACTION_TIMEOUT = 60/*seconds*/;
Configuration configuration();
Map<String, String> getDatabaseTuningProperties();
@Deprecated
List<ThirdPartyJaxRsPackage> getThirdpartyJaxRsClasses();
List<ThirdPartyJaxRsPackage> getThirdpartyJaxRsPackages();
DiagnosticsExtractor<Configurator> DIAGNOSTICS = new DiagnosticsExtractor<Configurator>()
{
@Override
public void dumpDiagnostics( final Configurator source, DiagnosticsPhase phase, StringLogger log )
{
if ( phase.isInitialization() || phase.isExplicitlyRequested() )
{
final Configuration config = source.configuration();
log.logLongMessage( "Server configuration:", new PrefetchingIterator<String>()
{
final Iterator<?> keys = config.getKeys();
@Override
protected String fetchNextOrNull()
{
while ( keys.hasNext() )
{
Object key = keys.next();
if ( key instanceof String )
{
return key + " = " + config.getProperty( (String) key );
}
}
return null;
}
}, true );
}
}
@Override
public String toString()
{
return Configurator.class.getName();
}
};
public static abstract class Adapter implements Configurator
{
@Override
public List<ThirdPartyJaxRsPackage> getThirdpartyJaxRsClasses()
{
return getThirdpartyJaxRsPackages();
}
@Override
public List<ThirdPartyJaxRsPackage> getThirdpartyJaxRsPackages()
{
return emptyList();
}
@Override
public Map<String, String> getDatabaseTuningProperties()
{
return emptyMap();
}
@Override
public Configuration configuration()
{
return new MapConfiguration( emptyMap() );
}
}
public static final Configurator EMPTY = new Configurator.Adapter()
{
};
}
| false
|
community_server_src_main_java_org_neo4j_server_configuration_Configurator.java
|
6,560
|
public interface ValidationRule
{
public void validate( Configuration configuration ) throws RuleFailedException;
}
| false
|
community_server_src_main_java_org_neo4j_server_configuration_validation_ValidationRule.java
|
6,561
|
public interface Database extends Lifecycle
{
public String getLocation();
public org.neo4j.graphdb.index.Index<Relationship> getRelationshipIndex( String name );
public org.neo4j.graphdb.index.Index<Node> getNodeIndex( String name );
public IndexManager getIndexManager();
public GraphDatabaseAPI getGraph();
public abstract boolean isRunning();
public Logging getLogging();
}
| false
|
community_server_src_main_java_org_neo4j_server_database_Database.java
|
6,562
|
public interface GraphDatabaseFactory
{
GraphDatabaseAPI createDatabase( String databaseStoreDirectory, Map<String, String> databaseProperties );
}
| false
|
community_server_src_main_java_org_neo4j_server_database_GraphDatabaseFactory.java
|
6,563
|
public interface RrdDbWrapper
{
RrdDb get();
void close() throws IOException;
static class Plain implements RrdDbWrapper
{
private final RrdDb db;
public Plain( RrdDb db )
{
this.db = db;
}
@Override
public RrdDb get()
{
return db;
}
@Override
public void close() throws IOException
{
db.close();
}
}
}
| false
|
community_server_src_main_java_org_neo4j_server_database_RrdDbWrapper.java
|
6,564
|
enum DatabaseMode implements GraphDatabaseFactory
{
SINGLE
{
@Override
public GraphDatabaseAPI createDatabase( String databaseStoreDirectory,
Map<String, String> databaseProperties )
{
return (GraphDatabaseAPI) new org.neo4j.graphdb.factory.GraphDatabaseFactory().
newEmbeddedDatabaseBuilder( databaseStoreDirectory).
setConfig( databaseProperties ).newGraphDatabase();
}
},
HA
{
@Override
public GraphDatabaseAPI createDatabase( String databaseStoreDirectory,
Map<String, String> databaseProperties )
{
return (GraphDatabaseAPI) new HighlyAvailableGraphDatabaseFactory().
newHighlyAvailableDatabaseBuilder( databaseStoreDirectory ).
setConfig( databaseProperties ).newGraphDatabase();
}
};
@Override
public abstract GraphDatabaseAPI createDatabase( String databaseStoreDirectory,
Map<String, String> databaseProperties );
}
| false
|
enterprise_server-enterprise_src_main_java_org_neo4j_server_enterprise_EnterpriseDatabase.java
|
6,565
|
private static enum WhatToDo
{
CREATE_GOOD_TUNING_FILE,
CREATE_DANGLING_TUNING_FILE_PROPERTY,
CREATE_CORRUPT_TUNING_FILE
}
| false
|
community_server_src_test_java_org_neo4j_server_helpers_CommunityServerBuilder.java
|
6,566
|
public interface UnitOfWork
{
void doWork();
}
| false
|
community_server_src_test_java_org_neo4j_server_helpers_UnitOfWork.java
|
6,567
|
public interface ServerModule
{
void start();
void stop();
}
| false
|
community_server_src_main_java_org_neo4j_server_modules_ServerModule.java
|
6,568
|
@Target( { ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER } )
@Retention( RetentionPolicy.RUNTIME )
public @interface Description
{
String value();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_Description.java
|
6,569
|
public interface Injectable<T>
{
/**
* Get the injectable value.
*
* @return the injectable value
*/
T getValue();
Class<T> getType();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_Injectable.java
|
6,570
|
@Target( ElementType.METHOD )
@Retention( RetentionPolicy.RUNTIME )
public @interface Name
{
String value();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_Name.java
|
6,571
|
@Target( ElementType.PARAMETER )
@Retention( RetentionPolicy.RUNTIME )
public @interface Parameter
{
String name();
boolean optional() default false;
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_Parameter.java
|
6,572
|
public interface ParameterDescriptionConsumer
{
void describeParameter( String name, Class<?> type, boolean optional, String description );
void describeListParameter( String name, Class<?> type, boolean optional, String description );
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_ParameterDescriptionConsumer.java
|
6,573
|
enum MatchType
{
end( "ends with" )
{
@Override
boolean match( String pattern, String string )
{
return string.endsWith( pattern );
}
},
matches()
{
@Override
boolean match( String pattern, String string )
{
return string.matches( pattern );
}
},
;
private final String description;
abstract boolean match( String pattern, String string );
private MatchType()
{
this.description = name();
}
private MatchType( String description )
{
this.description = description;
}
}
| false
|
community_server-plugin-test_src_test_java_org_neo4j_server_plugins_PluginFunctionalTestHelper.java
|
6,574
|
public interface PluginInvocator
{
<T> Representation invoke( GraphDatabaseAPI graphDb, String name, Class<T> type, String method, T context,
ParameterList params ) throws PluginLookupException, BadInputException, PluginInvocationFailureException,
BadPluginInvocationException;
ExtensionPointRepresentation describe( String name, Class<?> type, String method ) throws PluginLookupException;
List<ExtensionPointRepresentation> describeAll( String extensionName ) throws PluginLookupException;
Set<String> extensionNames();
}
| false
|
community_server_src_main_java_org_neo4j_server_plugins_PluginInvocator.java
|
6,575
|
public interface PluginLifecycle
{
/**
* Called at initialization time, before the plugin ressources are acutally loaded.
* @param graphDatabaseService of the Neo4j service, use it to integrate it with custom configuration mechanisms
* @param config server configuration
* @return A list of {@link Injectable}s that will be available to resource dependency injection later
*/
Collection<Injectable<?>> start( GraphDatabaseService graphDatabaseService, Configuration config );
/**
* called to shutdown individual external resources or configurations
*/
void stop();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_PluginLifecycle.java
|
6,576
|
interface PluginPointFactory
{
PluginPoint createFrom( ServerPlugin plugin, Method method, Class<?> discovery );
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_PluginPointFactory.java
|
6,577
|
@Target( ElementType.METHOD )
@Retention( RetentionPolicy.RUNTIME )
public @interface PluginTarget
{
Class<?> value();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_PluginTarget.java
|
6,578
|
public interface SPIPluginLifecycle extends PluginLifecycle
{
Collection<Injectable<?>> start( NeoServer neoServer );
void stop();
}
| false
|
community_server_src_main_java_org_neo4j_server_plugins_SPIPluginLifecycle.java
|
6,579
|
@Target( ElementType.PARAMETER )
@Retention( RetentionPolicy.RUNTIME )
public @interface Source
{
}
| false
|
community_server-api_src_main_java_org_neo4j_server_plugins_Source.java
|
6,580
|
public interface PreflightTask
{
public boolean run();
public String getFailureMessage();
}
| false
|
community_server_src_main_java_org_neo4j_server_preflight_PreflightTask.java
|
6,581
|
private enum MyRelationshipTypes implements RelationshipType
{
KNOWS
}
| false
|
community_server_src_test_java_org_neo4j_server_rest_IndexRelationshipDocIT.java
|
6,582
|
public interface TestResponse
{
int getStatus();
}
| false
|
community_server_src_test_java_org_neo4j_server_rest_TestResponse.java
|
6,583
|
public static enum ObjectType
{
NODE,
RELATIONSHIP,
PROPERTIES,
ROOT,
INDEX_ROOT,
;
String getCaption()
{
return name().substring( 0, 1 )
.toUpperCase() + name().substring( 1 )
.toLowerCase();
}
String getHtmlClass()
{
return getCaption().toLowerCase();
}
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_domain_HtmlHelper.java
|
6,584
|
public enum RelationshipDirection
{
all( Direction.BOTH ),
in( Direction.INCOMING ),
out( Direction.OUTGOING );
final Direction internal;
private RelationshipDirection( Direction internal )
{
this.internal = internal;
}
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_domain_RelationshipDirection.java
|
6,585
|
public enum TraverserReturnType
{
node( RepresentationType.NODE )
{
@Override
public MappingRepresentation toRepresentation( Path position )
{
return new org.neo4j.server.rest.repr.NodeRepresentation( position.endNode() );
}
},
relationship( RepresentationType.RELATIONSHIP )
{
@Override
public Representation toRepresentation( Path position )
{
Relationship lastRelationship = position.lastRelationship();
return lastRelationship != null? new org.neo4j.server.rest.repr.RelationshipRepresentation( lastRelationship ): Representation.emptyRepresentation();
}
},
path( RepresentationType.PATH )
{
@Override
public MappingRepresentation toRepresentation( Path position )
{
return new org.neo4j.server.rest.repr.PathRepresentation<Path>( position );
}
},
fullpath( RepresentationType.FULL_PATH )
{
@Override
public MappingRepresentation toRepresentation( Path position )
{
return new FullPathRepresentation( position );
}
};
public final RepresentationType repType;
private TraverserReturnType( RepresentationType repType )
{
this.repType = repType;
}
public abstract Representation toRepresentation( Path position );
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_domain_TraverserReturnType.java
|
6,586
|
public interface Leasable
{
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_paging_Leasable.java
|
6,587
|
public interface EntityRepresentation
{
ValueRepresentation selfUri();
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_EntityRepresentation.java
|
6,588
|
interface ExtensibleRepresentation
{
String getIdentity();
}
| false
|
community_server-api_src_main_java_org_neo4j_server_rest_repr_ExtensibleRepresentation.java
|
6,589
|
public interface ExtensionInjector
{
Map<String, List<String>> getExensionsFor( Class<?> type );
}
| false
|
community_server-api_src_main_java_org_neo4j_server_rest_repr_ExtensionInjector.java
|
6,590
|
public interface InputFormat
{
Object readValue( String input ) throws BadInputException;
Map<String, Object> readMap( String input, String... requiredKeys ) throws BadInputException;
List<Object> readList( String input ) throws BadInputException;
URI readUri( String input ) throws BadInputException;
ParameterList readParameterList( String input ) throws BadInputException;
}
| false
|
community_server-api_src_main_java_org_neo4j_server_rest_repr_InputFormat.java
|
6,591
|
@Target( ElementType.METHOD )
@Retention( RetentionPolicy.RUNTIME )
protected @interface Mapping
{
String value();
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_ObjectRepresentation.java
|
6,592
|
public interface RepresentationWriteHandler
{
void onRepresentationStartWriting();
void onRepresentationWritten();
void onRepresentationFinal();
RepresentationWriteHandler DO_NOTHING = new RepresentationWriteHandler()
{
@Override
public void onRepresentationStartWriting()
{
// do nothing
}
@Override
public void onRepresentationWritten()
{
// do nothing
}
@Override
public void onRepresentationFinal()
{
// do nothing
}
};
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_RepresentationWriteHandler.java
|
6,593
|
public interface StreamingFormat {
String STREAM_HEADER = "X-Stream";
MediaType MEDIA_TYPE = new MediaType( APPLICATION_JSON_TYPE.getType(),
APPLICATION_JSON_TYPE.getSubtype(), MapUtil.stringMap("stream", "true", "charset", "UTF-8") );
RepresentationFormat writeTo(OutputStream output);
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_StreamingFormat.java
|
6,594
|
private enum MappingTemplate
{
NODE( Representation.NODE )
{
@Override
String render( Map<String, Object> serialized )
{
return JsonHelper.createJsonFrom( MapUtil.map( "self", serialized.get( "self" ), "data",
serialized.get( "data" ) ) );
}
},
RELATIONSHIP( Representation.RELATIONSHIP )
{
@Override
String render( Map<String, Object> serialized )
{
return JsonHelper.createJsonFrom( MapUtil.map( "self", serialized.get( "self" ), "data",
serialized.get( "data" ) ) );
}
},
STRING( Representation.STRING )
{
@Override
String render( Map<String, Object> serialized )
{
return JsonHelper.createJsonFrom( serialized );
}
},
EXCEPTION( Representation.EXCEPTION )
{
@Override
String render( Map<String, Object> data )
{
return JsonHelper.createJsonFrom( data );
}
};
private final String key;
private MappingTemplate( String key )
{
this.key = key;
}
static final Map<String, MappingTemplate> TEMPLATES = new HashMap<String, MappingTemplate>();
static
{
for ( MappingTemplate template : values() )
TEMPLATES.put( template.key, template );
}
abstract String render( Map<String, Object> data );
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_formats_CompactJsonFormat.java
|
6,595
|
private enum ListTemplate
{
NODES
{
@Override
String render( List<Object> data )
{
StringBuilder builder = HtmlHelper.start( "Index hits", null );
if ( data.isEmpty() )
{
HtmlHelper.appendMessage( builder, "No index hits" );
return HtmlHelper.end( builder );
}
else
{
for ( Map<?, ?> serialized : (List<Map<?, ?>>) (List<?>) data )
{
Map<Object, Object> map = new LinkedHashMap<Object, Object>();
transfer( serialized, map, "self", "data" );
HtmlHelper.append( builder, map, HtmlHelper.ObjectType.NODE );
}
return HtmlHelper.end( builder );
}
}
},
RELATIONSHIPS
{
@Override
String render( List<Object> data )
{
if ( data.isEmpty() )
{
StringBuilder builder = HtmlHelper.start( HtmlHelper.ObjectType.RELATIONSHIP, null );
HtmlHelper.appendMessage( builder, "No relationships found" );
return HtmlHelper.end( builder );
}
else
{
Collection<Object> list = new ArrayList<Object>();
for ( Map<?, ?> serialized : (List<Map<?, ?>>) (List<?>) data )
{
Map<Object, Object> map = new LinkedHashMap<Object, Object>();
transfer( serialized, map, "self", "type", "data", "start", "end" );
list.add( map );
}
return HtmlHelper.from( list, HtmlHelper.ObjectType.RELATIONSHIP );
}
}
};
abstract String render( List<Object> data );
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_formats_HtmlFormat.java
|
6,596
|
private enum MappingTemplate
{
NODE( Representation.NODE )
{
@Override
String render( Map<String, Object> serialized )
{
String javascript = "";
StringBuilder builder = HtmlHelper.start( HtmlHelper.ObjectType.NODE, javascript );
HtmlHelper.append( builder, Collections.singletonMap( "data", serialized.get( "data" ) ),
HtmlHelper.ObjectType.NODE );
builder.append( "<form action='javascript:neo4jHtmlBrowse.getRelationships();'><fieldset><legend>Get relationships</legend>\n" );
builder.append( "<label for='direction'>with direction</label>\n" + "<select id='direction'>" );
builder.append( "<option value='" )
.append( serialized.get( "all_typed_relationships" ) )
.append( "'>all</option>" );
builder.append( "<option value='" )
.append( serialized.get( "incoming_typed_relationships" ) )
.append( "'>in</option>" );
builder.append( "<option value='" )
.append( serialized.get( "outgoing_typed_relationships" ) )
.append( "'>out</option>" );
builder.append( "</select>\n" );
builder.append( "<label for='types'>for type(s)</label><select id='types' multiple='multiple'>" );
for ( String relationshipType : (List<String>) serialized.get( "relationship_types" ) )
{
builder.append( "<option selected='selected' value='" )
.append( relationshipType )
.append( "'>" );
builder.append( relationshipType )
.append( "</option>" );
}
builder.append( "</select>\n" );
builder.append( "<button>Get</button>\n" );
builder.append( "</fieldset></form>\n" );
return HtmlHelper.end( builder );
}
},
RELATIONSHIP( Representation.RELATIONSHIP )
{
@Override
String render( Map<String, Object> serialized )
{
Map<Object, Object> map = new LinkedHashMap<Object, Object>();
transfer( serialized, map, "type", "data", "start", "end" );
return HtmlHelper.from( map, HtmlHelper.ObjectType.RELATIONSHIP );
}
},
NODE_INDEXES( Representation.NODE_INDEXES )
{
@Override
String render( Map<String, Object> serialized )
{
return renderIndex( serialized );
}
},
RELATIONSHIP_INDEXES( Representation.RELATIONSHIP_INDEXES )
{
@Override
String render( Map<String, Object> serialized )
{
return renderIndex( serialized );
}
},
GRAPHDB( Representation.GRAPHDB )
{
@Override
String render( Map<String, Object> serialized )
{
Map<Object, Object> map = new HashMap<>();
transfer( serialized, map, "index", "node_index", "relationship_index"/*, "extensions_info"*/);
return HtmlHelper.from( map, HtmlHelper.ObjectType.ROOT );
}
},
EXCEPTION( Representation.EXCEPTION )
{
@Override
String render( Map<String, Object> serialized )
{
StringBuilder entity = new StringBuilder( "<html>" );
entity.append( "<head><title>Error</title></head><body>" );
Object subjectOrNull = serialized.get( "message" );
if ( subjectOrNull != null )
{
entity.append( "<p><pre>" )
.append( subjectOrNull )
.append( "</pre></p>" );
}
entity.append( "<p><pre>" )
.append( serialized.get( "exception" ) );
List<Object> tb = (List<Object>) serialized.get( "stacktrace" );
if ( tb != null )
{
for ( Object el : tb )
entity.append( "\n\tat " + el );
}
entity.append( "</pre></p>" )
.append( "</body></html>" );
return entity.toString();
}
};
private final String key;
private MappingTemplate( String key )
{
this.key = key;
}
static final Map<String, MappingTemplate> TEMPLATES = new HashMap<String, MappingTemplate>();
static
{
for ( MappingTemplate template : values() )
TEMPLATES.put( template.key, template );
}
abstract String render( Map<String, Object> data );
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_repr_formats_HtmlFormat.java
|
6,597
|
public interface SecurityRule
{
String DEFAULT_DATABASE_PATH = Configurator.DEFAULT_DATA_API_PATH;
/**
* @param request The HTTP request currently under consideration.
* @return <code>true</code> if the rule passes, <code>false</code> if the
* rule fails and the request is to be rejected.
*/
boolean isAuthorized(HttpServletRequest request);
/**
* @return the root of the URI path from which rules will be valid, e.g.
* <code>/db/data</code> will apply this rule to everything below
* the path <code>/db/data</code> It is possible to use * as a
* wildcard character in return values, e.g.
* <code>/myExtension*</code> will extend security coverage to
* everything under the <code>/myExtension</code> path. Similarly
* more complex path behavior can be specified with more wildcards,
* e.g.: <code>/myExtension*myApplication*specialResources</code>.
* Note that the wildcard represents any character (including the
* '/' character), meaning <code>/myExtension/*</code> is not the
* same as <code>/myExtension*</code> and implementers should take
* care to ensure their implementations are tested accordingly.
* <p/>
* Final note: the only wildcard supported is '*' and there is no
* support for regular expression syntax.
*/
String forUriPath();
/**
* @return the opaque string representing the WWW-Authenticate header to
* which the rule applies. Will be used to formulate a
* <code>401</code> response code if the rule denies a request.
*/
String wwwAuthenticateHeader();
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_security_SecurityRule.java
|
6,598
|
private enum State
{
EMPTY, DOCUMENT_OPEN, RESULTS_OPEN, RESULTS_CLOSED, ERRORS_WRITTEN
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_transactional_ExecutionResultSerializer.java
|
6,599
|
public enum ResultDataContent
{
row
{
@Override
public ResultDataContentWriter writer( URI baseUri )
{
return new RowWriter();
}
},
graph
{
@Override
public ResultDataContentWriter writer( URI baseUri )
{
return new GraphExtractionWriter();
}
},
rest
{
@Override
public ResultDataContentWriter writer( URI baseUri )
{
return new RestRepresentationWriter( baseUri );
}
};
public abstract ResultDataContentWriter writer( URI baseUri );
public static ResultDataContent[] fromNames( List<?> names )
{
if ( names == null || names.isEmpty() )
{
return null;
}
ResultDataContent[] result = new ResultDataContent[names.size()];
Iterator<?> name = names.iterator();
for ( int i = 0; i < result.length; i++ )
{
Object contentName = name.next();
if ( contentName instanceof String )
{
try
{
result[i] = valueOf( ((String) contentName).toLowerCase() );
}
catch ( IllegalArgumentException e )
{
throw new IllegalArgumentException( "Invalid result data content specifier: " + contentName );
}
}
else
{
throw new IllegalArgumentException( "Invalid result data content specifier: " + contentName );
}
}
return result;
}
}
| false
|
community_server_src_main_java_org_neo4j_server_rest_transactional_ResultDataContent.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.