Skip to content
Browse files

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/tags/nexu…

…s-restlight-1.8.0.1.1@7482 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information...
2 parents 588a129 + 28c711f commit 870157f1fb6973d3484935e504ddd65f3260b0f6 dbradicich committed Nov 22, 2010
Showing with 0 additions and 9,814 deletions.
  1. +0 −90 nexus-api/pom.xml
  2. +0 −195 nexus-api/src/main/java/org/sonatype/nexus/AbstractApplicationStatusSource.java
  3. +0 −26 nexus-api/src/main/java/org/sonatype/nexus/ApplicationStatusSource.java
  4. +0 −32 nexus-api/src/main/java/org/sonatype/nexus/OperationMode.java
  5. +0 −52 nexus-api/src/main/java/org/sonatype/nexus/SystemState.java
  6. +0 −255 nexus-api/src/main/java/org/sonatype/nexus/SystemStatus.java
  7. +0 −28 nexus-api/src/main/java/org/sonatype/nexus/auth/AuthenticationItem.java
  8. +0 −20 nexus-api/src/main/java/org/sonatype/nexus/auth/NexusAuthenticationEvent.java
  9. +0 −52 nexus-api/src/main/java/org/sonatype/nexus/configuration/Configurable.java
  10. +0 −17 nexus-api/src/main/java/org/sonatype/nexus/configuration/CoreConfiguration.java
  11. +0 −12 nexus-api/src/main/java/org/sonatype/nexus/configuration/ExternalConfiguration.java
  12. +0 −36 nexus-api/src/main/java/org/sonatype/nexus/configuration/RevertableConfiguration.java
  13. +0 −8 nexus-api/src/main/java/org/sonatype/nexus/error/report/ErrorReportBundleContentContributor.java
  14. +0 −39 nexus-api/src/main/java/org/sonatype/nexus/error/report/ErrorReportBundleEntry.java
  15. +0 −8 nexus-api/src/main/java/org/sonatype/nexus/error/report/ErrorReportComponent.java
  16. +0 −79 nexus-api/src/main/java/org/sonatype/nexus/feeds/AuthcAuthzEvent.java
  17. +0 −80 nexus-api/src/main/java/org/sonatype/nexus/feeds/ErrorWarningEvent.java
  18. +0 −151 nexus-api/src/main/java/org/sonatype/nexus/feeds/FeedRecorder.java
  19. +0 −115 nexus-api/src/main/java/org/sonatype/nexus/feeds/NexusArtifactEvent.java
  20. +0 −89 nexus-api/src/main/java/org/sonatype/nexus/feeds/SystemEvent.java
  21. +0 −182 nexus-api/src/main/java/org/sonatype/nexus/feeds/SystemProcess.java
  22. +0 −71 nexus-api/src/main/java/org/sonatype/nexus/formfields/AbstractFormField.java
  23. +0 −20 nexus-api/src/main/java/org/sonatype/nexus/formfields/CheckboxFormField.java
  24. +0 −43 nexus-api/src/main/java/org/sonatype/nexus/formfields/FormField.java
  25. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/formfields/NumberTextFormField.java
  26. +0 −34 nexus-api/src/main/java/org/sonatype/nexus/formfields/RepoComboFormField.java
  27. +0 −32 nexus-api/src/main/java/org/sonatype/nexus/formfields/RepoOrGroupComboFormField.java
  28. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/formfields/StringTextFormField.java
  29. +0 −22 nexus-api/src/main/java/org/sonatype/nexus/index/events/ReindexRepositoriesEvent.java
  30. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/index/events/ReindexRepositoriesRequest.java
  31. +0 −46 nexus-api/src/main/java/org/sonatype/nexus/logging/AbstractLoggingComponent.java
  32. +0 −47 nexus-api/src/main/java/org/sonatype/nexus/logging/DefaultLoggerProvider.java
  33. +0 −11 nexus-api/src/main/java/org/sonatype/nexus/logging/LoggerProvider.java
  34. +0 −76 nexus-api/src/main/java/org/sonatype/nexus/mime/DefaultMimeUtil.java
  35. +0 −20 nexus-api/src/main/java/org/sonatype/nexus/mime/MimeUtil.java
  36. +0 −39 nexus-api/src/main/java/org/sonatype/nexus/plugins/NexusPlugin.java
  37. +0 −19 nexus-api/src/main/java/org/sonatype/nexus/plugins/PluginContext.java
  38. +0 −36 nexus-api/src/main/java/org/sonatype/nexus/plugins/RepositoryCustomizer.java
  39. +0 −35 nexus-api/src/main/java/org/sonatype/nexus/plugins/RepositoryType.java
  40. +0 −22 nexus-api/src/main/java/org/sonatype/nexus/plugins/RestResource.java
  41. +0 −130 ...s-api/src/main/java/org/sonatype/nexus/plugins/rest/AbstractDocumentationNexusResourceBundle.java
  42. +0 −67 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/AbstractNexusIndexHtmlCustomizer.java
  43. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/AbstractNexusResourceBundle.java
  44. +0 −145 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/DefaultStaticResource.java
  45. +0 −47 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/ExternalStaticResource.java
  46. +0 −36 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/NexusDocumentationBundle.java
  47. +0 −85 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/NexusIndexHtmlCustomizer.java
  48. +0 −39 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/NexusResourceBundle.java
  49. +0 −39 nexus-api/src/main/java/org/sonatype/nexus/plugins/rest/StaticResource.java
  50. +0 −53 nexus-api/src/main/java/org/sonatype/nexus/proxy/AccessDeniedException.java
  51. +0 −40 nexus-api/src/main/java/org/sonatype/nexus/proxy/AuthorizationException.java
  52. +0 −42 nexus-api/src/main/java/org/sonatype/nexus/proxy/IllegalOperationException.java
  53. +0 −40 nexus-api/src/main/java/org/sonatype/nexus/proxy/IllegalRequestException.java
  54. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/InvalidItemContentException.java
  55. +0 −99 nexus-api/src/main/java/org/sonatype/nexus/proxy/ItemNotFoundException.java
  56. +0 −41 nexus-api/src/main/java/org/sonatype/nexus/proxy/LocalStorageException.java
  57. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/NoSuchRepositoryException.java
  58. +0 −40 nexus-api/src/main/java/org/sonatype/nexus/proxy/NoSuchResourceStoreException.java
  59. +0 −50 nexus-api/src/main/java/org/sonatype/nexus/proxy/RemoteAccessDeniedException.java
  60. +0 −47 nexus-api/src/main/java/org/sonatype/nexus/proxy/RemoteAccessException.java
  61. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/RemoteAuthenticationNeededException.java
  62. +0 −41 nexus-api/src/main/java/org/sonatype/nexus/proxy/RemoteStorageException.java
  63. +0 −42 nexus-api/src/main/java/org/sonatype/nexus/proxy/RepositoryNotAvailableException.java
  64. +0 −328 nexus-api/src/main/java/org/sonatype/nexus/proxy/RequestContext.java
  65. +0 −167 nexus-api/src/main/java/org/sonatype/nexus/proxy/ResourceStore.java
  66. +0 −342 nexus-api/src/main/java/org/sonatype/nexus/proxy/ResourceStoreRequest.java
  67. +0 −51 nexus-api/src/main/java/org/sonatype/nexus/proxy/StorageException.java
  68. +0 −59 nexus-api/src/main/java/org/sonatype/nexus/proxy/access/AccessManager.java
  69. +0 −35 nexus-api/src/main/java/org/sonatype/nexus/proxy/access/Action.java
  70. +0 −73 nexus-api/src/main/java/org/sonatype/nexus/proxy/access/NexusItemAuthorizer.java
  71. +0 −51 nexus-api/src/main/java/org/sonatype/nexus/proxy/attributes/AttributeStorage.java
  72. +0 −53 nexus-api/src/main/java/org/sonatype/nexus/proxy/attributes/AttributesHandler.java
  73. +0 −57 nexus-api/src/main/java/org/sonatype/nexus/proxy/attributes/StorageFileItemInspector.java
  74. +0 −45 nexus-api/src/main/java/org/sonatype/nexus/proxy/attributes/StorageItemInspector.java
  75. +0 −101 nexus-api/src/main/java/org/sonatype/nexus/proxy/cache/AbstractPathCache.java
  76. +0 −19 nexus-api/src/main/java/org/sonatype/nexus/proxy/cache/CacheManager.java
  77. +0 −50 nexus-api/src/main/java/org/sonatype/nexus/proxy/cache/CacheStatistics.java
  78. +0 −44 nexus-api/src/main/java/org/sonatype/nexus/proxy/cache/PathCache.java
  79. +0 −45 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/AbstractVetoableEvent.java
  80. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/EventInspector.java
  81. +0 −28 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/NexusStartedEvent.java
  82. +0 −28 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/NexusStateChangeEvent.java
  83. +0 −28 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/NexusStoppedEvent.java
  84. +0 −65 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryConfigurationUpdatedEvent.java
  85. +0 −41 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEvent.java
  86. +0 −30 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventEvictUnusedItems.java
  87. +0 −40 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventExpireCaches.java
  88. +0 −55 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventLocalStatusChanged.java
  89. +0 −64 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventProxyMode.java
  90. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventProxyModeChanged.java
  91. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventProxyModeSet.java
  92. +0 −32 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventRecreateAttributes.java
  93. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryEventRecreateMavenMetadata.java
  94. +0 −22 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryGroupMembersChangedEvent.java
  95. +0 −69 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryItemEvent.java
  96. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryItemEventCache.java
  97. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryItemEventDelete.java
  98. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryItemEventRetrieve.java
  99. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryItemEventStore.java
  100. +0 −30 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryMaintenanceEvent.java
  101. +0 −37 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryRegistryEvent.java
  102. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryRegistryEventAdd.java
  103. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryRegistryEventRemove.java
  104. +0 −47 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/RepositoryRegistryRepositoryEvent.java
  105. +0 −47 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/TargetRegistryEvent.java
  106. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/TargetRegistryEventRemove.java
  107. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/Veto.java
  108. +0 −6 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/VetoFormatter.java
  109. +0 −24 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/VetoFormatterRequest.java
  110. +0 −16 nexus-api/src/main/java/org/sonatype/nexus/proxy/events/Vetoable.java
  111. +0 −449 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/AbstractStorageItem.java
  112. +0 −54 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/ByteArrayContentLocator.java
  113. +0 −27 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/ContentGenerator.java
  114. +0 −48 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/ContentLocator.java
  115. +0 −384 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/DefaultRepositoryItemUid.java
  116. +0 −141 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/DefaultStorageCollectionItem.java
  117. +0 −63 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/DefaultStorageCompositeFileItem.java
  118. +0 −143 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/DefaultStorageFileItem.java
  119. +0 −107 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/DefaultStorageLinkItem.java
  120. +0 −53 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/PreparedContentLocator.java
  121. +0 −98 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/ReadLockingContentLocator.java
  122. +0 −81 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/RepositoryItemUid.java
  123. +0 −50 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/RepositoryItemUidFactory.java
  124. +0 −43 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageCollectionItem.java
  125. +0 −22 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageCompositeFileItem.java
  126. +0 −32 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageCompositeItem.java
  127. +0 −71 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageFileItem.java
  128. +0 −203 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageItem.java
  129. +0 −37 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StorageLinkItem.java
  130. +0 −61 nexus-api/src/main/java/org/sonatype/nexus/proxy/item/StringContentLocator.java
  131. +0 −45 nexus-api/src/main/java/org/sonatype/nexus/proxy/mirror/DownloadMirrorSelector.java
  132. +0 −42 nexus-api/src/main/java/org/sonatype/nexus/proxy/mirror/DownloadMirrors.java
  133. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/mirror/PublishedMirrors.java
  134. +0 −57 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/AbstractIdContentClass.java
  135. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/ContentClass.java
  136. +0 −113 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/RepositoryRegistry.java
  137. +0 −111 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/RepositoryTypeDescriptor.java
  138. +0 −96 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/RepositoryTypeRegistry.java
  139. +0 −36 nexus-api/src/main/java/org/sonatype/nexus/proxy/registry/RootContentClass.java
  140. +0 −47 ...-api/src/main/java/org/sonatype/nexus/proxy/repository/ClientSSLRemoteAuthenticationSettings.java
  141. +0 −16 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/DefaultProxySelector.java
  142. +0 −53 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/DefaultRemoteConnectionSettings.java
  143. +0 −75 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/DefaultRemoteProxySettings.java
  144. +0 −58 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/DefaultRepositoryKind.java
  145. +0 −87 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/GroupRepository.java
  146. +0 −25 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/HostedRepository.java
  147. +0 −56 ...-api/src/main/java/org/sonatype/nexus/proxy/repository/IncompatibleMasterRepositoryException.java
  148. +0 −44 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/InvalidGroupingException.java
  149. +0 −20 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/ItemContentValidator.java
  150. +0 −31 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/LocalStatus.java
  151. +0 −85 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/Mirror.java
  152. +0 −33 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/NtlmRemoteAuthenticationSettings.java
  153. +0 −44 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/ProxyMode.java
  154. +0 −256 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/ProxyRepository.java
  155. +0 −6 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/ProxySelector.java
  156. +0 −6 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/RemoteAuthenticationSettings.java
  157. +0 −20 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/RemoteConnectionSettings.java
  158. +0 −28 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/RemoteProxySettings.java
  159. +0 −23 nexus-api/src/main/java/org/sonatype/nexus/proxy/repository/RemoteStatus.java
Sorry, we could not display the entire diff because too many files (6,638) changed.
View
90 nexus-api/pom.xml
@@ -1,90 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!-- Parent POM -->
- <parent>
- <groupId>org.sonatype.nexus</groupId>
- <artifactId>nexus</artifactId>
- <version>1.8.0.1</version>
- </parent>
-
- <!-- the version of maven's project object model -->
- <modelVersion>4.0.0</modelVersion>
-
- <!-- a unique name for this project -->
- <artifactId>nexus-api</artifactId>
-
- <!-- POM packaging -->
- <packaging>jar</packaging>
-
- <!-- a short but descriptive name for the project -->
- <name>Nexus : API</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.sonatype.nexus</groupId>
- <artifactId>nexus-utils</artifactId>
- </dependency>
-
- <!-- Here for "compatibility" reason only! -->
- <dependency>
- <groupId>org.sonatype.spice</groupId>
- <artifactId>spice-inject-plexus</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.sonatype.plexus.appevents</groupId>
- <artifactId>plexus-app-events-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.sonatype.plexus</groupId>
- <artifactId>plexus-task-scheduler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.sonatype.spice</groupId>
- <artifactId>spice-timeline</artifactId>
- </dependency>
- <dependency>
- <groupId>org.sonatype.configuration</groupId>
- <artifactId>base-configuration</artifactId>
- </dependency>
-
- <dependency>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- </dependency>
- <dependency>
- <groupId>eu.medsea.mimeutil</groupId>
- <artifactId>mime-util</artifactId>
- </dependency>
-
- <!-- for marking extensions -->
- <dependency>
- <groupId>org.sonatype.plugin</groupId>
- <artifactId>plugin-host-api</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-metadata</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project>
View
195 nexus-api/src/main/java/org/sonatype/nexus/AbstractApplicationStatusSource.java
@@ -1,195 +0,0 @@
-package org.sonatype.nexus;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.Logger;
-
-public abstract class AbstractApplicationStatusSource
- implements ApplicationStatusSource
-{
- @Requirement
- private Logger logger;
-
- /**
- * System status.
- */
- private final SystemStatus systemStatus;
-
- /**
- * Read/Write lock guarding systemStatus updates.
- */
- private final ReadWriteLock lock;
-
- /**
- * Timestamp of last update.
- */
- private long lastUpdate = -1;
-
- /**
- * Public constructor.
- */
- public AbstractApplicationStatusSource()
- {
- this.systemStatus = new SystemStatus();
-
- this.lock = new ReentrantReadWriteLock();
- }
-
- /**
- * Internal method for getting SystemStatus. Does not perform any locking.
- *
- * @return
- */
- protected SystemStatus getSystemStatusInternal()
- {
- return systemStatus;
- }
-
- /**
- * Returns the RW lock.
- *
- * @return
- */
- protected ReadWriteLock getLock()
- {
- return lock;
- }
-
- // ==
-
- /**
- * Returns the SystemStatus, guaranteeing it's consistent state.
- */
- public SystemStatus getSystemStatus()
- {
- updateSystemStatusIfNeeded( false );
-
- Lock lock = getLock().readLock();
-
- lock.lock();
-
- try
- {
- return getSystemStatusInternal();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public boolean setState( SystemState state )
- {
- Lock lock = getLock().writeLock();
-
- lock.lock();
-
- try
- {
- getSystemStatusInternal().setState( state );
-
- return true;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- // ==
-
- /**
- * Returns the Plexus logger.
- *
- * @return
- */
- protected Logger getLogger()
- {
- return logger;
- }
-
- /**
- * Reads the version from a properties file (the one embedded by Maven into Jar).
- *
- * @param path
- * @return
- */
- protected String readVersion( String path )
- {
- String version = "Unknown";
-
- try
- {
- Properties props = new Properties();
-
- InputStream is = getClass().getResourceAsStream( path );
-
- if ( is != null )
- {
- props.load( is );
-
- version = props.getProperty( "version" );
- }
-
- }
- catch ( IOException e )
- {
- logger.error( "Could not load/read version from " + path, e );
- }
-
- return version;
- }
-
- /**
- * Will check is needed a SystemStatus update (using retain time) and will perform it.
- *
- * @param forced if update is forced (performs update forcefully)
- */
- protected void updateSystemStatusIfNeeded( boolean forced )
- {
- long currentTime = System.currentTimeMillis();
-
- if ( forced || ( currentTime - lastUpdate > 30000 ) )
- {
- Lock lock = getLock().writeLock();
-
- lock.lock();
-
- try
- {
- // maybe someone did the job, while we were blocked
- if ( forced || ( currentTime - lastUpdate > 30000 ) )
- {
- renewSystemStatus( getSystemStatusInternal() );
-
- lastUpdate = currentTime;
- }
- }
- finally
- {
- lock.unlock();
- }
- }
- }
-
- /**
- * Discovers (probably in "edition specific" way) the version of the application.
- *
- * @return
- */
- protected abstract String discoverApplicationVersion();
-
- /**
- * Implement here any updates to SystemStatus needed. No need to bother with locking, it happens in the caller of
- * this method. The method body contains exclusive lock to SystemStatus.
- *
- * @param systemStatus
- */
- protected abstract void renewSystemStatus( SystemStatus systemStatus );
-}
View
26 nexus-api/src/main/java/org/sonatype/nexus/ApplicationStatusSource.java
@@ -1,26 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus;
-
-/**
- * The source of common data from App.
- *
- * @author cstamas
- */
-public interface ApplicationStatusSource
-{
- SystemStatus getSystemStatus();
-
- boolean setState( SystemState state );
-}
View
32 nexus-api/src/main/java/org/sonatype/nexus/OperationMode.java
@@ -1,32 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus;
-
-/**
- * The enum of possible operation modes in which Nexus Application may reside.
- *
- * @author cstamas
- */
-public enum OperationMode
-{
- /**
- * Nexus is in standalone mode.
- */
- STANDALONE,
-
- /**
- * Nexus is config slave.
- */
- CONFIGURATION_SLAVE;
-}
View
52 nexus-api/src/main/java/org/sonatype/nexus/SystemState.java
@@ -1,52 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus;
-
-/**
- * The enum of possible states in which Nexus Application may reside.
- *
- * @author cstamas
- */
-public enum SystemState
-{
- /**
- * Nexus is in process of starting. Should not be bothered until it is RUNNING.
- */
- STARTING,
-
- /**
- * Nexus is running and is healthy. It is fully functional.
- */
- STARTED,
-
- /**
- * Nexus tried to start up, but is failed due to broken user configuration. It is nonfunctional.
- */
- BROKEN_CONFIGURATION,
-
- /**
- * Nexus tried to start up, but is failed due to some unexpected IO error. It is nonfunctional.
- */
- BROKEN_IO,
-
- /**
- * Nexus is being shutdown.
- */
- STOPPING,
-
- /**
- * Nexus is shut down.
- */
- STOPPED;
-}
View
255 nexus-api/src/main/java/org/sonatype/nexus/SystemStatus.java
@@ -1,255 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus;
-
-import java.util.Date;
-
-/**
- * Nexus system state object. It gives small amount of important infos about Nexus Application.
- *
- * @author cstamas
- * @author damian
- */
-public class SystemStatus
-{
- /**
- * The Application Name
- */
- private String appName = "Sonatype Nexus Maven Repository Manager";
-
- /**
- * The Formatted Application Name, used whenever possible
- */
- private String formattedAppName = "Sonatype Nexus&trade;";
-
- /**
- * The Nexus Application version.
- */
- private String version = "unknown";
-
- /**
- * The Nexus Java API version (not the REST API!).
- */
- private String apiVersion = "unknown";
-
- /**
- * The Nexus Application edition for display in UI.
- */
- private String editionLong = "Open Source";
-
- /**
- * The Nexus Application edition for user agent
- */
- private String editionShort = "OSS";
-
- /**
- * The Nexus Application state.
- */
- private SystemState state;
-
- /**
- * The Nexus operation mode.
- */
- private OperationMode operationMode;
-
- /**
- * The time this instance of Nexus was started.
- */
- private Date initializedAt;
-
- /**
- * The time this instance of Nexus was started.
- */
- private Date startedAt;
-
- /**
- * The timestamp of last config change.
- */
- private Date lastConfigChange;
-
- /**
- * Is this 1st start of Nexus?
- */
- private boolean firstStart;
-
- /**
- * Was it an instance upgrade?
- */
- private boolean instanceUpgraded;
-
- /**
- * If instanceUpgraded, was there also a configuration upgrade?
- */
- private boolean configurationUpgraded;
-
- /**
- * Other error cause that blocked startup.
- */
- private Throwable errorCause;
-
- public String getAppName()
- {
- return appName;
- }
-
- public void setAppName( String appName )
- {
- this.appName = appName;
- }
-
- public String getFormattedAppName()
- {
- return formattedAppName;
- }
-
- public void setFormattedAppName( String formattedAppName )
- {
- this.formattedAppName = formattedAppName;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- public String getApiVersion()
- {
- return apiVersion;
- }
-
- public void setApiVersion( String version )
- {
- this.apiVersion = version;
- }
-
- public String getEditionLong()
- {
- return editionLong;
- }
-
- public void setEditionLong( String editionUI )
- {
- this.editionLong = editionUI;
- }
-
- public String getEditionShort()
- {
- return editionShort;
- }
-
- public void setEditionShort( String editionUserAgent )
- {
- this.editionShort = editionUserAgent;
- }
-
- public SystemState getState()
- {
- return state;
- }
-
- public void setState( SystemState status )
- {
- this.state = status;
- }
-
- public OperationMode getOperationMode()
- {
- return operationMode;
- }
-
- public void setOperationMode( OperationMode operationMode )
- {
- this.operationMode = operationMode;
- }
-
- public Date getInitializedAt()
- {
- return initializedAt;
- }
-
- public void setInitializedAt( Date initializedAt )
- {
- this.initializedAt = initializedAt;
- }
-
- public Date getStartedAt()
- {
- return startedAt;
- }
-
- public void setStartedAt( Date startedAt )
- {
- this.startedAt = startedAt;
- }
-
- public Date getLastConfigChange()
- {
- return lastConfigChange;
- }
-
- public void setLastConfigChange( Date lastConfigChange )
- {
- this.lastConfigChange = lastConfigChange;
- }
-
- public Throwable getErrorCause()
- {
- return errorCause;
- }
-
- public void setErrorCause( Throwable errorCause )
- {
- this.errorCause = errorCause;
- }
-
- public boolean isFirstStart()
- {
- return firstStart;
- }
-
- public void setFirstStart( boolean firstStart )
- {
- this.firstStart = firstStart;
- }
-
- public boolean isInstanceUpgraded()
- {
- return instanceUpgraded;
- }
-
- public void setInstanceUpgraded( boolean instanceUpgraded )
- {
- this.instanceUpgraded = instanceUpgraded;
- }
-
- public boolean isConfigurationUpgraded()
- {
- return configurationUpgraded;
- }
-
- public void setConfigurationUpgraded( boolean configurationUpgraded )
- {
- this.configurationUpgraded = configurationUpgraded;
- }
-
- public boolean isNexusStarted()
- {
- return SystemState.STARTED.equals( getState() );
- }
-}
View
28 nexus-api/src/main/java/org/sonatype/nexus/auth/AuthenticationItem.java
@@ -1,28 +0,0 @@
-package org.sonatype.nexus.auth;
-
-public class AuthenticationItem
-{
- private String userid;
- private String remoteIP;
- private boolean success;
-
- public AuthenticationItem( String userid, String remoteIP, boolean success )
- {
- this.userid = userid;
- this.remoteIP = remoteIP;
- this.success = success;
- }
-
- public String getRemoteIP()
- {
- return remoteIP;
- }
- public String getUserid()
- {
- return userid;
- }
- public boolean isSuccess()
- {
- return success;
- }
-}
View
20 nexus-api/src/main/java/org/sonatype/nexus/auth/NexusAuthenticationEvent.java
@@ -1,20 +0,0 @@
-package org.sonatype.nexus.auth;
-
-import org.sonatype.plexus.appevents.AbstractEvent;
-
-public class NexusAuthenticationEvent
- extends AbstractEvent<Object>
-{
- private final AuthenticationItem item;
-
- public NexusAuthenticationEvent( Object sender, AuthenticationItem item )
- {
- super( sender );
- this.item = item;
- }
-
- public AuthenticationItem getItem()
- {
- return item;
- }
-}
View
52 nexus-api/src/main/java/org/sonatype/nexus/configuration/Configurable.java
@@ -1,52 +0,0 @@
-package org.sonatype.nexus.configuration;
-
-import org.sonatype.configuration.ConfigurationException;
-
-
-/**
- * A Configurable component.
- *
- * @author cstamas
- */
-public interface Configurable
-{
- /**
- * Returns the current core configuration of the component.May return null if there is not config object set.
- *
- * @return
- */
- CoreConfiguration getCurrentCoreConfiguration();
-
- /**
- * Sets the configuration object and calls configure(). A shortcut for setCurrentConfiguration(config) and then
- * configure() calls.
- *
- * @param config
- * @throws ConfigurationException
- */
- void configure( Object config )
- throws ConfigurationException;
-
- /**
- * Returns true if there are some unsaved changes.
- *
- * @return
- */
- boolean isDirty();
-
- /**
- * Commits the changes. Resets the state of config "back to normal" (saved).
- */
- boolean commitChanges()
- throws ConfigurationException;
-
- /**
- * Rollbacks the changes. Resets the state of config "back to normal" (saved).
- */
- boolean rollbackChanges();
-
- /**
- * A simple short name.
- */
- String getName();
-}
View
17 nexus-api/src/main/java/org/sonatype/nexus/configuration/CoreConfiguration.java
@@ -1,17 +0,0 @@
-package org.sonatype.nexus.configuration;
-
-/**
- * Top level interface for wrapping up "core configurations", those used by core components.
- *
- * @author cstamas
- */
-public interface CoreConfiguration
- extends RevertableConfiguration
-{
- /**
- * Returns the external configuration, if any. Null otherwise.
- *
- * @return
- */
- ExternalConfiguration<?> getExternalConfiguration();
-}
View
12 nexus-api/src/main/java/org/sonatype/nexus/configuration/ExternalConfiguration.java
@@ -1,12 +0,0 @@
-package org.sonatype.nexus.configuration;
-
-/**
- * Top level interface for wrapping up "external configurations", those used by Repositories and plugins.
- *
- * @author cstamas
- */
-public interface ExternalConfiguration<T>
- extends RevertableConfiguration
-{
- T getConfiguration( boolean forModification );
-}
View
36 nexus-api/src/main/java/org/sonatype/nexus/configuration/RevertableConfiguration.java
@@ -1,36 +0,0 @@
-package org.sonatype.nexus.configuration;
-
-import org.sonatype.configuration.ConfigurationException;
-
-/**
- * Revertable configuration is a configuration that is changeable, but may be be reverted (rollback the changes). The
- * changes are "visible" only after applyChanges() call.
- *
- * @author cstamas
- */
-public interface RevertableConfiguration
-{
- /**
- * Returns true if this configuration holds some changes that are not persisted.
- *
- * @return
- */
- boolean isDirty();
-
- /**
- * Validatyes the changes, if any.
- */
- void validateChanges()
- throws ConfigurationException;
-
- /**
- * Commits the changes. Resets the state of config "back to normal" (saved). Will call validateChanges() if needed.
- */
- void commitChanges()
- throws ConfigurationException;
-
- /**
- * Rollbacks the changes. Resets the state of config "back to normal" (saved).
- */
- void rollbackChanges();
-}
View
8 ...pi/src/main/java/org/sonatype/nexus/error/report/ErrorReportBundleContentContributor.java
@@ -1,8 +0,0 @@
-package org.sonatype.nexus.error.report;
-
-public interface ErrorReportBundleContentContributor
-{
-
- public ErrorReportBundleEntry[] getEntries();
-
-}
View
39 nexus-api/src/main/java/org/sonatype/nexus/error/report/ErrorReportBundleEntry.java
@@ -1,39 +0,0 @@
-package org.sonatype.nexus.error.report;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.codehaus.plexus.util.IOUtil;
-
-public class ErrorReportBundleEntry
-{
-
- private InputStream content;
-
- private String entryName;
-
- public ErrorReportBundleEntry( String entryName, InputStream content )
- {
- super();
- this.entryName = entryName;
- this.content = content;
- }
-
- public InputStream getContent()
- {
- return content;
- }
-
- public String getEntryName()
- {
- return entryName;
- }
-
- public void releaseEntry()
- throws IOException
- {
- IOUtil.close( content );
- content = null;
- }
-
-}
View
8 nexus-api/src/main/java/org/sonatype/nexus/error/report/ErrorReportComponent.java
@@ -1,8 +0,0 @@
-package org.sonatype.nexus.error.report;
-
-public interface ErrorReportComponent
-{
-
- String getComponent();
-
-}
View
79 nexus-api/src/main/java/org/sonatype/nexus/feeds/AuthcAuthzEvent.java
@@ -1,79 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus.feeds;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A event that encapsulate authentication and authorization event.
- *
- * @author juven
- */
-public class AuthcAuthzEvent
-{
-
- /**
- * The date of event.
- */
- private Date eventDate;
-
- private final String action;
-
- private final String message;
-
- /**
- * The context of event.
- */
- private final Map<String, Object> eventContext;
-
- public AuthcAuthzEvent( String action, String message )
- {
- this.action = action;
-
- this.message = message;
-
- this.eventDate = new Date();
-
- this.eventContext = new HashMap<String, Object>();
- }
-
- public Date getEventDate()
- {
- return eventDate;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public Map<String, Object> getEventContext()
- {
- return eventContext;
- }
-
- public String getAction()
- {
- return action;
- }
-
-
- public void setEventDate( Date eventDate )
- {
- this.eventDate = eventDate;
- }
-
-}
View
80 nexus-api/src/main/java/org/sonatype/nexus/feeds/ErrorWarningEvent.java
@@ -1,80 +0,0 @@
-package org.sonatype.nexus.feeds;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A class that encapsulates all nexus errors and warnings
- *
- * @author juven
- */
-public class ErrorWarningEvent
-{
- public static final String ACTION_ERROR = "error";
-
- public static final String ACTION_WARNING = "warning";
-
- private Date eventDate;
-
- private final String action;
-
- private final String message;
-
- private final String stackTrace;
-
- private final Map<String, Object> eventContext;
-
- public ErrorWarningEvent( String action, String message )
- {
- this( action, message, "" );
- }
-
- public ErrorWarningEvent( String action, String message, String stackTrace )
- {
- this.action = action;
-
- this.message = message;
-
- this.eventDate = new Date();
-
- this.eventContext = new HashMap<String, Object>();
-
- this.stackTrace = stackTrace;
- }
-
- public Date getEventDate()
- {
- return eventDate;
- }
-
- public void setEventDate( Date date )
- {
- this.eventDate = date;
- }
-
- public Map<String, Object> getEventContext()
- {
- return eventContext;
- }
-
- public String getAction()
- {
- return action;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public String getStackTrace()
- {
- return stackTrace;
- }
-
- public String toString()
- {
- return getMessage();
- }
-}
View
151 nexus-api/src/main/java/org/sonatype/nexus/feeds/FeedRecorder.java
@@ -1,151 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus.feeds;
-
-import java.util.List;
-import java.util.Set;
-
-import org.sonatype.timeline.TimelineFilter;
-import org.sonatype.timeline.TimelineResult;
-
-/**
- * A recorder for events for later retrieval. The Actions are "generic" Nexus event related. For specific (Maven, P2)
- * actions, look into specific sources. Note: This is actually event recorder, not feed recorder.
- *
- * @author cstamas
- */
-public interface FeedRecorder
-{
- /**
- * System event action: boot
- */
- public static final String SYSTEM_BOOT_ACTION = "BOOT";
-
- /**
- * System event action: configuration
- */
- public static final String SYSTEM_CONFIG_ACTION = "CONFIG";
-
- /**
- * System event action: timeline purge
- */
- public static final String SYSTEM_TL_PURGE_ACTION = "TL_PURGE";
-
- /**
- * System event action: reindex
- */
- public static final String SYSTEM_REINDEX_ACTION = "REINDEX";
-
- /**
- * System event action: optimize index
- */
- public static final String SYSTEM_OPTIMIZE_INDEX_ACTION = "OPTIMIZE_INDEX";
-
- /**
- * System event action: publish indexes
- */
- public static final String SYSTEM_PUBLISHINDEX_ACTION = "PUBLISHINDEX";
-
- /**
- * System event action: download indexes
- */
- public static final String SYSTEM_DOWNLOADINDEX_ACTION = "DOWNLOADINDEX";
-
- /**
- * System event action: rebuildAttributes
- */
- public static final String SYSTEM_REBUILDATTRIBUTES_ACTION = "REBUILDATTRIBUTES";
-
- /**
- * System event action: repository local status changes
- */
- public static final String SYSTEM_REPO_LSTATUS_CHANGES_ACTION = "REPO_LSTATUS_CHANGES";
-
- /**
- * System event action: repository proxy status auto change
- */
- public static final String SYSTEM_REPO_PSTATUS_CHANGES_ACTION = "REPO_PSTATUS_CHANGES";
-
- /**
- * System event action: repository proxy status auto change
- */
- public static final String SYSTEM_REPO_PSTATUS_AUTO_CHANGES_ACTION = "REPO_PSTATUS_AUTO_CHANGES";
-
- /**
- * System event action: expire cache
- */
- public static final String SYSTEM_EXPIRE_CACHE_ACTION = "EXPIRE_CACHE";
-
- /**
- * System event action: shadow sync
- */
- public static final String SYSTEM_SYNC_SHADOW_ACTION = "SYNC_SHADOW";
-
- /**
- * System event action: evict unused proxied items
- */
- public static final String SYSTEM_EVICT_UNUSED_PROXIED_ITEMS_ACTION = "EVICT_UNUSED_PROXIED_ITEMS";
-
- /**
- * System event action: empty trash
- */
- public static final String SYSTEM_EMPTY_TRASH_ACTION = "EMPTY_TRASH";
-
- /**
- * System event action: remove repository folder
- */
- public static final String SYSTEM_REMOVE_REPO_FOLDER_ACTION = "REMOVE_REPO_FOLDER";
-
- /**
- * System event action: authentication
- */
- public static final String SYSTEM_AUTHC = "AUTHC";
-
- /**
- * System event action: authorization
- */
- public static final String SYSTEM_AUTHZ = "AUTHZ";
-
- // creating
-
- void addErrorWarningEvent( String action, String message);
-
- void addErrorWarningEvent( String action, String message, Throwable throwable);
-
- void addNexusArtifactEvent( NexusArtifactEvent nae );
-
- void addSystemEvent( String action, String message );
-
- void addAuthcAuthzEvent( AuthcAuthzEvent evt );
-
- SystemProcess systemProcessStarted( String action, String message );
-
- void systemProcessFinished( SystemProcess prc, String finishMessage );
-
- void systemProcessBroken( SystemProcess prc, Throwable e );
-
- // reading
-
- TimelineResult getEvents( Set<String> types, Set<String> subtypes, Integer from, Integer count,
- TimelineFilter filter );
-
- List<NexusArtifactEvent> getNexusArtifectEvents( Set<String> subtypes, Integer from, Integer count,
- TimelineFilter filter );
-
- List<SystemEvent> getSystemEvents( Set<String> subtypes, Integer from, Integer count, TimelineFilter filter );
-
- List<AuthcAuthzEvent> getAuthcAuthzEvents( Set<String> subtypes, Integer from, Integer count, TimelineFilter filter );
-
- List<ErrorWarningEvent> getErrorWarningEvents( Set<String> subtypes, Integer from, Integer count, TimelineFilter filter );
-}
View
115 nexus-api/src/main/java/org/sonatype/nexus/feeds/NexusArtifactEvent.java
@@ -1,115 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus.feeds;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.sonatype.nexus.artifact.NexusItemInfo;
-
-/**
- * A class thet encapsulates a Nexus artifact event: caching, deploying, deleting or retrieving of it.
- *
- * @author cstamas
- */
-public class NexusArtifactEvent
-{
- public static final String ACTION_CACHED = "cached";
-
- public static final String ACTION_DEPLOYED = "deployed";
-
- public static final String ACTION_DELETED = "deleted";
-
- public static final String ACTION_RETRIEVED = "retrieved";
-
- public static final String ACTION_BROKEN = "broken";
-
- public static final String ACTION_BROKEN_WRONG_REMOTE_CHECKSUM = "brokenWRC";
-
- /**
- * The artifactInfo about artifact.
- */
- private NexusItemInfo nexusItemInfo;
-
- /**
- * The date of the event.
- */
- private Date eventDate;
-
- /**
- * The context of the event (request).
- */
- private Map<String, Object> eventContext;
-
- /**
- * The action.
- */
- private String action;
-
- /**
- * The message.
- */
- private String message;
-
- public NexusItemInfo getNexusItemInfo()
- {
- return nexusItemInfo;
- }
-
- public void setNexusItemInfo( NexusItemInfo nexusItemInfo )
- {
- this.nexusItemInfo = nexusItemInfo;
- }
-
- public Date getEventDate()
- {
- return eventDate;
- }
-
- public void setEventDate( Date eventDate )
- {
- this.eventDate = eventDate;
- }
-
- public Map<String, Object> getEventContext()
- {
- return eventContext;
- }
-
- public void setEventContext( Map<String, Object> eventContext )
- {
- this.eventContext = eventContext;
- }
-
- public String getAction()
- {
- return action;
- }
-
- public void setAction( String action )
- {
- this.action = action;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public void setMessage( String message )
- {
- this.message = message;
- }
-
-}
View
89 nexus-api/src/main/java/org/sonatype/nexus/feeds/SystemEvent.java
@@ -1,89 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus.feeds;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A class that encapsulates a Nexus System event, like boot, reconfiguration, etc.
- *
- * @author cstamas
- */
-public class SystemEvent
-{
- /**
- * The date of event.
- */
- private Date eventDate;
-
- /**
- * The action.
- */
- private final String action;
-
- /**
- * Human message/descritpion.
- */
- private final String message;
-
- /**
- * The context of event.
- */
- private final Map<String, Object> eventContext;
-
- public SystemEvent( String action, String message )
- {
- super();
-
- this.eventDate = new Date();
-
- this.action = action;
-
- this.message = message;
-
- this.eventContext = new HashMap<String, Object>();
- }
-
- public Date getEventDate()
- {
- return eventDate;
- }
-
- public void setEventDate(Date date)
- {
- this.eventDate = date;
- }
-
- public Map<String, Object> getEventContext()
- {
- return eventContext;
- }
-
- public String getAction()
- {
- return action;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public String toString()
- {
- return getMessage();
- }
-}
View
182 nexus-api/src/main/java/org/sonatype/nexus/feeds/SystemProcess.java
@@ -1,182 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version.
- * Copyright (c) 2008 Sonatype, Inc. All rights reserved.
- * Includes the third-party code listed at http://nexus.sonatype.org/dev/attributions.html
- * This program is licensed to you under Version 3 only of the GNU General Public License as published by the Free Software Foundation.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License Version 3 for more details.
- * You should have received a copy of the GNU General Public License Version 3 along with this program.
- * If not, see http://www.gnu.org/licenses/.
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc.
- * "Sonatype" and "Sonatype Nexus" are trademarks of Sonatype, Inc.
- */
-package org.sonatype.nexus.feeds;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Date;
-
-/**
- * A system process event, a system event that has duration and holds possible error cause if any.
- *
- * @author cstamas
- */
-public class SystemProcess
- extends SystemEvent
-{
- enum Status
- {
- STARTED, FINISHED, BROKEN
- };
-
- /**
- * The process status.
- */
- private Status status;
-
- /**
- * When was the process started?
- */
- private final Date started;
-
- /**
- * When has finised the process?
- */
- private Date finished;
-
- /**
- * Human message/descritpion.
- */
- private String finishedMessage;
-
- /**
- * The error cause while running, if any.
- */
- private Throwable errorCause;
-
- public SystemProcess( String action, String message, Date started )
- {
- super( action, message );
-
- this.started = started;
-
- this.status = Status.STARTED;
- }
-
- public void finished( String message )
- {
- this.finished = new Date();
-
- this.status = Status.FINISHED;
-
- this.finishedMessage = message;
- }
-
- public void broken( Throwable e )
- {
- this.errorCause = e;
-
- this.finished = new Date();
-
- this.status = Status.BROKEN;
- }
-
- public Date getEventDate()
- {
- if ( finished == null )
- {
- return super.getEventDate();
- }
- else
- {
- return getFinished();
- }
- }
-
- public boolean isRunning()
- {
- return Status.STARTED.equals( status );
- }
-
- public boolean isFinished()
- {
- return Status.FINISHED.equals( status );
- }
-
- public boolean isBroken()
- {
- return Status.BROKEN.equals( status );
- }
-
- public Date getStarted()
- {
- return started;
- }
-
- public Date getFinished()
- {
- return finished;
- }
-
- public Throwable getErrorCause()
- {
- return errorCause;
- }
-
- public String getFinishedMessage()
- {
- return finishedMessage;
- }
-
- public String getMessage()
- {
- StringBuffer sb = new StringBuffer( super.getMessage() );
-
- if ( started != null )
- {
- sb.append( " : Process started on " );
-
- sb.append( started.toString() );
-
- if ( finished != null )
- {
- if ( Status.BROKEN.equals( status ) )
- {
- sb.append( ", finished on " ).append( finished.toString() ).append( " with error." );
-
- if ( errorCause != null )
- {
- sb.append( " Error message is: " ).append( errorCause.getClass().getName() );
-
- if ( errorCause.getMessage() != null )
- {
- sb.append( ", " ).append( errorCause.getMessage() );
- }
-
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter( sw );
- errorCause.printStackTrace( pw );
- sb.append( " Strack trace: " ).append( sw.toString() );
- }
- }
- else if ( Status.FINISHED.equals( status ) )
- {
- sb.append( ", finished successfully on " ).append( finished.toString() );
- }
- }
- else
- {
- sb.append( ", not yet finished." );
- }
- }
-
- return sb.toString();
- }
-
- public String toString()
- {
- return getMessage();
- }
-
-}
View
71 nexus-api/src/main/java/org/sonatype/nexus/formfields/AbstractFormField.java
@@ -1,71 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public abstract class AbstractFormField
- implements FormField
-{
- private String helpText;
- private String id;
- private String regexValidation;
- private boolean required;
- private String label;
-
- public AbstractFormField( String id, String label, String helpText, boolean required, String regexValidation )
- {
- this( id, label, helpText, required );
- this.regexValidation = regexValidation;
- }
-
- public AbstractFormField( String id, String label, String helpText, boolean required )
- {
- this( id );
- this.label = label;
- this.helpText = helpText;
- this.required = required;
- }
-
- public AbstractFormField( String id )
- {
- this.id = id;
- }
-
- public String getLabel()
- {
- return this.label;
- }
- public String getHelpText()
- {
- return this.helpText;
- }
- public String getId()
- {
- return this.id;
- }
- public String getRegexValidation()
- {
- return this.regexValidation;
- }
- public boolean isRequired()
- {
- return this.required;
- }
- public void setHelpText( String helpText )
- {
- this.helpText = helpText;
- }
- public void setId( String id )
- {
- this.id = id;
- }
- public void setRegexValidation( String regex )
- {
- this.regexValidation = regex;
- }
- public void setRequired( boolean required )
- {
- this.required = required;
- }
- public void setLabel( String label )
- {
- this.label = label;
- }
-}
View
20 nexus-api/src/main/java/org/sonatype/nexus/formfields/CheckboxFormField.java
@@ -1,20 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public class CheckboxFormField
- extends AbstractFormField
-{
- public CheckboxFormField( String id, String label, String helpText, boolean required )
- {
- super( id, label, helpText, required );
- }
-
- public CheckboxFormField( String id )
- {
- super( id );
- }
-
- public String getType()
- {
- return "checkbox";
- }
-}
View
43 nexus-api/src/main/java/org/sonatype/nexus/formfields/FormField.java
@@ -1,43 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public interface FormField
-{
- public static final boolean MANDATORY = true;
- public static final boolean OPTIONAL = false;
-
- /**
- * Get the type of this form field
- * @return
- */
- String getType();
-
- /**
- * Get the label of this form field
- * @return
- */
- String getLabel();
-
- /**
- * Get the ID of this form field
- * @return
- */
- String getId();
-
- /**
- * get the required flag of this field
- * @return
- */
- boolean isRequired();
-
- /**
- * Get the help text of this field
- * @return
- */
- String getHelpText();
-
- /**
- * Get the regexvalidation of this field
- * @return
- */
- String getRegexValidation();
-}
View
25 nexus-api/src/main/java/org/sonatype/nexus/formfields/NumberTextFormField.java
@@ -1,25 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public class NumberTextFormField
- extends AbstractFormField
-{
- public NumberTextFormField( String id, String label, String helpText, boolean required, String regexValidation )
- {
- super( id, label, helpText, required, regexValidation );
- }
-
- public NumberTextFormField( String id, String label, String helpText, boolean required )
- {
- super( id, label, helpText, required );
- }
-
- public NumberTextFormField( String id )
- {
- super( id );
- }
-
- public String getType()
- {
- return "number";
- }
-}
View
34 nexus-api/src/main/java/org/sonatype/nexus/formfields/RepoComboFormField.java
@@ -1,34 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public class RepoComboFormField
- extends AbstractFormField
-{
- public static final String DEFAULT_HELP_TEXT = "Select the repository or repository group.";
-
- public static final String DEFAULT_LABEL = "Repository";
-
- public RepoComboFormField( String id, String label, String helpText, boolean required, String regexValidation )
- {
- super( id, label, helpText, required, regexValidation );
- }
-
- public RepoComboFormField( String id, String label, String helpText, boolean required )
- {
- super( id, label, helpText, required );
- }
-
- public RepoComboFormField( String id, boolean required )
- {
- super( id, DEFAULT_LABEL, DEFAULT_HELP_TEXT, required );
- }
-
- public RepoComboFormField( String id )
- {
- super( id, DEFAULT_LABEL, DEFAULT_HELP_TEXT, false );
- }
-
- public String getType()
- {
- return "repo";
- }
-}
View
32 nexus-api/src/main/java/org/sonatype/nexus/formfields/RepoOrGroupComboFormField.java
@@ -1,32 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public class RepoOrGroupComboFormField
- extends AbstractFormField
-{
- public static final String DEFAULT_HELP_TEXT = "Select the repository or repository group";
- public static final String DEFAULT_LABEL = "Repository/Group";
- public RepoOrGroupComboFormField( String id, String label, String helpText, boolean required, String regexValidation )
- {
- super( id, label, helpText, required, regexValidation );
- }
-
- public RepoOrGroupComboFormField( String id, String label, String helpText, boolean required )
- {
- super( id, label, helpText, required );
- }
-
- public RepoOrGroupComboFormField( String id, boolean required )
- {
- super( id, DEFAULT_LABEL, DEFAULT_HELP_TEXT, required );
- }
-
- public RepoOrGroupComboFormField( String id )
- {
- super( id, DEFAULT_LABEL, DEFAULT_HELP_TEXT, false );
- }
-
- public String getType()
- {
- return "repo-or-group";
- }
-}
View
25 nexus-api/src/main/java/org/sonatype/nexus/formfields/StringTextFormField.java
@@ -1,25 +0,0 @@
-package org.sonatype.nexus.formfields;
-
-public class StringTextFormField
- extends AbstractFormField
-{
- public StringTextFormField( String id, String label, String helpText, boolean required, String regexValidation )
- {
- super( id, label, helpText, required, regexValidation );
- }
-
- public StringTextFormField( String id, String label, String helpText, boolean required )
- {
- super( id, label, helpText, required );
- }
-
- public StringTextFormField( String id )
- {
- super( id );
- }
-
- public String getType()
- {
- return "string";
- }
-}
View
22 nexus-api/src/main/java/org/sonatype/nexus/index/events/ReindexRepositoriesEvent.java
@@ -1,22 +0,0 @@
-package org.sonatype.nexus.index.events;
-
-import org.sonatype.plexus.appevents.AbstractEvent;
-
-@Deprecated
-public class ReindexRepositoriesEvent
-extends AbstractEvent<Object>
-{
-
- private ReindexRepositoriesRequest reindexRepositoriesRequest;
-
- public ReindexRepositoriesEvent( Object component, ReindexRepositoriesRequest reindexRepositoriesRequest )
- {
- super( component );
- this.reindexRepositoriesRequest = reindexRepositoriesRequest;
- }
-
- public ReindexRepositoriesRequest getReindexRepositoriesRequest()
- {
- return reindexRepositoriesRequest;
- }
-}
View
25 nexus-api/src/main/java/org/sonatype/nexus/index/events/ReindexRepositoriesRequest.java
@@ -1,25 +0,0 @@
-package org.sonatype.nexus.index.events;
-
-@Deprecated
-public class ReindexRepositoriesRequest
-{
- private String path;
-
- private boolean fullReindex;
-
- public ReindexRepositoriesRequest( String path, boolean fullReindex )
- {
- this.path = path;
- this.fullReindex = fullReindex;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public boolean isFullReindex()
- {
- return fullReindex;
- }
-}
View
46 nexus-api/src/main/java/org/sonatype/nexus/logging/AbstractLoggingComponent.java
@@ -1,46 +0,0 @@
-package org.sonatype.nexus.logging;
-
-import javax.inject.Inject;
-
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.slf4j.Logger;
-
-public abstract class AbstractLoggingComponent
-{
- private Logger logger;
-
- // TODO: double annos here, to be able to use this in Nexus plugins but also in Nexus Core while transitioning!
- @Inject
- @Requirement
- private LoggerProvider loggerProvider;
-
- /**
- * Default constructor.
- */
- // TODO Drop this when switching to Guice (use constructor injection)
- public AbstractLoggingComponent()
- {
-
- }
-
- /**
- * Constructor.
- *
- * @param loggerProvider logger provider
- */
- @Inject
- public AbstractLoggingComponent( final LoggerProvider loggerProvider )
- {
- this.loggerProvider = loggerProvider;
- }
-
- protected Logger getLogger()
- {
- if ( logger == null )
- {
- logger = loggerProvider.getLogger( this.getClass().getName() );
- }
-
- return logger;
- }
-}
View
47 nexus-api/src/main/java/org/sonatype/nexus/logging/DefaultLoggerProvider.java
@@ -1,47 +0,0 @@
-package org.sonatype.nexus.logging;
-
-import java.util.HashMap;
-
-import org.codehaus.plexus.component.annotations.Component;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A very-very simple Provider implementation for providing SLF4J loggers.
- *
- * @author cstamas
- */
-@Component( role = LoggerProvider.class )
-public class DefaultLoggerProvider
- implements LoggerProvider
-{
- private final HashMap<String, Logger> loggers = new HashMap<String, Logger>();
-
- public synchronized Logger get()
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
-
- String loggerKey = null;
-
- if ( stackTrace.length >= 4 )
- {
- loggerKey = stackTrace[3].getClassName();
- }
- else
- {
- loggerKey = "ROOT";
- }
-
- return getLogger( loggerKey );
- }
-
- public Logger getLogger( String loggerKey )
- {
- if ( !loggers.containsKey( loggerKey ) )
- {
- loggers.put( loggerKey, LoggerFactory.getLogger( loggerKey ) );
- }
-
- return loggers.get( loggerKey );
- }
-}
View
11 nexus-api/src/main/java/org/sonatype/nexus/logging/LoggerProvider.java
@@ -1,11 +0,0 @@
-package org.sonatype.nexus.logging;
-
-import javax.inject.Provider;
-
-import org.slf4j.Logger;
-
-public interface LoggerProvider
- extends Provider<Logger>
-{
- Logger getLogger( String loggerKey );
-}
View
76 nexus-api/src/main/java/org/sonatype/nexus/mime/DefaultMimeUtil.java
@@ -1,76 +0,0 @@
-package org.sonatype.nexus.mime;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.codehaus.plexus.component.annotations.Component;
-
-import eu.medsea.mimeutil.MimeType;
-import eu.medsea.mimeutil.MimeUtil2;
-import eu.medsea.mimeutil.detector.ExtensionMimeDetector;
-
-@Component( role = MimeUtil.class )
-public class DefaultMimeUtil
- implements MimeUtil
-{
- private MimeUtil2 mimeUtil;
-
- public DefaultMimeUtil()
- {
- mimeUtil = new MimeUtil2();
-
- // use Extenaion only for now (speed but less accuracy)
- mimeUtil.registerMimeDetector( ExtensionMimeDetector.class.getName() );
- }
-
- public MimeUtil2 getMimeUtil2()
- {
- return mimeUtil;
- }
-
- public String getMimeType( String fileName )
- {
- return MimeUtil2.getMostSpecificMimeType( getMimeUtil2().getMimeTypes( fileName ) ).toString();
- }
-
- public String getMimeType( File file )
- {
- return MimeUtil2.getMostSpecificMimeType( getMimeUtil2().getMimeTypes( file ) ).toString();
- }
-
- public String getMimeType( URL url )
- {
- return MimeUtil2.getMostSpecificMimeType( getMimeUtil2().getMimeTypes( url ) ).toString();
- }
-
- @SuppressWarnings( "unchecked" )
- public Set<String> getMimeTypes( String fileName )
- {
- return this.toStringSet( getMimeUtil2().getMimeTypes( fileName ) );
- }
-
- @SuppressWarnings( "unchecked" )
- public Set<String> getMimeTypes( File file )
- {
- return this.toStringSet( getMimeUtil2().getMimeTypes( file ) );
- }
-
- @SuppressWarnings( "unchecked" )
- public Set<String> getMimeTypes( URL url )
- {
- return this.toStringSet( getMimeUtil2().getMimeTypes( url ) );
- }
-
- private Set<String> toStringSet( Collection<MimeType> mimeTypes)
- {
- Set<String> result = new HashSet<String>();
- for ( MimeType mimeType : mimeTypes )
- {
- result.add( mimeType.toString() );
- }
- return result;
- }
-}
View
20