@SuppressWarnings("rawtypes") public boolean endSession(WBEMClient client,CIMInstance zonesetService,boolean commit) throws WBEMException {
  UnsignedInteger32 result=null;
  try {
    int sessionState=cimIntegerProperty(zonesetService,"SessionState");
    if (sessionState == _notApplicable) {
      return true;
    }
    int endMode=commit ? _ended : _terminated;
    CIMArgument[] inargs=new CIMArgument[]{_cimArgumentFactory.uint16("RequestedSessionState",endMode)};
    result=(UnsignedInteger32)client.invokeMethod(zonesetService.getObjectPath(),"SessionControl",inargs,new CIMArgument[1]);
    _log.info("End session returned code: " + result.intValue());
    return result.intValue() == 0;
  }
 catch (  WBEMException ex) {
    _log.error("Encountered an exception while trying to start a zone session." + ex.getLocalizedMessage());
    throw ex;
  }
}

@ SuppressWarnings ( "rawtypes" ) public boolean endSession ( WBEMClient client , CIMInstance zonesetService , boolean commit ) throws WBEMException { UnsignedInteger32 result = null ; try { int sessionState = cimIntegerProperty ( zonesetService , "SessionState" ) ; if ( sessionState == _notApplicable ) { return true ; } int endMode = commit ? _ended : _terminated ; CIMArgument [ ] inargs = new CIMArgument [ ] { _cimArgumentFactory . uint16 ( "RequestedSessionState" , endMode ) } ; result = ( UnsignedInteger32 ) client . invokeMethod ( zonesetService . getObjectPath ( ) , "SessionControl" , inargs , new CIMArgument [ 1 ] ) ; _log . info ( "End session returned code: " + result . intValue ( ) ) ; return result . intValue ( ) == 0 ; } catch ( WBEMException ex ) { _log . error ( "Encountered an exception while trying to start a zone session." + ex . getLocalizedMessage ( ) ) ; throw ex ; } }
end a session , commit if commit = = true
