Search in sources :

Example 1 with ManagedOperationParameters

use of org.apache.cxf.management.annotation.ManagedOperationParameters in project cxf by apache.

the class ManagedRMEndpoint method terminateDestinationSequence.

@ManagedOperation(description = "Terminate Destination Sequence")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public void terminateDestinationSequence(String sid) throws JMException {
    DestinationSequence ds = getDestinationSeq(sid);
    if (null == ds) {
        throw new JMException("no destination sequence");
    }
    Proxy proxy = endpoint.getProxy();
    try {
        proxy.terminate(ds);
        ds.getDestination().removeSequence(ds);
    } catch (RMException e) {
        throw new JMException("Error terminating sequence: " + e.getMessage());
    }
}
Also used : JMException(javax.management.JMException) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters) ManagedOperation(org.apache.cxf.management.annotation.ManagedOperation)

Example 2 with ManagedOperationParameters

use of org.apache.cxf.management.annotation.ManagedOperationParameters in project cxf by apache.

the class ManagedRMEndpoint method terminateSourceSequence.

@ManagedOperation(description = "Terminate Source Sequence")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public void terminateSourceSequence(String sid) throws JMException {
    SourceSequence ss = getSourceSeq(sid);
    if (null == ss) {
        throw new JMException("no source sequence");
    }
    Proxy proxy = endpoint.getProxy();
    try {
        proxy.terminate(ss);
        ss.getSource().removeSequence(ss);
    } catch (RMException e) {
        throw new JMException("Error terminating sequence: " + e.getMessage());
    }
}
Also used : JMException(javax.management.JMException) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters) ManagedOperation(org.apache.cxf.management.annotation.ManagedOperation)

Example 3 with ManagedOperationParameters

use of org.apache.cxf.management.annotation.ManagedOperationParameters in project cxf by apache.

the class ModelMBeanAssembler method getManagedOperationParameters.

public ManagedOperationParameter[] getManagedOperationParameters(Method method) {
    ManagedOperationParameters params = method.getAnnotation(ManagedOperationParameters.class);
    ManagedOperationParameter[] result = null;
    if (params == null) {
        result = new ManagedOperationParameter[0];
    } else {
        result = params.value();
    }
    return result;
}
Also used : ManagedOperationParameter(org.apache.cxf.management.annotation.ManagedOperationParameter) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters)

Example 4 with ManagedOperationParameters

use of org.apache.cxf.management.annotation.ManagedOperationParameters in project cxf by apache.

the class ManagedRMEndpoint method getSourceSequenceAcknowledgedRange.

@ManagedOperation(description = "Source Sequence Acknowledged Range")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public Long[] getSourceSequenceAcknowledgedRange(String sid) {
    SourceSequence ss = getSourceSeq(sid);
    if (null == ss) {
        throw new IllegalArgumentException("no sequence");
    }
    List<Long> list = new ArrayList<>();
    for (AcknowledgementRange r : ss.getAcknowledgement().getAcknowledgementRange()) {
        list.add(r.getLower());
        list.add(r.getUpper());
    }
    return list.toArray(new Long[list.size()]);
}
Also used : ArrayList(java.util.ArrayList) AcknowledgementRange(org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters) ManagedOperation(org.apache.cxf.management.annotation.ManagedOperation)

Example 5 with ManagedOperationParameters

use of org.apache.cxf.management.annotation.ManagedOperationParameters in project cxf by apache.

the class ManagedRMEndpoint method getDestinationSequenceAcknowledgedRange.

@ManagedOperation(description = "Destination Sequence Acknowledged Range")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public Long[] getDestinationSequenceAcknowledgedRange(String sid) {
    DestinationSequence ds = getDestinationSeq(sid);
    if (null == ds) {
        throw new IllegalArgumentException("no sequence");
    }
    List<Long> list = new ArrayList<>();
    for (AcknowledgementRange r : ds.getAcknowledgment().getAcknowledgementRange()) {
        list.add(r.getLower());
        list.add(r.getUpper());
    }
    return list.toArray(new Long[list.size()]);
}
Also used : ArrayList(java.util.ArrayList) AcknowledgementRange(org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange) ManagedOperationParameters(org.apache.cxf.management.annotation.ManagedOperationParameters) ManagedOperation(org.apache.cxf.management.annotation.ManagedOperation)

Aggregations

ManagedOperationParameters (org.apache.cxf.management.annotation.ManagedOperationParameters)6 ManagedOperation (org.apache.cxf.management.annotation.ManagedOperation)5 JMException (javax.management.JMException)3 ArrayList (java.util.ArrayList)2 AcknowledgementRange (org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement.AcknowledgementRange)2 ManagedOperationParameter (org.apache.cxf.management.annotation.ManagedOperationParameter)1