Commits

David Carr  committed d1442c5

docs: tweak windows-provider javadocs

  • Participants
  • Parent commits f86aa5e

Comments (0)

Files changed (7)

File windows-provider/build.gradle

         systemProperty "managed.${it}", System.getProperty("managed.${it}")
     }
 }
+
+javadoc {
+    title "AuthC4J Windows Provider ${version}"
+    options.links "http://docs.oracle.com/javase/7/docs/api/"
+}
+
+uploadArchives.repositories.mavenDeployer {
+    pom {
+        project {
+            name "windows-provider"
+            description "AuthC4J Windows Provider"
+        }
+    }
+}

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/ActiveDirectoryUserInformationSource.java

 import java.util.LinkedHashSet;
 import java.util.Set;
 
+/**
+ * A {@link us.carrclan.david.authc4j.api.UserInformationSource} implementation that provides access to Active Directory
+ * users and groups.
+ */
 public class ActiveDirectoryUserInformationSource extends WindowsUserInformationSource {
     private String serverName;
 
         return collector.getUserInformationSet();
     }
 
+    /**
+     * Returns {@code true} if the current platform is Windows and the machine is a member of a domain.
+     */
     @Override
     public boolean isAvailable() {
         return super.isAvailable() && isMachineDomainMember();
     }
 
     @Override
-    protected void afterInitialize(IWindowsAuthProvider provider) {
+    void afterInitialize(IWindowsAuthProvider provider) {
         serverName = provider.getCurrentComputer().getMemberOf();
     }
 

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/LocalWindowsUserInformationSource.java

 import java.util.LinkedHashSet;
 import java.util.Set;
 
+/**
+ * A {@link us.carrclan.david.authc4j.api.UserInformationSource} implementation that provides access to local Windows
+ * users and groups.
+ */
 public class LocalWindowsUserInformationSource extends WindowsUserInformationSource {
     @Override
     public UserInformation authenticate(String principal, Password password) {

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/USER_INFO_10.java

  * The USER_INFO_10 structure contains information about a user account, including the account name, comments associated
  * with the account, and the user's full name.
  */
-public class USER_INFO_10 extends Structure {
+class USER_INFO_10 extends Structure {
     // TODO: remove this when JNA 3.5.2 is released
     // https://github.com/twall/jna/pull/178
 

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/UserWithLocalGroupInformationCollector.java

 import java.util.LinkedHashSet;
 import java.util.Set;
 
-public class UserWithLocalGroupInformationCollector extends UserInformationCollector {
+class UserWithLocalGroupInformationCollector extends UserInformationCollector {
     UserWithLocalGroupInformationCollector(UserInformationSource source) {
         super(source);
     }

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/WindowsUserInformationSource.java

 import java.util.LinkedHashSet;
 import java.util.Set;
 
-public abstract class WindowsUserInformationSource extends AbstractUserInformationSource {
+abstract class WindowsUserInformationSource extends AbstractUserInformationSource {
     private boolean initialized = false;
     private IWindowsAuthProvider provider;
 
+    /**
+     * Returns {@code true} if the current platform is Windows.
+     */
     public boolean isAvailable() {
         return Platform.isWindows();
     }
 
-    protected UserInformation buildUserInformation(IWindowsIdentity userIdentity, String serverName) {
+    UserInformation buildUserInformation(IWindowsIdentity userIdentity, String serverName) {
         Advapi32Util.Account account = Advapi32Util.getAccountBySid(userIdentity.getSidString());
         Netapi32Util.UserInfo userInfo = Netapi32Util.getUserInfo(account.name, serverName);
         String shortName = userInfo.name;
         return new ImmutableUserInformation(this, shortName, longName, groupInfo);
     }
 
-    protected IWindowsAuthProvider getProvider() {
+    IWindowsAuthProvider getProvider() {
         initialize();
         return provider;
     }
     /**
      * Based on {@link Netapi32Util#getUsers}, but returns more information.
      */
-    protected static void enumerateUserInfo(String serverName, UserInfoRecipient recipient) {
+    static void enumerateUserInfo(String serverName, UserInfoRecipient recipient) {
         PointerByReference bufptr = new PointerByReference();
         IntByReference entriesRead = new IntByReference();
         IntByReference totalEntries = new IntByReference();
         }
     }
 
-    protected synchronized void initialize() {
+    synchronized void initialize() {
         if (initialized) return;
         provider = new WindowsAuthProviderImpl();
         afterInitialize(provider);
         initialized = true;
     }
 
-    protected void afterInitialize(IWindowsAuthProvider provider) {
+    void afterInitialize(IWindowsAuthProvider provider) {
     }
 }

File windows-provider/src/main/java/us/carrclan/david/authc4j/windows/provider/package-info.java

+/*
+ * Copyright 2013 David M. Carr
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
+ * the License for the specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * An AuthC4J provider backed by the Windows
+ * <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa370680(v=vs.85).aspx">Network Management APIs</a>.
+ *
+ * <p>Implementations are provided for access to both local and Active Directory users.</p>
+ */
+package us.carrclan.david.authc4j.windows.provider;