Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1824 for trunk/sources


Ignore:
Timestamp:
05/15/09 12:53:21 (16 years ago)
Author:
msteinbi
Message:

new method delete client group added (#599)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs

    r1813 r1824  
    5555    public static string RESPONSE_CLIENT_CLIENTGROUP_ADDED = "Client.ClientGroupAdded";
    5656    public static string RESPONSE_CLIENT_CLIENTGROUP_DOESNT_EXIST = "Client.ClientGroupDoesntExist";
     57    public static string RESPONSE_CLIENT_CLIENTGROUP_DELETED = "Client group sucessfully deleted";
    5758    public static string RESPONSE_CLIENT_RESOURCE_ADDED_TO_GROUP = "Client.ResourceAddedToGroup";
    5859    public static string RESPONSE_CLIENT_RESOURCE_REMOVED = "Client.ResourceRemoved";
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/Interfaces/IClientManager.cs

    r1757 r1824  
    4545    Response AddClientGroup(ClientGroup clientGroup);
    4646    [OperationContract]
     47    Response DeleteClientGroup(Guid clientGroupId);
     48    [OperationContract]
    4749    Response AddResourceToGroup(Guid clientGroupId, Resource resource);
    4850    [OperationContract]
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientManager.cs

    r1757 r1824  
    9191          }
    9292        }
     93        emptyClientGroup.Id = Guid.Empty;
    9394        allClientGroups.Add(emptyClientGroup);
    9495
     
    247248    }
    248249
     250    public Response DeleteClientGroup(Guid clientGroupId) {
     251      ISession session = factory.GetSessionForCurrentThread();
     252
     253      try {
     254        IClientGroupAdapter clientGroupAdapter =
     255          session.GetDataAdapter<ClientGroup, IClientGroupAdapter>();
     256
     257        Response response = new Response();
     258
     259        ClientGroup clientGroup = clientGroupAdapter.GetById(clientGroupId);
     260        if (clientGroup == null) {
     261          response.Success = false;
     262          response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_CLIENTGROUP_DOESNT_EXIST;
     263          return response;
     264        }
     265
     266        clientGroupAdapter.Delete(clientGroup);
     267
     268        response.Success = true;
     269        response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_CLIENTGROUP_DELETED;
     270        return response;
     271
     272      } finally {
     273        if (session != null)
     274          session.EndSession();
     275      }
     276    }
     277
    249278    #endregion
    250279  }
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs

    r1805 r1824  
    162162    }
    163163
     164    public Response DeleteClientGroup(Guid clientGroupId) {
     165      return clientManager.DeleteClientGroup(clientGroupId);
     166    }
     167
    164168  /*
    165169    private bool HasPermission(Guid action) {
     
    188192
    189193    }
    190 
    191 
    192194  }
    193195}
Note: See TracChangeset for help on using the changeset viewer.