Examples of ResourceCategory


Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(name==null||name=="")
    {
      result.setFailed(RESOURCE_CATEGORY_NAME_IS_NULL);
      return result;
    }
    ResourceCategory category = new ResourceCategory();
    try{
      BeanUtils.populate(category, properties);
      category.setId(MyUUIDGen.getUUID());
      resourceCategoryDAO.merge(category);
      result.setSucceed(category.getId());
    }
    catch(Exception e)
    {
      e.printStackTrace();
      result.setFailed(e.getMessage());
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(id==null)
    {
      result.setFailed(RESOURCE_CATEGORY_ID_IS_NULL);
      return result;
    }
    ResourceCategory category = resourceCategoryDAO.findById(id);
    if(category==null)
    {
      result.setFailed(RESOURCE_CATEGORY_NOT_EXIST);
      return result;
    }
    try{
      BeanUtils.populate(category, properties);
      category.setId(id);
      resourceCategoryDAO.merge(category);
      result.setSucceed();
    }
    catch(Exception e)
    {
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(id==null)
    {
      result.setFailed(RESOURCE_CATEGORY_ID_IS_NULL);
      return result;
    }
    ResourceCategory category = resourceCategoryDAO.findById(id);
    if(category==null)
    {
      result.setFailed(RESOURCE_CATEGORY_NOT_EXIST);
      return result;
    }
    Set<Resources> resources = category.getResourceses();
    if(resources!=null&&resources.size()>0)//有资源与此目录关联,则返回失败
    {
      result.setFailed(CATEGORY_EXIST_RESOURCE);
      return result;
    }
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(categoryID==null)
    {
      result.setFailed(RESOURCE_CATEGORY_ID_IS_NULL);
      return result;
    }
    ResourceCategory category = resourceCategoryDAO.findById(categoryID);
    if(category==null)
    {
      result.setFailed(RESOURCE_CATEGORY_NOT_EXIST);
      return result;
    }
    Set<Resources>resources = category.getResourceses();
    ArrayList<Resources> aResource = new ArrayList<Resources>();
    aResource.addAll(resources);
    result.setData(ObjectListConvert2DynaBeanList.convert(aResource));
    result.setSucceed();
    return result;
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(categoryID==null)
    {
      result.setFailed(RESOURCE_CATEGORY_ID_IS_NULL);
      return result;
    }
    ResourceCategory category = resourceCategoryDAO.findById(categoryID);
    if(category==null)
    {
      result.setFailed(RESOURCE_CATEGORY_NOT_EXIST);
      return result;
    }
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.ResourceCategory

    if(categoryID==null)
    {
      result.setFailed(RESOURCE_CATEGORY_ID_IS_NULL);
      return result;
    }
    ResourceCategory category = resourceCategoryDAO.findById(categoryID);
    if(category==null)
    {
      result.setFailed(RESOURCE_CATEGORY_NOT_EXIST);
      return result;
    }
View Full Code Here

Examples of org.rhq.core.domain.resource.ResourceCategory

        }
        return descriptor;
    }

    private void addType(ResourceType type) {
        ResourceCategory category = type.getCategory();

        synchronized (typesLock) {
            if (!typesByCategory.containsKey(category)) {
                typesByCategory.put(category, new LinkedHashSet<ResourceType>());
            }
View Full Code Here

Examples of org.rhq.core.domain.resource.ResourceCategory

    private void addRunsInsideParentTypes(ResourceDescriptor resourceDescriptor, ResourceType resourceType) {
        RunsInsideType runsInside = resourceDescriptor.getRunsInside();
        if (runsInside != null) {
            List<ParentResourceType> parentTypesDescriptor = runsInside.getParentResourceType();
            for (ParentResourceType parentTypeDescriptor : parentTypesDescriptor) {
                ResourceCategory parentResourceCategory = parentTypeDescriptor.getPlugin().equals("Platforms") ? ResourceCategory.PLATFORM
                    : ResourceCategory.SERVER;
                ResourceType parentResourceType = new ResourceType(parentTypeDescriptor.getName(),
                    parentTypeDescriptor.getPlugin(), parentResourceCategory, ResourceType.ANY_PLATFORM_TYPE);
                ResourceType fullParentType = allTypes.get(parentResourceType);
                if (fullParentType != null) {
View Full Code Here

Examples of org.rhq.core.domain.resource.ResourceCategory

    public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
        if (value == null) {
            return "null";
        }
        ResourceCategory resourceCategory;
        if (value instanceof ResourceCategory) {
            resourceCategory = (ResourceCategory) value;
        } else if (value instanceof String) {
            String categoryName = (String) value;
            resourceCategory = ResourceCategory.valueOf(categoryName);
View Full Code Here

Examples of org.rhq.core.domain.resource.ResourceCategory

        return getResourceIcon(resource, "24");
    }

    private static String getResourceIcon(Resource resource, String size) {
        ResourceType type = resource.getResourceType();
        ResourceCategory category;
        if (type != null) {
            category = type.getCategory();
        } else {
            category = ResourceCategory.SERVICE;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.