public IOidFacade RestoreSid(OidTranslationSlashSeparatedTypeAndIds id)
        {
            var          type = ValidateServiceId(id);
            IServiceSpec spec;

            try {
                spec = (IServiceSpec)framework.MetamodelManager.GetSpecification(type);
            }
            catch (Exception e) {
                throw new ServiceResourceNotFoundNOSException(type.ToString(), e);
            }

            if (spec == null)
            {
                throw new ServiceResourceNotFoundNOSException(type.ToString());
            }

            var service = framework.ServicesManager.GetServicesWithVisibleActions(framework.LifecycleManager).SingleOrDefault(no => no.Spec.IsOfType(spec));

            if (service == null)
            {
                throw new ServiceResourceNotFoundNOSException(type.ToString());
            }

            return(new OidFacade(service.Oid));
        }
        public IOidFacade RestoreOid(OidTranslationSlashSeparatedTypeAndIds id)
        {
            var type    = ValidateObjectId(id);
            var keys    = GetKeys(id.InstanceId, type);
            var adapter = GetObject(keys, type);

            if (adapter == null)
            {
                throw new ObjectResourceNotFoundNOSException($"{id}: null adapter");
            }

            return(new OidFacade(adapter.Oid));
        }
        public IOidFacade RestoreSid(OidTranslationSlashSeparatedTypeAndIds id)
        {
            ITypeSpec spec = GetServiceTypeSpecByServiceName(id);

            if (spec is IServiceSpec)
            {
                var service = framework.ServicesManager.GetServicesWithVisibleActions(framework.LifecycleManager).SingleOrDefault(no => no.Spec.IsOfType(spec));

                if (service == null)
                {
                    throw new ServiceResourceNotFoundNOSException(spec.FullName);
                }

                return(new OidFacade(service.Oid));
            }

            if (!spec.IsStatic)
            {
                // we were looking for a static class masquerading as a service
                throw new ServiceResourceNotFoundNOSException(spec.FullName);
            }

            return(null);
        }
Esempio n. 4
0
 public IOidFacade RestoreSid(OidTranslationSlashSeparatedTypeAndIds id)
 {
     throw new NotImplementedException();
 }