Exemplo n.º 1
0
 public void deleteResourceAllocation(ResourceMaster resourceMaster) {
   ResourceAllocation resourceAllocation =
       resourceAllocationDao.getResourceAllocationById(resourceMaster.getResourceId());
   try {
     resourceAllocationDao.deleteResourceAllocation(resourceAllocation);
   } catch (Exception e) {
     LOG.error(ImiDataFormatUtils.getStackTrace(e));
   }
 }
Exemplo n.º 2
0
 public void updateResourceAllocation(
     ResourceMaster resourceMaster,
     Integer userid,
     Integer clientId,
     Integer groupid,
     Integer teamid,
     String clientname,
     String clientkey) {
   ResourceAllocation resourceAllocation = new ResourceAllocation();
   try {
     resourceAllocation.setResourceId(resourceMaster.getResourceId());
     resourceAllocation.setCreatedOn(new Date());
     // Hardcoding OH for now change to properties file
     String nodeType = "OH";
     String admin = "Admin";
     int rcId = 21;
     resourceAllocation.setNodeId(nodeType + "#" + clientname);
     resourceAllocation.setRcId(rcId);
     resourceAllocation.setNodeType(nodeType);
     resourceAllocation.setStatus((byte) 2);
     resourceAllocation.setUpdatedOn(resourceAllocation.getCreatedOn());
     resourceAllocation.setExpiresOn(ImiDataFormatUtils.getmaxDate());
     resourceAllocation.setActivatedOn(resourceAllocation.getCreatedOn());
     resourceAllocation.setCreatedBy(admin);
     resourceAllocation.setIsDefault((byte) 2);
     resourceAllocation.setUserkey(clientkey);
     resourceAllocationDao.createNewResourceAllocation(resourceAllocation);
   } catch (Exception e) {
   }
 }