Examples of EntityContext


Examples of org.rhq.core.domain.common.EntityContext

*/
public class ResourceAlertHistoryView extends AlertHistoryView {
    public static ResourceAlertHistoryView get(ResourceComposite composite) {

        String tableTitle = MSG.view_alerts_table_title_resource();
        EntityContext context = EntityContext.forResource(composite.getResource().getId());
        boolean hasWriteAccess = composite.getResourcePermission().isAlert();
        return new ResourceAlertHistoryView(tableTitle, context, hasWriteAccess);
    }
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

* @author Jay Shaughnessy
*/
public class ResourceDriftDefinitionsView extends DriftDefinitionsView {
    public static ResourceDriftDefinitionsView get(ResourceComposite composite) {
        String tableTitle = MSG.view_drift_table_resourceDef();
        EntityContext context = EntityContext.forResource(composite.getResource().getId());
        boolean hasWriteAccess = composite.getResourcePermission().isDrift();
        return new ResourceDriftDefinitionsView(tableTitle, context, hasWriteAccess);
    }
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

        return null;
    }

    @Override
    public void execute() {
        EntityContext context = getEntityContext();
        switch (context.getType()) {
        case Resource:

            ResourceCriteria rc = new ResourceCriteria();
            rc.addFilterId(context.getResourceId());
            rc.fetchResourceType(true);
            GWTServiceLookup.getDriftService().updateDriftDefinition(context, getNewDriftDefinition(),
                new AsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                        CoreGUI.getMessageCenter().notify(
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

    public AvailabilityUIBean() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();

        EntityContext context = WebUtility.getEntityContext();
        try {
            MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();

            // adjust down so the start time of the first point equals the begin time of the metric display range prefs
            long adjust = (rangePreferences.end - rangePreferences.begin) / DefaultConstants.DEFAULT_CHART_POINTS;
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

        } catch (SchedulerException e) {
            log.error("Failed to unschedule Quartz trigger [" + triggerName + "].", e);
        }

        String scheduleSubQuery = (String) jobDataMap.get(MeasurementScheduleManagerBean.SCHEDULE_SUBQUERY);
        EntityContext entityContext = new EntityContext(
            Integer.parseInt((String) jobDataMap.get(MeasurementScheduleManagerBean.ENTITYCONTEXT_RESOURCEID)),
            Integer.parseInt((String) jobDataMap.get(MeasurementScheduleManagerBean.ENTITYCONTEXT_GROUPID)),
            Integer.parseInt((String) jobDataMap.get(MeasurementScheduleManagerBean.ENTITYCONTEXT_PARENT_RESOURCEID)),
            Integer.parseInt((String) jobDataMap.get(MeasurementScheduleManagerBean.ENTITYCONTEXT_RESOURCETYPEID))
        );
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

    public static WebUserPreferences getWebUserPreferences() {
        return EnterpriseFacesContextUtility.getWebUser().getWebPreferences();
    }

    public static String contextFragmentURL() {
        EntityContext context = WebUtility.getEntityContext();
        switch (context.type) {
        case Resource:
            return ParamConstants.RESOURCE_ID_PARAM + "=" + String.valueOf(context.resourceId);
        case ResourceGroup:
            return ParamConstants.GROUP_ID_PARAM + "=" + String.valueOf(context.groupId);
        case AutoGroup:
            return ParamConstants.PARENT_RESOURCE_ID_PARAM + "=" + String.valueOf(context.parentResourceId) + "&"
                + ParamConstants.RESOURCE_TYPE_ID_PARAM + "=" + String.valueOf(context.resourceTypeId);
        default:
            throw new IllegalArgumentException(context.getUnknownContextMessage());
        }
    }
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

     * This legacy struts action expects a "ctype" parameter where the new UI uses "type".
     *
     * @return context fragment of the URL based on the current entity.
     */
    public static String contextFragmentURLForIndicatorsChart() {
        EntityContext context = WebUtility.getEntityContext();
        switch (context.type) {
        case AutoGroup:
            return ParamConstants.PARENT_RESOURCE_ID_PARAM + "=" + String.valueOf(context.parentResourceId) + "&"
                + ParamConstants.CHILD_RESOURCE_TYPE_ID_PARAM + "=" + String.valueOf(context.resourceTypeId);
        default:
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

        int parentResourceId = WebUtility.getOptionalIntRequestParameter(request,
            ParamConstants.PARENT_RESOURCE_ID_PARAM, -1);
        int resourceTypeId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.RESOURCE_TYPE_ID_PARAM,
            -1);

        return new EntityContext(resourceId, groupId, parentResourceId, resourceTypeId);
    }
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

    }

    @Override
    public List<AvailabilityPoint> findAvailabilitiesForResource(Subject subject, int resourceId,
        long fullRangeBeginTime, long fullRangeEndTime, int numberOfPoints, boolean withCurrentAvailability) {
        EntityContext context = new EntityContext(resourceId, -1, -1, -1);
        return getAvailabilitiesForContext(subject, context, fullRangeBeginTime, fullRangeEndTime, numberOfPoints,
            withCurrentAvailability);
    }
View Full Code Here

Examples of org.rhq.core.domain.common.EntityContext

    }

    @Override
    public List<AvailabilityPoint> findAvailabilitiesForResourceGroup(Subject subject, int groupId,
        long fullRangeBeginTime, long fullRangeEndTime, int numberOfPoints, boolean withCurrentAvailability) {
        EntityContext context = new EntityContext(-1, groupId, -1, -1);
        return getAvailabilitiesForContext(subject, context, fullRangeBeginTime, fullRangeEndTime, numberOfPoints,
            withCurrentAvailability);
    }
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.