use of com.vmware.vim.vasa._1_0.data.xsd.MountInfo in project coprhd-controller by CoprHD.
the class ContextManagerImpl method setContext.
/**
* vasaService interface
*/
@Override
public VasaProviderInfo setContext(UsageContext uc) throws InvalidArgument, InvalidSession, StorageFault {
final String methodName = "setContext(): ";
log.debug(methodName + "Entry");
if (log.isDebugEnabled()) {
HostInitiatorInfo[] hostInitiators = uc.getHostInitiator();
if (hostInitiators != null && hostInitiators.length > 0) {
log.debug(methodName + "list of host initiators (HBA):");
for (HostInitiatorInfo initiator : hostInitiators) {
log.debug(methodName + "id[" + initiator.getUniqueIdentifier() + "] iSCSIId[" + initiator.getIscsiIdentifier() + "] nodeWWN[" + initiator.getNodeWwn() + "] portWWN[" + initiator.getPortWwn() + "]");
}
}
String[] iscsiIpAddresseses = uc.getIscsiInitiatorIpAddress();
if (iscsiIpAddresseses != null) {
log.debug(methodName + "list of iSCSI initiator IP addresses:");
log.debug(methodName + Arrays.asList(iscsiIpAddresseses));
}
MountInfo[] mountPoints = uc.getMountPoint();
if (mountPoints != null && mountPoints.length > 0) {
log.debug(methodName + "List of file share mount paths:");
for (MountInfo mountPoint : mountPoints) {
log.debug(methodName + "filePath[" + mountPoint.getFilePath() + "] serverName[" + mountPoint.getServerName() + "]");
}
}
log.debug(methodName + "vSphere service instance Id[" + uc.getVcGuid() + "]");
}
String clientAddress = "unknown";
try {
// _sslUtil.checkForUniqueVASASessionId();
SessionContext sc = null;
clientAddress = _sslUtil.checkHttpRequest(true, false);
// Tear down any existing session
log.debug(methodName + "Tear down any existing session");
invalidateSession();
// Create new session.
sc = SessionContext.createSession(uc, clientAddress);
log.trace(methodName + "Created a new session: " + sc.getSessionId());
sc.setSosManager(_sosManager);
log.trace(methodName + "SOS manager is set in session context: " + sc.getSessionId());
_vpInfo.setSessionId(sc.getSessionId());
_sslUtil.setHttpResponse(sc);
log.debug(methodName + "Exit returning VasaProviderInfo with new session Id[" + _vpInfo.getSessionId() + "]");
return _vpInfo;
} catch (StorageFault sf) {
log.error(methodName + " unknown exception occured", sf);
throw sf;
} catch (InvalidSession is) {
log.error(methodName + "Invalid session exception", is);
throw is;
} catch (Exception e) {
log.error("unknown exception occured", e);
throw FaultUtil.StorageFault("runtime ", e);
}
}
use of com.vmware.vim.vasa._1_0.data.xsd.MountInfo in project coprhd-controller by CoprHD.
the class SOSManager method getMountPathsFromUsageContext.
public List<String> getMountPathsFromUsageContext() throws InvalidSession, StorageFault {
final String methodName = "getMountPathsFromUsageContext(): ";
log.debug(methodName + "Entry");
Set<String> mountPathList = new HashSet<String>();
UsageContext uc = this.getUsageContext();
MountInfo[] mountPoints = uc.getMountPoint();
if (!Util.isEmpty(mountPoints)) {
for (MountInfo eachMountPointInfo : mountPoints) {
String filePath = eachMountPointInfo.getFilePath();
if (!Util.isEmpty(filePath)) {
mountPathList.add(filePath);
}
}
}
log.debug(methodName + "Exit returning [" + mountPathList + "]");
return new ArrayList<String>(mountPathList);
}
Aggregations