Skip to content

Commit

Permalink
Initialize sharingDate of Federated Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
vthglyk committed Apr 26, 2018
1 parent 1d214f8 commit c0bba37
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,19 @@ public void clearPrivateInfo() {
}

public void shareToNewFederation(String federationId, Boolean barteringStatus) {
ResourceSharingInformation resourceSharingInformation = new ResourceSharingInformation();
resourceSharingInformation.setBartering(barteringStatus);

if (cloudResource.getFederationInfo().getSharingInformation().get(federationId) != null &&
cloudResource.getFederationInfo().getSharingInformation().get(federationId).getSharingDate() != null)
resourceSharingInformation.setSharingDate(cloudResource.getFederationInfo().getSharingInformation().get(federationId).getSharingDate());
shareToNewFederation(federationId, barteringStatus,
cloudResource.getFederationInfo().getSharingInformation().get(federationId).getSharingDate());
else
resourceSharingInformation.setSharingDate(new Date());
shareToNewFederation(federationId, barteringStatus, new Date());

}

public void shareToNewFederation(String federationId, Boolean barteringStatus, Date sharingDate) {
ResourceSharingInformation resourceSharingInformation = new ResourceSharingInformation();
resourceSharingInformation.setBartering(barteringStatus);
resourceSharingInformation.setSharingDate(sharingDate);

cloudResource.getFederationInfo().getSharingInformation().put(federationId, resourceSharingInformation);

Expand Down

0 comments on commit c0bba37

Please sign in to comment.