idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
15,800 | boolean migrationRequired ( ) throws RepositoryException { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( storagePathOld ) ) { return true ; } try { Node node = ( Node ) session . getItem ( service . getStoragePath ( ) ) ; return node . isNodeType ( JOS_ORGANIZATION_NODETYPE_OLD )... | Method to know if migration is need . | 114 | 8 |
15,801 | private void moveOldStructure ( ) throws Exception { ExtendedSession session = ( ExtendedSession ) service . getStorageSession ( ) ; try { if ( session . itemExists ( storagePathOld ) ) { return ; } else { session . move ( service . getStoragePath ( ) , storagePathOld , false ) ; session . save ( ) ; } } finally { sess... | Method for moving old storage into temporary location . | 86 | 9 |
15,802 | private void removeOldStructure ( ) throws RepositoryException { ExtendedSession session = ( ExtendedSession ) service . getStorageSession ( ) ; try { if ( session . itemExists ( storagePathOld ) ) { NodeIterator usersIter = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; while ( users... | Method for removing old storage from temporary location . | 287 | 9 |
15,803 | private void migrateUsers ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( usersStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; UserHandlerImpl uh = ( ( UserHandlerImpl ) service . getU... | Method for users migration . | 122 | 5 |
15,804 | private void migrateGroups ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( groupsStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( groupsStorageOld ) ) . getNodesLazily ( ) ; GroupHandlerImpl gh = ( ( GroupHandlerImpl ) service .... | Method for groups migration . Must be run after users and membershipTypes migration . | 141 | 15 |
15,805 | private void migrateGroups ( Node startNode ) throws Exception { NodeIterator iterator = ( ( ExtendedNode ) startNode ) . getNodesLazily ( ) ; GroupHandlerImpl gh = ( ( GroupHandlerImpl ) service . getGroupHandler ( ) ) ; while ( iterator . hasNext ( ) ) { Node oldGroupNode = iterator . nextNode ( ) ; gh . migrateGroup... | Method for groups migration . | 98 | 5 |
15,806 | private void migrateMembershipTypes ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( membershipTypesStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( membershipTypesStorageOld ) ) . getNodesLazily ( ) ; MembershipTypeHandlerImpl m... | Method for membershipTypes migration . | 143 | 6 |
15,807 | private void migrateProfiles ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( usersStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; UserProfileHandlerImpl uph = ( ( UserProfileHandlerImp... | Method for profiles migration . | 137 | 5 |
15,808 | private void migrateMemberships ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( usersStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; MembershipHandlerImpl mh = ( ( MembershipHandlerImp... | Method for memberships migration . | 150 | 6 |
15,809 | protected void addBooleanValue ( Document doc , String fieldName , Object internalValue ) { doc . add ( createFieldWithoutNorms ( fieldName , internalValue . toString ( ) , PropertyType . BOOLEAN ) ) ; } | Adds the string representation of the boolean value to the document as the named field . | 51 | 16 |
15,810 | protected void addReferenceValue ( Document doc , String fieldName , Object internalValue ) { String uuid = internalValue . toString ( ) ; doc . add ( createFieldWithoutNorms ( fieldName , uuid , PropertyType . REFERENCE ) ) ; doc . add ( new Field ( FieldNames . PROPERTIES , FieldNames . createNamedValue ( fieldName ,... | Adds the reference value to the document as the named field . The value s string representation is added as the reference data . Additionally the reference data is stored in the index . | 107 | 34 |
15,811 | protected void addPathValue ( Document doc , String fieldName , Object pathString ) { doc . add ( createFieldWithoutNorms ( fieldName , pathString . toString ( ) , PropertyType . PATH ) ) ; } | Adds the path value to the document as the named field . The path value is converted to an indexable string value using the name space mappings with which this class has been created . | 47 | 37 |
15,812 | protected void addNameValue ( Document doc , String fieldName , Object internalValue ) { doc . add ( createFieldWithoutNorms ( fieldName , internalValue . toString ( ) , PropertyType . NAME ) ) ; } | Adds the name value to the document as the named field . The name value is converted to an indexable string treating the internal value as a qualified name and mapping the name space using the name space mappings with which this class has been created . | 47 | 49 |
15,813 | protected float getPropertyBoost ( InternalQName propertyName ) { if ( indexingConfig == null ) { return DEFAULT_BOOST ; } else { return indexingConfig . getPropertyBoost ( node , propertyName ) ; } } | Returns the boost value for the given property name . | 50 | 10 |
15,814 | protected void addNodeName ( Document doc , String namespaceURI , String localName ) throws RepositoryException { String name = mappings . getNamespacePrefixByURI ( namespaceURI ) + ":" + localName ; doc . add ( new Field ( FieldNames . LABEL , name , Field . Store . NO , Field . Index . NOT_ANALYZED_NO_NORMS ) ) ; // ... | Depending on the index format version adds one or two fields to the document for the node name . | 216 | 19 |
15,815 | protected long writeValue ( File file , ValueData value ) throws IOException { if ( value . isByteArray ( ) ) { return writeByteArrayValue ( file , value ) ; } else { return writeStreamedValue ( file , value ) ; } } | Write value to a file . | 54 | 6 |
15,816 | protected long writeByteArrayValue ( File file , ValueData value ) throws IOException { OutputStream out = new FileOutputStream ( file ) ; try { byte [ ] data = value . getAsByteArray ( ) ; out . write ( data ) ; return data . length ; } finally { out . close ( ) ; } } | Write value array of bytes to a file . | 69 | 9 |
15,817 | protected long writeStreamedValue ( File file , ValueData value ) throws IOException { long size ; // stream Value if ( value instanceof StreamPersistedValueData ) { StreamPersistedValueData streamed = ( StreamPersistedValueData ) value ; if ( streamed . isPersisted ( ) ) { // already persisted in another Value, copy i... | Write streamed value to a file . | 401 | 7 |
15,818 | protected long writeOutput ( OutputStream out , ValueData value ) throws IOException { if ( value . isByteArray ( ) ) { byte [ ] buff = value . getAsByteArray ( ) ; out . write ( buff ) ; return buff . length ; } else { InputStream in ; if ( value instanceof StreamPersistedValueData ) { StreamPersistedValueData streame... | Stream value data to the output . | 195 | 7 |
15,819 | protected long copy ( InputStream in , OutputStream out ) throws IOException { // compare classes as in Java6 Channels.newChannel(), Java5 has a bug in newChannel(). boolean inFile = in instanceof FileInputStream && FileInputStream . class . equals ( in . getClass ( ) ) ; boolean outFile = out instanceof FileOutputStre... | Copy input to output data using NIO . | 398 | 9 |
15,820 | protected long copyClose ( InputStream in , OutputStream out ) throws IOException { try { try { return copy ( in , out ) ; } finally { in . close ( ) ; } } finally { out . close ( ) ; } } | Copy input to output data using NIO . Input and output streams will be closed after the operation . | 50 | 20 |
15,821 | public Response report ( Session session , String path , HierarchicalProperty body , Depth depth , String baseURI ) { try { Node node = ( Node ) session . getItem ( path ) ; WebDavNamespaceContext nsContext = new WebDavNamespaceContext ( session ) ; String strUri = baseURI + node . getPath ( ) ; URI uri = new URI ( Tex... | Webdav Report method implementation . | 377 | 7 |
15,822 | protected Set < QName > getProperties ( HierarchicalProperty body ) { HashSet < QName > properties = new HashSet < QName > ( ) ; HierarchicalProperty prop = body . getChild ( new QName ( "DAV:" , "prop" ) ) ; if ( prop == null ) { return properties ; } for ( int i = 0 ; i < prop . getChildren ( ) . size ( ) ; i ++ ) { ... | Returns the list of properties . | 127 | 6 |
15,823 | public void write ( List < NodeTypeData > nodeTypes , OutputStream os ) throws RepositoryException { OutputStreamWriter out = new OutputStreamWriter ( os ) ; try { for ( NodeTypeData nodeType : nodeTypes ) { printNamespaces ( nodeType , out ) ; printNodeTypeDeclaration ( nodeType , out ) ; } out . close ( ) ; } catch (... | Write given list of node types to output stream . | 104 | 10 |
15,824 | private void printNamespaces ( NodeTypeData nodeTypeData , OutputStreamWriter out ) throws RepositoryException , IOException { /** * Using set to store all prefixes found in node types to avoid * duplication */ Set < String > namespaces = new HashSet < String > ( ) ; /** Scanning nodeType definition for used namespaces... | Print namespaces to stream | 413 | 5 |
15,825 | private void printNodeTypeDeclaration ( NodeTypeData nodeTypeData , OutputStreamWriter out ) throws RepositoryException , IOException { /** Print name */ out . write ( "[" + qNameToString ( nodeTypeData . getName ( ) ) + "] " ) ; /** Print supertypes */ InternalQName [ ] superTypes = nodeTypeData . getDeclaredSupertype... | Method recursively print to output stream node type definition in cnd format . | 536 | 16 |
15,826 | private void printPropertyDeclaration ( PropertyDefinitionData propertyDefinition , OutputStreamWriter out ) throws IOException , RepositoryException { /** Print name */ out . write ( "\r\n " ) ; out . write ( "- " + qNameToString ( propertyDefinition . getName ( ) ) ) ; out . write ( " (" + ExtendedPropertyType . name... | Prints to output stream property definition in CND format | 615 | 11 |
15,827 | private void printChildDeclaration ( NodeDefinitionData nodeDefinition , OutputStreamWriter out ) throws IOException , RepositoryException { out . write ( "\r\n " ) ; out . write ( "+ " + qNameToString ( nodeDefinition . getName ( ) ) + " " ) ; InternalQName [ ] requiredTypes = nodeDefinition . getRequiredPrimaryTypes ... | Print to output stream child node definition in CND format | 452 | 11 |
15,828 | public float getNodeBoost ( NodeData state ) { IndexingRule rule = getApplicableIndexingRule ( state ) ; if ( rule != null ) { return rule . getNodeBoost ( ) ; } return DEFAULT_BOOST ; } | Returns the boost for the node scope fulltext index field . | 52 | 12 |
15,829 | private PathExpression getCondition ( Node config ) throws IllegalNameException , RepositoryException { Node conditionAttr = config . getAttributes ( ) . getNamedItem ( "condition" ) ; if ( conditionAttr == null ) { return null ; } String conditionString = conditionAttr . getNodeValue ( ) ; int idx ; int axis ; Interna... | Gets the condition expression from the configuration . | 703 | 9 |
15,830 | public void remove ( ) throws IOException { if ( ( fileBuffer != null ) && PrivilegedFileHelper . exists ( fileBuffer ) ) { if ( ! PrivilegedFileHelper . delete ( fileBuffer ) ) { throw new IOException ( "Cannot remove file " + PrivilegedFileHelper . getAbsolutePath ( fileBuffer ) + " Close all streams." ) ; } } } | Remove buffer . | 81 | 3 |
15,831 | private void swapBuffers ( ) throws IOException { byte [ ] data = ( ( ByteArrayOutputStream ) out ) . toByteArray ( ) ; fileBuffer = PrivilegedFileHelper . createTempFile ( "decoderBuffer" , ".tmp" ) ; PrivilegedFileHelper . deleteOnExit ( fileBuffer ) ; out = new BufferedOutputStream ( PrivilegedFileHelper . fileOutpu... | Swap in - memory buffer with file . | 101 | 9 |
15,832 | public void logComment ( String message ) throws IOException { if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addComment ( message ) ; } else { writeMessage ( message ) ; } } | Adds comment to log . | 48 | 5 |
15,833 | public void logDescription ( String description ) throws IOException { // The ThreadLocal has been initialized so we know that we are in multithreaded mode. if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addComment ( description ) ; } else { writeMessage ( description ) ; } } | Adds description to log . | 68 | 5 |
15,834 | public void logBrokenObjectAndSetInconsistency ( String brokenObject ) throws IOException { setInconsistency ( ) ; // The ThreadLocal has been initialized so we know that we are in multithreaded mode. if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addBrokenObject ( brokenObject ) ; } else { writeBro... | Adds detailed event to log . | 91 | 6 |
15,835 | public void logExceptionAndSetInconsistency ( String message , Throwable e ) throws IOException { setInconsistency ( ) ; // The ThreadLocal has been initialized so we know that we are in multithreaded mode. if ( reportContext . get ( ) != null ) { reportContext . get ( ) . addLogException ( message , e ) ; } else { wri... | Adds exception with full stack trace . | 91 | 7 |
15,836 | private String getIdColumn ( ) throws SQLException { try { return lockManagerEntry . getParameterValue ( ISPNCacheableLockManagerImpl . INFINISPAN_JDBC_CL_ID_COLUMN_NAME ) ; } catch ( RepositoryConfigurationException e ) { throw new SQLException ( e ) ; } } | Returns the column name which contain node identifier . | 74 | 9 |
15,837 | protected String getTableName ( ) throws SQLException { try { String dialect = getDialect ( ) ; String quote = "\"" ; if ( dialect . startsWith ( DBConstants . DB_DIALECT_MYSQL ) ) quote = "`" ; return quote + lockManagerEntry . getParameterValue ( ISPNCacheableLockManagerImpl . INFINISPAN_JDBC_TABLE_NAME ) + "_" + "L"... | Returns the name of LOCK table . | 151 | 8 |
15,838 | public File getNextFile ( ) { File nextFile = null ; try { String sNextName = generateName ( ) ; nextFile = new File ( backupSetDir . getAbsoluteFile ( ) + File . separator + sNextName ) ; if ( isFullBackup && isDirectoryForFullBackup ) { if ( ! PrivilegedFileHelper . exists ( nextFile ) ) { PrivilegedFileHelper . mkdi... | Get next file in backup set . | 153 | 7 |
15,839 | private String getStrDate ( Calendar c ) { int m = c . get ( Calendar . MONTH ) + 1 ; int d = c . get ( Calendar . DATE ) ; return "" + c . get ( Calendar . YEAR ) + ( m < 10 ? "0" + m : m ) + ( d < 10 ? "0" + d : d ) ; } | Returns date as String in format YYYYMMDD . | 79 | 12 |
15,840 | private String getStrTime ( Calendar c ) { int h = c . get ( Calendar . HOUR ) ; int m = c . get ( Calendar . MINUTE ) ; int s = c . get ( Calendar . SECOND ) ; return "" + ( h < 10 ? "0" + h : h ) + ( m < 10 ? "0" + m : m ) + ( s < 10 ? "0" + s : s ) ; } | Returns time as String in format HHMMSS . | 95 | 10 |
15,841 | void createStructure ( ) throws RepositoryException { Session session = getStorageSession ( ) ; try { Node storage = session . getRootNode ( ) . addNode ( storagePath . substring ( 1 ) , STORAGE_NODETYPE ) ; storage . addNode ( STORAGE_JOS_USERS , STORAGE_JOS_USERS_NODETYPE ) ; storage . addNode ( STORAGE_JOS_GROUPS , ... | Creates storage structure . | 249 | 5 |
15,842 | Session getStorageSession ( ) throws RepositoryException { try { ManageableRepository repository = getWorkingRepository ( ) ; String workspaceName = storageWorkspace ; if ( workspaceName == null ) { workspaceName = repository . getConfiguration ( ) . getDefaultWorkspaceName ( ) ; } return repository . getSystemSession ... | Return system Session to org - service storage workspace . For internal use only . | 102 | 15 |
15,843 | protected ManageableRepository getWorkingRepository ( ) throws RepositoryException , RepositoryConfigurationException { return repositoryName != null ? repositoryService . getRepository ( repositoryName ) : repositoryService . getCurrentRepository ( ) ; } | Returns working repository . If repository name is configured then it will be returned otherwise the current repository is used . | 50 | 21 |
15,844 | public JCRPath createJCRPath ( JCRPath parentLoc , String relPath ) throws RepositoryException { JCRPath addPath = parseNames ( relPath , false ) ; return parentLoc . add ( addPath ) ; } | Creates JCRPath from parent path and relPath | 50 | 11 |
15,845 | private boolean isNonspace ( String str , char ch ) throws RepositoryException { if ( ch == ' ' ) { throw new RepositoryException ( "Illegal absPath: \"" + str + "\": The path entry contains an illegal char: \"" + ch + "\"" ) ; } return ! ( ( ch == ' ' ) || ( ch == ' ' ) || ( ch == ' ' ) || ( ch == ' ' ) || ( ch == ' '... | Some functions for JCRPath Validation | 139 | 8 |
15,846 | public boolean isAbsolute ( ) { if ( names [ 0 ] . getIndex ( ) == 1 && names [ 0 ] . getName ( ) . length ( ) == 0 && names [ 0 ] . getNamespace ( ) . length ( ) == 0 ) return true ; else return false ; } | Tell if the path is absolute . | 63 | 7 |
15,847 | public QPathEntry [ ] getRelPath ( int relativeDegree ) throws IllegalPathException { int len = getLength ( ) - relativeDegree ; if ( len < 0 ) throw new IllegalPathException ( "Relative degree " + relativeDegree + " is more than depth for " + getAsString ( ) ) ; QPathEntry [ ] relPath = new QPathEntry [ relativeDegree... | Get relative path with degree . | 116 | 6 |
15,848 | public static QPath getCommonAncestorPath ( QPath firstPath , QPath secondPath ) throws PathNotFoundException { if ( ! firstPath . getEntries ( ) [ 0 ] . equals ( secondPath . getEntries ( ) [ 0 ] ) ) { throw new PathNotFoundException ( "For the given ways there is no common ancestor." ) ; } List < QPathEntry > caEntri... | Get common ancestor path . | 209 | 5 |
15,849 | public String getAsString ( ) { if ( stringName == null ) { StringBuilder str = new StringBuilder ( ) ; for ( int i = 0 ; i < getLength ( ) ; i ++ ) { str . append ( names [ i ] . getAsString ( true ) ) ; } stringName = str . toString ( ) ; } return stringName ; } | Get String representation . | 78 | 4 |
15,850 | public static QPath parse ( String qPath ) throws IllegalPathException { if ( qPath == null ) throw new IllegalPathException ( "Bad internal path '" + qPath + "'" ) ; if ( qPath . length ( ) < 2 || ! qPath . startsWith ( "[]" ) ) throw new IllegalPathException ( "Bad internal path '" + qPath + "'" ) ; int uriStart = 0 ... | Parses string and make internal path from it . | 400 | 11 |
15,851 | void repair ( boolean ignoreFailure ) throws IOException { if ( errors . size ( ) == 0 ) { log . info ( "No errors found." ) ; return ; } int notRepairable = 0 ; for ( Iterator < ConsistencyCheckError > it = errors . iterator ( ) ; it . hasNext ( ) ; ) { final ConsistencyCheckError error = it . next ( ) ; try { if ( er... | Repairs detected errors during the consistency check . | 279 | 9 |
15,852 | private void run ( ) throws IOException , RepositoryException { // UUIDs of multiple nodes in the index Set < String > multipleEntries = new HashSet < String > ( ) ; // collect all documents UUIDs documentUUIDs = new HashSet < String > ( ) ; CachingMultiIndexReader reader = index . getIndexReader ( ) ; try { for ( int ... | Runs the consistency check . | 644 | 6 |
15,853 | public WorkspaceContainer getWorkspaceContainer ( String workspaceName ) { Object comp = getComponentInstance ( workspaceName ) ; return comp != null && comp instanceof WorkspaceContainer ? ( WorkspaceContainer ) comp : null ; } | Get workspace Container by name . | 47 | 6 |
15,854 | public WorkspaceEntry getWorkspaceEntry ( String wsName ) { for ( WorkspaceEntry entry : config . getWorkspaceEntries ( ) ) { if ( entry . getName ( ) . equals ( wsName ) ) return entry ; } return null ; } | Get workspace configuration entry by name . | 57 | 7 |
15,855 | private void load ( ) throws RepositoryException { //Namespaces first NamespaceDataPersister namespacePersister = ( NamespaceDataPersister ) this . getComponentInstanceOfType ( NamespaceDataPersister . class ) ; NamespaceRegistryImpl nsRegistry = ( NamespaceRegistryImpl ) getNamespaceRegistry ( ) ; namespacePersister .... | Load namespaces and nodetypes from persistent repository . | 183 | 11 |
15,856 | protected InternalQName [ ] getSelectProperties ( ) throws RepositoryException { // get select properties List < InternalQName > selectProps = new ArrayList < InternalQName > ( ) ; selectProps . addAll ( Arrays . asList ( root . getSelectProperties ( ) ) ) ; if ( selectProps . size ( ) == 0 ) { // use node type constra... | Returns the select properties for this query . | 489 | 8 |
15,857 | protected Session session ( String repoName , String wsName , List < String > lockTokens ) throws Exception , NoSuchWorkspaceException { // To be cloud compliant we need now to ignore the provided repository name (more details in JCR-2138) ManageableRepository repo = repositoryService . getCurrentRepository ( ) ; if ( ... | Gives access to the current session . | 391 | 8 |
15,858 | protected String getRepositoryName ( String repoName ) throws RepositoryException { // To be cloud compliant we need now to ignore the provided repository name (more details in JCR-2138) ManageableRepository repo = repositoryService . getCurrentRepository ( ) ; String currentRepositoryName = repo . getConfiguration ( )... | Gives the name of the repository to access . | 159 | 10 |
15,859 | protected String normalizePath ( String repoPath ) { if ( repoPath . length ( ) > 0 && repoPath . endsWith ( "/" ) ) { return repoPath . substring ( 0 , repoPath . length ( ) - 1 ) ; } return repoPath ; } | Normalizes path . | 58 | 4 |
15,860 | protected String path ( String repoPath , boolean withIndex ) { String path = repoPath . substring ( workspaceName ( repoPath ) . length ( ) ) ; if ( path . length ( ) > 0 ) { if ( ! withIndex ) { return TextUtil . removeIndexFromPath ( path ) ; } return path ; } return "/" ; } | Extracts path from repository path . | 75 | 8 |
15,861 | protected List < String > lockTokens ( String lockTokenHeader , String ifHeader ) { ArrayList < String > lockTokens = new ArrayList < String > ( ) ; if ( lockTokenHeader != null ) { if ( lockTokenHeader . startsWith ( "<" ) ) { lockTokenHeader = lockTokenHeader . substring ( 1 , lockTokenHeader . length ( ) - 1 ) ; } i... | Creates the list of Lock tokens from Lock - Token and If headers . | 254 | 15 |
15,862 | private URI buildURI ( String path ) throws URISyntaxException { try { return new URI ( path ) ; } catch ( URISyntaxException e ) { return new URI ( TextUtil . escape ( path , ' ' , true ) ) ; } } | Build URI from string . | 56 | 5 |
15,863 | private boolean isAllowedPath ( String workspaceName , String path ) { if ( pattern == null ) return true ; Matcher matcher = pattern . matcher ( workspaceName + ":" + path ) ; if ( ! matcher . find ( ) ) { log . warn ( "Access not allowed to webdav resource {}" , path ) ; return false ; } return true ; } | Check resource access allowed | 81 | 4 |
15,864 | protected void createRepositoryInternally ( String backupId , RepositoryEntry rEntry , String rToken , DBCreationProperties creationProps ) throws RepositoryConfigurationException , RepositoryCreationException { if ( rpcService != null ) { String stringRepositoryEntry = null ; try { JsonGeneratorImpl generatorImpl = ne... | Create repository internally . serverUrl and connProps contain specific properties for db creation . | 598 | 17 |
15,865 | protected void removeRepositoryLocally ( String repositoryName , boolean forceRemove ) throws RepositoryCreationException { try { // extract list of all datasources ManageableRepository repositorty = repositoryService . getRepository ( repositoryName ) ; Set < String > datasources = extractDataSourceNames ( repositorty... | Remove repository locally . | 459 | 4 |
15,866 | private void traverseResources ( Resource resource , int counter ) throws XMLStreamException , RepositoryException , IllegalResourceTypeException , URISyntaxException , UnsupportedEncodingException { xmlStreamWriter . writeStartElement ( "DAV:" , "response" ) ; xmlStreamWriter . writeStartElement ( "DAV:" , "href" ) ; ... | Traverses resources and collects the vales of required properties . | 259 | 13 |
15,867 | private void calculateWorkspaceDataSize ( ) { long dataSize ; try { dataSize = getWorkspaceDataSizeDirectly ( ) ; } catch ( QuotaManagerException e1 ) { throw new IllegalStateException ( "Can't calculate workspace data size" , e1 ) ; } ChangesItem changesItem = new ChangesItem ( ) ; changesItem . updateWorkspaceChanged... | Calculates and accumulates workspace data size . | 109 | 10 |
15,868 | private void printWarning ( PropertyImpl property , Exception exception ) throws RepositoryException { if ( PropertyManager . isDevelopping ( ) ) { LOG . warn ( "Binary value reader error, content by path " + property . getPath ( ) + ", property id " + property . getData ( ) . getIdentifier ( ) + " : " + exception . ge... | Print warning message on the console | 143 | 6 |
15,869 | private void setJCRProperties ( NodeImpl parent , Properties props ) throws Exception { if ( ! parent . isNodeType ( "dc:elementSet" ) ) { parent . addMixin ( "dc:elementSet" ) ; } ValueFactory vFactory = parent . getSession ( ) . getValueFactory ( ) ; LocationFactory lFactory = parent . getSession ( ) . getLocationFac... | Sets metainfo properties as JCR properties to node . | 342 | 13 |
15,870 | private static String prepareScripts ( String initScriptPath , String itemTableSuffix , String valueTableSuffix , String refTableSuffix , boolean isolatedDB ) throws IOException { String scripts = IOUtil . getStreamContentAsString ( PrivilegedFileHelper . getResourceAsStream ( initScriptPath ) ) ; if ( isolatedDB ) { s... | Preparing SQL scripts for database initialization . | 127 | 8 |
15,871 | public static String getRootNodeInitializeScript ( String itemTableName , boolean multiDb ) { String singeDbScript = "insert into " + itemTableName + "(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, " + "N_ORDER_NUM) VALUES('" + Constants . ROOT_PARENT_UUID + "', '" + Constants . ROOT_PARENT_UUID + "',... | Initialization script for root node . | 275 | 7 |
15,872 | public static String getObjectScript ( String objectName , boolean multiDb , String dialect , WorkspaceEntry wsEntry ) throws RepositoryConfigurationException , IOException { String scripts = prepareScripts ( wsEntry , dialect ) ; String sql = null ; for ( String query : JDBCUtils . splitWithSQLDelimiter ( scripts ) ) ... | Returns SQL script for create objects such as index primary of foreign key . | 178 | 14 |
15,873 | public static boolean useSequenceForOrderNumber ( WorkspaceEntry wsConfig , String dbDialect ) throws RepositoryConfigurationException { try { if ( wsConfig . getContainer ( ) . getParameterValue ( JDBCWorkspaceDataContainer . USE_SEQUENCE_FOR_ORDER_NUMBER , JDBCWorkspaceDataContainer . USE_SEQUENCE_AUTO ) . equalsIgno... | Use sequence for order number . | 191 | 6 |
15,874 | SessionImpl createSession ( ConversationState user ) throws RepositoryException , LoginException { if ( IdentityConstants . SYSTEM . equals ( user . getIdentity ( ) . getUserId ( ) ) ) { // Need privileges to get system session. SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { secu... | Creates Session object by given Credentials | 229 | 9 |
15,875 | @ Override public synchronized void retain ( ) throws RepositoryException { try { if ( ! isRetainable ( ) ) throw new RepositoryException ( "Unsupported configuration place " + configurationService . getURL ( param . getValue ( ) ) + " If you want to save configuration, start repository from standalone file." + " Or pe... | Retain configuration of JCR If configurationPersister is configured it write data in to the persister otherwise it try to save configuration in file | 637 | 28 |
15,876 | protected void doRestore ( File backupFile ) throws BackupException { if ( ! PrivilegedFileHelper . exists ( backupFile ) ) { LOG . warn ( "Nothing to restore for quotas" ) ; return ; } ZipObjectReader in = null ; try { in = new ZipObjectReader ( PrivilegedFileHelper . zipInputStream ( backupFile ) ) ; quotaPersister .... | Restores content . | 161 | 4 |
15,877 | private void repairDataSize ( ) { try { long dataSize = quotaPersister . getWorkspaceDataSize ( rName , wsName ) ; ChangesItem changesItem = new ChangesItem ( ) ; changesItem . updateWorkspaceChangedSize ( dataSize ) ; quotaPersister . setWorkspaceDataSize ( rName , wsName , 0 ) ; // workaround Runnable task = new Appl... | After workspace data size being restored need also to update repository and global data size on respective value . | 148 | 19 |
15,878 | protected void doBackup ( File backupFile ) throws BackupException { ZipObjectWriter out = null ; try { out = new ZipObjectWriter ( PrivilegedFileHelper . zipOutputStream ( backupFile ) ) ; quotaPersister . backupWorkspaceData ( rName , wsName , out ) ; } catch ( IOException e ) { throw new BackupException ( e ) ; } fi... | Backups data to define file . | 124 | 7 |
15,879 | private void importResource ( Node parentNode , InputStream file_in , String resourceType , ArtifactDescriptor artifact ) throws RepositoryException { // Note that artifactBean been initialized within constructor // resourceType can be jar, pom, metadata String filename ; if ( resourceType . equals ( "metadata" ) ) { f... | this method used for writing to repo jars poms and their checksums | 370 | 14 |
15,880 | private IndexInfos createIndexInfos ( Boolean system , IndexerIoModeHandler modeHandler , QueryHandlerEntry config , QueryHandler handler ) throws RepositoryConfigurationException { try { // read RSYNC configuration RSyncConfiguration rSyncConfiguration = new RSyncConfiguration ( config ) ; // rsync configured if ( rSy... | Factory method for creating corresponding IndexInfos class . RSyncIndexInfos created if RSync configured and ISPNIndexInfos otherwise | 173 | 27 |
15,881 | @ Managed @ ManagedDescription ( "The number of active locks" ) public int getNumLocks ( ) { try { return getNumLocks . run ( ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return - 1 ; } | Returns the number of active locks . | 83 | 7 |
15,882 | protected boolean hasLocks ( ) { try { return hasLocks . run ( ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return true ; } | Indicates if some locks have already been created . | 64 | 10 |
15,883 | public boolean isLockLive ( String nodeId ) throws LockException { try { return isLockLive . run ( nodeId ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return false ; } | Check is LockManager contains lock . No matter it is in pending or persistent state . | 72 | 17 |
15,884 | protected LockData getLockDataById ( String nodeId ) { try { return getLockDataById . run ( nodeId ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return null ; } | Returns lock data by node identifier . | 72 | 7 |
15,885 | protected synchronized List < LockData > getLockList ( ) { try { return getLockList . run ( ) ; } catch ( LockException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "An exception occurred: " + e . getMessage ( ) ) ; } } return null ; } | Returns all locks . | 69 | 4 |
15,886 | public SessionLockManager getSessionLockManager ( String sessionId , SessionDataManager transientManager ) { CacheableSessionLockManager sessionManager = new CacheableSessionLockManager ( sessionId , this , transientManager ) ; sessionLockManagers . put ( sessionId , sessionManager ) ; return sessionManager ; } | Return new instance of session lock manager . | 63 | 8 |
15,887 | public synchronized void removeExpired ( ) { final List < String > removeLockList = new ArrayList < String > ( ) ; for ( LockData lock : getLockList ( ) ) { if ( ! lock . isSessionScoped ( ) && lock . getTimeToDeath ( ) < 0 ) { removeLockList . add ( lock . getNodeIdentifier ( ) ) ; } } Collections . sort ( removeLockL... | Remove expired locks . Used from LockRemover . | 111 | 10 |
15,888 | protected void removeLock ( String nodeIdentifier ) { try { NodeData nData = ( NodeData ) dataManager . getItemData ( nodeIdentifier ) ; //Skip removing, because that node was removed in other node of cluster. if ( nData == null ) { return ; } PlainChangesLog changesLog = new PlainChangesLogImpl ( new ArrayList < ItemS... | Remove lock used by Lock remover . | 426 | 8 |
15,889 | protected void removeAll ( ) { List < LockData > locks = getLockList ( ) ; for ( LockData lockData : locks ) { removeLock ( lockData . getNodeIdentifier ( ) ) ; } } | Remove all locks . | 46 | 4 |
15,890 | public static byte [ ] getAsByteArray ( TransactionChangesLog dataChangesLog ) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( os ) ; oos . writeObject ( dataChangesLog ) ; byte [ ] bArray = os . toByteArray ( ) ; return bArray ; } | getAsByteArray . Make the array of bytes from ChangesLog . | 79 | 14 |
15,891 | public static TransactionChangesLog getAsItemDataChangesLog ( byte [ ] byteArray ) throws IOException , ClassNotFoundException { ByteArrayInputStream is = new ByteArrayInputStream ( byteArray ) ; ObjectInputStream ois = new ObjectInputStream ( is ) ; TransactionChangesLog objRead = ( TransactionChangesLog ) ois . readO... | getAsItemDataChangesLog . Make the ChangesLog from array of bytes . | 81 | 16 |
15,892 | public PlainChangesLog read ( ObjectReader in ) throws UnknownClassIdException , IOException { int key ; if ( ( key = in . readInt ( ) ) != SerializationConstants . PLAIN_CHANGES_LOG_IMPL ) { throw new UnknownClassIdException ( "There is unexpected class [" + key + "]" ) ; } int eventType = in . readInt ( ) ; String se... | Read and set PlainChangesLog data . | 195 | 8 |
15,893 | public void write ( ObjectWriter out , PlainChangesLog pcl ) throws IOException { // write id out . writeInt ( SerializationConstants . PLAIN_CHANGES_LOG_IMPL ) ; out . writeInt ( pcl . getEventType ( ) ) ; out . writeString ( pcl . getSessionId ( ) ) ; List < ItemState > list = pcl . getAllStates ( ) ; int listSize = ... | Write PlainChangesLog data . | 153 | 6 |
15,894 | private ExtendedNode getUsersStorageNode ( ) throws RepositoryException { Session session = service . getStorageSession ( ) ; try { return ( ExtendedNode ) utils . getUsersStorageNode ( service . getStorageSession ( ) ) ; } finally { session . logout ( ) ; } } | Returns users storage node . | 61 | 5 |
15,895 | protected void closeStatements ( ) { try { if ( findItemById != null ) { findItemById . close ( ) ; } if ( findItemByPath != null ) { findItemByPath . close ( ) ; } if ( findItemByName != null ) { findItemByName . close ( ) ; } if ( findChildPropertyByPath != null ) { findChildPropertyByPath . close ( ) ; } if ( findPr... | Close all statements . | 693 | 4 |
15,896 | public List < NodeDataIndexing > getNodesAndProperties ( String lastNodeId , int offset , int limit ) throws RepositoryException , IllegalStateException { List < NodeDataIndexing > result = new ArrayList < NodeDataIndexing > ( ) ; checkIfOpened ( ) ; try { startTxIfNeeded ( ) ; ResultSet resultSet = findNodesAndPropert... | Returns from storage the next page of nodes and its properties . | 532 | 12 |
15,897 | public long getNodesCount ( ) throws RepositoryException { try { ResultSet countNodes = findNodesCount ( ) ; try { if ( countNodes . next ( ) ) { return countNodes . getLong ( 1 ) ; } else { throw new SQLException ( "ResultSet has't records." ) ; } } finally { JDBCUtils . freeResources ( countNodes , null , null ) ; } ... | Reads count of nodes in workspace . | 122 | 8 |
15,898 | public long getWorkspaceDataSize ( ) throws RepositoryException { long dataSize = 0 ; ResultSet result = null ; try { result = findWorkspaceDataSize ( ) ; try { if ( result . next ( ) ) { dataSize += result . getLong ( 1 ) ; } } finally { JDBCUtils . freeResources ( result , null , null ) ; } result = findWorkspaceProp... | Calculates workspace data size . | 293 | 7 |
15,899 | public long getNodeDataSize ( String nodeIdentifier ) throws RepositoryException { long dataSize = 0 ; ResultSet result = null ; try { result = findNodeDataSize ( getInternalId ( nodeIdentifier ) ) ; try { if ( result . next ( ) ) { dataSize += result . getLong ( 1 ) ; } } finally { JDBCUtils . freeResources ( result ,... | Calculates node data size . | 310 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.