Commit 603c3ed8 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

[OPENBUS-2352] Separação da IDL de governança da IDL do protocolo

- Correção na OpenBusLib-Lua pra que não sejam oferecidos operações pra obter as facetas de governança.
- Adição de código nos testes e no busadmin pra que eles obtenham as interfaces de governança diretamente e não dependam da OpenBusLib-Lua pra isso.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/branches/02_00_00@144378 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 929110fc
......@@ -39,6 +39,26 @@ local host, port
local connection
local orb = openbus.initORB{ localrefs="proxy" }
local OpenBusContext = orb.OpenBusContext
do
idl.loadto(orb)
local CoreServices = {
CertificateRegistry = admintypes,
InterfaceRegistry = authotypes,
EntityRegistry = authotypes,
}
for name, idlmod in pairs(CoreServices) do
OpenBusContext["get"..name] = function (self)
local conn = self:getCurrentConnection()
if conn == nil or conn.login == nil then
sysexthrow.NO_PERMISSION{
completed = "COMPLETED_NO",
minor = loginconst.NoLoginCode,
}
end
return self.orb:narrow(conn.bus:getFacetByName(name), idlmod[name])
end
end
end
-- Guarda as funções que serão os tratadores das ações de linha de comando
local handlers = {}
......
......@@ -8,6 +8,7 @@ local idl = require "openbus.core.idl"
local UnauthorizedOperation = idl.types.services.UnauthorizedOperation
local MissingCertificate = idl.types.services.access_control.MissingCertificate
local admidl = require "openbus.core.admin.idl"
local CertificateRegistry = admidl.types.services.access_control.admin.v1_0.CertificateRegistry
local InvalidCertificate = admidl.types.services.access_control.admin.v1_0.InvalidCertificate
......@@ -27,6 +28,20 @@ local certificate = syscrt
-- Inicializao --------------------------------------------------------------
local orb = openbus.initORB()
local OpenBusContext = orb.OpenBusContext
do
admidl.loadto(orb)
function OpenBusContext:getCertificateRegistry()
local conn = self:getCurrentConnection()
if conn == nil or conn.login == nil then
sysexthrow.NO_PERMISSION{
completed = "COMPLETED_NO",
minor = loginconst.NoLoginCode,
}
end
local facet = conn.bus:getFacetByName("CertificateRegistry")
return self.orb:narrow(facet, CertificateRegistry)
end
end
local connprops = { accesskey = openbus.newKey() }
-- Casos de Teste -------------------------------------------------------------
......
......@@ -28,6 +28,26 @@ local dPassword = password
-- Inicializao --------------------------------------------------------------
local orb = openbus.initORB()
local OpenBusContext = orb.OpenBusContext
do
admidl.loadto(orb)
local CoreServices = {
InterfaceRegistry = offadm,
EntityRegistry = offadm,
}
for name, idlmod in pairs(CoreServices) do
OpenBusContext["get"..name] = function (self)
local conn = self:getCurrentConnection()
if conn == nil or conn.login == nil then
sysexthrow.NO_PERMISSION{
completed = "COMPLETED_NO",
minor = loginconst.NoLoginCode,
}
end
local facet = conn.bus:getFacetByName(name)
return self.orb:narrow(facet, idlmod[name])
end
end
end
local connprops = { accesskey = openbus.newKey() }
-- Casos de Teste -------------------------------------------------------------
......
......@@ -12,8 +12,12 @@ local offtps = idl.types.services.offer_registry
local InvalidService = offtps.InvalidService
local InvalidProperties = offtps.InvalidProperties
local UnauthorizedFacets = offtps.UnauthorizedFacets
-- TODO:[maia] all the code that depend on these definition are misplaced here,
-- they all should be in the file of the tests of EntityRegistry.
local admidl = require "openbus.core.admin.idl"
local offadm = admidl.types.services.offer_registry.admin.v1_0
local EntityRegistry = offadm.EntityRegistry
local AuthorizationInUse = offadm.AuthorizationInUse
local throwsysex = require "openbus.util.sysex"
......@@ -36,6 +40,20 @@ local entity = system
-- Inicializao --------------------------------------------------------------
local orb = openbus.initORB{ localrefs="proxy" }
local OpenBusContext = orb.OpenBusContext
do
admidl.loadto(orb)
function OpenBusContext:getEntityRegistry()
local conn = self:getCurrentConnection()
if conn == nil or conn.login == nil then
sysexthrow.NO_PERMISSION{
completed = "COMPLETED_NO",
minor = loginconst.NoLoginCode,
}
end
local facet = conn.bus:getFacetByName("EntityRegistry")
return self.orb:narrow(facet, EntityRegistry)
end
end
local connprops = { accesskey = openbus.newKey() }
-- Casos de Teste -------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment