servlib/naming/StringScheme.h
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 /*
       
     2  *    Copyright 2005-2006 Intel Corporation
       
     3  * 
       
     4  *    Licensed under the Apache License, Version 2.0 (the "License");
       
     5  *    you may not use this file except in compliance with the License.
       
     6  *    You may obtain a copy of the License at
       
     7  * 
       
     8  *        http://www.apache.org/licenses/LICENSE-2.0
       
     9  * 
       
    10  *    Unless required by applicable law or agreed to in writing, software
       
    11  *    distributed under the License is distributed on an "AS IS" BASIS,
       
    12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13  *    See the License for the specific language governing permissions and
       
    14  *    limitations under the License.
       
    15  */
       
    16 
       
    17 #ifndef _STRING_SCHEME_H_
       
    18 #define _STRING_SCHEME_H_
       
    19 
       
    20 #include "Scheme.h"
       
    21 #include <oasys/util/Singleton.h>
       
    22 
       
    23 namespace dtn {
       
    24 
       
    25 class StringScheme : public Scheme, public oasys::Singleton<StringScheme> {
       
    26 public:
       
    27     /**
       
    28      * Validate that the SSP in the given URI is legitimate for
       
    29      * this scheme. If * the 'is_pattern' paraemeter is true, then
       
    30      * the ssp is being validated as an EndpointIDPattern.
       
    31      *
       
    32      * @return true if valid
       
    33      */
       
    34     virtual bool validate(const URI& uri, bool is_pattern = false);
       
    35 
       
    36     /**
       
    37      * Match the pattern to the endpoint id in a scheme-specific
       
    38      * manner.
       
    39      */
       
    40     virtual bool match(const EndpointIDPattern& pattern,
       
    41                        const EndpointID& eid);
       
    42 
       
    43     /**
       
    44      * Check if the given URI is a singleton EID.
       
    45      */
       
    46     virtual singleton_info_t is_singleton(const URI& uri);
       
    47 
       
    48 private:
       
    49     friend class oasys::Singleton<StringScheme>;
       
    50     StringScheme() {}
       
    51 };
       
    52 
       
    53 } // namespace dtn
       
    54 
       
    55 #endif /* _STRING_SCHEME_H_ */