Ejemplo n.º 1
0
        public Result CreateDeliveryCacheStorageServiceWithApplicationId(out IDeliveryCacheStorageService service,
                                                                         ApplicationId applicationId)
        {
            if (!AccessControl.HasFlag(AccessControl.MountOthersDeliveryCacheStorage))
            {
                UnsafeHelpers.SkipParamInit(out service);
                return(ResultBcat.PermissionDenied.Log());
            }

            return(CreateDeliveryCacheStorageServiceImpl(out service, applicationId));
        }
Ejemplo n.º 2
0
        public Result CreateDeliveryCacheStorageService(out IDeliveryCacheStorageService service, ulong processId)
        {
            Result rc = Server.Hos.Arp.GetApplicationLaunchProperty(out ApplicationLaunchProperty launchProperty,
                                                                    processId);

            if (rc.IsFailure())
            {
                UnsafeHelpers.SkipParamInit(out service);
                return(ResultBcat.NotFound.LogConverted(rc));
            }

            return(CreateDeliveryCacheStorageServiceImpl(out service, launchProperty.ApplicationId));
        }
Ejemplo n.º 3
0
        private Result CreateDeliveryCacheStorageServiceImpl(out IDeliveryCacheStorageService service,
                                                             ApplicationId applicationId)
        {
            UnsafeHelpers.SkipParamInit(out service);

            Result rc = Server.GetStorageManager().Open(applicationId.Value);

            if (rc.IsFailure())
            {
                return(rc);
            }

            // todo: Check if network account required

            service = new DeliveryCacheStorageService(Server, applicationId.Value, AccessControl);

            return(Result.Success);
        }