-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upstream: b=master,r=d2a592382fa343d6cd13c45b69a9edffe39c68c1,t=2017-…
…04-07-1629-26139
- Loading branch information
1 parent
864e629
commit d077248
Showing
21 changed files
with
506 additions
and
689 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...nts/nexus-common/src/main/java/org/sonatype/nexus/common/app/ManagedLifecycleManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2008-present Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
package org.sonatype.nexus.common.app; | ||
|
||
import org.sonatype.nexus.common.app.ManagedLifecycle.Phase; | ||
|
||
/** | ||
* Manages {@link ManagedLifecycle} components. | ||
* | ||
* @since 3.3 | ||
*/ | ||
public interface ManagedLifecycleManager | ||
{ | ||
/** | ||
* Returns the current phase. | ||
*/ | ||
Phase getCurrentPhase(); | ||
|
||
/** | ||
* Attempts to move to the target phase by starting (or stopping) components phase-by-phase. If any components have | ||
* appeared since the last request which belong to the current phase or earlier then they are automatically started | ||
* before the current phase is changed. Similarly components that have disappeared are stopped. | ||
*/ | ||
void to(Phase targetPhase) throws Exception; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...nexus-rapture/src/test/resources/jasmine/static/rapture/NX/controller/Permissions-spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
describe('NX.controller.Permissions', function() { | ||
var data = [ | ||
{ | ||
id: 'permission1', | ||
permitted: 'false' | ||
} | ||
]; | ||
|
||
beforeAll(function(done) { | ||
Ext.onReady(function() { | ||
NX.store.Permission.addMembers({ | ||
proxy: { | ||
type: 'memory', | ||
data: data, | ||
reader: { | ||
type: 'json' | ||
} | ||
} | ||
}); | ||
|
||
done(); | ||
}); | ||
}); | ||
|
||
describe('fetchPermissions', function() { | ||
it('loads data from the memory proxy', function() { | ||
var permissions = Ext.create('NX.controller.Permissions'); | ||
permissions.fetchPermissions(); | ||
expect(permissions.getStore('Permission').getById('permission1').get('permitted')).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../nexus-repository/src/main/java/org/sonatype/nexus/repository/tools/DeadBlobResult.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2008-present Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
package org.sonatype.nexus.repository.tools | ||
|
||
import javax.annotation.Nullable | ||
|
||
import org.sonatype.nexus.repository.storage.Asset | ||
|
||
import groovy.transform.ToString | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull | ||
|
||
/** | ||
* @since 3.3 | ||
*/ | ||
@ToString(includePackage = false) | ||
class DeadBlobResult | ||
{ | ||
final String repositoryName | ||
|
||
final Asset asset | ||
|
||
final String errorMessage | ||
|
||
final ResultState resultState | ||
|
||
DeadBlobResult(final String repositoryName, @Nullable final Asset asset, final ResultState resultState, | ||
final String errorMessage) | ||
{ | ||
this.repositoryName = checkNotNull(repositoryName) | ||
this.asset = asset | ||
this.resultState = checkNotNull(resultState) | ||
this.errorMessage = checkNotNull(errorMessage) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...nts/nexus-repository/src/main/java/org/sonatype/nexus/repository/tools/ResultState.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2008-present Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
package org.sonatype.nexus.repository.tools | ||
|
||
/** | ||
* Possible error states that can be detected by {@link DeadBlobFinder}. | ||
* @since 3.3 | ||
*/ | ||
enum ResultState { | ||
ASSET_DELETED, // DB record was deleted during inspection | ||
DELETED, // DB record references blobRef which has since been deleted | ||
MISSING_BLOB_REF, // DB record has no blobRef | ||
SHA1_DISAGREEMENT, // DB record and blob have different SHA1 | ||
UNAVAILABLE_BLOB, // blob has an inputstream that reports 0 when calling isAvailable() | ||
UNKNOWN, | ||
UNREADABLE_BLOB, // Unable to read blob from disk | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.