2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2001,2003 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A// of the service store. 2N/A// Author: James Kempf 2N/A// Created On: Mon Oct 20 12:36:35 1997 2N/A// Last Modified By: James Kempf 2N/A// Last Modified On: Tue Mar 2 15:32:23 1999 2N/A * The ServiceStoreInMemory class implements the ServiceStore interface 2N/A * on in-memory data structures. 2N/A * <details of those structures here> 2N/A * @author James Kempf 2N/A * The BVCollector interface allows various 2N/A * data structures to collect stuff from the BtreeVector. 2N/A * @author James Kempf 2N/A // Set the return value. 2N/A * The ParserBVCollector class implements a BtreeVector 2N/A * collector for the parser. 2N/A * @author James Kempf 2N/A // Add if we don't already have it. 2N/A // Need to adjust lifetime to reflect the time to live. Don't 2N/A // set the lifetime if it has already expired. 2N/A * The AttributeBVCollector class implements a BtreeVector 2N/A * collector for the collecting attribute values by type. 2N/A * @author James Kempf 2N/A // records already seen. 2N/A // If we've got it already, then don't add again. 2N/A "ssim_attrbvc_botch",
2N/A * The ScopeBVCollector class implements a BtreeVector 2N/A * collector for the collecting records if scopes match. 2N/A * @author James Kempf 2N/A // for those we've seen 2N/A // If we've got it already, then don't add. 2N/A * The AllBVCollector class implements a BtreeVector 2N/A * collector for collecting all records. 2N/A * @author James Kempf 2N/A // If we've got it already, then don't add. 2N/A * The List class implements a linked list for storing records 2N/A * in the BtreeVector structure. 2N/A * @author James Kempf 2N/A // Create a new list object. 2N/A // Insert a new record after this one. Return the new 2N/A // Delete this record from the list. 2N/A * The RegRecord class implements a record with the value for the 2N/A * record buckets. It is used as elements in BtreeVector. 2N/A * @author James Kempf 2N/A // Construct a new one. 2N/A // Add a new record to the buckets, return new element. 2N/A // For every element in record's list, set the return value in the 2N/A // returns object. Since deletions may have removed everything 2N/A // from this record, return true only if something was there. 2N/A * The BtreeVector class stores registrations in sorted order. The 2N/A * Quicksort algorithm is used to insert items and search for something. 2N/A * @author James Kempf 2N/A // Contains the sorted vector. 2N/A // Return the contents as a sorted vector of RegRecord. 2N/A // Note that this doesn't return a copy, so 2N/A // the vector can be side-effected. 2N/A // Add the entire contents of the vector to the return record. 2N/A for (i =
0; i < n; i++) {
2N/A // Add a new record to this vector. We also garbage collect any 2N/A // records that are empty. Return the list object added. 2N/A // Add the record to this one. 2N/A // Add only if no element in the vector matches the tag. 2N/A // Go through the vector, putting in anything that isn't equal. 2N/A for (i =
0; i < n; i++) {
2N/A // Add to prospective returns. 2N/A // If we got this far, there are some no matches. 2N/A for (i =
0; i < n; i++) {
2N/A // We can't walk the vector if the value is an AttributePattern, 2N/A // because equals doesn't apply. 2N/A for (i =
0; i < n; i++) {
2N/A // If nothing came back, return false. 2N/A // Otherwise set returns in the vector. 2N/A // Go through the vector, putting in anything that isn't equal. 2N/A for (i =
0; i < n; i++) {
2N/A // Go through the vector, putting in anything that is 2N/A // less than or equal. 2N/A for (i =
0; i < n; i++) {
2N/A // Go through the vector, putting in anything that is not 2N/A // less than or equal. Start at the top. 2N/A for (i = n -
1; i >=
0; i--) {
2N/A // Go through the vector, putting in anything that is greater 2N/A // than or equal. Start at the top. 2N/A for (i = n -
1; i >=
0; i--) {
2N/A // Go through the vector, putting in anything that is not 2N/A for (i =
0; i < n; i++) {
2N/A // Binary tree walk the vector, performing the operation. Note that 2N/A // we use dynamic typing heavily here to get maximum code reuse. 2N/A // Get the starting set of indicies. 2N/A // Get the one at the current middle. 2N/A // Garbage Collection. 2N/A // If it was null, then delete. But only if we're 2N/A // inserting. We leave it alone on lookup. 2N/A // Compare value to record, if equal, return record. 2N/A // Recalculate index. We move left, because the value is 2N/A // less that the value in the vector, so an equal value 2N/A // must be to the left. Note that the top is not in the 2N/A // interval because it has already been checked and 2N/A // Neither top nor middle are in the interval, 2N/A // so size is zero. We need to compare with bottom. 2N/A // If the pattern is equal to bottom, return it. 2N/A // If the pattern is less than or equal to bottom, 2N/A // we insert it at bottom. If it is greater 2N/A // than or equal, we insert it at middle. 2N/A // Pattern is less than bottom, so insert 2N/A // If it equals bottom, then return bottom rec. 2N/A // Recalculate index. We move right, because the value is 2N/A // greater that the value in the vector, so an equal 2N/A // value must be to the right. Note that the top is not 2N/A // in the interval because it has already been checked 2N/A // and found wanting. 2N/A // Neither bottom nor middle is in the interval, 2N/A // so size is zero. We need to compare with top. 2N/A // If the pattern is equal to the top, we 2N/A // return the top. If the pattern is greater 2N/A // then top, we insert it after top, else we 2N/A // insert it at top. 2N/A // Pattern is greater than top, so insert 2N/A // Pattern is less than top, so insert at 2N/A // top, causing top to move up. 2N/A // If it equals top, then return top rec. 2N/A // Take care of update where vector is empty or cleaned out. 2N/A // Add any registrations that match the pattern. 2N/A // If the pattern is an AttributePattern instead of an 2N/A // AttributeString, the subclass method will get invoked. 2N/A // Add any registrations that are less than or equal to the pattern. 2N/A // Add any registrations that are greater than or equal to the pattern. 2N/A * The InMemoryEvaluator evaluates queries for ServiceStoreInMemory. 2N/A * @author James Kempf 2N/A // Evaluate the query by matching the attribute tag and 2N/A // value, using the operator. If invert is true, then 2N/A // return records that do NOT match. 2N/A // If inversion is on, then gather all from the 2N/A // table of registrations that do NOT have this 2N/A // Find the table of classes v.s. sorted value vectors. 2N/A // If attribute not present, then simply return. 2N/A // If operator is present, then return all. 2N/A // ...but only if invert isn't on. 2N/A // We use attrLevelNot to get all, because it 2N/A // will also pick up keywords. There are 2N/A // no keywords in attrLevel because keywords 2N/A // don't have any values. 2N/A // We know that the type table is fully initialized with 2N/A // BtreeVectors for each type. 2N/A // Get the pattern's class. Pattern will not be null because 2N/A // the parser has checked for it and PRESENT has been 2N/A // filtered out above. 2N/A // If the class is AttributePattern, then use AttributeString 2N/A // If invert is on, collect those whose types don't match as 2N/A // Only record if the type does NOT match. 2N/A // Get the sorted value vector corresponding to the value class. 2N/A // Do the appropriate thing for the operator. 2N/A // Note that we've filtered out Opaque, Boolean, and wildcarded 2N/A // strings before calling this method. 2N/A // Note that we've filtered out Opaque and Boolean 2N/A // before calling this method. 2N/A * The ServiceRecordInMemory class implements the 2N/A * ServiceStore.ServiceRecord interface on in-memory data structures. 2N/A * Each property is implemented as an instance variable. 2N/A * @author James Kempf 2N/A // URL signature block list, if any. 2N/A // Attribute signature block list, if any. 2N/A // Create a ServiceStoreInMemory record. 2N/A // All need to be nonnull. 2N/A * Return the ServiceURL for the record. 2N/A * @return The record's service URL. 2N/A * Return the Vector of ServerAttribute objects for the record. 2N/A * @return Vector of ServerAttribute objects for the record. 2N/A * Return the locale of the registration. 2N/A * @return The locale of the registration. 2N/A * Return the Vector of scopes in which the record is registered. 2N/A * @return Vector of strings with scope names. 2N/A * Return the expiration time for the record. This informs the 2N/A * service store when the record should expire and be removed 2N/A * @return The expiration time for the record. 2N/A * Return the URL signature list. 2N/A * @return URL signature block list. 2N/A * Return the attribute signature list. 2N/A * @return Attribute signature list. 2N/A // Package-local methods. 2N/A // Convert a vector of ServiceLocationAttribute objects to 2N/A for (i =
0; i < n; i++) {
2N/A * A record for scopeTypeLangTable table, 2N/A * @author James Kempf 2N/A // Table of attributes, sorted by value. 2N/A // True if the record is for an abstract 2N/A // ServiceStoreInMemory instance variables. 2N/A // ServiceStoreInMemory maintains an invaraint that the record for a 2N/A // particular URL, set of scopes, and locale is the same object 2N/A // (pointer-wise) regardless of where it is inserted into the table. 2N/A // So it can be compared with ==. 2N/A // The scopeTypeLangTable 2N/A // STLRecord objects. The STLRecord.attrValueSort field is a Hashtable 2N/A // where all registrations *having* the attribute tag keys in the 2N/A // table are contained. This table is used in queries for positive 2N/A // logical expressions. The STLRecord.attrSort field is a BtreeVector 2N/A // keyed by attribute. It is used for negative queries to find all 2N/A // records not having a particular attribute and to find all 2N/A // registrations. The STLRecord.isAbstract field tells whether the record 2N/A // is for an abstract type name. 2N/A // The values in the STLRecord.attrValueSort hashtable are themselves 2N/A // hashtables. These hashtables are keyed by one of the type keys below, 2N/A // with the values being BtreeVector objects. The BtreeVector objects 2N/A // contain sorted lists of RegRecord objects for Integer, 2N/A // AttributeString, Boolean, and Opaque types. All records having 2N/A // values equal to the value in the RegRecord are put into a list 2N/A // on the RegRecord. There is no STLRecord.attrValueSort 2N/A // hashtable for keyword attributes because they have no values. 2N/A // The parser evaluator must use the STLRecord.attrSort hashtable when a 2N/A // present operator is encountered (the only valid operator with a 2N/A // The values in the STLRecord.attrSort BtreeVector are RegRecord 2N/A // objects with all records having that attribute tag being on the 2N/A // Keys for the various types. 2N/A "com.sun.slp.AttributeString";
2N/A // The urlScopeLangTable 2N/A // Keys for this table are service url as a string. We don't use 2N/A // the service URL itself because the hash code depends on the 2N/A // current service type rather than the original, and we need 2N/A // to be able to distinguish for a non-service: URL if a 2N/A // registration comes in with a different service type from the 2N/A // original. Values are hashtables with key being scope name, 2N/A // values are hashtables with lang tag key. Ultimate values are 2N/A // a vector of List objects for lists in which List.record is 2N/A // inserted. This table is used to perform deletions and for 2N/A // finding the attributes associated with a particular URL. 2N/A // The sstLocales Table 2N/A // the type/scope, values are a hashtable keyed by lang tag. 2N/A // Values in the lang tag table are Integer objects giving 2N/A // A queue of records sorted according to expiration time. 2N/A // Constants that indicate whether there are any registrations. 2N/A // Boot time. For DAAdvert timestamps. 2N/A // ServiceStore Interface Methods. 2N/A * Return the time since the last stateless reboot 2N/A * of the ServiceStore. 2N/A * @return A Long giving the time since the last stateless reboot, 2N/A * Age out all records whose time has expired. 2N/A * @param deleted A Vector for return of ServiceStore.Service records 2N/A * containing deleted services. 2N/A * @return The time interval until another table walk must be done, 2N/A // Get the ageOut queue and remove all records whose 2N/A // Go through the queue, dropping records that 2N/A // Break out when none expire now. 2N/A // Remove the element from the queue. 2N/A * Must decrement the index 'i' otherwise the next iteration 2N/A * around the loop will miss the element immediately after 2N/A * the element removed. 2N/A * WARNING: Do not use 'i' again until the loop has 2N/A * iterated as it may, after decrementing, 2N/A // Deregister all on this list. We 2N/A // take specific care to save the next 2N/A // list element before we deregister, otherwise 2N/A // it will be gone after the deregister. 2N/A // Save the record for the service table, in case more 2N/A // processing needed. 2N/A // Save l.next NOW before deregisterInternal() removes it! 2N/A // Calculate the new sleep time. If there's anything in the vector, 2N/A // then use element 0, because the vector is sorted by time 2N/A // and that will be minimum. Otherwise, use the maximum. 2N/A // it will wake right up, but 2N/A * Create a new registration with the given parameters. 2N/A * @param url The ServiceURL. 2N/A * @param attrs The Vector of ServiceLocationAttribute objects. 2N/A * @param locale The Locale. 2N/A * @param scopes Vector of scopes in which this record is registered. 2N/A * @param urlSig auth block Hashtable for URL signature, or null if none. 2N/A * @param attrSig auth block Hashtable for URL signature, or null if none. 2N/A * @return True if there is an already existing registration that 2N/A * this one replaced. 2N/A * @exception ServiceLocationException Thrown if any 2N/A * error occurs during registration or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A synchronized public boolean 2N/A // Find an existing record, in any set of scopes having this language. 2N/A // Deregister from existing scopes, if there is an existing record. 2N/A // Ensure that the rereg SPI set and the record's SPI set are 2N/A // equivalent. We need only check the URL sigs here, since 2N/A // this operation is equivalent to a dereg followed by a reg, 2N/A // and dereg requires only URL auth blocks. 2N/A "not_all_spis_present",
2N/A // not all required SPIs were present in SrvReg 2N/A "not_all_spis_present",
2N/A // Create a new record to register. 2N/A // Add new registration. 2N/A * Deregister a ServiceURL from the database for every locale 2N/A * and every scope. There will be only one record for each URL 2N/A * and locale deregistered, regardless of the number of scopes in 2N/A * which the URL was registered, since the attributes will be the 2N/A * same in each scope if the locale is the same. 2N/A * @param url The ServiceURL 2N/A * @param scopes Vector of scopes. 2N/A * @param urlSig The URL signature, if any. 2N/A * @exception ServiceLocationException Thrown if the 2N/A * ServiceStore does not contain the URL, or if any 2N/A * error occurs during the operation, or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A synchronized public void 2N/A // Find existing record. Any locale will do. 2N/A // verify that the dereg SPI set and the record's SPI set are 2N/A "not_all_spis_present",
2N/A // not all required SPIs were present in SrvDereg 2N/A "not_all_spis_present",
2N/A * Deregister the URL for all locales. Use the recorded service URL 2N/A * because the one passed by the client is possibly incomplete e.g. 2N/A * lacking the service type. 2N/A * Update the service registration with the new parameters, adding 2N/A * attributes and updating the service URL's lifetime. 2N/A * @param url The ServiceURL. 2N/A * @param attrs The Vector of ServiceLocationAttribute objects. 2N/A * @param locale The Locale. 2N/A * @param scopes Vector of scopes in which this record is registered. 2N/A * @exception ServiceLocationException Thrown if any 2N/A * error occurs during registration or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A synchronized public void 2N/A // If this is a nonServiceURL, check whether it's registered 2N/A // under a different service type. 2N/A // Deregister the URL in this locale. 2N/A // Create a new record to update. 2N/A // Merge old record into new. 2N/A // Add the new record. 2N/A * Delete the attributes from the ServiceURL object's table entries. 2N/A * Delete for every locale that has the attributes and every scope. 2N/A * Note that the attribute tags must be lower-cased in the locale of 2N/A * the registration, not in the locale of the request. 2N/A * @param url The ServiceURL. 2N/A * @param scopes Vector of scopes. 2N/A * @param attrTags The Vector of String 2N/A * objects specifying the attribute tags of 2N/A * the attributes to delete. 2N/A * @param locale Locale of the request. 2N/A * @exception ServiceLocationException Thrown if the 2N/A * ServiceStore does not contain the URL or if any 2N/A * error occurs during the operation or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A synchronized public void 2N/A // Get the scope level from urlScopeLangTable. 2N/A // Error if no old record to update. 2N/A // Check existing records to be sure that the scopes 2N/A // match. Attributes must be the same across 2N/A // Create attribute patterns for the default locale. This 2N/A // is an optimization. Only Turkish differs in lower 2N/A // case from the default. If there are any other exceptions, 2N/A // we need to move this into the loop. 2N/A // Look through the language table for this language at scope level. 2N/A "ssim_empty_scope_table",
2N/A "ssim_empty_lang_table",
2N/A // Find the list of records for this language. 2N/A // If we've done this one already, go on. 2N/A // Delete old registration. 2N/A // Delete attributes from this record. 2N/A // If the locale is Turkish, then use the Turkish patterns. 2N/A // Reregister the record. 2N/A // If no record found, report error. 2N/A "ssim_no_rec_locale",
2N/A * Return a Vector of String containing the service types for this 2N/A * scope and naming authority. If there are none, an empty vector is 2N/A * @param namingAuthority The namingAuthority, or "*" if for all. 2N/A * @param scopes The scope names. 2N/A * @return A Vector of String objects that are the type names, or 2N/A * an empty vector if there are none. 2N/A * @exception ServiceLocationException Thrown if any 2N/A * error occurs during the operation or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A // Get all the keys in the table, look for scope. 2N/A // Check whether this is an abstract type entry. 2N/A // If so, then we ignore it, because we only 2N/A // want full type names in the return. 2N/A // If the scope matches then check the naming authority. 2N/A // If not already there, see if we should add this one to the 2N/A // If wildcard, then simply add it to the vector. 2N/A // Check naming authority. 2N/A * Return a Hashtable with the key FS_SERVICES matched to the 2N/A * hashtable of ServiceURL objects as key and a vector 2N/A * of their scopes as value, and the key FS_SIGTABLE 2N/A * matched to a hashtable with ServiceURL objects as key 2N/A * and the auth block Hashtable for the URL (if any) for value. The 2N/A * returned service URLs will match the service type, scope, query, 2N/A * and locale. If there are no signatures, the FS_SIGTABLE 2N/A * key returns null. If there are no 2N/A * registrations in any locale, FS_SERVICES is bound to an 2N/A * @param serviceType The service type name. 2N/A * @param scope The scope name. 2N/A * @param query The query, with any escaped characters as yet unprocessed. 2N/A * @param locale The locale in which to lowercase query and search. 2N/A * @return A Hashtable with the key FS_SERVICES matched to the 2N/A * hashtable of ServiceURL objects as key and a vector 2N/A * of their scopes as value, and the key FS_SIGTABLE 2N/A * matched to a hashtable with ServiceURL objects as key 2N/A * and the auth block Hashtable for the URL (if any) for value. 2N/A * If there are no registrations in any locale, FS_SERVICES 2N/A * is bound to an empty table. 2N/A * @exception ServiceLocationException Thrown if a parse error occurs 2N/A * during query parsing or if any 2N/A * error occurs during the operation or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. 2N/A // Get the services and signatures tables. 2N/A // Remove leading and trailing spaces. 2N/A // Check whether there are any registrations for this type/scope/ 2N/A // language tag and, if not, whether there are others. 2N/A // in another language, but not this one. 2N/A // Only do query if regs exist. 2N/A for (i =
0; i < n; i++) {
2N/A // If no record for this combo of service type and 2N/A // Special case if the query string is empty. This 2N/A // indicates that all registrations should be returned. 2N/A // Use the BtreeVector.getAll() method to get all 2N/A // registrations. We will end up revisiting some 2N/A // list elements because there will be ones 2N/A // for multiple attributes, but that will be 2N/A // filtered in the BVCollector.setReturn() method. 2N/A // Otherwise, use the LDAPv3 parser to evaluate. 2N/A // Create return hashtable. 2N/A // Set up return hashtable. 2N/A // Put in signatures if there. 2N/A * Return a Hashtable with key FA_ATTRIBUTES matched to the 2N/A * vector of ServiceLocationAttribute objects and key FA_SIG 2N/A * matched to the auth block Hashtable for the attributes (if any) 2N/A * The attribute objects will have tags matching the tags in 2N/A * the input parameter vector. If there are no registrations in any locale, 2N/A * FA_ATTRIBUTES is an empty vector. 2N/A * @param url The ServiceURL for which the records should be returned. 2N/A * @param scopes The scope names for which to search. 2N/A * @param attrTags The Vector of String 2N/A * objects containing the attribute tags. 2N/A * @param locale The locale in which to lower case tags and search. 2N/A * @return A Hashtable with a vector of ServiceLocationAttribute objects 2N/A * as the key and the auth block Hashtable for the attributes 2N/A * (if any) as the value. 2N/A * If there are no registrations in any locale, FA_ATTRIBUTES 2N/A * is an empty vector. 2N/A * @exception ServiceLocationException Thrown if any 2N/A * error occurs during the operation or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. An error should be 2N/A * thrown if the tag vector is for a partial request 2N/A * and any of the scopes are protected. 2N/A // Check whether there are any registrations for this scope/type 2N/A // language and, if not, whether there are others. 2N/A // in another language, but not this one. 2N/A // Only if there are any regs at all. 2N/A // Process string tags into pattern objects. Note that, here, 2N/A // the patterns are locale specific because the locale of 2N/A // the request determines how the attribute tags are lower 2N/A // Return attributes from the matching URL record. 2N/A // If nothing there, then simply return. The URL isn't 2N/A // We reuse ht here for attributes. 2N/A for (i =
0; i < n; i++) {
2N/A // If no registration in this scope, continue. 2N/A // Get the vector of lists. 2N/A // If no registration in this locale, continue. 2N/A // Get the service record. 2N/A // Once we've found *the* URL record, we can leave the loop 2N/A // because there is only one record per locale. 2N/A // Clear out the hashtable. We reuse it for the return. 2N/A // Store the return vector and the signatures, if any. 2N/A // Put in the empty vector, in case there are no regs at all. 2N/A * Return a Vector of ServiceLocationAttribute objects with attribute tags 2N/A * matching the tags in the input parameter vector for all service URL's 2N/A * of the service type. If there are no registrations 2N/A * in any locale, an empty vector is returned. 2N/A * @param serviceType The service type name. 2N/A * @param scopes The scope names for which to search. 2N/A * @param attrTags The Vector of String 2N/A * objects containing the attribute tags. 2N/A * @param locale The locale in which to lower case tags. 2N/A * @return A Vector of ServiceLocationAttribute objects matching the query. 2N/A * If no match occurs but there are registrations 2N/A * in other locales, null is returned. If there are no registrations 2N/A * in any locale, an empty vector is returned. 2N/A * @exception ServiceLocationException Thrown if any 2N/A * error occurs during the operation or if the table 2N/A * requires a network connection that failed. This 2N/A * includes timeout failures. An error should also be 2N/A * signalled if any of the scopes are protected. 2N/A // Check whether there are any registrations for this type/scope/ 2N/A // language and, if not, whether there are others. 2N/A // in another language, but not this one. 2N/A // Process string tags into pattern objects. Note that, here, 2N/A // the patterns are locale specific because the locale of 2N/A // the request determines how the attribute tags are lower 2N/A // Make a collector for accessing the BtreeVector. 2N/A for (i =
0; i < n; i++) {
2N/A // If no service type and scope, go to next scope. 2N/A // Get BtreeVector with all attributes for searching. 2N/A // If there are no tags, then simply return everything in 2N/A // Use Btree vector to match the attribute tag patterns, 2N/A // returning matching records. 2N/A * Obtain the record matching the service URL and locale. 2N/A * @param URL The service record to match. 2N/A * @param locale The locale of the record. 2N/A * @return The ServiceRecord object, or null if none. 2N/A // Search in all scopes. 2N/A * Obtains service records with scopes matching from vector scopes. 2N/A * If scopes is null, then returns all records. 2N/A * @param scopes Vector of scopes to match. 2N/A * @return Enumeration Of ServiceRecord Objects. 2N/A // Use a scope collector. 2N/A * Dump the service store to the log. 2N/A // If the service type is abstract, then skip it. It will be 2N/A // displayed when the concrete type is. 2N/A // Now write them out. 2N/A for (i =
0; i < n; i++) {
2N/A // Register the record without any preliminaries. We assume that 2N/A // any old records have been removed and merged into this one, 2N/A // Make one age out queue entry. It will go into 2N/A // all scopes, but that's OK. 2N/A // Go through all scopes. 2N/A for (i =
0; i < n; i++) {
2N/A // Initialize the urltable list vector for this URL. 2N/A // Add ageOut record, so that it gets deleted when 2N/A // If the type is an abstract type, then add 2N/A // separate records. 2N/A // Create a urlScopeLangTable record for this URL. 2N/A // Get scope level, creating if new. 2N/A // Get lang level, creating if new. 2N/A // Check whether there's anything already there. 2N/A "ssim_url_lang_botch",
2N/A // Add a new list vector, and return it. 2N/A // If it's not there, make it. 2N/A // Otherwise, add record to all. 2N/A // Add a new record into the attr value table. 2N/A // Go through the attribute list. 2N/A for (i =
0; i < n; i++) {
2N/A // If a type table record exists, use it. Otherwise, 2N/A // create a newly initialized one. 2N/A // Get the class of values. 2N/A // We're done, since there are no attributes to add. 2N/A // Get the BtreeVector. 2N/A // Insert a record for each value. 2N/A for (j =
0; j < m; j++) {
2N/A // Put the element into the deletion table. 2N/A // Return a newly initialized attribute type table. It will 2N/A // have a hash for each allowed type, with a new BtreeVector 2N/A // Add a new record into the attrs table. 2N/A // If no attributes, then add with empty string as 2N/A // the attribute tag. 2N/A // Iterate through the attribute list, adding to the 2N/A // BtreeVector with attribute as the sort key. 2N/A for (i =
0; i < n; i++) {
2N/A // Save for deletion. 2N/A // Add a record to the ageOut queue. 2N/A // Remove the URL record from the database. 2N/A // To deregister, we only need to find the Vector of List objects 2N/A // containing the places where this registration is hooked into 2N/A // lists and unhook them. Garbage collection of other structures 2N/A // is handled during insertion or in deregisterTypeLocale(), 2N/A // if there are no more registrations at all. 2N/A // Find the scope table.. 2N/A // If it's not there, then maybe not registered. 2N/A // For each scope, find the lang table. 2N/A for (i =
0; i < n; i++) {
2N/A // If the locale is non-null, then just deregister from this 2N/A // also the number of regs table. 2N/A // Check for abstract type as well. 2N/A // Otherwise, deregister all languages. 2N/A // also the number of regs table. 2N/A // Check for abstract type as well. 2N/A // If the table is empty, then remove the lang table. 2N/A // If all languages were deleted, delete the 2N/A // urlScopeLangTable record. Other GC handled in 2N/A // deleteTypeLocale(). 2N/A // Deregister a single locale from the language table. 2N/A // Get the Vector containing the list of registrations. 2N/A "ssim_null_reg_vector",
2N/A // Walk down the list of registrations and unhook them from 2N/A // their respective lists. 2N/A for (i =
0; i < n; i++) {
2N/A // Remove the locale record. 2N/A // Find an existing record matching the URL by searching in all scopes. 2N/A // The record will be the same for all scopes in the same language. 2N/A // If locale is null, return any. If there are none, return null. 2N/A // Look in urlScopeLangTable. 2N/A // If scopes is null, then perform the search for all 2N/A // scopes in the table. Otherwise perform it for 2N/A // all scopes incoming. 2N/A // If no langLevel table, continue searching. 2N/A // Use lang tag if we have it, otherwise, pick arbitrary. 2N/A // If none for this locale, try the next scope. 2N/A // Select out the record. 2N/A // Find attributes matching the record and place the matching attributes 2N/A // into the vector. Use the hashtable for collation. 2N/A // For each attribute, go through the tag vector If an attribute 2N/A // matches, merge it into the return vector. 2N/A for (i =
0; i < n; i++) {
2N/A // All attributes match if the pattern vector is 2N/A // Check each pattern against the attribute id. 2N/A // Check the attribute against the pattern. If the pattern is null, 2N/A // then match occurs. Merge the attribute into the vector 2N/A // We save the attribute value if either 2N/A // the pattern is null or it matches the attribute id. 2N/A // Create new values vector so record copy isn't 2N/A // Create new attribute so record copy isn't 2N/A // Merge duplicate attributes into vector. 2N/A // Check whether the incoming scopes are the same as existing 2N/A // Drill down in the urlScopeLangTable table. 2N/A return;
// not yet registered... 2N/A // We need to have exactly the same scopes as in 2N/A // the registration. 2N/A for (i =
0; i < n; i++) {
2N/A // Check whether an existing nonservice URL is registered under 2N/A // a different service type. 2N/A // Drill down in the urlScopeLangTable table. 2N/A return;
// not yet registered. 2N/A // Get hashtable of locale records under scopes. Any scope 2N/A "ssim_null_lang_table",
2N/A // Get a record from any locale. 2N/A "ssim_empty_lang_table",
2N/A // Get vector of registrations. 2N/A "ssim_empty_reg_vector",
2N/A // OK, now check the registration. 2N/A // Merge old record into new record. 2N/A // Charge up the hashtable with the new attributes. 2N/A for (i =
0; i < n; i++) {
2N/A // Merge in the old attributes. 2N/A for (i =
0; i < n; i++) {
2N/A // Change the attribute vector on the rec. 2N/A // Merge old scopes into new. 2N/A for (j =
0; j < m; j++) {
2N/A // Note that we don't have to merge security because there 2N/A // will never be an incremental update to a record 2N/A // in a protected scope. 2N/A // Change the scope vector on the rec. 2N/A // Delete attributes matching attrTags. 2N/A // For each attribute, go through the tag vector and put attributes 2N/A // that do not match the tags into the new attribute vector. 2N/A // If there are no attributes for this one, then simply return. 2N/A for (i =
0; i < n; i++) {
2N/A // Now check the tags. 2N/A // If there's a match, mark for deletion. 2N/A // Replace the attribute vector in the record. 2N/A // Convert a vector of attribute tag strings to attribute pattern objects. 2N/A // Takes care of findAttributes() case where no vector. 2N/A for (i =
0; i < n; i++) {
2N/A // Output of service store to log. 2N/A // Write record to config log file. 2N/A // Utilities for dealing with service type/scope locale table. 2N/A // Bump up the number of registrations for this service type, scope and 2N/A // Get any existing record. 2N/A // Insert a new one if none there. 2N/A // Add a new one if none there, otherwise, bump up old. 2N/A // Bump down the number of registrations for this service type, scope, 2N/A // Get any existing record. 2N/A // If none there, then error. But this should have been caught 2N/A // during deletion, so it's fatal. 2N/A "ssim_ssttable_botch",
2N/A // Get the Integer object recording the number of registrations. 2N/A "ssim_ssttable_lang_botch",
2N/A // Bump down by one, remove if zero. 2N/A // Garbage collection. 2N/A // Remove records from the scopeTypeLangTable, 2N/A // since there are no registrations left for this 2N/A // Return REGS if the language is supported. Supported means that the 2N/A // there are some registrations of this service type in it or that 2N/A // there are none in any locale. Return NO_REGS if there are absolutely 2N/A // no registrations whatsoever, in any language. Return NO_REGS_IN_LOCALE 2N/A // if there are no registrations in that language but there are in 2N/A // Look through scope vector. 2N/A for (i =
0; i < n; i++) {
2N/A // Get any existing record. 2N/A // If there are no regs, then check next scope. 2N/A // Check whether there are other language regs 2N/A // or same language regs. 2N/A // Return appropriate code. 2N/A // Hash key calculations and hash table structuring. 2N/A // Return a key for type and scope. 2N/A // Make a hash key consisting of the scope and service type. 2N/A // Return the key's scope. 2N/A // Parse off the final lang. 2N/A // Return true if the record is for an abstract type.