Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
	gradle.properties
  • Loading branch information
marcellom committed May 4, 2016
2 parents fa40f57 + 8940922 commit d43cb43
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
Binary file modified README.md
Binary file not shown.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ allprojects{
compile 'org.springframework.boot:spring-boot-starter-logging:' + springBootVersion

//Openbaton sdk
//compile 'org.openbaton:sdk:1.0.2-SNAPSHOT'
compile 'org.openbaton:monitoring:1.1.0-SNAPSHOT'

compile 'org.openbaton:monitoring:2.0.0'
testCompile 'org.springframework:spring-test:' + springVersion
//Gson
compile 'com.google.code.gson:gson:2.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void receiveNewNsr(String message) {
logger.debug("Received nfvo event with action: " + openbatonEvent.getAction());

boolean isNSRManaged = policyManager.isNSRManaged(openbatonEvent.getPayload().getId());
//Here we consider every instantiatie finish as recovery action finished
//Here we consider every instantiate finish as recovery action finished
recoveryActionFinished();

if (!isNSRManaged)
Expand Down Expand Up @@ -85,7 +85,7 @@ private OpenbatonEvent getOpenbatonEvent(String message) throws NFVORequestorExc
}

private void recoveryActionFinished() {
RecoveryAction recoveryAction = new RecoveryAction(RecoveryActionType.SWITCH_TO_STANDBY,"","");
RecoveryAction recoveryAction = new RecoveryAction();
recoveryAction.setStatus(RecoveryActionStatus.FINISHED);
kieSession.insert(recoveryAction);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public RecoveryAction(RecoveryActionType recoveryActionType, String vnfmEndpoint
this.vimName = vimName;
this.startingTime="";
}
public RecoveryAction(){}

public RecoveryActionStatus getStatus() {
return status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
* Created by mob on 31.01.16.
*/
public interface VNFAlarmRepositoryCustom {
VNFAlarm changeAlarmState(String thresholdId, AlarmState alarmState);
VNFAlarm changeAlarmState(String vnfrId, AlarmState alarmState);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class VNFAlarmRepositoryImpl implements VNFAlarmRepositoryCustom{

@Override
@Transactional
public VNFAlarm changeAlarmState(String thresholdId, AlarmState alarmState) {
VNFAlarm vnfAlarm = vnfAlarmRepository.findFirstByThresholdId(thresholdId);
public VNFAlarm changeAlarmState(String vnfrId, AlarmState alarmState) {
VNFAlarm vnfAlarm = vnfAlarmRepository.findFirstByVnfrId(vnfrId);
if(vnfAlarm!=null){
vnfAlarm.setAlarmState(alarmState);
}
Expand Down
1 change: 1 addition & 0 deletions fault-correlator/src/main/resources/rules/pre_rules.drl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ rule "Create a VNFAlarmStateChangedNotification"
then
String policyId=policyManager.getPolicyIdByThresholdId(currentThresholdId);
String vnfrId = policyManager.getVnfrIdByPolicyId(policyId);
logger.debug("vnfrId : "+vnfrId + " policyId:"+policyId+" alarmState:"+alarmState);
VNFAlarmStateChangedNotification vnfAlarmStateChangedNotification = new VNFAlarmStateChangedNotification(vnfrId,policyId,alarmState);
delete(notification);
insert(vnfAlarmStateChangedNotification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ rule "Get a CRITICAL Virtualized Resource Alarm and switch to standby"
logger.info("Switch to standby fired!");
highAvailabilityManager.switchToRedundantVNFC(failedVnfcInstance,vnfr,vdu);

RecoveryAction recoveryAction= new RecoveryAction(RecoveryActionType.SWITCH_TO_STANDBY,vnfr.getEndpoint(), "" );
RecoveryAction recoveryAction= new RecoveryAction(RecoveryActionType.SWITCH_TO_STANDBY,vnfr.getEndpoint(),"");
recoveryAction.setStatus(RecoveryActionStatus.IN_PROGRESS);
logger.debug("Recovery action in progress! :"+recoveryAction);
insert(recoveryAction);
Expand All @@ -79,9 +79,9 @@ end
rule "A VR alarm is cleared"
when
VirtualizedResourceAlarmStateChangedNotification( currentThresholdId : triggerId, alarmState == AlarmState.CLEARED )
updatedVrAlarm : VRAlarm() from vrAlarmRepository.changeAlarmState( currentThresholdId , AlarmState.CLEARED )
then
VRAlarm vrAlarm = vrAlarmRepository.changeAlarmState(currentThresholdId,AlarmState.CLEARED);
logger.debug("\tThis vr alarm is cleared :" + vrAlarm);
logger.debug("\tThis vr alarm is cleared :" + updatedVrAlarm);
Iterable<VRAlarm> alarms = vrAlarmRepository.findAll();
logger.debug("Current VR alarms:"+alarms);
end
Expand Down Expand Up @@ -122,9 +122,9 @@ end
rule "A VNF alarm is cleared"

when
VNFAlarmStateChangedNotification( resourceId : resourceId, alarmState == AlarmState.CLEARED )
VNFAlarmStateChangedNotification( $vnfrId : resourceId, alarmState == AlarmState.CLEARED )
then
VNFAlarm vnfAlarm = vnfAlarmRepository.changeAlarmState(resourceId,AlarmState.CLEARED);
VNFAlarm vnfAlarm = vnfAlarmRepository.changeAlarmState($vnfrId,AlarmState.CLEARED);
logger.info("\tThis VNF alarm is cleared :" + vnfAlarm);
Iterable<VNFAlarm> alarms = vnfAlarmRepository.findAll();
logger.debug("Current VNF alarms:"+alarms);
Expand All @@ -133,11 +133,11 @@ end
rule "A VNF alarm is updated"

when
vascn : VNFAlarmStateChangedNotification( resourceId :resourceId, alarmState == AlarmState.UPDATED )
vnfAlarmUpdated : VNFAlarm( perceivedSeverity == PerceivedSeverity.CRITICAL, vnfcIds : vnfcIds ) from vnfAlarmRepository.findFirstByThresholdId(resourceId)
vascn : VNFAlarmStateChangedNotification( $vnfrId : resourceId, alarmState == AlarmState.UPDATED )
vnfAlarmUpdated : VNFAlarm( perceivedSeverity == PerceivedSeverity.CRITICAL, vnfcIds : vnfcIds ) from vnfAlarmRepository.findFirstByVnfrId($vnfrId)
vnfcId : String() from vnfcIds
then
logger.info("\tThis VNF alarm is updated :" + vnfAlarmRepository.changeAlarmState(resourceId,AlarmState.UPDATED));
logger.info("\tThis VNF alarm is updated :" + vnfAlarmRepository.changeAlarmState( $vnfrId, AlarmState.UPDATED));

VirtualNetworkFunctionRecord vnfr = nfvoRequestorWrapper.getVirtualNetworkFunctionRecord(vnfAlarmUpdated.getVnfrId());
VNFCInstance vnfcInstance = nfvoRequestorWrapper.getVNFCInstanceById(vnfcId);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# limitations under the License.
#

version=1.0.0-SNAPSHOT
version=1.0.1
group=org.openbaton

0 comments on commit d43cb43

Please sign in to comment.