idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
15,400
public QPath getRemainder ( ) { if ( matchPos + matchLength >= pathLength ) { return null ; } else { try { throw new RepositoryException ( "Not implemented" ) ; } catch ( RepositoryException e ) { throw ( IllegalStateException ) new IllegalStateException ( "Path not normalized" ) . initCause ( e ) ; } } }
Returns the remaining path after the matching part .
15,401
private void calculateDocFilter ( ) throws IOException { PerQueryCache cache = PerQueryCache . getInstance ( ) ; @ SuppressWarnings ( "unchecked" ) Map < String , BitSet > readerCache = ( Map < String , BitSet > ) cache . get ( MatchAllScorer . class , reader ) ; if ( readerCache == null ) { readerCache = new HashMap <...
Calculates a BitSet filter that includes all the nodes that have content in properties according to the field name passed in the constructor of this MatchAllScorer .
15,402
public String [ ] getSynonyms ( String word ) { String [ ] synonyms = table . get ( word ) ; if ( synonyms == null ) return EMPTY ; String [ ] copy = new String [ synonyms . length ] ; System . arraycopy ( synonyms , 0 , copy , 0 , synonyms . length ) ; return copy ; }
Returns the synonym set for the given word sorted ascending .
15,403
public static void writePropStats ( XMLStreamWriter xmlStreamWriter , Map < String , Set < HierarchicalProperty > > propStatuses ) throws XMLStreamException { for ( Map . Entry < String , Set < HierarchicalProperty > > stat : propStatuses . entrySet ( ) ) { xmlStreamWriter . writeStartElement ( "DAV:" , "propstat" ) ; ...
Writes the statuses of properties into XML .
15,404
public static void writeProperty ( XMLStreamWriter xmlStreamWriter , HierarchicalProperty prop ) throws XMLStreamException { String uri = prop . getName ( ) . getNamespaceURI ( ) ; String prefix = xmlStreamWriter . getNamespaceContext ( ) . getPrefix ( uri ) ; if ( prefix == null ) { prefix = "" ; } String local = prop...
Writes the statuses of property into XML .
15,405
public static void writeAttributes ( XMLStreamWriter xmlStreamWriter , HierarchicalProperty property ) throws XMLStreamException { Map < String , String > attributes = property . getAttributes ( ) ; Iterator < String > keyIter = attributes . keySet ( ) . iterator ( ) ; while ( keyIter . hasNext ( ) ) { String attrName ...
Writes property attributes into XML .
15,406
private String getRealm ( String sUrl ) throws IOException , ModuleException { AuthorizationHandler ah = AuthorizationInfo . getAuthHandler ( ) ; try { URL url = new URL ( sUrl ) ; HTTPConnection connection = new HTTPConnection ( url ) ; connection . removeModule ( CookieModule . class ) ; AuthorizationInfo . setAuthHa...
Get realm by URL .
15,407
public static String getChecksum ( InputStream in , String algo ) throws NoSuchAlgorithmException , IOException { MessageDigest md = MessageDigest . getInstance ( algo ) ; DigestInputStream digestInputStream = new DigestInputStream ( in , md ) ; digestInputStream . on ( true ) ; while ( digestInputStream . read ( ) > -...
Generates checksum for the InputStream .
15,408
private static String generateString ( byte [ ] bytes ) { StringBuffer sb = new StringBuffer ( ) ; for ( byte b : bytes ) { int v = b & 0xFF ; sb . append ( ( char ) HEX . charAt ( v >> 4 ) ) ; sb . append ( ( char ) HEX . charAt ( v & 0x0f ) ) ; } return sb . toString ( ) ; }
Converts the array of bytes into a HEX string .
15,409
public static void cleanWorkspaceData ( WorkspaceEntry wsEntry ) throws DBCleanException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; Connection jdbcConn = getConnection ( wsEntry ) ; String dialect = resolveDialect ( jdbcConn , wsEntry ) ; boolean autoCommit ...
Cleans workspace data from database .
15,410
public static void cleanRepositoryData ( RepositoryEntry rEntry ) throws DBCleanException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; WorkspaceEntry wsEntry = rEntry . getWorkspaceEntries ( ) . get ( 0 ) ; boolean multiDB = getMultiDbParameter ( wsEntry ) ; i...
Cleans repository data from database .
15,411
public static DBCleanerTool getRepositoryDBCleaner ( Connection jdbcConn , RepositoryEntry rEntry ) throws DBCleanException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; WorkspaceEntry wsEntry = rEntry . getWorkspaceEntries ( ) . get ( 0 ) ; boolean multiDb = g...
Returns database cleaner for repository .
15,412
public static DBCleanerTool getWorkspaceDBCleaner ( Connection jdbcConn , WorkspaceEntry wsEntry ) throws DBCleanException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; String dialect = resolveDialect ( jdbcConn , wsEntry ) ; boolean autoCommit = dialect . star...
Returns database cleaner for workspace .
15,413
private static Connection getConnection ( WorkspaceEntry wsEntry ) throws DBCleanException { String dsName = getSourceNameParameter ( wsEntry ) ; DataSource ds ; try { ds = ( DataSource ) new InitialContext ( ) . lookup ( dsName ) ; } catch ( NamingException e ) { throw new DBCleanException ( e ) ; } if ( ds == null ) ...
Opens connection to database underlying a workspace .
15,414
private String hash ( String dataId ) { try { MessageDigest digest = MessageDigest . getInstance ( hashAlgorithm ) ; digest . update ( dataId . getBytes ( "UTF-8" ) ) ; return new BigInteger ( 1 , digest . digest ( ) ) . toString ( 32 ) ; } catch ( NumberFormatException e ) { throw new RuntimeException ( "Could not gen...
Gives the hash code of the given data id
15,415
private QPathEntry parsePatternQPathEntry ( String namePattern , SessionImpl session ) throws RepositoryException { int colonIndex = namePattern . indexOf ( ':' ) ; int bracketIndex = namePattern . lastIndexOf ( '[' ) ; String namespaceURI ; String localName ; int index = getDefaultIndex ( ) ; if ( bracketIndex != - 1 ...
Parse QPathEntry from string namePattern . NamePattern may contain wildcard symbols in namespace and local name . And may not contain index which means look all samename siblings . So ordinary QPathEntry parser is not acceptable .
15,416
protected void accumulatePersistedNodesChanges ( Map < String , Long > calculatedChangedNodesSize ) throws QuotaManagerException { for ( Entry < String , Long > entry : calculatedChangedNodesSize . entrySet ( ) ) { String nodePath = entry . getKey ( ) ; long delta = entry . getValue ( ) ; try { long dataSize = delta + ...
Update nodes data size .
15,417
protected void accumulatePersistedWorkspaceChanges ( long delta ) throws QuotaManagerException { long dataSize = 0 ; try { dataSize = quotaPersister . getWorkspaceDataSize ( rName , wsName ) ; } catch ( UnknownDataSizeException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( e . getMessage ( ) , e ) ; } } long ne...
Update workspace data size .
15,418
protected void accumulatePersistedRepositoryChanges ( long delta ) { long dataSize = 0 ; try { dataSize = quotaPersister . getRepositoryDataSize ( rName ) ; } catch ( UnknownDataSizeException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( e . getMessage ( ) , e ) ; } } long newDataSize = Math . max ( dataSize + ...
Update repository data size .
15,419
private void accumulatePersistedGlobalChanges ( long delta ) { long dataSize = 0 ; try { dataSize = quotaPersister . getGlobalDataSize ( ) ; } catch ( UnknownDataSizeException e ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( e . getMessage ( ) , e ) ; } } long newDataSize = Math . max ( dataSize + delta , 0 ) ; qu...
Update global data size .
15,420
protected NodeImpl parent ( final boolean pool ) throws RepositoryException { NodeImpl parent = ( NodeImpl ) dataManager . getItemByIdentifier ( getParentIdentifier ( ) , pool ) ; if ( parent == null ) { throw new ItemNotFoundException ( "FATAL: Parent is null for " + getPath ( ) + " parent UUID: " + getParentIdentifie...
Get parent node item .
15,421
public NodeData parentData ( ) throws RepositoryException { checkValid ( ) ; NodeData parent = ( NodeData ) dataManager . getItemData ( getData ( ) . getParentIdentifier ( ) ) ; if ( parent == null ) { throw new ItemNotFoundException ( "FATAL: Parent is null for " + getPath ( ) + " parent UUID: " + getData ( ) . getPar...
Get and return parent node data .
15,422
public JCRPath getLocation ( ) throws RepositoryException { if ( this . location == null ) { this . location = session . getLocationFactory ( ) . createJCRPath ( qpath ) ; } return this . location ; }
Get item JCRPath location .
15,423
public String getType ( ) { if ( input == null ) { return "allprop" ; } if ( input . getChild ( PropertyConstants . DAV_ALLPROP_INCLUDE ) != null ) { return "include" ; } QName name = input . getChild ( 0 ) . getName ( ) ; if ( name . getNamespaceURI ( ) . equals ( "DAV:" ) ) return name . getLocalPart ( ) ; else retur...
Returns the type of request .
15,424
public R run ( A ... arg ) throws E { final TransactionManager tm = getTransactionManager ( ) ; Transaction tx = null ; try { if ( tm != null ) { try { tx = tm . suspend ( ) ; } catch ( SystemException e ) { LOG . warn ( "Cannot suspend the current transaction" , e ) ; } } return execute ( arg ) ; } finally { if ( tx !...
Executes the action outside the context of the current tx
15,425
protected R execute ( A ... arg ) throws E { if ( arg == null || arg . length == 0 ) { return execute ( ( A ) null ) ; } return execute ( arg [ 0 ] ) ; }
Executes the action
15,426
public NodeRepresentation getNodeRepresentation ( Node node , String mediaTypeHint ) throws RepositoryException { NodeRepresentationFactory factory = factory ( node ) ; if ( factory != null ) return factory . createNodeRepresentation ( node , mediaTypeHint ) ; else return new DocumentViewNodeRepresentation ( node ) ; }
Get NodeRepresentation for given node . String mediaTypeHint can be used as external information for representation . By default node will be represented as doc - view .
15,427
public void spoolDone ( ) { final CountDownLatch sl = this . spoolLatch . get ( ) ; this . spoolLatch . set ( null ) ; sl . countDown ( ) ; }
Mark the file ready for read .
15,428
public ItemData getItemData ( NodeData parent , QPathEntry [ ] relPathEntries , ItemType itemType ) throws RepositoryException { ItemData item = parent ; for ( int i = 0 ; i < relPathEntries . length ; i ++ ) { if ( i == relPathEntries . length - 1 ) { item = getItemData ( parent , relPathEntries [ i ] , itemType ) ; }...
Return item data by parent NodeDada and relPathEntries If relpath is JCRPath . THIS_RELPATH = . it return itself
15,429
public ItemData getItemData ( String identifier , boolean checkChangesLogOnly ) throws RepositoryException { ItemData data = null ; ItemState state = changesLog . getItemState ( identifier ) ; if ( state == null ) { data = transactionableManager . getItemData ( identifier , checkChangesLogOnly ) ; data = updatePathIfNe...
Return item data by identifier in this transient storage then in workspace container .
15,430
public ItemImpl getItem ( NodeData parent , QPathEntry name , boolean pool , ItemType itemType ) throws RepositoryException { return getItem ( parent , name , pool , itemType , true ) ; }
Return Item by parent NodeDada and the name of searched item .
15,431
public ItemImpl getItem ( NodeData parent , QPathEntry name , boolean pool , ItemType itemType , boolean apiRead , boolean createNullItemData ) throws RepositoryException { long start = 0 ; if ( LOG . isDebugEnabled ( ) ) { start = System . currentTimeMillis ( ) ; LOG . debug ( "getItem(" + parent . getQPath ( ) . getA...
For internal use . Return Item by parent NodeDada and the name of searched item .
15,432
public ItemImpl getItem ( NodeData parent , QPathEntry [ ] relPath , boolean pool , ItemType itemType ) throws RepositoryException { long start = 0 ; if ( LOG . isDebugEnabled ( ) ) { start = System . currentTimeMillis ( ) ; StringBuilder debugPath = new StringBuilder ( ) ; for ( QPathEntry rp : relPath ) { debugPath ....
Return Item by parent NodeDada and array of QPathEntry which represent a relative path to the searched item
15,433
public ItemImpl getItem ( QPath path , boolean pool ) throws RepositoryException { long start = 0 ; if ( LOG . isDebugEnabled ( ) ) { start = System . currentTimeMillis ( ) ; LOG . debug ( "getItem(" + path . getAsString ( ) + " ) >>>>>" ) ; } ItemImpl item = null ; try { return item = readItem ( getItemData ( path ) ,...
Return item by absolute path in this transient storage then in workspace container .
15,434
protected ItemImpl readItem ( ItemData itemData , boolean pool ) throws RepositoryException { return readItem ( itemData , null , pool , true ) ; }
Read ItemImpl of given ItemData . Will call postRead Action and check permissions .
15,435
protected ItemImpl readItem ( ItemData itemData , NodeData parent , boolean pool , boolean apiRead ) throws RepositoryException { if ( ! apiRead ) { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { security . checkPermission ( JCRRuntimePermissions . INVOKE_INTERNAL_API_PERMISSION ...
Create or reload pooled ItemImpl with the given ItemData .
15,436
public ItemImpl getItemByIdentifier ( String identifier , boolean pool ) throws RepositoryException { return getItemByIdentifier ( identifier , pool , true ) ; }
Return item by identifier in this transient storage then in workspace container .
15,437
public ItemImpl getItemByIdentifier ( String identifier , boolean pool , boolean apiRead ) throws RepositoryException { long start = 0 ; if ( LOG . isDebugEnabled ( ) ) { start = System . currentTimeMillis ( ) ; LOG . debug ( "getItemByIdentifier(" + identifier + " ) >>>>>" ) ; } ItemImpl item = null ; try { return ite...
For internal use required privileges . Return item by identifier in this transient storage then in workspace container .
15,438
public AccessControlList getACL ( QPath path ) throws RepositoryException { long start = 0 ; if ( LOG . isDebugEnabled ( ) ) { start = System . currentTimeMillis ( ) ; LOG . debug ( "getACL(" + path . getAsString ( ) + " ) >>>>>" ) ; } try { NodeData parent = ( NodeData ) getItemData ( Constants . ROOT_UUID ) ; if ( pa...
Return the ACL of the location . A session pending changes will be searched too . Item path will be traversed from the root node to a last existing item .
15,439
protected List < ItemState > reindexSameNameSiblings ( NodeData cause , ItemDataConsumer dataManager ) throws RepositoryException { List < ItemState > changes = new ArrayList < ItemState > ( ) ; NodeData parentNodeData = ( NodeData ) dataManager . getItemData ( cause . getParentIdentifier ( ) ) ; NodeData nextSibling =...
Reindex same - name siblings of the node Reindex is actual for remove move only . If node is added then its index always is a last in list of childs .
15,440
public List < PropertyData > getReferencesData ( String identifier , boolean skipVersionStorage ) throws RepositoryException { List < PropertyData > persisted = transactionableManager . getReferencesData ( identifier , skipVersionStorage ) ; List < PropertyData > sessionTransient = new ArrayList < PropertyData > ( ) ; ...
Returns all REFERENCE properties that refer to this node .
15,441
private void validate ( QPath path ) throws RepositoryException , AccessDeniedException , ReferentialIntegrityException { List < ItemState > changes = changesLog . getAllStates ( ) ; for ( ItemState itemState : changes ) { if ( itemState . isInternallyCreated ( ) ) { if ( itemState . isMixinChanged ( ) ) { if ( itemSta...
Validate all user created changes saves like access permeations mandatory items value constraint .
15,442
private void validateAccessPermissions ( ItemState changedItem ) throws RepositoryException , AccessDeniedException { if ( changedItem . isAddedAutoCreatedNodes ( ) ) { validateAddNodePermission ( changedItem ) ; } else if ( changedItem . isDeleted ( ) ) { validateRemoveAccessPermission ( changedItem ) ; } else if ( ch...
Validate ItemState for access permeations
15,443
private void validateMandatoryItem ( ItemState changedItem ) throws ConstraintViolationException , AccessDeniedException { if ( changedItem . getData ( ) . isNode ( ) && ( changedItem . isAdded ( ) || changedItem . isMixinChanged ( ) ) && ! changesLog . getItemState ( changedItem . getData ( ) . getQPath ( ) ) . isDele...
Validate ItemState which represents the add node for it s all mandatory items
15,444
void rollback ( ItemData item ) throws InvalidItemStateException , RepositoryException { PlainChangesLog slog = changesLog . pushLog ( item . getQPath ( ) ) ; SessionChangesLog changes = new SessionChangesLog ( slog . getAllStates ( ) , session ) ; for ( Iterator < ItemImpl > removedIter = invalidated . iterator ( ) ; ...
Removes all pending changes of this item
15,445
protected List < ? extends ItemData > mergeList ( ItemData rootData , DataManager dataManager , boolean deep , int action ) throws RepositoryException { List < ItemState > transientDescendants = new ArrayList < ItemState > ( ) ; traverseTransientDescendants ( rootData , action , transientDescendants ) ; if ( deep || ! ...
Merge a list of nodes and properties of root data . NOTE . Properties in the list will have empty value data . I . e . for operations not changes properties content . USED FOR DELETE .
15,446
private void traverseStoredDescendants ( ItemData parent , DataManager dataManager , int action , Map < String , ItemData > ret , boolean listOnly , Collection < ItemState > transientDescendants ) throws RepositoryException { if ( parent . isNode ( ) && ! isNew ( parent . getIdentifier ( ) ) ) { if ( action != MERGE_PR...
Calculate all stored descendants for the given parent node
15,447
private List < ? extends ItemData > getStoredDescendants ( ItemData parent , DataManager dataManager , int action ) throws RepositoryException { if ( parent . isNode ( ) ) { List < ItemData > childItems = null ; List < NodeData > childNodes = dataManager . getChildNodesData ( ( NodeData ) parent ) ; if ( action != MERG...
Get all stored descendants for the given parent node
15,448
private void traverseTransientDescendants ( ItemData parent , int action , List < ItemState > ret ) throws RepositoryException { if ( parent . isNode ( ) ) { if ( action != MERGE_PROPS ) { Collection < ItemState > childNodes = changesLog . getLastChildrenStates ( parent , true ) ; for ( ItemState childNode : childNodes...
Calculate all transient descendants for the given parent node
15,449
private void reloadDescendants ( QPath parentOld , QPath parent ) throws RepositoryException { List < ItemImpl > items = itemsPool . getDescendats ( parentOld ) ; for ( ItemImpl item : items ) { ItemData oldItemData = item . getData ( ) ; ItemData newItemData = updatePath ( parentOld , parent , oldItemData ) ; ItemImpl...
Reload item s descendants in item reference pool
15,450
private ItemData updatePathIfNeeded ( ItemData data ) throws IllegalPathException { if ( data == null || changesLog . getAllPathsChanged ( ) == null ) return data ; List < ItemState > states = changesLog . getAllPathsChanged ( ) ; for ( int i = 0 , length = states . size ( ) ; i < length ; i ++ ) { ItemState state = st...
Updates the path if needed and gives the updated item data if an update was needed or the provided item data otherwise
15,451
private ItemData updatePath ( QPath parentOld , QPath parent , ItemData oldItemData ) throws IllegalPathException { int relativeDegree = oldItemData . getQPath ( ) . getDepth ( ) - parentOld . getDepth ( ) ; QPath newQPath = QPath . makeChildPath ( parent , oldItemData . getQPath ( ) . getRelPath ( relativeDegree ) ) ;...
Updates the path of the item data and gives the updated objects
15,452
private static Statistics getStatistics ( Class < ? > target , String signature ) { initIfNeeded ( ) ; Statistics statistics = MAPPING . get ( signature ) ; if ( statistics == null ) { synchronized ( JCRAPIAspect . class ) { Class < ? > interfaceClass = findInterface ( target ) ; if ( interfaceClass != null ) { Map < S...
Gives the corresponding statistics for the given target class and AspectJ signature
15,453
private static void initIfNeeded ( ) { if ( ! INITIALIZED ) { synchronized ( JCRAPIAspect . class ) { if ( ! INITIALIZED ) { ExoContainer container = ExoContainerContext . getTopContainer ( ) ; JCRAPIAspectConfig config = null ; if ( container != null ) { config = ( JCRAPIAspectConfig ) container . getComponentInstance...
Initializes the aspect if needed
15,454
public static DBCleaningScripts prepareScripts ( String dialect , WorkspaceEntry wsEntry ) throws DBCleanException { if ( dialect . startsWith ( DialectConstants . DB_DIALECT_MYSQL ) ) { return new MySQLCleaningScipts ( dialect , wsEntry ) ; } else if ( dialect . startsWith ( DialectConstants . DB_DIALECT_DB2 ) ) { ret...
Prepare SQL scripts for cleaning workspace data from database .
15,455
private void triggerRSyncSynchronization ( ) { if ( modeHandler . getMode ( ) == IndexerIoMode . READ_ONLY ) { EmbeddedCacheManager cacheManager = cache . getCacheManager ( ) ; if ( cacheManager . getCoordinator ( ) instanceof JGroupsAddress && cacheManager . getTransport ( ) instanceof JGroupsTransport ) { JGroupsTran...
Call to system RSync binary implementation
15,456
public static SessionProvider createAnonimProvider ( ) { Identity id = new Identity ( IdentityConstants . ANONIM , new HashSet < MembershipEntry > ( ) ) ; return new SessionProvider ( new ConversationState ( id ) ) ; }
Helper for creating Anonymous session provider .
15,457
public synchronized Session getSession ( String workspaceName , ManageableRepository repository ) throws LoginException , NoSuchWorkspaceException , RepositoryException { if ( closed ) { throw new IllegalStateException ( "Session provider already closed" ) ; } if ( workspaceName == null ) { throw new IllegalArgumentExc...
Gets the session from an internal cache if a similar session has already been used or creates a new session and puts it into the internal cache .
15,458
private String key ( ManageableRepository repository , String workspaceName ) { String repositoryName = repository . getConfiguration ( ) . getName ( ) ; return repositoryName + workspaceName ; }
Key generator for sessions cache .
15,459
public static String extractCommonAncestor ( String pattern , String absPath ) { pattern = normalizePath ( pattern ) ; absPath = normalizePath ( absPath ) ; String [ ] patterEntries = pattern . split ( "/" ) ; String [ ] pathEntries = absPath . split ( "/" ) ; StringBuilder ancestor = new StringBuilder ( ) ; int count ...
Returns common ancestor for paths represented by absolute path and pattern .
15,460
protected void doUpdateIndex ( Set < String > removedNodes , Set < String > addedNodes , Set < String > parentRemovedNodes , Set < String > parentAddedNodes ) { ChangesHolder changes = searchManager . getChanges ( removedNodes , addedNodes ) ; ChangesHolder parentChanges = parentSearchManager . getChanges ( parentRemov...
Update index .
15,461
private int forceCloseSession ( String repositoryName , String workspaceName ) throws RepositoryException , RepositoryConfigurationException { ManageableRepository mr = repositoryService . getRepository ( repositoryName ) ; WorkspaceContainerFacade wc = mr . getWorkspaceContainer ( workspaceName ) ; SessionRegistry ses...
Close sessions on specific workspace .
15,462
public List < String > readList ( ) throws IOException { InputStream in = PrivilegedFileHelper . fileInputStream ( logFile ) ; try { List < String > list = new ArrayList < String > ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( in ) ) ; String line ; while ( ( line = reader . readLine ( ) ) ...
Reads the log file .
15,463
public void addJobEntry ( BackupJob job ) { try { JobEntryInfo info = new JobEntryInfo ( ) ; info . setDate ( Calendar . getInstance ( ) ) ; info . setType ( job . getType ( ) ) ; info . setState ( job . getState ( ) ) ; info . setURL ( job . getStorageURL ( ) ) ; logWriter . write ( info , config ) ; } catch ( IOExcep...
Adding the the backup job .
15,464
public Collection < JobEntryInfo > getJobEntryStates ( ) { HashMap < Integer , JobEntryInfo > infos = new HashMap < Integer , JobEntryInfo > ( ) ; for ( JobEntryInfo jobEntry : jobEntries ) { infos . put ( jobEntry . getID ( ) , jobEntry ) ; } return infos . values ( ) ; }
Getting the states for jobs .
15,465
public Response mkCol ( Session session , String path , String nodeType , List < String > mixinTypes , List < String > tokens ) { Node node ; try { nullResourceLocks . checkLock ( session , path , tokens ) ; node = session . getRootNode ( ) . addNode ( TextUtil . relativizePath ( path ) , nodeType ) ; path = node . get...
Webdav Mkcol method implementation .
15,466
private void addMixins ( Node node , List < String > mixinTypes ) { for ( int i = 0 ; i < mixinTypes . size ( ) ; i ++ ) { String curMixinType = mixinTypes . get ( i ) ; try { node . addMixin ( curMixinType ) ; } catch ( Exception exc ) { log . error ( "Can't add mixin [" + curMixinType + "]" , exc ) ; } } }
Adds mixins to node .
15,467
public Response unLock ( Session session , String path , List < String > tokens ) { try { try { Node node = ( Node ) session . getItem ( path ) ; if ( node . isLocked ( ) ) { node . unlock ( ) ; session . save ( ) ; } return Response . status ( HTTPStatus . NO_CONTENT ) . build ( ) ; } catch ( PathNotFoundException exc...
Webdav Unlock method implementation .
15,468
public static HierarchicalProperty lockDiscovery ( String token , String lockOwner , String timeOut ) { HierarchicalProperty lockDiscovery = new HierarchicalProperty ( new QName ( "DAV:" , "lockdiscovery" ) ) ; HierarchicalProperty activeLock = lockDiscovery . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , ...
Returns the information about lock .
15,469
protected HierarchicalProperty supportedLock ( ) { HierarchicalProperty supportedLock = new HierarchicalProperty ( new QName ( "DAV:" , "supportedlock" ) ) ; HierarchicalProperty lockEntry = new HierarchicalProperty ( new QName ( "DAV:" , "lockentry" ) ) ; supportedLock . addChild ( lockEntry ) ; HierarchicalProperty l...
The information about supported locks .
15,470
protected HierarchicalProperty supportedMethodSet ( ) { HierarchicalProperty supportedMethodProp = new HierarchicalProperty ( SUPPORTEDMETHODSET ) ; supportedMethodProp . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "supported-method" ) ) ) . setAttribute ( "name" , "PROPFIND" ) ; supportedMethodProp . ad...
The information about supported methods .
15,471
private void updateVersion ( Node fileNode , InputStream inputStream , String autoVersion , List < String > mixins ) throws RepositoryException { if ( ! fileNode . isCheckedOut ( ) ) { fileNode . checkout ( ) ; fileNode . getSession ( ) . save ( ) ; } if ( CHECKOUT . equals ( autoVersion ) ) { updateContent ( fileNode ...
Updates the content of the versionable file according to auto - version value .
15,472
void put ( String uuid , CachingIndexReader reader , int n ) { LRUMap cacheSegment = docNumbers [ getSegmentIndex ( uuid . charAt ( 0 ) ) ] ; String key = uuid ; synchronized ( cacheSegment ) { Entry e = ( Entry ) cacheSegment . get ( key ) ; if ( e != null ) { if ( reader . getCreationTick ( ) <= e . creationTick ) { ...
Puts a document number into the cache using a uuid as key . An entry is only overwritten if the according reader is younger than the reader associated with the existing entry .
15,473
public Value createValue ( JCRName value ) throws RepositoryException { if ( value == null ) return null ; try { return new NameValue ( value . getInternalName ( ) , locationFactory ) ; } catch ( IOException e ) { throw new RepositoryException ( "Cannot create NAME Value from JCRName" , e ) ; } }
Create Value from JCRName .
15,474
public Value createValue ( JCRPath value ) throws RepositoryException { if ( value == null ) return null ; try { return new PathValue ( value . getInternalPath ( ) , locationFactory ) ; } catch ( IOException e ) { throw new RepositoryException ( "Cannot create PATH Value from JCRPath" , e ) ; } }
Create Value from JCRPath .
15,475
public Value createValue ( Identifier value ) { if ( value == null ) return null ; try { return new ReferenceValue ( value ) ; } catch ( IOException e ) { LOG . warn ( "Cannot create REFERENCE Value from Identifier " + value , e ) ; return null ; } }
Create Value from Id .
15,476
public Value loadValue ( ValueData data , int type ) throws RepositoryException { try { switch ( type ) { case PropertyType . STRING : return new StringValue ( data ) ; case PropertyType . BINARY : return new BinaryValue ( data , spoolConfig ) ; case PropertyType . BOOLEAN : return new BooleanValue ( data ) ; case Prop...
Creates new Value object using ValueData
15,477
protected Connection openConnection ( ) throws SQLException { return SecurityHelper . doPrivilegedSQLExceptionAction ( new PrivilegedExceptionAction < Connection > ( ) { public Connection run ( ) throws SQLException { return ds . getConnection ( ) ; } } ) ; }
Opens connection to database .
15,478
public String getUrlParams ( ) { StringBuffer osParams = new StringBuffer ( ) ; for ( Iterator i = this . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) i . next ( ) ; if ( entry . getValue ( ) != null ) osParams . append ( "&" + encodeConfig ( entry . getKey ( ) . toString ( ) ...
Generate the url parameter sequence used to pass this configuration to the editor .
15,479
public String addLock ( Session session , String path ) throws LockException { String repoPath = session . getRepository ( ) . hashCode ( ) + "/" + session . getWorkspace ( ) . getName ( ) + "/" + path ; if ( ! nullResourceLocks . containsKey ( repoPath ) ) { String newLockToken = IdGenerator . generate ( ) ; session ....
Locks the node .
15,480
public void removeLock ( Session session , String path ) { String repoPath = session . getRepository ( ) . hashCode ( ) + "/" + session . getWorkspace ( ) . getName ( ) + "/" + path ; String token = nullResourceLocks . get ( repoPath ) ; session . removeLockToken ( token ) ; nullResourceLocks . remove ( repoPath ) ; }
Removes lock from the node .
15,481
public boolean isLocked ( Session session , String path ) { String repoPath = session . getRepository ( ) . hashCode ( ) + "/" + session . getWorkspace ( ) . getName ( ) + "/" + path ; if ( nullResourceLocks . get ( repoPath ) != null ) { return true ; } return false ; }
Checks if the node is locked .
15,482
public void checkLock ( Session session , String path , List < String > tokens ) throws LockException { String repoPath = session . getRepository ( ) . hashCode ( ) + "/" + session . getWorkspace ( ) . getName ( ) + "/" + path ; String currentToken = nullResourceLocks . get ( repoPath ) ; if ( currentToken == null ) { ...
Checks if the node can be unlocked using current tokens .
15,483
private Object getObject ( Class cl , byte [ ] data ) throws Exception { JsonHandler jsonHandler = new JsonDefaultHandler ( ) ; JsonParser jsonParser = new JsonParserImpl ( ) ; InputStream inputStream = new ByteArrayInputStream ( data ) ; jsonParser . parse ( inputStream , jsonHandler ) ; JsonValue jsonValue = jsonHand...
Will be created the Object from JSON binary data .
15,484
public Response propPatch ( Session session , String path , HierarchicalProperty body , List < String > tokens , String baseURI ) { try { lockHolder . checkLock ( session , path , tokens ) ; Node node = ( Node ) session . getItem ( path ) ; WebDavNamespaceContext nsContext = new WebDavNamespaceContext ( session ) ; URI...
Webdav Proppatch method method implementation .
15,485
public List < HierarchicalProperty > setList ( HierarchicalProperty request ) { HierarchicalProperty set = request . getChild ( new QName ( "DAV:" , "set" ) ) ; HierarchicalProperty prop = set . getChild ( new QName ( "DAV:" , "prop" ) ) ; List < HierarchicalProperty > setList = prop . getChildren ( ) ; return setList ...
List of properties to set .
15,486
public List < HierarchicalProperty > removeList ( HierarchicalProperty request ) { HierarchicalProperty remove = request . getChild ( new QName ( "DAV:" , "remove" ) ) ; HierarchicalProperty prop = remove . getChild ( new QName ( "DAV:" , "prop" ) ) ; List < HierarchicalProperty > removeList = prop . getChildren ( ) ; ...
List of properties to remove .
15,487
public Response orderPatch ( Session session , String path , HierarchicalProperty body , String baseURI ) { try { Node node = ( Node ) session . getItem ( path ) ; List < OrderMember > members = getMembers ( body ) ; WebDavNamespaceContext nsContext = new WebDavNamespaceContext ( session ) ; URI uri = new URI ( TextUti...
Webdav OrderPatch method implementation .
15,488
protected List < OrderMember > getMembers ( HierarchicalProperty body ) { ArrayList < OrderMember > members = new ArrayList < OrderMember > ( ) ; List < HierarchicalProperty > childs = body . getChildren ( ) ; for ( int i = 0 ; i < childs . size ( ) ; i ++ ) { OrderMember member = new OrderMember ( childs . get ( i ) )...
Get oder members .
15,489
protected boolean doOrder ( Node parentNode , List < OrderMember > members ) { boolean success = true ; for ( int i = 0 ; i < members . size ( ) ; i ++ ) { OrderMember member = members . get ( i ) ; int status = HTTPStatus . OK ; try { parentNode . getSession ( ) . refresh ( false ) ; String positionedNodeName = null ;...
Order members .
15,490
private InputStream spoolInputStream ( ObjectReader in , long contentLen ) throws IOException { byte [ ] buffer = new byte [ 0 ] ; byte [ ] tmpBuff ; long readLen = 0 ; File sf = null ; OutputStream sfout = null ; try { while ( true ) { int needToRead = contentLen - readLen > 2048 ? 2048 : ( int ) ( contentLen - readLe...
Spool input stream .
15,491
protected TransientItemData copyItemDataDelete ( final ItemData item ) throws RepositoryException { if ( item == null ) { return null ; } if ( item . isNode ( ) ) { final NodeData node = ( NodeData ) item ; final AccessControlList acl = node . getACL ( ) ; if ( acl == null ) { throw new RepositoryException ( "Node ACL ...
Copy ItemData for Delete operation .
15,492
protected List < ValueData > copyValues ( PropertyData property ) throws RepositoryException { List < ValueData > src = property . getValues ( ) ; List < ValueData > copy = new ArrayList < ValueData > ( src . size ( ) ) ; try { for ( ValueData vd : src ) { copy . add ( ValueDataUtil . createTransientCopy ( vd ) ) ; } }...
Do actual copy of the property ValueDatas .
15,493
public NodeTypeData build ( ) { if ( nodeDefinitionDataBuilders . size ( ) > 0 ) { childNodeDefinitions = new NodeDefinitionData [ nodeDefinitionDataBuilders . size ( ) ] ; for ( int i = 0 ; i < childNodeDefinitions . length ; i ++ ) { childNodeDefinitions [ i ] = nodeDefinitionDataBuilders . get ( i ) . build ( ) ; } ...
Creates instance of NodeTypeData using parameters stored in this object .
15,494
public static void createVersion ( Node nodeVersioning ) throws Exception { if ( ! nodeVersioning . isNodeType ( NT_FILE ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Version history is not impact with non-nt:file documents, there'is not any version created." ) ; } return ; } if ( ! nodeVersioning . isNodeType...
Create new version and clear redundant versions
15,495
private static void removeRedundant ( Node nodeVersioning ) throws Exception { VersionHistory versionHistory = nodeVersioning . getVersionHistory ( ) ; String baseVersion = nodeVersioning . getBaseVersion ( ) . getName ( ) ; String rootVersion = nodeVersioning . getVersionHistory ( ) . getRootVersion ( ) . getName ( ) ...
Remove redundant version - Remove versions has been expired - Remove versions over max allow
15,496
protected List < PropertyData > getChildProps ( String parentId , boolean withValue ) { return getChildProps . run ( parentId , withValue ) ; }
Internal get child properties .
15,497
protected ItemData putItem ( ItemData item ) { if ( item . isNode ( ) ) { return putNode ( ( NodeData ) item , ModifyChildOption . MODIFY ) ; } else { return putProperty ( ( PropertyData ) item , ModifyChildOption . MODIFY ) ; } }
Internal put Item .
15,498
protected ItemData putNode ( NodeData node , ModifyChildOption modifyListsOfChild ) { if ( node . getParentIdentifier ( ) != null ) { if ( modifyListsOfChild == ModifyChildOption . NOT_MODIFY ) { cache . putIfAbsent ( new CacheQPath ( getOwnerId ( ) , node . getParentIdentifier ( ) , node . getQPath ( ) , ItemType . NO...
Internal put Node .
15,499
protected void putNullItem ( NullItemData item ) { boolean inTransaction = cache . isTransactionActive ( ) ; try { if ( ! inTransaction ) { cache . beginTransaction ( ) ; } cache . setLocal ( true ) ; if ( ! item . getIdentifier ( ) . equals ( NullItemData . NULL_ID ) ) { cache . putIfAbsent ( new CacheId ( getOwnerId ...
Internal put NullNode .