示例#1
0
class Register(Context):
    '''
    The register context.
    '''
    # ---------------------------------------------------------------- Defined
    services = defines(Iterable,
                       doc='''
    @rtype: Iterable(class)
    The classes that implement service APIs.
    ''')
    exclude = defines(set,
                      doc='''
    @rtype: set(object)
    The invoker identifiers that dictate the invokers to be excluded from the process. This is set gets updated whenever
    there is a problem invoker and in the case the chain is no fully consumed another try is made with this exclusion set.
    ''')
    doSuggest = defines(IDo,
                        doc='''
    @rtype: callable(*args)
    The suggest logger to be used for registration.
    ''')
示例#2
0
class ResponseContent(Context):
    '''
    The response context.
    '''
    # ---------------------------------------------------------------- Defined
    source = defines(IInputStream, doc='''
    @rtype: IInputStream
    The stream that provides the response content in bytes.
    ''')
    length = defines(int, doc='''
    @rtype: integer
    Contains the length for the content.
    ''')
    type = defines(str, doc='''
    @rtype: string
    The type for the streamed content.
    ''')
    charSet = defines(str, doc='''
    @rtype: string
    The char set encoding for streamed content.
    ''')
示例#3
0
class Request(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Defined
    repository = defines(IRepository,
                         doc='''
    @rtype: IRepository
    The repository to be used for finding matches.
    ''')
    # ---------------------------------------------------------------- Required
    clientIP = requires(str)
示例#4
0
class Response(Coded):
    '''
    The response context.
    '''
    # ---------------------------------------------------------------- Defined
    errorInput = defines(InputError,
                         doc='''
    @rtype: InputError
    The input error translated from SQL alchemy error.
    ''')
    # ---------------------------------------------------------------- Optional
    isSuccess = optional(bool)
示例#5
0
class Create(Context):
    '''
    The create encoder context.
    '''
    # ---------------------------------------------------------------- Defined
    encoder = defines(ITransfrom, doc='''
    @rtype: ITransfrom
    The encoder for the property.
    ''')    
    # ---------------------------------------------------------------- Required
    name = requires(str)
    objType = requires(Type)
示例#6
0
class NodeInvoker(Context):
    '''
    The node context.
    '''
    # ---------------------------------------------------------------- Defined
    parent = defines(Context,
                     doc='''
    @rtype: Context
    The parent node.
    ''')
    invokers = defines(dict,
                       doc='''
    @rtype: dictionary{string: Context}
    The invokers indexed by the HTTP method name.
    ''')
    conflicts = defines(dict,
                        doc='''
    @rtype: dictionary{string: list[Context]}
    The invokers indexed by the HTTP method name that conflict with the invoker associated with the method in 'invokers'.
    ''')
    child = defines(Context,
                    doc='''
    @rtype: Context
    The direct child node for a user input value.
    ''')
    childByName = defines(dict,
                          doc='''
    @rtype: dictionary{string: Context}
    The child nodes indexed by name.
    ''')
    type = defines(Type,
                   doc='''
    @rtype: Type
    The type represented by the child node.
    ''')
示例#7
0
class Decoding(Context):
    '''
    The model decoding context.
    '''
    # ---------------------------------------------------------------- Defined
    name = defines(str,
                   doc='''
    @rtype: string
    The decoder name.
    ''')
    parent = defines(Context,
                     doc='''
    @rtype: Context
    The parent decoding that this decoding is based on.
    ''')
    property = defines(TypeProperty,
                       doc='''
    @rtype: TypeProperty
    The property that represents the decoding.
    ''')
    children = defines(dict,
                       doc='''
    @rtype: dictionary{string: Context}
    The decoding children indexed by the decoding name.
    ''')
    doDecode = defines(IDo,
                       doc='''
    @rtype: callable(target, value)
    Decodes the value into the provided target.
    @param target: Context
        Target context object used for decoding.
    @param value: object
        The value to be decoded.
    ''')
    # ---------------------------------------------------------------- Optional
    isMandatory = optional(bool)
    # ---------------------------------------------------------------- Required
    type = requires(Type)
    doSet = requires(IDo)
    doGet = requires(IDo)
示例#8
0
class Invoker(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Defined
    node = defines(Context,
                   doc='''
    @rtype: Context
    The invoker node.
    ''')
    # ---------------------------------------------------------------- Required
    path = requires(list)
    location = requires(str)
示例#9
0
class Definition(Context):
    '''
    The definition context.
    '''
    # ---------------------------------------------------------------- Defined
    name = defines(str,
                   doc='''
    @rtype: string
    The definition name.
    ''')
    types = defines(list,
                    doc='''
    @rtype: list[Type]
    The definition types in the normal order of the appearance.
    ''')
    references = defines(list,
                         doc='''
    @rtype: list[Context]
    The definition references that directly linked with this definition.
    ''')
    # ---------------------------------------------------------------- Required
    category = requires(str)
示例#10
0
class PermissionCompensate(Context):
    '''
    The permission context.
    '''
    # ---------------------------------------------------------------- Defined
    navigate = defines(str,
                       doc='''
    @rtype: string
    The navigate path.
    ''')
    # ---------------------------------------------------------------- Required
    access = requires(Access)
    filters = requires(dict)
示例#11
0
class Element(Context):
    '''
    The element context.
    '''
    # ---------------------------------------------------------------- Defined
    node = defines(Context,
                   doc='''
    @rtype: Context
    The element node.
    ''')
    # ---------------------------------------------------------------- Required
    name = requires(str)
    property = requires(TypeProperty)
示例#12
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Defined
    property = defines(TypeProperty,
                       doc='''
    @rtype: TypeProperty
    The option property that represents the decoding.
    ''')
    # ---------------------------------------------------------------- Required
    input = requires(Input)
    type = requires(Type)
示例#13
0
class Solicit(Context):
    '''
    The solicit context.
    '''
    # ---------------------------------------------------------------- Defined
    repository = defines(Context,
                         doc='''
    @rtype: Context
    The parsed repository.
    ''')
    # ---------------------------------------------------------------- Required
    stream = requires(IInputStream)
    uri = requires(str)
class SolicitationFilter(Context):
    '''
    The solicitation context.
    '''
    # ---------------------------------------------------------------- Defined
    userId = defines(int,
                     doc='''
    @rtype: integer
    The id of the user to create gateways for.
    ''')
    method = defines(int,
                     doc='''
    @rtype: integer
    The method to get the permissions for.
    ''')
    types = defines(Iterable,
                    doc='''
    @rtype: Iterable(TypeAcl)
    The ACL types to get the permissions for.
    ''')
    # ---------------------------------------------------------------- Required
    permissions = requires(Iterable)
示例#15
0
class Node(Context):
    '''
    The node context.
    '''
    # ---------------------------------------------------------------- Defined
    invokersGet = defines(dict, doc='''
    @rtype: dictionary{TypeProperty: Context}
    The invokers contexts that can be used to get a model by a property model indexed by the property model that makes
    the invoker accessible based on the current node.
    ''')
    # ---------------------------------------------------------------- Required
    child = requires(Context)
    childByName = requires(dict)
    invokers = requires(dict)
示例#16
0
class RequestContent(Context):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Defined
    source = defines(IInputStream)
    doContentReader = definesIf(IDo,
                                doc='''
    @rtype: callable(bytes) -> bytes|None
    The content reader callable used for pushing data from the asyncore read, returns True in order to get more data.
    Once the reader is finalized it will return either None or remaining bytes.
    ''')
    # ---------------------------------------------------------------- Required
    length = requires(int)
示例#17
0
class RequestDecode(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Required
    headers = requires(dict)
    # ---------------------------------------------------------------- Optional
    parameters = optional(list)
    # ---------------------------------------------------------------- Defined
    decoderHeader = defines(IDecoderHeader,
                            doc='''
    @rtype: IDecoderHeader
    The decoder used for reading the request headers.
    ''')
class Create(Context):
    '''
    The create encoder context.
    '''
    # ---------------------------------------------------------------- Defined
    specifiers = defines(list,
                         doc='''
    @rtype: list[ISpecifier]
    The specifiers for attributes with the paths.
    ''')
    # ---------------------------------------------------------------- Optional
    encoder = optional(ITransfrom)
    # ---------------------------------------------------------------- Required
    objType = requires(Type)
示例#19
0
class RequestContent(Context):
    '''
    The request content context.
    '''
    # ---------------------------------------------------------------- Required
    type = requires(str)
    charSet = requires(str)
    disposition = requires(str)
    dispositionAttr = requires(dict)
    source = requires(IInputStream)
    fetchNextContent = requires(Callable)
    previousContent = requires(object)
    # ---------------------------------------------------------------- Defined
    name = defines(str)
示例#20
0
class InvokerOnInput(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Defined
    path = defines(list,
                   doc='''
    @rtype: list[Context]
    The path elements.
    ''')
    # ---------------------------------------------------------------- Required
    id = requires(str)
    inputs = requires(tuple)
    target = requires(TypeModel)
示例#21
0
class RequestDecode(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Required
    decoderHeader = requires(IDecoderHeader)
    # ---------------------------------------------------------------- Optional
    argumentsOfType = optional(dict)
    # ---------------------------------------------------------------- Defined
    language = defines(str,
                       doc='''
    @rtype: string
    The language for the content.
    ''')
示例#22
0
class Decoding(Context):
    '''
    The decoding context.
    '''
    # ---------------------------------------------------------------- Defined
    contentDefinitions = defines(dict,
                                 doc='''
    @rtype: dictionary{string: Context}
    The definition context for the content decoding indexed by category.
    ''')
    # ---------------------------------------------------------------- Required
    parent = requires(Context)
    name = requires(str)
    children = requires(dict)
示例#23
0
class Request(respository.Request):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Defined
    match = defines(Context,
                    doc='''
    @rtype: Context
    The error match in case of failure.
    ''')
    # ---------------------------------------------------------------- Required
    method = requires(str)
    headers = requires(dict)
    uri = requires(str)
    decoderHeader = requires(IDecoderHeader)
示例#24
0
class Solicit(Context):
    '''
    The solicit context.
    '''
    # ---------------------------------------------------------------- Defined
    gateways = defines(Iterable,
                       doc='''
    @rtype: Iterable(Gateway)
    The ACL gateways.
    ''')
    # ---------------------------------------------------------------- Optional
    rootURI = optional(str)
    replacements = optional(dict)
    # ---------------------------------------------------------------- Required
    permissions = requires(Iterable)
示例#25
0
 class Repository(Context):
     '''
     The repository context.
     '''
     # ---------------------------------------------------------------- Defined
     parent = attribute(Context,
                        doc='''
     @rtype: Context
     The parent context for repository. 
     ''')
     actions = defines(list,
                       doc='''
     @rtype: list[Context]
     The list of actions created.
     ''')
示例#26
0
class DefineEncoder(Context):
    '''
    The create encoder context.
    '''
    # ---------------------------------------------------------------- Defined
    encoder = defines(ITransfrom,
                      doc='''
    @rtype: ITransfrom
    The encoder to be used for rendering objects.
    ''')
    # ---------------------------------------------------------------- Optional
    name = optional(str)
    specifiers = optional(list)
    # ---------------------------------------------------------------- Required
    objType = requires(Type)
示例#27
0
class Request(Context):
    '''
    The request context.
    '''
    # ---------------------------------------------------------------- Defined
    invoker = defines(Context,
                      doc='''
    @rtype: Context
    The invoker corresponding to the request.
    ''')
    # ---------------------------------------------------------------- Required
    method = requires(str)
    node = requires(Context)
    nodesValues = requires(dict)
    converterPath = requires(Converter)
示例#28
0
class Invoker(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Defined
    invokerGet = defines(Context, doc='''
    @rtype: Context
    The invoker used for getting the target model.
    ''')
    # ---------------------------------------------------------------- Required
    node = requires(Context)
    isCollection = requires(bool)
    isModel = requires(bool)
    target = requires(TypeModel)
    path = requires(list)
示例#29
0
class Invoker(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Defined
    intrInputs = defines(OrderedDict, doc='''
    @rtype: dictionary{string: Input}
    The introspection inputs indexed by the input name. 
    ''')
    # ---------------------------------------------------------------- Required
    id = requires(str)
    call = requires(TypeCall)
    methodHTTP = requires(str)
    path = requires(list)
    shadowing = requires(Context)
    doInvoke = requires(IDo)
示例#30
0
class Invoker(Context):
    '''
    The invoker context.
    '''
    # ---------------------------------------------------------------- Defined
    node = defines(Context,
                   doc='''
    @rtype: Context
    The invoker node.
    ''')
    # ---------------------------------------------------------------- Optional
    shadowing = optional(Context)
    # ---------------------------------------------------------------- Required
    methodHTTP = requires(str)
    path = requires(list)
    location = requires(str)