irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsSubStructFileUnlink.cpp
Go to the documentation of this file.
1 
3 #include "subStructFileUnlink.h"
4 #include "miscServerFunct.hpp"
5 #include "dataObjOpr.hpp"
7 
9 
10 
11 int
14  int remoteFlag;
15  int status;
16 
17  remoteFlag = resolveHost( &subFile->addr, &rodsServerHost );
18 
19  if ( remoteFlag == LOCAL_HOST ) {
20  status = _rsSubStructFileUnlink( rsComm, subFile );
21  }
22  else if ( remoteFlag == REMOTE_HOST ) {
23  status = remoteSubStructFileUnlink( rsComm, subFile, rodsServerHost );
24  }
25  else {
26  if ( remoteFlag < 0 ) {
27  return remoteFlag;
28  }
29  else {
31  "rsSubStructFileUnlink: resolveHost returned unrecognized value %d",
32  remoteFlag );
34  }
35  }
36 
37  return status;
38 }
39 
40 int
43  int status;
44 
45  if ( rodsServerHost == NULL ) {
47  "remoteSubStructFileUnlink: Invalid rodsServerHost" );
49  }
50 
51  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
52  return status;
53  }
54 
56 
57  if ( status < 0 ) {
59  "remoteSubStructFileUnlink: rcSubStructFileUnlink failed for %s, status = %d",
60  subFile->subFilePath, status );
61  }
62 
63  return status;
64 }
65 
67  subFile_t* _sub_file ) {
68  // =-=-=-=-=-=-=-
69  // create first class structured object
72  *_sub_file ) );
73  struct_obj->comm( _comm );
74  struct_obj->resc_hier( _sub_file->specColl->rescHier );
75 
76  // =-=-=-=-=-=-=-
77  // call abstrcated interface to unlink
78  irods::error unlink_err = fileUnlink( _comm, struct_obj );
79  if ( !unlink_err.ok() ) {
80  std::stringstream msg;
81  msg << "failed on call to fileUnlink for [";
82  msg << struct_obj->physical_path();
83  msg << "]";
84  irods::log( PASSMSG( msg.str(), unlink_err ) );
85  return unlink_err.code();
86 
87  }
88  else {
89  return unlink_err.code();
90 
91  }
92 
93 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
Subfile
Definition: objInfo.h:316
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
Subfile::subFilePath
char subFilePath[(1024+64)]
Definition: objInfo.h:318
fileUnlink
irods::error fileUnlink(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:177
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
rcSubStructFileUnlink
int rcSubStructFileUnlink(rcComm_t *conn, subFile_t *subFile)
Definition: rcSubStructFileUnlink.cpp:23
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
Subfile::specColl
specColl_t * specColl
Definition: objInfo.h:322
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods::structured_object
Definition: irods_structured_object.hpp:15
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
Subfile::addr
rodsHostAddr_t addr
Definition: objInfo.h:317
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
SpecColl::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:84
irods::log
void log(const error &)
Definition: irods_log.cpp:13
irods::structured_object_ptr
boost::shared_ptr< structured_object > structured_object_ptr
Definition: irods_structured_object.hpp:107
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
rodsServerHost
Definition: rodsConnect.h:62
irods_structured_object.hpp
dataObjOpr.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375