org.gcube.common.vremanagement.deployer.impl.operators.common
Class Report

java.lang.Object
  extended by org.gcube.common.vremanagement.deployer.impl.operators.common.Report

public class Report
extends Object

Creates a report of the deployment operations to send to the DLManagement Service

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class Report.PACKAGESTATUS
          possible package status on the report
static class Report.ReportNotFoundException
          ReportNotFoundException exception
static class Report.ReportNotValidException
          ReportNotValidException exception
static class Report.REPORTSTATUS
           
static class Report.TYPE
          report type
 
Field Summary
protected  org.gcube.common.core.utils.logging.GCUBELog logger
          Object logger.
 
Constructor Summary
Report(org.apache.axis.message.addressing.EndpointReferenceType callbackEPR, String callbackID, int numOfPackages, Report.TYPE type, org.gcube.common.core.scope.GCUBEScope callerScope)
          Creates a new empty report
 
Method Summary
 void addPackage(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo deployedpackage, Report.PACKAGESTATUS status, int position, String... message)
          Adds a new package to the report
 void addRI(String riid, org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo pack)
          Adds a new RunningInstance ID to the report
 void close()
          Closes the report
 boolean delete()
           
 org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo getPackageInfo(int i)
          Gets the package information in the given position in the report
 String getPackageStatus(int i)
          Gets the deployment status of the package in the given position in the report
static Report load(String id)
          Loads the deployment report
 void save()
          Saves the report on the local file system
 void send()
          Sends the report to the DLManagement Service
 void updatePackageStatus(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo p, Report.PACKAGESTATUS status, String... message)
          Updates the status of the given package in the report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.gcube.common.core.utils.logging.GCUBELog logger
Object logger.

Constructor Detail

Report

public Report(org.apache.axis.message.addressing.EndpointReferenceType callbackEPR,
              String callbackID,
              int numOfPackages,
              Report.TYPE type,
              org.gcube.common.core.scope.GCUBEScope callerScope)
Creates a new empty report

Parameters:
callbackEPR - the callback EndpointReference where to send the report
callbackID - the session ID for the deployment
numOfPackages - number of packages that compose the report
type - the report type (deploy/undeploy)
Method Detail

addPackage

public void addPackage(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo deployedpackage,
                       Report.PACKAGESTATUS status,
                       int position,
                       String... message)
Adds a new package to the report

Parameters:
deployedpackage - the information about the deployed package
status - the final status of the deployment (started/deployed/failed...)
position - the position in the report

addRI

public void addRI(String riid,
                  org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo pack)
Adds a new RunningInstance ID to the report

Parameters:
riid - the RI identifier
pack - the package info

send

public void send()
          throws IOException
Sends the report to the DLManagement Service

Throws:
IOException - if the generation and/or the sending of the report fails

getPackageInfo

public org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo getPackageInfo(int i)
Gets the package information in the given position in the report

Parameters:
i - the position in the report
Returns:
the package information found at (i) position

getPackageStatus

public String getPackageStatus(int i)
Gets the deployment status of the package in the given position in the report

Parameters:
i - the position in the report
Returns:
the status of the package

close

public void close()
Closes the report


save

public void save()
          throws IOException
Saves the report on the local file system

Throws:
IOException - if the saving fails

delete

public boolean delete()
               throws IOException
Throws:
IOException

load

public static Report load(String id)
                   throws Report.ReportNotFoundException,
                          IOException,
                          Report.ReportNotValidException,
                          Exception
Loads the deployment report

Parameters:
id - the ID of the report to load
Returns:
the report
Throws:
IOException - if the report cannot be loaded
Report.ReportNotValidException - if the string is not a valid report serialization
Exception - if the report is not found
Report.ReportNotFoundException

updatePackageStatus

public void updatePackageStatus(org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo p,
                                Report.PACKAGESTATUS status,
                                String... message)
Updates the status of the given package in the report

Parameters:
p - the package to update
status - the new status
message - the message associated to the new status


Copyright © 2012. All Rights Reserved.