protected override void ProcessRecord()
{
// first make sure to reset existing data
ConnectionParameters = null;
SetCmisSession(null);
// set the connection parameters
if (Parameters == null)
{
ConnectionParameters = ConnectionFactory.CreateAtomPubParams(Url, UserName, Password);
}
else
{
ConnectionParameters = Utilities.HashtableToStringDict(Parameters);
}
// check if insecure SSLs should be used anyway
if (Insecure)
{
// TODO: improve unsecure SLL handling
ServicePointManager.ServerCertificateValidationCallback +=
_acceptInsecureSSLCallback;
}
else
{
ServicePointManager.ServerCertificateValidationCallback -=
_acceptInsecureSSLCallback;
}
// check if we should directly connect to a specified repository
if (!String.IsNullOrEmpty(Repository))
{
// either by optional name
SetCmisSession(ConnectionFactory.Connect(ConnectionParameters, Repository));
}
else if (ConnectionParameters.ContainsKey(SessionParameter.RepositoryId))
{
// or by provided parameters
SetCmisSession(ConnectionFactory.Connect(ConnectionParameters));
}
}
}