Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1757


Ignore:
Timestamp:
05/08/09 12:05:02 (15 years ago)
Author:
msteinbi
Message:

new method get all groups for resource (#599)

Location:
trunk/sources
Files:
4 edited

Legend:

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

    r1752 r1757  
    5959    public static string RESPONSE_CLIENT_RESOURCE_NOT_FOUND = "Client.ResourceNotFound";
    6060    public static string RESPONSE_CLIENT_PERMISSIONOWNER_DOESNT_EXIST = "Client.PermissionOwnerDoesntExist";
     61    public static string RESPONSE_CLIENT_GET_GROUPS_OF_CLIENT = "Get all groups of a client";
    6162
    6263    public static string RESPONSE_COMMUNICATOR_HEARTBEAT_RECEIVED = "Communicator.HeardbeatReceived";
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/Interfaces/IClientManager.cs

    r1449 r1757  
    4141    ResponseList<ClientGroup> GetAllClientGroups();
    4242    [OperationContract]
     43    ResponseObject<List<ClientGroup>> GetAllGroupsOfResource(Guid resourceId);
     44    [OperationContract]
    4345    Response AddClientGroup(ClientGroup clientGroup);
    4446    [OperationContract]
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientManager.cs

    r1633 r1757  
    221221      }
    222222    }
     223
     224    public ResponseObject<List<ClientGroup>> GetAllGroupsOfResource(Guid resourceId) {
     225      ISession session = factory.GetSessionForCurrentThread();
     226
     227      try {
     228        IClientGroupAdapter clientGroupAdapter =
     229          session.GetDataAdapter<ClientGroup, IClientGroupAdapter>();
     230        IClientAdapter clientAdapter =
     231          session.GetDataAdapter<ClientInfo, IClientAdapter>();
     232
     233        ResponseObject<List<ClientGroup>> response = new ResponseObject<List<ClientGroup>>();
     234
     235        ClientInfo client = clientAdapter.GetById(resourceId);
     236        List<ClientGroup> groupsOfClient = new List<ClientGroup>(clientGroupAdapter.MemberOf(client));
     237        response.Obj = groupsOfClient;
     238        response.Success = true;
     239        response.StatusMessage = ApplicationConstants.RESPONSE_CLIENT_GET_GROUPS_OF_CLIENT;
     240
     241        return response;
     242      }
     243      finally {
     244        if (session != null)
     245          session.EndSession();
     246      }
     247    }
     248
    223249    #endregion
    224250  }
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs

    r1650 r1757  
    182182    }
    183183
     184    public ResponseObject<List<ClientGroup>> GetAllGroupsOfResource(Guid resourceId) {
     185      return clientManager.GetAllGroupsOfResource(resourceId);
     186    }
     187
    184188    #endregion
    185 
    186189  }
    187190}
Note: See TracChangeset for help on using the changeset viewer.