Examples of SLA


Examples of org.rioproject.sla.SLA

            return lowerBreachNotification;
        }

        public void notify(RemoteServiceEvent event) {
            SLAThresholdEvent slaEvent = (SLAThresholdEvent)event;
            SLA sla = slaEvent.getSLA();
            Calculable c = slaEvent.getCalculable();
            String type = slaEvent.getThresholdType().name();
            System.out.println(type+" current: "+c.getValue()+", low: " + sla.getLowThreshold() + ", high: " + sla.getHighThreshold());
            if(slaEvent.getThresholdType()== ThresholdType.BREACHED) {
                if(c.getValue()>sla.getHighThreshold())
                    upperBreachNotification = true;
                if(c.getValue()<sla.getLowThreshold())
                    lowerBreachNotification = true;
            }
        }
View Full Code Here

Examples of org.rioproject.sla.SLA

    }

    @Override
    public String getDescription() {
        StringBuilder builder = new StringBuilder();
        SLA sla = getEvent().getSLA();
        builder.append(getEvent().getServiceElement().getName()).append(" on ");
        builder.append(getEvent().getHostAddress()).append(" SLA ");
        builder.append("\"").append(sla.getIdentifier()).append("\"").append(" ");
        builder.append(getStatus().toLowerCase()).append(", ");
        builder.append("value: ");
        double value = getEvent().getCalculable().getValue();
        if(value<1)
            builder.append(formatPercent(value));
View Full Code Here

Examples of org.rioproject.sla.SLA

     */
    public static void setThreadDeadlockDetector(ServiceElement sElem, MBeanServerConnection mbsc) {
        WatchDescriptor threadDeadlockDesc = getWatchDescriptor(sElem, ThreadDeadlockMonitor.ID);

        if(threadDeadlockDesc == null) {
            SLA sla = new SLA(ThreadDeadlockMonitor.ID, 0, 1);
            sla.setSlaPolicyHandler(SLAPolicyHandler.class.getName());
            threadDeadlockDesc = ThreadDeadlockMonitor.getWatchDescriptor();
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
            sla.setWatchDescriptors(threadDeadlockDesc);
            sElem.getServiceLevelAgreements().addServiceSLA(sla);
        } else {
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
        }
    }
View Full Code Here

Examples of org.rioproject.sla.SLA

            double[] range = new double[]{
                thresholdValues.getCurrentLowThreshold(),
                thresholdValues.getCurrentHighThreshold()
            };

            SLA sla = new SLA(calculable.getId(), range);
            try {
                ServiceBeanInstance instance = makeServiceBeanInstance();
                SLAThresholdEvent event = new SLAThresholdEvent(proxy,
                                                                context.getServiceElement(),
                                                                instance,
View Full Code Here

Examples of org.rioproject.sla.SLA

        try {
            double[] range = new double[]{thresholdValues.getCurrentLowThreshold(),
                                          thresholdValues.getCurrentHighThreshold()};

            SLA sla = new SLA(calculable.getId(), range);
            SLAThresholdEvent event = new SLAThresholdEvent(instance.getService(),
                                                            serviceElement,
                                                            instance,
                                                            calculable,
                                                            sla,
View Full Code Here

Examples of org.rioproject.sla.SLA

        List<Resource> resources = new ArrayList<Resource>();
        InputStream is = null;
        for (ServiceHandle sh : serviceHandles) {
            for (Map.Entry<String, SLA> entry : sh.getSLAMap().entrySet()) {
                String watchID = entry.getKey();
                SLA sla = entry.getValue();
                try {
                    if (asFile) {
                        is = new FileInputStream(rule);
                    } else {
                        is = this.getClass().getClassLoader().getResourceAsStream(rule);
View Full Code Here

Examples of org.wso2.carbon.governance.api.sla.dataobjects.SLA

     * @return the artifact added.
     * @throws GovernanceException if the operation failed.
     */
    public SLA newSLA(QName qName) throws GovernanceException {
        String slaId = UUID.randomUUID().toString();
        SLA sla = new SLA(slaId, qName);
        sla.associateRegistry(registry);
        return sla;
    }
View Full Code Here

Examples of org.wso2.carbon.governance.api.sla.dataobjects.SLA

     * @return the artifact added.
     * @throws GovernanceException if the operation failed.
     */
    public SLA newSLA(OMElement content) throws GovernanceException {
        String slaId = UUID.randomUUID().toString();
        SLA sla = new SLA(slaId, content);
        sla.associateRegistry(registry);
        return sla;
    }
View Full Code Here

Examples of org.wso2.carbon.governance.api.sla.dataobjects.SLA

     */
    public void updateSLA(SLA sla) throws GovernanceException {
        boolean succeeded = false;
        try {
            registry.beginTransaction();
            SLA oldSLA = getSLA(sla.getId());
            // first check for the old sla and remove it.
            if (oldSLA != null) {
                QName oldQname = oldSLA.getQName();
                if (!oldQname.equals(sla.getQName())) {
                    // then it is analogue to moving the resource for the new location
                    String oldPath = oldSLA.getPath();
                    // so just delete the old path
                    registry.delete(oldPath);
                }
            }
            addSLA(sla);
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.