Ejemplo n.º 1
0
 /// <summary>
 /// Executes when Unhandled Exception is thrown.
 /// </summary>
 /// <param name="context">ActionExecuted Context</param>
 public override void OnException(HttpActionExecutedContext context)
 {
     DiagnosticsProvider diagnostics = new DiagnosticsProvider(this.GetType());
     Exception exception = context.Exception;
     diagnostics.WriteErrorTrace(TraceEventId.Exception, exception);
     context.Response = context.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exception.Message);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RepositoryController" /> class.
 /// </summary>
 /// <param name="repositoryService">Repository service object.</param>
 /// <param name="userService">User service object.</param>
 public RepositoryController(IRepositoryService repositoryService, IUserService userService)
 {
     this.repositoryService = repositoryService;
     this.diagnostics = new DiagnosticsProvider(this.GetType());
     this.userService = userService;
     this.user = IdentityHelper.GetCurrentUser(this.userService, this.User as ClaimsPrincipal);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageRouter"/> class.
 /// </summary>
 /// <param name="messageHandlerFactory">IMessageHandlerFactory to instantiate IMessageHandler.</param>
 /// <param name="queueRepository">IQueueRepository instance.</param>
 public MessageRouter(IMessageHandlerFactory messageHandlerFactory, IQueueRepository queueRepository)
 {
     this.messageHandlerFactory = messageHandlerFactory;
     this.queueRepository = queueRepository;
     this.VisibilityTimeOut = ConfigReader<int>.GetSetting(VisibilityTimeOutAppSettingName);
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QCController" /> class.
 /// </summary>
 /// <param name="qcService">IQC Service object.</param>
 /// <param name="fileServiceFactory">File service factory</param>
 /// <param name="userService">User service</param>
 public QCController(IQCService qcService, IFileServiceFactory fileServiceFactory, IUserService userService)
 {
     this.qcService = qcService;
     this.fileServiceFactory = fileServiceFactory;
     this.userService = userService;
     this.user = IdentityHelper.GetCurrentUser(this.userService, this.User as ClaimsPrincipal);
     this.diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 5
0
  /// <summary>
 /// Initializes a new instance of the <see cref="MessageHandlerFactory"/> class.
 /// </summary>
 /// <param name="fileServiceFactory">IFileServiceFactory to instantiate IFileService.</param>
 /// <param name="repositoryService">IRepositoryService instance.</param>
 /// <param name="queueRepository">IQueueRepository instance.</param>
 /// <param name="blobRepository">IBlobRepository instance.</param>
 public MessageHandlerFactory(IFileServiceFactory fileServiceFactory, IRepositoryService repositoryService, IQueueRepository queueRepository, IBlobDataRepository blobRepository)
 {
     this.fileServiceFactory = fileServiceFactory;
     this.repositoryService = repositoryService;
     this.queueRepository = queueRepository;
     this.blobRepository = blobRepository;
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Instantiates the PublishController
 /// </summary>
 public PublishController(IPublishQueueService publishQueueService, IUserService userService, IRepositoryService repositoryService, IFileServiceFactory fileServiceFactory)
     : base()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
     this.publishQueueService = publishQueueService;
     this.userService = userService;
     this.repositoryService = repositoryService;
     this.fileServiceFactory = fileServiceFactory;
     this.user = IdentityHelper.GetCurrentUser(this.userService, this.User as ClaimsPrincipal);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WindowsLiveAuthorizationController" /> class.
 /// </summary>
 public WindowsLiveAuthorizationController()
 {
     this.diagnostics = new DiagnosticsProvider(this.GetType());
     
     // Read the config settings;
     string baseRepositoryName = BaseRepositoryEnum.SkyDrive.ToString();
     this.oAuthURL = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.OAuthUrl);
     this.oAuthAuthZUrl = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.OAuthAuthZUrl);
     this.clientId = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.ClientId);
     this.redirectionURL = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.RedicrectionUrl);
     this.clientSecret = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.ClientSecret);
     this.skyDriveUpdateScope = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.SkyDriveUpdateScope);
     this.offlineAccessScope = ConfigReader<string>.GetRepositoryConfigValues(baseRepositoryName, SkyDriveConstants.WindowsLiveOfflinseAccessScope);
 }
Ejemplo n.º 8
0
        public BlobController(IFileServiceFactory fileServiceFactory, IUserService userService, IFileHandlerFactory fileHandlerFactory)
        {
            Check.IsNotNull(fileServiceFactory, "fileServiceFactory");
            Check.IsNotNull(userService, "userService");
            Check.IsNotNull(fileHandlerFactory, "fileHandlerFactory");
            diagnostics = new DiagnosticsProvider(this.GetType());

            this.userService = userService;
            this.fileService = fileServiceFactory.GetFileService(Constants.Default);

            // get the current/signed in user
            this.user = IdentityHelper.GetCurrentUser(this.userService, this.User as ClaimsPrincipal);
            this.fileHandlerFactory = fileHandlerFactory;

        }
Ejemplo n.º 9
0
        protected void Application_Error(object sender, EventArgs e)
        {
            // Get the error details
            Exception ex = Server.GetLastError();

            // Check exception type and default Http 500 (internal server error)
            Response.StatusCode = (ex is HttpException) ? (ex as HttpException).GetHttpCode() : (int)HttpStatusCode.InternalServerError;

            // Log exception
            DiagnosticsProvider diagnostics = new DiagnosticsProvider(this.GetType());
            string error = string.Join("\n", "Unhandled Exception: ", ex.ToString());
            diagnostics.WriteErrorTrace(TraceEventId.Exception, error);

            // Clear buffers
            Server.ClearError();
            Response.End();
        }
Ejemplo n.º 10
0
 public UsersController(IUserService userService)
 {
     this.userService = userService;
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkyDriveAdapter"/> class.
 /// </summary>
 public SkyDriveAdapter()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataVerseAdapter"/> class.
 /// </summary>
 public DataVerseAdapter()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Instantiates the AuthenticationController
 /// </summary>
 public AuthenticationController()
     :base()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkerRole"/> class.
 /// </summary>
 public WorkerRole()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 15
0
 public JWTTokenValidationHandler()
     :base()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 16
0
 public CorsHandler()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FilePurgeService" /> class.
 /// </summary>
 /// <param name="fileService">File service instance.</param>
 public FilePurgeService(FSI.IFileService fileService, IUnityContainer container)
 {
     this.diagnostics = new DiagnosticsProvider(this.GetType());
     this.fileService = fileService;
     this.container = container;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FilePurgeService" /> class.
 /// </summary>
 /// <param name="fileService">File service instance.</param>
 public FileUpdateService(FSI.IFileService fileService)
 {
     this.diagnostics = new DiagnosticsProvider(this.GetType());
     this.fileService = fileService;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkyDriveFileService"/> class.
 /// </summary>
 /// <param name="fileDataRepository">IFileRepository instance.</param>
 /// <param name="blobDataRepository">IBlobDataRepository instance.</param>
 /// <param name="unitOfWork">IUnitOfWork instance.</param>
 /// <param name="repositoryDetails">IRepositoryDetails instance.</param>
 /// <param name="repositoryService">IRepositoryService instance.</param>
 /// <param name="userService">IUserService instance</param>
 /// <param name="repositoryAdapterFactory">IRepositoryAdapterFactory instance.</param>
 public SkyDriveFileService(IFileRepository fileDataRepository, IBlobDataRepository blobDataRepository, IUnitOfWork unitOfWork, IRepositoryDetails repositoryDetails,IRepositoryService repositoryService, IUserService userService, IRepositoryAdapterFactory repositoryAdapterFactory)
     : base(fileDataRepository, blobDataRepository, unitOfWork, repositoryDetails, repositoryService, repositoryAdapterFactory)
 {
     this.userService = userService;
     diagnostics = new DiagnosticsProvider(this.GetType());
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FilesController" /> class.
 /// </summary>
 /// <param name="fileServiceFactory">IFileServiceFactory</param>
 /// <param name="repositoryService">IRepositoryService</param>
 /// <param name="qcService">IQCService</param>
 /// <param name="userService">IUserService</param>
 /// <param name="repositoryAdapterFactory">IRepositoryAdapterFactory</param>
 public FilesController(IFileServiceFactory fileServiceFactory, IRepositoryService repositoryService, IQCService qcService, IUserService userService, IRepositoryAdapterFactory repositoryAdapterFactory)
 {
     this.repositoryService = repositoryService;
     this.qcService = qcService;
     this.fileServiceFactory = fileServiceFactory;
     this.userService = userService;
     this.fileService = fileServiceFactory.GetFileService(BaseRepositoryEnum.Default.ToString());
     this.diagnostics = new DiagnosticsProvider(this.GetType());
     this.repositoryAdapterFactory = repositoryAdapterFactory;
     this.user = IdentityHelper.GetCurrentUser(this.userService, this.User as ClaimsPrincipal);
 }
Ejemplo n.º 21
0
 public ApiJWTSecurityTokenHandler()
     :base()
 {
     diagnostics = new DiagnosticsProvider(this.GetType());
 }