Namespace: OpenEdge.Web.DataObject
Class
ServiceRegistryImpl
Parent classes:
Inherits: Progress.Lang.Object
Implements: OpenEdge.Logging.ISupportLogging

/* *************************************************************************************************************************
Copyright (c) 2016-2017 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
File:ServiceRegistryImpl
Purpose:Contains a registry for mapped services
Author(s):pjudge
Created:Wed May 18 13:06:41 EDT 2016
Notes:This is the actual instance that does the work, called
from the ServiceRegistry's static methods




Method Summary
Options Name Purpose
AddDefaultOperations (character) /* Add default operations for a service (if not yet @param character The service for which to add default operations */
HANDLE CreateTempTable (character, JsonObject)
DeregisterService (character) /* Removes a service registration. @param character The name of the service to remove from the registry */
FindOperationRecord (character, character, MethodEnum, buffer) /* Helper method to find and position the Operation buffer to a given service/method. Caller must check availablity themselves. @param character The service name @param character The service URI @param MethodEnum the http method @param buffer The Operation record to find. */
FindSchemaRecord (character, character, buffer) /* Helper method to find and position the Service buffer to a given service. Caller must check availablity themselves. @param character The service name @param buffer The Service record to find. */
FindServiceRecord (character, buffer) /* Helper method to find and position the Service buffer to a given service. Caller must check availablity themselves. @param character The service name @param buffer The Service record to find. */
OpenEdge.Web.DataObject.MappedOperation GetOperation (character, character, MethodEnum) /* Returns details about the operation @param character The serviceName @param character The relative URI @param MethodEnum The HTTP method @return MappedOperation The operation map for this Method/URI */
HANDLE GetSchema (character, character) /* Returns a schema for a given service oepration. @param character The service name @param character The schema name @return handle An empty data structure (TT or PDS) */
Progress.Json.ObjectModel.JsonObject GetServiceCatalog (character) /* Returns a catalog for a named service @param character The service name. @return JsonObject A JSDO catalog. If no exist or none can be found, return null. @throws AssertionFailedError If the name is empty or null @throws AppError If the requested service does not exist in the registry */
Progress.Json.ObjectModel.JsonObject GetServiceOptions (character) /* Returns the service options for a named service @param character The service name. @return JsonObject A JSDO object containing options. If no exist or none can be found, return an empty JSON object. @throws AssertionFailedError If the name is empty or null */
INTEGER GetServices (character[]) /* Returns all registered service names @return character extent An array of registered services. indeterminate if none. */
LOGICAL HasOperation (character, character, MethodEnum) /* Indicates whether a mapped operation exists @param character the service name @param character The relative URI (to the service) @param MethodEnum The HTTP method @return logical TRUE if the service exists */
LOGICAL HasService (character) /* Indicates whether a named service is available in the registry. @param character The name of the mapped service @return logical TRUE if the service exists */
LOGICAL LoadFromFile (character, handle) /* Loads a named service from a file @param character The service name to load @param handle The FILE-INFO handle for the file @return logical TRUE if the named service was found */
LoadFromFile (handle) /* Loads all services from the file @param handle The FILE-INFO handle for the file. */
LoadOperations (character, JsonObject) /* Converts a JSON map into internal structures @param character The service name @param JsonObject The operation map */
LoadSchemas (character, JsonObject) /* Converts a JSON map into internal structures @param character The service name @param JsonObject The set of schema */
PutOperation (character, MappedOperation) /* Adds a new operation map for a service. @param MethodEnum The HTTP method @param character The relative URI @param MappedOperation The operation map for this Method/URI */
PutSchema (character, character, handle) /* Saves a schema for a given service @param character The service name @param character The schema name @param handle An empty data structure (TT or PDS) */
PutServiceCatalog (character, JsonObject) /* Sets a catalog for a named service @param character The service name. @param JsonObject A JSDO catalog. If no exist or none can be found, return null. @throws AssertionFailedError If the name is empty or null @throws AppError If the requested service does not exist in the registry */
PutServiceOptions (character, JsonObject) /* Sets the service options for a named service @param character The service name. @param JsonObject A JSON object containing options. @throws AssertionFailedError If the name is empty or null @throws AppError If the requested service does not exist in the registry */
RegisterAllFromFolder (character) /* Registers all services found in a given folder. Can be used at agent startup @param character An extant folder */
RegisterFromFile (character) /* Registers all services found in a given file. Can be used at agent startup @param character An extant file */
RegisterFromFile (character, character) /* Registers a named service found in a given file. Can be used at agent startup @param character A service name @param character An extant file */
RegisterService (character, character, JsonObject, JsonObject, JsonObject) /* Register a service in this handler. @param character (mandatory) The service name. @param JsonObject (recommended) An operation map for the service. @param JsonObject (optional) A catalog for the service. Optional since it may exist on disk */
RemoveOperation (character, character, MethodEnum) /* Removes an operation mapping from the collection operation maps. No-op if none exists. @param character the service name @param character The relative URI @param MethodEnum The HTTP method */
RemoveSchema (character, character) /* Removes an operation schema from service No-op if none exists. @param character the service name @param character The schema name */
LOGICAL TryFindService (character, character) /* Indicates whether a named service is available. Will attempt to locate a service map if it is not yet registered, and will register it if one can be found. The search path for finding the service mapping files is 1. Look in the webapp's WEB-INF/openedge folder first 2. Look in the instance's /openedge folder next 3. Look in the rest of PROPATH @param character The name of the mapped service @param character The name of the webapp currently executed @return logical TRUE if the service exists */

Constructor Summary
Options Name Purpose
ServiceRegistryImpl ()

Property Summary
Options Name Purpose
OpenEdge.Logging.ILogWriter Logger


Method Detail
Top

AddDefaultOperations (character)

/* Add default operations for a service (if not yet
Parameters:
pcServiceName CHARACTER
Top

HANDLE CreateTempTable (character, JsonObject)

Parameters:
pcName CHARACTER
poTable Progress.Json.ObjectModel.JsonObject
Returns HANDLE
Top

DeregisterService (character)

/* Removes a service registration.
Parameters:
pcServiceName CHARACTER
Top

FindOperationRecord (character, character, MethodEnum, buffer)

/* Helper method to find and position the Operation buffer to a given service/method. Caller must check
availablity themselves.
Parameters:
pcServiceName CHARACTER
pcServiceURI CHARACTER
poMethod OpenEdge.Net.HTTP.MethodEnum
pbOperation buffer
Top

FindSchemaRecord (character, character, buffer)

/* Helper method to find and position the Service buffer to a given service. Caller must check
availablity themselves.
Parameters:
pcServiceName CHARACTER
pcSchemaName CHARACTER
pbSchema buffer
Top

FindServiceRecord (character, buffer)

/* Helper method to find and position the Service buffer to a given service. Caller must check
availablity themselves.
Parameters:
pcServiceName CHARACTER
pbService buffer
Top

OpenEdge.Web.DataObject.MappedOperation GetOperation (character, character, MethodEnum)

/* Returns details about the operation
Parameters:
pcServiceName CHARACTER
pcServiceURI CHARACTER
poMethod OpenEdge.Net.HTTP.MethodEnum
Returns OpenEdge.Web.DataObject.MappedOperation
MappedOperation The operation map for this Method/URI
Top

HANDLE GetSchema (character, character)

/* Returns a schema for a given service oepration.
Parameters:
pcServiceName CHARACTER
pcSchemaName CHARACTER
Returns HANDLE
handle An empty data structure (TT or PDS)
Top

Progress.Json.ObjectModel.JsonObject GetServiceCatalog (character)

/* Returns a catalog for a named service
@throws AssertionFailedError If the name is empty or null
@throws AppError If the requested service does not exist in the registry
Parameters:
pcServiceName CHARACTER
Returns Progress.Json.ObjectModel.JsonObject
JsonObject A JSDO catalog. If no exist or none can be found, return null.
Top

Progress.Json.ObjectModel.JsonObject GetServiceOptions (character)

/* Returns the service options for a named service
found, return an empty JSON object.
@throws AssertionFailedError If the name is empty or null
Parameters:
pcServiceName CHARACTER
Returns Progress.Json.ObjectModel.JsonObject
JsonObject A JSDO object containing options. If no exist or none can be
Top

INTEGER GetServices (character[])

/* Returns all registered service names
Parameters:
pcServices CHARACTER
Returns INTEGER
character extent An array of registered services. indeterminate if none.
Top

LOGICAL HasOperation (character, character, MethodEnum)

/* Indicates whether a mapped operation exists
Parameters:
pcServiceName CHARACTER
pcServiceURI CHARACTER
poMethod OpenEdge.Net.HTTP.MethodEnum
Returns LOGICAL
logical TRUE if the service exists
Top

LOGICAL HasService (character)

/* Indicates whether a named service is available in the registry.
Parameters:
pcServiceName CHARACTER
Returns LOGICAL
logical TRUE if the service exists
Top

LOGICAL LoadFromFile (character, handle)

/* Loads a named service from a file
Parameters:
pcServiceName CHARACTER
phFile HANDLE
Returns LOGICAL
logical TRUE if the named service was found
Top

LoadFromFile (handle)

/* Loads all services from the file
Parameters:
phFile HANDLE
Top

LoadOperations (character, JsonObject)

/* Converts a JSON map into internal structures
Parameters:
pcServiceName CHARACTER
poOperations Progress.Json.ObjectModel.JsonObject
Top

LoadSchemas (character, JsonObject)

/* Converts a JSON map into internal structures
Parameters:
pcServiceName CHARACTER
poSchemas Progress.Json.ObjectModel.JsonObject
Top

PutOperation (character, MappedOperation)

/* Adds a new operation map for a service.
Parameters:
pcServiceName CHARACTER
poMappedOperation OpenEdge.Web.DataObject.MappedOperation
Top

PutSchema (character, character, handle)

/* Saves a schema for a given service
Parameters:
pcServiceName CHARACTER
pcSchemaName CHARACTER
phSchema HANDLE
Top

PutServiceCatalog (character, JsonObject)

/* Sets a catalog for a named service
@throws AssertionFailedError If the name is empty or null
@throws AppError If the requested service does not exist in the registry
Parameters:
pcServiceName CHARACTER
poCatalog Progress.Json.ObjectModel.JsonObject
Top

PutServiceOptions (character, JsonObject)

/* Sets the service options for a named service
@throws AssertionFailedError If the name is empty or null
@throws AppError If the requested service does not exist in the registry
Parameters:
pcServiceName CHARACTER
poOptions Progress.Json.ObjectModel.JsonObject
Top

RegisterAllFromFolder (character)

/* Registers all services found in a given folder. Can be used at agent startup
Parameters:
pcFolder CHARACTER
Top

RegisterFromFile (character)

/* Registers all services found in a given file. Can be used at agent startup
Parameters:
pcFile CHARACTER
Top

RegisterFromFile (character, character)

/* Registers a named service found in a given file. Can be used at agent startup
Parameters:
pcServiceName CHARACTER
pcFile CHARACTER
Top

RegisterService (character, character, JsonObject, JsonObject, JsonObject)

/* Register a service in this handler.
Parameters:
pcServiceName CHARACTER
pcVersion CHARACTER
poOperations Progress.Json.ObjectModel.JsonObject
poCatalog Progress.Json.ObjectModel.JsonObject
poSchemas Progress.Json.ObjectModel.JsonObject
Top

RemoveOperation (character, character, MethodEnum)

/* Removes an operation mapping from the collection operation maps.
No-op if none exists.
Parameters:
pcServiceName CHARACTER
pcServiceURI CHARACTER
poMethod OpenEdge.Net.HTTP.MethodEnum
Top

RemoveSchema (character, character)

/* Removes an operation schema from service
No-op if none exists.
Parameters:
pcServiceName CHARACTER
pcSchemaName CHARACTER
Top

LOGICAL TryFindService (character, character)

/* Indicates whether a named service is available. Will attempt to
locate a service map if it is not yet registered, and will register
it if one can be found. The search path for finding the service mapping
files is
1. Look in the webapp's WEB-INF/openedge folder first
2. Look in the instance's /openedge folder next
3. Look in the rest of PROPATH
Parameters:
pcServiceName CHARACTER
pcWebAppPath CHARACTER
Returns LOGICAL
logical TRUE if the service exists


Constructor Detail
Top

ServiceRegistryImpl ()



Property Detail
Top

OpenEdge.Logging.ILogWriter Logger

Returns OpenEdge.Logging.ILogWriter


Copyright © 2017 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7