当前位置: 首页>>代码示例>>Java>>正文


Java ILogger类代码示例

本文整理汇总了Java中com.onedrive.sdk.logger.ILogger的典型用法代码示例。如果您正苦于以下问题:Java ILogger类的具体用法?Java ILogger怎么用?Java ILogger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ILogger类属于com.onedrive.sdk.logger包,在下文中一共展示了ILogger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Initializes the authenticator.
 * @param executors The executors to schedule foreground and background tasks.
 * @param httpProvider The http provider for sending requests.
 * @param activity The activity to create interactive UI on.
 * @param logger The logger for diagnostic information.
 */
@Override
public synchronized void init(final IExecutors executors,
                              final IHttpProvider httpProvider,
                              final Activity activity,
                              final ILogger logger) {
    mActivity = activity;

    if (mInitialized) {
        return;
    }

    mExecutors = executors;
    mLogger = logger;
    mInitialized = true;
    mAuthClient = new LiveAuthClient(mContext, getClientId(), Arrays.asList(getScopes()));

    final SharedPreferences prefs = getSharedPreferences();
    mUserId.set(prefs.getString(USER_ID_KEY, null));
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:27,代码来源:MyMSAAuthenticator.java

示例2: generateResult

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Generate the async operation result based on server response.
 *
 * @param request    The http request.
 * @param connection The http connection.
 * @param serializer The serializer.
 * @param logger     The logger.
 * @return The async operation status.
 * @throws Exception An exception occurs if the request was unable to complete for any reason.
 */
@Override
public AsyncOperationStatus generateResult(final IHttpRequest request,
                                           final IConnection connection,
                                           final ISerializer serializer,
                                           final ILogger logger)
        throws Exception {
    if (connection.getResponseCode() == HttpResponseCode.HTTP_SEE_OTHER) {
        logger.logDebug("Item copy job has completed.");
        return AsyncOperationStatus.createdCompleted(connection.getHeaders().get("Location"));
    }

    InputStream in = null;

    try {
        in = new BufferedInputStream(connection.getInputStream());
        final AsyncOperationStatus result = serializer.deserializeObject(
                DefaultHttpProvider.streamToString(in), AsyncOperationStatus.class);
        result.seeOther = connection.getHeaders().get("Location");
        return result;
    } finally {
        if (in != null) {
            in.close();
        }
    }
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:36,代码来源:AsyncMonitorResponseHandler.java

示例3: init

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Initializes the authenticator.
 * @param executors The executors to schedule foreground and background tasks.
 * @param httpProvider The http provider for sending requests.
 * @param activity The activity to create interactive UI on.
 * @param logger The logger for diagnostic information.
 */
@Override
public synchronized void init(final IExecutors executors,
                 final IHttpProvider httpProvider,
                 final Activity activity,
                 final ILogger logger) {
    if (mInitialized) {
        return;
    }

    mExecutors = executors;
    mActivity = activity;
    mLogger = logger;
    mInitialized = true;
    mAuthClient = new LiveAuthClient(activity, getClientId(), Arrays.asList(getScopes()));

    final SharedPreferences prefs = getSharedPreferences();
    mUserId.set(prefs.getString(USER_ID_KEY, null));
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:26,代码来源:MSAAuthenticator.java

示例4: init

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Initializes the authenticator.
 * @param executors The executors to schedule foreground and background tasks.
 * @param httpProvider The http provider for sending requests.
 * @param activity The activity to create interactive UI on.
 * @param logger The logger for diagnostic information.
 */
@Override
public synchronized void init(final IExecutors executors,
                              final IHttpProvider httpProvider,
                              final Activity activity,
                              final ILogger logger) {
    if (mInitialized) {
        return;
    }

    mExecutors = executors;
    mActivity = activity;
    mLogger = logger;
    mLogger.logDebug("Initializing MSA and ADAL authenticators");
    mMSAAuthenticator.init(executors, httpProvider, activity, logger);
    mADALAuthenticator.init(executors, httpProvider, activity, logger);
    mInitialized = true;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:25,代码来源:DisambiguationAuthenticator.java

示例5: MyMSAAccountInfo

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates an MSAAccountInfo object.
 * @param authenticator The authenticator that this account info was created from.
 * @param liveConnectSession The session this account is based off of.
 * @param logger The logger.
 */
public MyMSAAccountInfo(final MyMSAAuthenticator authenticator,
                      final LiveConnectSession liveConnectSession,
                      final ILogger logger) {
    mAuthenticator = authenticator;
    mSession = liveConnectSession;
    mLogger = logger;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:14,代码来源:MyMSAAccountInfo.java

示例6: DisambiguationRequest

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates the disambiguation request.
 * @param activity The context to show the UI in.
 * @param callback The callback when the request has completed.
 * @param logger The logger.
 */
public DisambiguationRequest(final Activity activity,
                             final ICallback<DisambiguationResponse> callback,
                             final ILogger logger) {
    mActivity = activity;
    mCallback = callback;
    mLogger = logger;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:14,代码来源:DisambiguationRequest.java

示例7: ADALAccountInfo

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates an ADALAccountInfo object.
 * @param authenticator The authenticator that this account info was created from.
 * @param authenticationResult The authentication result for this account.
 * @param oneDriveServiceInfo The service info for OneDrive.
 * @param logger The logger
 */
public ADALAccountInfo(final ADALAuthenticator authenticator,
                       final AuthenticationResult authenticationResult,
                       final ServiceInfo oneDriveServiceInfo,
                       final ILogger logger) {
    mAuthenticator = authenticator;
    mAuthenticationResult = authenticationResult;
    mOneDriveServiceInfo = oneDriveServiceInfo;
    mLogger = logger;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:17,代码来源:ADALAccountInfo.java

示例8: MSAAccountInfo

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates an MSAAccountInfo object.
 * @param authenticator The authenticator that this account info was created from.
 * @param liveConnectSession The session this account is based off of.
 * @param logger The logger.
 */
public MSAAccountInfo(final MSAAuthenticator authenticator,
                      final LiveConnectSession liveConnectSession,
                      final ILogger logger) {
    mAuthenticator = authenticator;
    mSession = liveConnectSession;
    mLogger = logger;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:14,代码来源:MSAAccountInfo.java

示例9: DefaultHttpProvider

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates the DefaultHttpProvider.
 * @param serializer The serializer.
 * @param requestInterceptor The request interceptor.
 * @param executors The executors.
 * @param logger The logger for diagnostic information.
 */
public DefaultHttpProvider(final ISerializer serializer,
                           final IRequestInterceptor requestInterceptor,
                           final IExecutors executors,
                           final ILogger logger) {
    mSerializer = serializer;
    mRequestInterceptor = requestInterceptor;
    mExecutors = executors;
    mLogger = logger;
    mConnectionFactory = new DefaultConnectionFactory();
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:18,代码来源:DefaultHttpProvider.java

示例10: getLogger

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Gets the logger.
 * @return The logger.
 */
public ILogger getLogger() {
    if (mLogger == null) {
        mLogger = new DefaultLogger();
        mLogger.logDebug("Created DefaultLogger");
    }
    return mLogger;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:12,代码来源:DefaultClientConfig.java

示例11: generateResult

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Generate the chunked upload response result.
 *
 * @param request    The http request.
 * @param connection The http connection.
 * @param serializer The serializer.
 * @param logger     The system logger.
 * @return The chunked upload result which could be upload session/uploaded item or error.
 * @throws Exception An exception occurs if the request was unable to complete for any reason.
 */
@Override
public ChunkedUploadResult generateResult(
        final IHttpRequest request,
        final IConnection connection,
        final ISerializer serializer,
        final ILogger logger) throws Exception {
    InputStream in = null;

    try {
        if (connection.getResponseCode() == HttpResponseCode.HTTP_ACCEPTED) {
            logger.logDebug("Chunk bytes has been accepted by the server.");
            in = new BufferedInputStream(connection.getInputStream());
            final UploadSession seesion = serializer.deserializeObject(
                    DefaultHttpProvider.streamToString(in), UploadSession.class);

            return new ChunkedUploadResult(seesion);

        } else if (connection.getResponseCode() == HttpResponseCode.HTTP_CREATED
                || connection.getResponseCode() == HttpResponseCode.HTTP_OK) {
            logger.logDebug("Upload session is completed, uploaded item returned.");
            in = new BufferedInputStream(connection.getInputStream());
            String rawJson = DefaultHttpProvider.streamToString(in);
            UploadType uploadedItem = serializer.deserializeObject(rawJson,
                                                                   this.mDeserializeTypeClass);

            return new ChunkedUploadResult(uploadedItem);
        } else if (connection.getResponseCode() >= HttpResponseCode.HTTP_CLIENT_ERROR) {
            logger.logDebug("Receiving error during upload, see detail on result error");

            return new ChunkedUploadResult(
                    OneDriveServiceException.createFromConnection(request, null, serializer,
                                                                  connection));
        }
    } finally {
        if (in != null) {
            in.close();
        }
    }

    return null;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:52,代码来源:ChunkedUploadResponseHandler.java

示例12: DefaultExecutors

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates a new instance of the DefaultExecutors.
 * @param logger The logger.
 */
public DefaultExecutors(final ILogger logger) {
    mLogger = logger;
    mBackgroundExecutor = (ThreadPoolExecutor)Executors.newCachedThreadPool();
    mForegroundExecutor = new SynchronousExecutor();
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:10,代码来源:DefaultExecutors.java

示例13: init

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Initializes the authenticator.
 * @param executors The executors to schedule foreground and background tasks.
 * @param httpProvider The http provider for sending requests.
 * @param activity The activity to create interactive UI on.
 * @param logger The logger for diagnostic information.
 */
@Override
public synchronized void init(final IExecutors executors,
                              final IHttpProvider httpProvider,
                              final Activity activity,
                              final ILogger logger) {
    if (mInitialized) {
        return;
    }

    mExecutors = executors;
    mHttpProvider = httpProvider;
    mActivity = activity;
    mLogger = logger;

    final BrokerPermissionsChecker brokerPermissionsChecker = new BrokerPermissionsChecker(mActivity, mLogger);
    brokerPermissionsChecker.check();

    try {
        mAdalContext = new AuthenticationContext(activity,
                                                LOGIN_AUTHORITY,
                                                VALIDATE_AUTHORITY);
    } catch (final NoSuchAlgorithmException | NoSuchPaddingException e) {
        final ClientAuthenticatorException exception = new ClientAuthenticatorException(
            "Unable to access required cryptographic libraries for ADAL",
            e,
            OneDriveErrorCodes.AuthenticationFailure);
        mLogger.logError("Problem creating the AuthenticationContext for ADAL", exception);
        throw exception;
    }

    final SharedPreferences prefs = getSharedPreferences();
    mUserId.set(prefs.getString(USER_ID_KEY, null));
    mResourceUrl.set(prefs.getString(RESOURCE_URL_KEY, null));

    final String serviceInfoAsString = prefs.getString(SERVICE_INFO_KEY, null);
    ServiceInfo serviceInfo = null;
    try {
        if (serviceInfoAsString != null) {
            serviceInfo = mHttpProvider.getSerializer()
                              .deserializeObject(serviceInfoAsString, ServiceInfo.class);
        }
    } catch (final Exception ex) {
        mLogger.logError("Unable to parse serviceInfo from saved preferences", ex);
    }
    mOneDriveServiceInfo.set(serviceInfo);
    mInitialized = true;

    // If there is incomplete information about the account, clear everything so
    // the application is in a known state.
    if (mUserId.get() != null || mResourceUrl.get() != null || mOneDriveServiceInfo.get() != null) {
        mLogger.logDebug("Found existing login information");
        if (mUserId.get() == null || mResourceUrl.get() == null || mOneDriveServiceInfo.get() == null) {
            mLogger.logDebug("Existing login information was incompletely, flushing sign in state");
            this.logout();
        }
    }
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:65,代码来源:ADALAuthenticator.java

示例14: DefaultSerializer

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
/**
 * Creates a DefaultSerializer.
 * @param logger The logger.
 */
public DefaultSerializer(final ILogger logger) {
    mLogger = logger;
    mGson = GsonFactory.getGsonInstance(logger);
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:9,代码来源:DefaultSerializer.java

示例15: getLogger

import com.onedrive.sdk.logger.ILogger; //导入依赖的package包/类
@Override
public ILogger getLogger() {
    return mLogger;
}
 
开发者ID:OneDrive,项目名称:onedrive-sdk-android,代码行数:5,代码来源:MockClient.java


注:本文中的com.onedrive.sdk.logger.ILogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。